cancel
Showing results for 
Search instead for 
Did you mean: 

custom renditions

sam1980
Champ in-the-making
Champ in-the-making
The documentation states "You are likely to want to change the rendition definitions available for your website, and this can be done by overriding the Spring bean with the identifier "wqsmodule_renditionDefinitions". It is not clear to me how to override this bean. My WCMQS-extensions in share is through a module. I'd be thankful if anyone could elaborate on this issue.
1 REPLY 1

bremmington
Champ on-the-rise
Champ on-the-rise
Sorry for the delay in coming back to you. Alfresco will auto-load any Spring context file that is located on the classpath at "alfresco/extension/*-context.xml" (this is the repo tier rather than the Share tier). So, to override the wqsmodule_renditionDefinitions bean you should create a file named something like "my-wqs-context.xml", fill it in with something like (I've copied one of the out-of-the-box definitions as an example, but you can use your own, of course):

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="wqsmodule_renditionDefinitions" class="java.util.ArrayList">
        <constructor-arg>
            <list>
                <bean class="org.alfresco.module.org_alfresco_module_wcmquickstart.rendition.BootstrapCompositeRenditionDefinition">
                    <property name="name" value="smallThumbnail"/>
                    <property name="renderingEngineName" value="compositeRenderingEngine"/>
                    <property name="definitions">
                        <list>                           
                            <bean class="org.alfresco.module.org_alfresco_module_wcmquickstart.rendition.BootstrapRenditionDefinition">
                                <property name="renderingEngineName" value="reformat"/>
                                <property name="parameters">
                                    <map>
                                        <entry key="mime-type" value="image/jpeg"/>         
                                        <entry key="runAs" value="System"/>  
                                    </map>
                                </property>
                            </bean>
                            <bean class="org.alfresco.module.org_alfresco_module_wcmquickstart.rendition.BootstrapRenditionDefinition">
                                <property name="renderingEngineName" value="imageRenderingEngine"/>
                                <property name="parameters">
                                    <map>
                                        <entry key="xsize" value="72"/>                           
                                        <entry key="ysize" value="72"/>                                                       
                                        <entry key="maintainAspectRatio" value="false"/>
                                        <entry key="runAs" value="System"/>
                                    </map>
                                </property>
                            </bean>
                        </list>                   
                    </property>
                </bean>
            </list>
        </constructor-arg>
    </bean>
</beans>
Finally, place your new context file on the classpath at "alfresco/extension/my-wqs-context.xml", restart Alfresco, and your new rendition definitions should be bootstrapped.