12-19-2017 05:04 PM
I'm using Alfresco Community v5.2.0 to store some files (pdf, jpg/png essentially).
I'm creating a web app to retrieve this files for a school project.
I'm trying to create a grid of files from a specific folder in my application.
But when i'm retrieving the list of a specific folders with their thumbnails, the resolution of the thumbnail is very low (100x75).
How to configure Alfresco to generate a larger thumbnail ?
I tried to override the settings in :
C:\alfresco-community\tomcat\webapps\alfresco\cmisfs\stylesheets\ thumbnails.xsl
But this didn't work..
I'm using Alfresco on my computer (windows), with REST API call. Where can i configure this resolution ?
Thanks in advance,
12-22-2017 02:49 AM
Wow thank you !
I found a way to ovveride the thumbnail definition :
I created a file
thumbnail-service-context.xml
in
[AlfrescoRootFolder]\tomcat\shared\classes\alfresco\extension\
In this file I wrote :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- Slingshot Document Library image thumbnail options -->
<!-- Note that this will auto-register with parent="baseThumbnailDefinition" in the future -->
<bean id="thumbnailDefinitionDoclib" class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
<property name="name" value="doclib" />
<property name="mimetype" value="image/png"/>
<property name="transformationOptions">
<bean parent="defaultImageTransformationOptions">
<property name="resizeOptions">
<bean parent="defaultImageResizeOptions">
<property name="width" value="900"/>
<property name="height" value="900"/>
<property name="allowEnlargement" value="false" />
</bean>
</property>
</bean>
</property>
<property name="placeHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_doclib.png" />
<property name="mimeAwarePlaceHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_doclib{0}.png" />
<property name="runAs" value="System"/>
<property name="failureHandlingOptions" ref="standardFailureOptions"/>
</bean>
</beans>
And now I can retrieve a thumbnail by calling :
/alfresco/api/-default-/public/alfresco/versions/1/nodes/{idDocAlfresco}/renditions/doclib/content
12-20-2017 02:01 PM
Where did you find the idea to modify / put the thumbnail.xsl there? This has nothing to do with the thumnail resolutions and is only related to displaying a CMIS-based file system view (as far as I can tell).
Alfresco thumbnails are defined in the thumbnail-service-context.xml (and can be overriden via a Spring bean context file in the shared/alfresco/extension/... path) - you can see the default definitions in the source file. You could add a custom thumbnail definition in your own Spring context file, and retrieve thumbnails created according to that definition for your project.
12-22-2017 02:49 AM
Wow thank you !
I found a way to ovveride the thumbnail definition :
I created a file
thumbnail-service-context.xml
in
[AlfrescoRootFolder]\tomcat\shared\classes\alfresco\extension\
In this file I wrote :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- Slingshot Document Library image thumbnail options -->
<!-- Note that this will auto-register with parent="baseThumbnailDefinition" in the future -->
<bean id="thumbnailDefinitionDoclib" class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
<property name="name" value="doclib" />
<property name="mimetype" value="image/png"/>
<property name="transformationOptions">
<bean parent="defaultImageTransformationOptions">
<property name="resizeOptions">
<bean parent="defaultImageResizeOptions">
<property name="width" value="900"/>
<property name="height" value="900"/>
<property name="allowEnlargement" value="false" />
</bean>
</property>
</bean>
</property>
<property name="placeHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_doclib.png" />
<property name="mimeAwarePlaceHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_doclib{0}.png" />
<property name="runAs" value="System"/>
<property name="failureHandlingOptions" ref="standardFailureOptions"/>
</bean>
</beans>
And now I can retrieve a thumbnail by calling :
/alfresco/api/-default-/public/alfresco/versions/1/nodes/{idDocAlfresco}/renditions/doclib/content
Explore our Alfresco products with the links below. Use labels to filter content by product module.