alfresco-ng2-components/docs/core/services/thumbnail.service.md
Maurizio Vitale 1fa81962a0
👽 Angular 14 rebase 👽 (#7769)
* fix after rebase

* new release strategy for ng next

Signed-off-by: eromano <eugenioromano16@gmail.com>

* peer dep

Signed-off-by: eromano <eugenioromano16@gmail.com>

* Angular 14

fix unit test and storybook

Signed-off-by: eromano <eugenioromano16@gmail.com>

fix after rebase

Signed-off-by: eromano <eugenioromano16@gmail.com>

update pkg.json

Signed-off-by: eromano <eugenioromano16@gmail.com>

missing dep

Signed-off-by: eromano <eugenioromano16@gmail.com>

Fix mistake and missing code

Dream....build only affected libs

Add utility run commands

* Use nx command to run affected tests

* Fix nx test core

fix content tests

Run unit with watch false

core test fixes

reduce test warnings

Fix process cloud unit

Fix adf unit test

Fix lint process cloud

Disable lint next line

Use right core path

Fix insights unit

fix linting insights

Fix process-services unit

fix the extensions test report

fix test warnings

Fix content unit

Fix bunch of content unit

* Produce an adf alpha of 14

* hopefully fixing the content

* Push back the npm publish

* Remove flaky unit

* Fix linting

* Make the branch as root

* Get rid of angualar13

* Remove the travis depth

* Fixing version for npm

* Enabling cache for unit and build

* Fix scss for core and paths

Copy i18 and asset by using ng-packager

Export the theming alias and fix path

Use ng-package to copy assets process-services-cloud

Use ng-package to copy assets process-services

Use ng-package to copy assets content-services

Use ng-package to copy assets insights

* feat: fix api secondary entry point

* fix storybook rebase

* Move dist under dist/libs from lib/dist

* Fix the webstyle

* Use only necessary nrwl deps and improve lint

* Fix unit for libs

* Convert lint.sh to targets - improve performance

* Use latest of angular

* Align alfresco-js-api

Signed-off-by: eromano <eugenioromano16@gmail.com>
Co-authored-by: eromano <eugenioromano16@gmail.com>
Co-authored-by: Mikolaj Serwicki <mikolaj.serwicki@hyland.com>
Co-authored-by: Tomasz <tomasz.gnyp@hyland.com>
2022-08-25 10:50:30 +01:00

4.2 KiB
Raw Blame History

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
  • 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
  • getMimeTypeIcon(mimeType: string): string
    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 Archive thumbnail 'application/x-compressed', 'application/x-zip-compressed', 'application/zip'
Text Text thumbnail 'text/plain', 'application/json', 'application/x-javascript', 'application/vnd.apple.pages'
Bitmap/raster image Bitmap thumbnail 'image/png', 'image/jpeg', 'image/gif'
MP4 video MP4 thumbnail 'video/mp4'
SVG vector image SVG thumbnail 'image/svg+xml'
HTML file HTML thumbnail 'text/html'
PDF file PDF thumbnail 'application/pdf'
Folder Folder thumbnail
Disabled folder Disabled folder thumbnail
Excel spreadsheet Spreadsheet thumbnail 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'
PowerPoint slideshow PowerPoint thumbnail '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 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'
Keynote presentation Keynote thumbnail 'application/vnd.apple.keynote'
Numbers spreadsheet Numbers thumbnail '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:

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>
.....

See also