[ADF-1586] Added docs for Thumbnail and Mime type (#2537)

This commit is contained in:
Andy Stark 2017-10-24 13:39:14 +01:00 committed by Eugenio Romano
parent 553c71c958
commit 020be18b57
19 changed files with 82 additions and 11 deletions

View File

@ -194,9 +194,9 @@ for more information about installing and using the source code.
- [Form rendering service](form-rendering.service.md)
- [Form service](form.service.md)
- [*Process content service](../ng2-components/ng2-activiti-form/src/services/process-content.service.ts)
- [*Activiti alfresco service](../ng2-components/ng2-activiti-form/src/services/activiti-alfresco.service.ts)
- [*Node service](../ng2-components/ng2-activiti-form/src/services/node.service.ts)
- [*Process content service](../ng2-components/ng2-activiti-form/src/services/process-content.service.ts)
- [*Widget visibility service](../ng2-components/ng2-activiti-form/src/services/widget-visibility.service.ts)
### Widgets
@ -289,7 +289,6 @@ for more information about installing and using the source code.
### Directives
- [Task audit directive](task-audit.directive.md)
- [*No task detail template directive](../ng2-components/ng2-activiti-tasklist/src/components/no-task-detail-template.directive.ts)
### Models
@ -335,14 +334,13 @@ for more information about installing and using the source code.
- [Node permission directive](node-permission.directive.md)
- [Node restore directive](node-restore.directive.md)
- [Upload directive](upload.directive.md)
- [*Card view content proxy directive](../ng2-components/ng2-alfresco-core/src/components/view/card-view-content-proxy.directive.ts)
### Pipes
- [Mime type icon pipe](mime-type-icon.pipe.md)
- [Node name tooltip pipe](node-name-tooltip.pipe.md)
- [Text highlight pipe](text-highlight.pipe.md)
- [*File size pipe](../ng2-components/ng2-alfresco-core/src/pipes/file-size.pipe.ts)
- [*Mime type icon pipe](../ng2-components/ng2-alfresco-core/src/pipes/mime-type-icon.pipe.ts)
- [*Time ago pipe](../ng2-components/ng2-alfresco-core/src/pipes/time-ago.pipe.ts)
- [*User initial pipe](../ng2-components/ng2-alfresco-core/src/pipes/user-initial.pipe.ts)
@ -356,6 +354,7 @@ for more information about installing and using the source code.
- [Log service](log.service.md)
- [Notification service](notification.service.md)
- [Renditions service](renditions.service.md)
- [Thumbnail service](thumbnail.service.md)
- [Translation service](translation.service.md)
- [Upload service](upload.service.md)
- [User preferences service](user-preferences.service.md)
@ -381,7 +380,6 @@ for more information about installing and using the source code.
- [*Shared links api service](../ng2-components/ng2-alfresco-core/src/services/shared-links-api.service.ts)
- [*Sites api service](../ng2-components/ng2-alfresco-core/src/services/sites-api.service.ts)
- [*Storage service](../ng2-components/ng2-alfresco-core/src/services/storage.service.ts)
- [*Thumbnail service](../ng2-components/ng2-alfresco-core/src/services/thumbnail.service.ts)
- [*Translate loader service](../ng2-components/ng2-alfresco-core/src/services/translate-loader.service.ts)
<!-- ng2-alfresco-core end -->
@ -450,11 +448,6 @@ for more information about installing and using the source code.
### Components
- [Login component](login.component.md)
### Directives
- [*Login footer directive](../ng2-components/ng2-alfresco-login/src/directives/login-footer.directive.ts)
- [*Login header directive](../ng2-components/ng2-alfresco-login/src/directives/login-header.directive.ts)
<!-- ng2-alfresco-login end -->
[(Back to Contents)](#contents)
@ -571,6 +564,8 @@ for more information about installing and using the source code.
- [*TxtViewer component](../ng2-components/ng2-alfresco-viewer/src/components/txtViewer.component.ts)
- [*Unknown format component](../ng2-components/ng2-alfresco-viewer/src/components/unknown-format/unknown-format.component.ts)
- [*Viewer info drawer component](../ng2-components/ng2-alfresco-viewer/src/components/viewer-info-drawer.component.ts)
- [*Viewer more actions component](../ng2-components/ng2-alfresco-viewer/src/components/viewer-more-actions.component.ts)
- [*Viewer open with component](../ng2-components/ng2-alfresco-viewer/src/components/viewer-open-with.component.ts)
- [*Viewer toolbar component](../ng2-components/ng2-alfresco-viewer/src/components/viewer-toolbar.component.ts)
### Directives

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 B

View File

@ -0,0 +1,23 @@
# Mime Type Icon pipe
Retrieves an icon to represent a MIME type.
## Basic Usage
```HTML
<div>
<img src='{{ "image/jpeg" | adfMimeTypeIcon }}' />
</div>
```
## Details
The pipe takes a MIME type as input and returns the URL of an SVG file that
symbolizes that type (see the [Thumbnail service](thumbnail.service.md) for the mapping between types and icons). The pipe will return a "miscellaneous" icon when no specific mapping is defined.
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
<!-- seealso start -->
## See also
- [Thumbnail service](thumbnail.service.md)
<!-- seealso end -->

View File

@ -57,6 +57,7 @@
"login.component": ["logout.directive"],
"logout.directive": [],
"metadata-indicators": [],
"mime-type-icon.pipe": [],
"node-permission.directive": [],
"notification.service": [],
"pagination.component": [],
@ -91,6 +92,7 @@
"task-list.component": [],
"text-highlight.pipe": [],
"theming": [],
"thumbnail.service": ["mime-type-icon.pipe"],
"toolbar-divider.component": [],
"toolbar-title.component": [],
"toolbar.component": ["toolbar-divider.component", "toolbar-title.component"],

47
docs/thumbnail.service.md Normal file
View File

@ -0,0 +1,47 @@
# Thumbnail service
Retrieves an SVG thumbnail image to represent a document type.
## Methods
`public getDocumentThumbnailUrl(document: any): string`<br/>
Gets a thumbnail URL for a document node.
`public getMimeTypeIcon(mimeType: string): string`<br/>
Gets a thumbnail URL for a MIME type.
`public getDefaultMimeTypeIcon(): string`<br/>
Gets a "miscellaneous" thumbnail URL for types with no other icon defined.
## Details
The service can locate a thumbnail icon (in SVG format) for either
a document node or a MIME type. The default mapping between types
and icons is shown in the table below:
| Document | Icon | Types |
| --- | --- | --- |
| Compressed archive | ![Archive thumbnail](docassets/images/ft_ic_archive.png) | 'application/x-compressed', 'application/x-zip-compressed', 'application/zip' |
| Text | ![Text thumbnail](docassets/images/ft_ic_document.png) | 'text/plain', 'application/json', 'application/x-javascript', 'application/vnd.apple.pages' |
| Bitmap/raster image | ![Bitmap thumbnail](docassets/images/ft_ic_raster_image.png) | 'image/png', 'image/jpeg', 'image/gif' |
| MP4 video | ![MP4 thumbnail](docassets/images/ft_ic_video.png) | 'video/mp4' |
| SVG vector image| ![SVG thumbnail](docassets/images/ft_ic_vector_image.png) | 'image/svg+xml' |
| HTML file | ![HTML thumbnail](docassets/images/ft_ic_website.png) | 'text/html' |
| PDF file | ![PDF thumbnail](docassets/images/ft_ic_pdf.png) | 'application/pdf' |
| Folder | ![Folder thumbnail](docassets/images/ft_ic_folder.png) | |
| Disabled folder | ![Disabled folder thumbnail](docassets/images/ft_ic_folder_disable.png) | |
| Excel spreadsheet | ![Spreadsheet thumbnail](docassets/images/ft_ic_ms_excel.png) | 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' |
| PowerPoint slideshow | ![PowerPoint thumbnail](docassets/images/ft_ic_ms_powerpoint.png) | 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' |
| Word document | ![Word thumbnail](docassets/images/ft_ic_ms_word.png) | 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' |
| Keynote presentation | ![Keynote thumbnail](docassets/images/ft_ic_presentation.png) | 'application/vnd.apple.keynote' |
| Numbers spreadsheet | ![Numbers thumbnail](docassets/images/ft_ic_spreadsheet.png) | 'application/vnd.apple.numbers' |
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
<!-- seealso start -->
## See also
- [Mime type icon pipe](mime-type-icon.pipe.md)
<!-- seealso end -->

View File

@ -9,5 +9,9 @@
"empty-folder-content",
"empty-list",
"loading-template",
"no-content-template"
"no-content-template",
"card-view-content-proxy",
"login-footer.directive",
"login-header.directive",
"no-task-detail-template"
]