05-13-2010 07:46 AM
<property name="transformCommand">
<bean class="org.alfresco.util.exec.RuntimeExec">
<property name="commandMap">
<map>
<entry key=".*">
<value>/opt/Vividata/bin/ocrxtr ..${target} ${source } ….
What I want is to create custom way to add new parameters for istance: ${locale} and so on. is there a known way for this.
05-13-2010 10:28 AM
<property name="defaultProperties">
<props>
…
</props>
…
Inject your transformCommand into a RuntimeExecutableContentTransformerWorker and call execute with an instance of RuntimeExecutableContentTransformerOptions which contains values to substitute into the ${…} parameters.05-13-2010 10:40 AM
class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer"
parent="baseContentTransformer">
<property name="checkCommand">
<!– <bean class="org.alfresco.util.exec.RuntimeExec"> –>
<bean class="org.alfresco.docassistent.util.CustomRuntimeExec">
<property name="commandMap">
<map>
<entry key="Linux">
<value>/opt/Vividata/bin/ocrxtr -help</value>
</entry>
<entry key="Windows.*">
<value>D:/ocrxtr.bat -help</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 -overwrite=y -out_text_format=pdf
-language=${language} -out_text_name=${target} ${source}</value>
</entry>
<entry key="Windows.*">
<value>D:/ocrxtr.bat -overwrite=y -out_text_format=pdf
-language=${language} -out_text_name=${target} ${source}</value>
</entry>
</map>
</property>
<property name="errorCodes">
<value>1,2</value>
</property>
[b]<property name="defaultProperties">
<props>
<prop key="language"></prop>
</props>
</property>[/b]
</bean>
</property>
<property name="explicitTransformations">….
<list>
05-13-2010 10:48 AM
Map<String, Serializable> actionParams = new HashMap<String, Serializable>();
actionParams.put("actionName", "transform");
actionParams.put("transformer", "application/pdf");
Action action = this.getActionService().createAction(actionname);
action.setParameterValues(repoActionParams);
System.out.println("START TRANFORMATION");
this.getActionService().executeAction(action, nodeRef);
05-13-2010 11:07 AM
05-14-2010 05:39 AM
05-14-2010 08:44 AM
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.