 
					
				
		
10-30-2013 11:13 AM
The out-of-the-box thumbnails are registered in the thumbnail-service-context.xml file. I don’t see a clean way to extend that without repeating the definitions, so in my example, I wrote a bean that calls the Thumbnail Registry and registers the custom thumbnail definitions provided in the Spring context file
Instead of creating a custom bean to register your custom thumbnail definitions, you could have just used MethodInvokingFactory bean to register them directly to the default thumbnailRegistry bean.
document.createThumbnail("scImageThumbnail", true);
11-05-2013 11:13 AM
 
					
				
		
11-07-2013 10:28 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
 
<beans>
   <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
      <property name="targetObject" ref="thumbnailRegistry"/>
      <property name="targetMethod" value="addThumbnailDefinition"/>
      <property name="arguments">
         <list>
            <bean class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
               <property name="name" value="scImageThumbnail"/>
               <property name="mimetype" value="image/png"/>
               <property name="transformationOptions">
                  <bean class="org.alfresco.repo.content.transform.magick.ImageTransformationOptions">
                     <property name="resizeOptions">
                        <bean class="org.alfresco.repo.content.transform.magick.ImageResizeOptions">
                           <property name="height" value="100"/>
                           <property name="maintainAspectRatio" value="true"/>
                           <property name="resizeToThumbnail" value="true"/>
                        </bean>
                     </property>
                  </bean>
               </property>
               <property name="placeHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_medium.jpg"/>
            </bean>
         </list>
      </property>
   </bean>
</beans>
<!– User avatar 64x64 image thumbnail options –>
<!– Note that this will auto-register with parent="baseThumbnailDefinition" in the future –>
11-07-2013 12:59 PM
    <bean id="assetPreview" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject" ref="thumbnailRegistry" />
        <property name="targetMethod" value="addThumbnailDefinition" />
        <property name="arguments">
            <list>
                 <!– Asset Preview - thumbnail options –>
                 <bean class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
                    <property name="name" value="assetPreview" />
                    <property name="mimetype" value="image/png"/>
                    <property name="transformationOptions">
                       <bean class="org.alfresco.repo.content.transform.magick.ImageTransformationOptions">
                          <property name="resizeOptions">
                             <bean class="org.alfresco.repo.content.transform.magick.ImageResizeOptions">
                                <property name="width" value="600"/>
                                <property name="height" value="600"/>
                                <property name="maintainAspectRatio" value="true"/>
                                <property name="resizeToThumbnail" value="true" />
                                <property name="allowEnlargement" value="false" />
                             </bean>
                          </property>
                       </bean>
                    </property>
                    <property name="placeHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_imgpreview.png" />
                    <property name="runAs" value="System"/>
                    <property name="failureHandlingOptions" ref="standardFailureOptions"/>
                </bean>
            </list>
        </property>
    </bean>
 
					
				
		
11-11-2013 08:40 PM
11-12-2013 02:42 AM
 
					
				
		
05-31-2014 01:19 PM
 
					
				
				
			
		
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.