From 821b82ee29dbe22d79c5fb4fc26d786eab3cf06a Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 7 Jun 2016 17:00:55 +0100 Subject: [PATCH] #152 support for mime type icons --- .../app/components/files/files.component.html | 6 + .../ng2-alfresco-documentlist/package.json | 4 +- .../src/components/document-list.css | 7 +- .../src/components/document-list.html | 9 +- .../src/components/document-list.ts | 34 +++- .../document-list.empty-folder.png | Bin .../src/img/ft_ic_archive.svg | 144 ++++++++++++++++ .../src/img/ft_ic_audio.svg | 143 ++++++++++++++++ .../src/img/ft_ic_database.svg | 142 ++++++++++++++++ .../src/img/ft_ic_document.svg | 143 ++++++++++++++++ .../src/img/ft_ic_ebook.svg | 143 ++++++++++++++++ .../src/img/ft_ic_folder.svg | 142 ++++++++++++++++ .../src/img/ft_ic_folder_empty.svg | 143 ++++++++++++++++ .../src/img/ft_ic_form.svg | 143 ++++++++++++++++ .../src/img/ft_ic_google_docs.svg | 147 ++++++++++++++++ .../src/img/ft_ic_google_drawings.svg | 147 ++++++++++++++++ .../src/img/ft_ic_google_forms.svg | 147 ++++++++++++++++ .../src/img/ft_ic_google_sheets.svg | 148 +++++++++++++++++ .../src/img/ft_ic_google_slides.svg | 146 ++++++++++++++++ .../src/img/ft_ic_miscellaneous.svg | 142 ++++++++++++++++ .../src/img/ft_ic_ms_excel.svg | 157 ++++++++++++++++++ .../src/img/ft_ic_ms_powerpoint.svg | 152 +++++++++++++++++ .../src/img/ft_ic_ms_word.svg | 151 +++++++++++++++++ .../src/img/ft_ic_pdf.svg | 144 ++++++++++++++++ .../src/img/ft_ic_presentation.svg | 142 ++++++++++++++++ .../src/img/ft_ic_raster_image.svg | 143 ++++++++++++++++ .../src/img/ft_ic_spreadsheet.svg | 151 +++++++++++++++++ .../src/img/ft_ic_vector_image.svg | 144 ++++++++++++++++ .../src/img/ft_ic_video.svg | 144 ++++++++++++++++ .../src/img/ft_ic_website.svg | 142 ++++++++++++++++ .../src/services/alfresco.service.ts | 19 +++ 31 files changed, 3549 insertions(+), 20 deletions(-) rename ng2-components/ng2-alfresco-documentlist/src/{components => img}/document-list.empty-folder.png (100%) create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_archive.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_audio.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_database.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_document.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ebook.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_folder.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_folder_empty.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_form.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_docs.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_drawings.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_forms.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_sheets.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_slides.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_miscellaneous.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_excel.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_powerpoint.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_word.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_pdf.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_presentation.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_raster_image.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_spreadsheet.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_vector_image.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_video.svg create mode 100755 ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_website.svg diff --git a/demo-shell-ng2/app/components/files/files.component.html b/demo-shell-ng2/app/components/files/files.component.html index b3be56f5b5..38c8a79e33 100644 --- a/demo-shell-ng2/app/components/files/files.component.html +++ b/demo-shell-ng2/app/components/files/files.component.html @@ -23,6 +23,12 @@ source="name" class="full-width name-column"> + diff --git a/ng2-components/ng2-alfresco-documentlist/package.json b/ng2-components/ng2-alfresco-documentlist/package.json index 004e4f47e8..43f59a5502 100644 --- a/ng2-components/ng2-alfresco-documentlist/package.json +++ b/ng2-components/ng2-alfresco-documentlist/package.json @@ -18,8 +18,8 @@ "copy-html-css:w": "cpx './src/**/*.{html,css}' dist/src -w", "copy-i18n": "cpx './i18n/**/*.json' dist/i18n", "copy-i18n:w": "cpx './i18n/**/*.json' dist/i18n -w", - "copy-images": "cpx './src/**/*.{png,jpg,gif}' dist/src", - "copy-images:w": "cpx './src/**/*.{png,jpg,gif}' dist/src -w", + "copy-images": "cpx './src/**/*.{png,jpg,gif,svg}' dist/src", + "copy-images:w": "cpx './src/**/*.{png,jpg,gif,svg}' dist/src -w", "tsc": "tsc", "tsc:w": "tsc -w", "pretest": "npm run build", diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.css b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.css index d23118641c..510e9ef7fe 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.css +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.css @@ -1,11 +1,6 @@ :host .full-width { width: 100%; } -:host .folder-thumbnail { - font-size: 48px; - cursor: pointer; -} - -:host .document-thumbnail { +:host .thumbnail { width: 48px; height: 48px; cursor: pointer; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.html b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.html index 8b49b4ab33..4723e07089 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.html +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.html @@ -41,12 +41,7 @@ (click)="onItemClick(content, $event)" [attr.data-automation-id]="col.source === '$thumbnail' ? '$thumbnail' : col.source + '_' + getObjectValue(content.entry, col.source)">
-
- {{folderIcon || 'folder_open'}} -
-
- -
+
{{getObjectValue(content.entry, col.source)}} @@ -109,7 +104,7 @@ [ngForTemplate]="emptyFolderTemplate"> + [src]="__baseUrl + '/img/document-list.empty-folder.png'"> diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts index 119a4aa834..020555c6a1 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts @@ -46,7 +46,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit, DEFAULT_ROOT_FOLDER: string = '/Sites/swsdp/documentLibrary'; - __baseUrl = __moduleName.replace('/document-list.js', ''); + __baseUrl = __moduleName.replace('/components/document-list.js', ''); @Input() navigate: boolean = true; @@ -57,6 +57,9 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit, @Input('folder-icon') folderIcon: string; + @Input() + thumbnails: boolean = false; + @Output() itemClick: EventEmitter = new EventEmitter(); @@ -237,14 +240,35 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit, } /** - * Gets thumbnail URL for the given document node. + * Gets thumbnail URL for the given node. * @param node Node to get URL for. * @returns {string} URL address. */ - getDocumentThumbnailUrl(node: MinimalNodeEntity): string { - if (this._alfrescoService) { - return this._alfrescoService.getDocumentThumbnailUrl(node); + getThumbnailUrl(node: MinimalNodeEntity): string { + if (node && node.entry) { + let entry = node.entry; + + if (entry.isFolder) { + return `${this.__baseUrl}/img/ft_ic_folder.svg`; + } + + if (entry.isFile) { + if (this.thumbnails) { + if (this._alfrescoService) { + return this._alfrescoService.getDocumentThumbnailUrl(node); + } + return null; + } + + if (entry.content && entry.content.mimeType) { + let icon = this._alfrescoService.getMimeTypeIcon(entry.content.mimeType); + return `${this.__baseUrl}/img/${icon}`; + } + } + + return `${this.__baseUrl}/img/ft_ic_miscellaneous.svg`; } + return null; } diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.empty-folder.png b/ng2-components/ng2-alfresco-documentlist/src/img/document-list.empty-folder.png similarity index 100% rename from ng2-components/ng2-alfresco-documentlist/src/components/document-list.empty-folder.png rename to ng2-components/ng2-alfresco-documentlist/src/img/document-list.empty-folder.png diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_archive.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_archive.svg new file mode 100755 index 0000000000..46ede302c1 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_archive.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_audio.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_audio.svg new file mode 100755 index 0000000000..2900811633 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_audio.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_database.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_database.svg new file mode 100755 index 0000000000..ceb52d33cc --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_database.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_document.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_document.svg new file mode 100755 index 0000000000..a4c7f8ab58 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_document.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ebook.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ebook.svg new file mode 100755 index 0000000000..c54f4cee66 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ebook.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_folder.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_folder.svg new file mode 100755 index 0000000000..a4aed351b8 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_folder.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_folder_empty.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_folder_empty.svg new file mode 100755 index 0000000000..c862a2a43b --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_folder_empty.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_form.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_form.svg new file mode 100755 index 0000000000..19fbf2eec5 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_form.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_docs.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_docs.svg new file mode 100755 index 0000000000..1278d3ca82 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_docs.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_drawings.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_drawings.svg new file mode 100755 index 0000000000..bbf792fc31 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_drawings.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_forms.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_forms.svg new file mode 100755 index 0000000000..1efd176ecc --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_forms.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_sheets.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_sheets.svg new file mode 100755 index 0000000000..fcce83f9d9 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_sheets.svg @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_slides.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_slides.svg new file mode 100755 index 0000000000..f0e228f0c0 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_google_slides.svg @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_miscellaneous.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_miscellaneous.svg new file mode 100755 index 0000000000..216bac4449 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_miscellaneous.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_excel.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_excel.svg new file mode 100755 index 0000000000..2395571d71 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_excel.svg @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_powerpoint.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_powerpoint.svg new file mode 100755 index 0000000000..66a8573881 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_powerpoint.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_word.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_word.svg new file mode 100755 index 0000000000..bf97e75633 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_ms_word.svg @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_pdf.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_pdf.svg new file mode 100755 index 0000000000..dab3fcb118 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_pdf.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_presentation.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_presentation.svg new file mode 100755 index 0000000000..fa34514e60 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_presentation.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_raster_image.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_raster_image.svg new file mode 100755 index 0000000000..a5e0067b30 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_raster_image.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_spreadsheet.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_spreadsheet.svg new file mode 100755 index 0000000000..4109b571db --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_spreadsheet.svg @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_vector_image.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_vector_image.svg new file mode 100755 index 0000000000..cc9d3e83df --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_vector_image.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_video.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_video.svg new file mode 100755 index 0000000000..05489013cf --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_video.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_website.svg b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_website.svg new file mode 100755 index 0000000000..2f18354879 --- /dev/null +++ b/ng2-components/ng2-alfresco-documentlist/src/img/ft_ic_website.svg @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.ts b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.ts index 0df4f10c7a..979c042803 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.ts @@ -23,6 +23,7 @@ import { AlfrescoSettingsService } from 'ng2-alfresco-core/dist/ng2-alfresco-cor declare let AlfrescoApi: any; +// TODO: consider renaming to something like 'DocumentListService' /** * Internal service used by Document List component. */ @@ -31,6 +32,19 @@ export class AlfrescoService { private _baseUrlPath: string = '/alfresco/api/-default-/public/alfresco/versions/1'; + mimeTypeIcons: any = { + 'image/png': 'ft_ic_raster_image.svg', + 'image/jpeg': 'ft_ic_raster_image.svg', + 'image/gif': 'ft_ic_raster_image.svg', + 'application/pdf': 'ft_ic_pdf.svg', + 'application/vnd.ms-excel': 'ft_ic_ms_excel.svg', + 'application/msword': 'ft_ic_ms_word.svg', + 'application/vnd.ms-powerpoint': 'ft_ic_ms_powerpoint.svg', + 'video/mp4': 'ft_ic_video.svg', + 'text/plain': 'ft_ic_document.svg', + 'application/x-javascript': 'ft_ic_document.svg' + }; + constructor( private settings: AlfrescoSettingsService) { } @@ -101,6 +115,11 @@ export class AlfrescoService { document.entry.id + '/content'; } + getMimeTypeIcon(mimeType: string): string { + let icon = this.mimeTypeIcons[mimeType]; + return icon || 'ft_ic_miscellaneous.svg'; + } + private handleError(error: Response) { // in a real world app, we may send the error to some remote logging infrastructure // instead of just logging it to the console