AnsweredAssumed Answered

[SOLVED] Content Transformation

Question asked by nowhere on Nov 14, 2009
Latest reply on Aug 1, 2012 by wmay
Hi all,
I'm trying to implement a transformer to use intelliant OCR.
Following example at this url http://wiki.alfresco.com/wiki/Content_Transformations#RuntimeExecutableContentTransformer
I wrote my ocr-tranformer-context.xml

<?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="transformer.Ocr.Tiff2Pdf" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker" parent="baseContentTransformer">
      <property name="checkCommand">
         <bean class="org.alfresco.util.exec.RuntimeExec">
            <property name="commandMap">
                <map>
                    <entry key=".*">
                        <value>ocr.exe –about</value>
                    </entry>
                </map>
            </property>
         
         </bean>
      </property>
      <property name="transformCommand">
         <bean class="org.alfresco.util.exec.RuntimeExec">
            <property name="commandMap">
                <map>
                    <entry key="Windows.*">
                        <value>ocr.exe –replace –language fr –pdf –output-file "${target}" "${source}"</value>
                    </entry>
                </map>
            </property>
           
         </bean>
      </property>
      <property name="explicitTransformations">
         <list>
            <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails" >
      <property name="sourceMimetype"><value>image/tiff</value></property>
                <property name="targetMimetype"><value>application/pdf</value></property>
            </bean>
         </list>
      </property>
   </bean>   
</beans>

and I get following error at tomcat startup:

ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'transformer.Ocr.Tiff2Pdf' defined in file [C:\Tomcat6\shared\classes\alf
resco\extension\ocr-transformers-context.xml]: Error setting property values; ne
sted exception is org.springframework.beans.NotWritablePropertyException: Invali
d property 'registry' of bean class [org.alfresco.repo.content.transform.Runtime
ExecutableContentTransformerWorker]: Bean property 'registry' is not writable or
has an invalid setter method. Does the parameter type of the setter match the r
eturn type of the getter?

Where am I in wrong? Hoping in some help, it's very urgent to me :)

Thanks!

Outcomes