Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there an equivalent of FileTypeImageUtils for Alfresco Share?

Tags:

share

alfresco

I need to retrieve the icon of a content file based on its media type.

I know that in Alfresco Explorer you could use the FileTypeImageUtils.getFileTypeImage() method.

Is there something equivalent in Share?

like image 689
plus- Avatar asked Dec 20 '25 07:12

plus-


1 Answers

Do you want the file icon, or the file thumbnail?

If you're on Alfresco 4.0, the URL to request the thumbnail of a document is /proxy/alfresco/api/node/workspace/[Store]/[ID]/content/thumbnails/doclib?c=queue&ph=true eg http://localhost:8080/share/proxy/alfresco/api/node/workspace/SpacesStore/62d652d5-5759-434e-8739-295fa3447481/content/thumbnails/doclib?c=queue&ph=true

The way to build that is usually:

Alfresco.constants.PROXY_URI + 'api/node/' + nodeRef.uri + '/content/thumbnails/doclib?c=queue&ph=true"

If you do just want the icon, then the code is something like:

Alfresco.constants.URL_RESCONTEXT + 'components/images/filetypes/' + Alfresco.util.getFileIcon(name)
like image 59
Gagravarr Avatar answered Dec 22 '25 22:12

Gagravarr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!