03-15-2011 03:20 PM
03-31-2011 03:14 AM
<?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.tiff2rtf" 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>/usr/local/bin/cuneiform</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>/usr/local/bin/cuneiform</value>
<value>-l</value>
<value>fra</value>
<value>-f</value>
<value>rtf</value>
<value>-o</value>
<value>${target}</value>
<value>${source}</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>image/tiff</value></property>
<property name="targetMimetype"><value>application/rtf</value></property>
</bean>
</list>
</property>
</bean>
<bean id="transformer.worker.tiff2txt" 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>/usr/local/bin/cuneiform</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>/usr/local/bin/cuneiform</value>
<value>-l</value>
<value>fra</value>
<value>-f</value>
<value>text</value>
<value>-o</value>
<value>${target}</value>
<value>${source}</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>image/tiff</value></property>
<property name="targetMimetype"><value>text/plain</value></property>
</bean>
</list>
</property>
</bean>
<bean id="transformer.tiff2rtf" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
<property name="worker">
<ref bean="transformer.worker.tiff2rtf" />
</property>
</bean>
<bean id="transformer.tiff2txt" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
<property name="worker">
<ref bean="transformer.worker.tiff2txt" />
</property>
</bean>
</beans>
Bon, ça fonctionne bien avec cuneiform, mais pas avec un script plus compliqué qui créé des fichiers temporaires (pdfocr que j'ai trouvé sur le net en l'occurrence)…c'est un début !Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.