mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
4.2 KiB
4.2 KiB
Title, Added, Status, Last reviewed
Title | Added | Status | Last reviewed |
---|---|---|---|
Thumbnail service | v2.0.0 | Active | 2019-03-20 |
Thumbnail service
Retrieves an SVG thumbnail image to represent a document type.
Class members
Methods
- getDefaultMimeTypeIcon():
string
Gets a "miscellaneous" thumbnail URL for types with no other icon defined.- Returns
string
- URL string
- Returns
- getDocumentThumbnailUrl(node:
NodeEntry
|string
, attachment?:boolean
, ticket?:string
):string
Gets a thumbnail URL for the given document node.- node:
NodeEntry
|string
- Node or Node ID to get URL for. - attachment:
boolean
- (Optional) Toggles whether to retrieve content as an attachment for download - ticket:
string
- (Optional) Custom ticket to use for authentication - Returns
string
- URL string
- node:
- getMimeTypeIcon(mimeType:
string
):string
Gets a thumbnail URL for a MIME type.- mimeType:
string
- MIME type for the thumbnail - Returns
string
- URL string
- mimeType:
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:
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:
import { ThumbnailService } from '@alfresco/adf-core';
constructor(public thumbnailService: ThumbnailService) {
}
MP4 <mat-icon svgIcon="video/mp4"></mat-icon>
PDF <mat-icon svgIcon="application/pdf"></mat-icon>
GIF <mat-icon svgIcon="image/gif"></mat-icon>
.....