AnsweredAssumed Answered

Alfresco CE 3.0 transformer not launching

Question asked by magarcia_sm on Oct 27, 2016
Latest reply on Nov 10, 2016 by magarcia_sm

Hello all

     We are creating a tiff to pdf transformation with tesseract 3.03 in our alfresco community version 3.0. We have created an configuration file ocr-transformers-context.xml with the following code

 

<?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.tiff2pdfTess" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">

        <property name="worker">

            <ref bean="transformer.worker.tiff2pdfTess" />

        </property>

    </bean>

    <bean id="transformer.worker.tiff2pdfTess" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">

       <property name="mimetypeService">

            <ref bean="mimetypeService" />

        </property>

       <property name="checkCommand">

            <bean class="org.alfresco.util.exec.RuntimeExec">

                <property name="commandsAndArguments">

                    <map>

                        <entry key=".*">

                            <list>

                                <value>chmod 755 /opt/ocr/transformRotateOCRMulti.sh</value>

                            </list>

                        </entry>

                    </map>

                </property>

            </bean>

        </property>

        <property name="transformCommand">

            <bean class="org.alfresco.util.exec.RuntimeExec">

                <property name="commandsAndArguments">

                    <map>

                        <entry key=".*">

                            <list>

                                <value>/opt/ocr/transformRotateOCRMulti.sh ${source} ${target}</value>

                            </list>

                        </entry>

                    </map>

                </property>

                <property name="errorCodes">

                    <value>1,2,3</value>

                </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>

 

The sh script is a bash script that receibes a Tiff image and runs tesseract to tranform it to a PDF file. If we execute the command it works fine with not issue. This script has 777 permission

Problem is that when we launch alfresco and we want to run a rule so every time a new TIFF file gets included in a space it gets transformed to PDF... nothing happens. We have placed the file in

$AlfrescoHome/tomcat/shared/classes/alfresco/extension/.. and we know the ocr-transformers-context.sml file gets loaded because if we introduce wrong code in it, alfresco is not able to be launched. However seems to us that Alfresco is never using this transformation like if he is not able or we have not configured it, to use the bash sh linux script.

 

We have tried to move the ocr-transformers-context.xml file from $AlfrescoHome/tomcat/shared/classes/alfresco/extension/ to $AlfrescoHome/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/.. but again no transformation is run.

 

What else we must do to get this transformation executed?

 

I can tell you also that nothing is shown in the alfresco.log file. Also the bash sh script has a log file that never gets created.

Any ideas please?

Outcomes