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?
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?
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)