AnsweredAssumed Answered

Custom Transformations

Question asked by gladiac on Mar 13, 2007
Latest reply on Jun 14, 2007 by newtoalf
Having some problems with transforming files using a custom transformers xml file - Alfresco seems to be ignoring the custom instructions and just renaming the file.  I've checked that the command works in a terminal, no errors thrown when starting the server etc.  I've added a new filetype (png) to the transformers list for the web client and it is available to select when setting a rule up, but the end result of a transformation is a .png-named file but still in pdf format :?.

Any ideas, or places for more debugging info?

Thanks, xml below, feel free to move if this is the wrong section etc. :)

my-transformers-context.xml

   <bean id="transformer.Pdf2Png" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer" parent="baseContentTransformer">
      <property name="checkCommand">
         <bean class="org.alfresco.util.exec.RuntimeExec">
            <property name="commandMap">
                <map>
                    <entry key=".*">
                        <value>/opt/Vividata/bin/ocrxtr -version</value>
                    </entry>
                </map>
            </property>
            <property name="errorCodes">
               <value>1,2</value>
            </property>
         </bean>
      </property>
      <property name="transformCommand">
         <bean class="org.alfresco.util.exec.RuntimeExec">
            <property name="commandMap">
                <map>
                    <entry key="Linux">
                        <value>/opt/Vividata/bin/ocrxtr -info_log /tmp/ocrxtr.log -error_log /tmp/ocrxtr.log -out_text_format none -out_graphics_format png -out_regions_as_graphics Y -out_graphics_name "${target}" "${source}"</value>
                    </entry>
                </map>
            </property>
            <property name="errorCodes">
               <value>1,2</value>
            </property>
         </bean>
      </property>
      <property name="explicitTransformations">
         <list>
            <bean class="org.alfresco.repo.content.transform.ContentTransformerRegistry$TransformationKey" >
                <constructor-arg><value>application/pdf</value></constructor-arg>
                <constructor-arg><value>image/png</value></constructor-arg>
            </bean>
         </list>
      </property>
   </bean>

web-client-config-custom.xml:

   <config evaluator="string-compare" condition="Action Wizards">
      <!– The list of transformers to show in the transform actions –>
      <transformers>
         <transformer name="image/png"/>
      </transformers>
   </config>

Outcomes