cancel
Showing results for 
Search instead for 
Did you mean: 

Mimetype thumbnail

iwkse
Star Contributor
Star Contributor
Hi,
I'm adding a new type of content from the create menu, I've registered a new mime type and put the relative icons in the images/filetype folder.
When I create the document it gets the custom icon I provided and the mime type is set correctly. However when I am in the tree document list page
something is not behaving okey. In the views where it is used a rendition (doclib) and it gets the thumbnail from the node id, the icon is not showed
correctly but instead there's the generic icon.
I'm trying to debug to get what's behind the scenes there but I wasn't successful yes.

I'm not sure from where such rendition gets the right icon to show, I hope someone of you have a clue

Regards
4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator
Hello,

renditions use placeholder images on the Repository tier when there is no transformation capable of transforming mimetype X to the expected mimetype (PNG for doclib thumbnails). Those placeholders are located in the Repository JAR on path (/classes)/alfresco/thumbnail/thumbnail_placeholder_doclib.png (generic placeholder) and (/classes)/alfresco/thumbnail/thumbnail_placeholder_doclib{0}.png (pattern based, mimetype-aware placeholder - just replace {0} with "_" + file extension of the source mimetype, i.e. "_pdf" for the PDF-specific placeholder).

Regards
Axel

iwkse
Star Contributor
Star Contributor
Hi Axel,
thanks for your useful comment!

Instead of inserting the png directly into the jar I'm trying to create an extension and give the path needed but it doesnt' seem to work.


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING/DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
        <bean id="patchThumbnailDocLib" class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
            <property name="mimeAwarePlaceHolderResourcePath" value="alfresco/extension/thumbnail/thumbnail_placeholder_doclib{0}.png" />
        </bean>
</beans>

It makes sense?

Regards

afaust
Legendary Innovator
Legendary Innovator
Hello,

that bean definition will not work. You don't actually need to define/override any bean for this. You can simply put your custome placeholder in /shared/classes/alfresco/thumbnail/ based on the name pattern and Alfresco should pick it up. Only the default placeholders are contained in the JAR but the lookup is actually not specific to the JAR - it will pick up any placeholder put properly within the classpath (and /shared/classes is one of the valid classpath roots).

Regards
Axel

iwkse
Star Contributor
Star Contributor
Hi Axel,
thanks again. If I want to embed this into a more maintainable JAR to put in alfresco/WEB-INF/lib (I am using maven), could it work the same?

[edit]

Nevermind I figure it out myself, I've included it in the resources/alfresco folder and it's working now!

Thanks a lot

Regards