첫 번째 파일을 초과하여 업로드 된 파일에서 변환 스크립트가 실행되지 않는 이유는 무엇입니까?Alfresco에서 변환 스크립트 실행 중
Alfresco에서 폴더를 청취하는 변환 규칙을 설정했습니다. 새 파일이 폴더에 저장되면 규칙에 따라 텍스트 레이어없이 PDF를 가져 와서 jpeg로 분할하고 jpeg를 OCR 한 다음 jpeg를 PDF로 변환하고 PDF를 병합하여 OCR 된 PDF를 반환합니다. 그런 다음 텍스트 레이어를 사용하여 결과가 다른 폴더에 복사되므로 작업이 완료되었음을 알 수 있습니다.
명령 줄에서 스크립트를 실행하면 작동합니다. 처음 Alfresco 폴더에 파일을 놓으면 (업로드) 스크립트를 실행하고 파일을 복사합니다. 그러나 이후에 파일을 폴더에 놓으면 스크립트는 실행되지 않지만 파일은 여전히 대상 폴더에 복사됩니다. 그래서 규칙이 호출되고 있지만 스크립트가 다음 파일에서 실행되지 않는 것 같습니다. 스크립트를 로깅했습니다. 그래서 스크립트가 호출되지 않습니다. 규칙이 필터가없는 폴더의 모든 신규 및 수정 된 파일에 적용됩니다. 그런 다음 사용자 지정 OCR 스크립트와 상위 폴더로 정의 된 대상 폴더를 사용하여 변환 및 복사 명령을 실행합니다.
<?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.PdfOCRTool" class="org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker">
<property name="mimetypeService">
<ref bean="mimetypeService"/>
</property>
<property name="transformCommand">
<bean name="transformer.pdftoocr.Command" class="org.alfresco.util.exec.RuntimeExec">
<property name="commandMap">
<map>
<entry key=".*">
<value>/opt/ocr/ocr.sh ${source} ${target}</value>
</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/pdf</value>
</property>
<property name="targetMimetype">
<value>application/pdf</value>
</property>
</bean>
</list>
</property>
</bean>
<bean id="transformer.proxy.PdfOCRTool" class="org.alfresco.repo.management.subsystems.SubsystemProxyFactory">
<property name="sourceApplicationContextFactory">
<ref bean="thirdparty"/>
</property>
<property name="sourceBeanName">
<value>transformer.worker.PdfOCRTool</value>
</property>
<property name="interfaces">
<list>
<value>org.alfresco.repo.content.transform.ContentTransformerWorker</value>
</list>
</property>
</bean>
<bean id="transformer.PdfOCRTool" class="org.alfresco.repo.content.transform.ProxyContentTransformer" parent="baseContentTransformer">
<property name="worker">
<ref bean="transformer.proxy.PdfOCRTool"/>
</property>
</bean>
</beans>
규칙이 맞습니까? – Gagravarr