cancel
Showing results for 
Search instead for 
Did you mean: 

Overriding msword Open Office content transformer

andrepra
Champ in-the-making
Champ in-the-making
Alfresco 3.4d CE.
I need to change the pdf transformer for msword because the results obtained with Open Office cause some graphics differences unacceptable for our porpuse.
Following the wiki I decided to use the RuntimeExec bean to manage the transformation from msword to pdf. I wrote a new context file like this


<?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.worker.doc2pdf" 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>d:/PdfConverter/PdfConverter.exe</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>d:/PdfConverter/PdfConverter</value>
                        <value>${source}</value>
                        <value>${target}</value>
                     </list>
                  </entry>
               </map>
            </property>
            <property name="errorCodes">
               <value>1,2</value>
            </property>
         </bean>
      </property>

      <property name="explicitTransformations">
         <list>
            <bean class="org.alfresco.repo.content.transform.ExplictTransformationDetails">
               <property name="sourceMimetype"><value>application/msword</value></property>
               <property name="targetMimetype"><value>application/pdf</value></property>
            </bean>
         </list>
      </property>
   </bean>

   <bean id="transformer.doc2pdf" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
      <property name="worker">
         <ref bean="transformer.worker.doc2pdf" />
      </property>
   </bean>
</beans>

and everything works fine.
The problem is when I have Open Office also configured. I want to leave all the office transformations configured with open office except for MsWord file.
Seems that the xml written in the extension folder doesn't replace the msword to pdf transformation.
I have to disable something in the Open Office configuration file?

thanks
1 REPLY 1

andrepra
Champ in-the-making
Champ in-the-making
I commented the msword entry in the file openoffice-documents-format.xml

<!–
  <document-format><name>Microsoft Word</name>
    <family>Text</family>
    <mime-type>application/msword</mime-type>
    <file-extension>doc</file-extension>
    <export-filters>
      <entry><family>Text</family><string>MS Word 97</string></entry>
    </export-filters>
  </document-format>
–>


Now my doc to pdf trasformations are performed by my custom transformer.