mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
* [ADF-3323] Fixed URL path to Typescript source files * [ADF-3323] Fixed and checked broken links caused by previous bug
72 lines
3.6 KiB
Markdown
72 lines
3.6 KiB
Markdown
---
|
||
Added: v2.0.0
|
||
Status: Active
|
||
Last reviewed: 2018-03-21
|
||
---
|
||
|
||
# Thumbnail service
|
||
|
||
Retrieves an SVG thumbnail image to represent a document type.
|
||
|
||
## Class members
|
||
|
||
### Methods
|
||
|
||
- **getDefaultMimeTypeIcon**(): `string`<br/>
|
||
Gets a "miscellaneous" thumbnail URL for types with no other icon defined.
|
||
- **Returns** `string` - URL string
|
||
- **getDocumentThumbnailUrl**(node: `any`): `string`<br/>
|
||
Gets a thumbnail URL for the given document node.
|
||
- _node:_ `any` - Node to get URL for.
|
||
- **Returns** `string` - URL string
|
||
- **getMimeTypeIcon**(mimeType: `string`): `string`<br/>
|
||
Gets a thumbnail URL for a MIME type.
|
||
- _mimeType:_ `string` - MIME type for the thumbnail
|
||
- **Returns** `string` - URL string
|
||
|
||
## 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 |  | 'application/x-compressed', 'application/x-zip-compressed', 'application/zip' |
|
||
| Text |  | 'text/plain', 'application/json', 'application/x-javascript', 'application/vnd.apple.pages' |
|
||
| Bitmap/raster image |  | 'image/png', 'image/jpeg', 'image/gif' |
|
||
| MP4 video |  | 'video/mp4' |
|
||
| SVG vector image |  | 'image/svg+xml' |
|
||
| HTML file |  | 'text/html' |
|
||
| PDF file |  | 'application/pdf' |
|
||
| Folder |  | |
|
||
| Disabled folder |  | |
|
||
| Excel spreadsheet |  | 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' |
|
||
| PowerPoint slideshow |  | 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' |
|
||
| Word document |  | 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' |
|
||
| Keynote presentation |  | 'application/vnd.apple.keynote' |
|
||
| Numbers spreadsheet |  | 'application/vnd.apple.numbers' |
|
||
|
||
### Mat-icon
|
||
|
||
All the ADF icons for MIME types are now registered into the MatIconRegistry, so you can use all
|
||
the icons via the <mat-icon> tag:
|
||
|
||
```javascript
|
||
import { ThumbnailService } from '@alfresco/adf-core';
|
||
|
||
constructor(public thumbnailService: ThumbnailService) {
|
||
}
|
||
```
|
||
|
||
```html
|
||
MP4 <mat-icon svgIcon="video/mp4"></mat-icon>
|
||
PDF <mat-icon svgIcon="application/pdf"></mat-icon>
|
||
GIF <mat-icon svgIcon="image/gif"></mat-icon>
|
||
.....
|
||
```
|
||
|
||
## See also
|
||
|
||
- [Mime type icon pipe](mime-type-icon.pipe.md)
|