Commit 0fe224f9 authored by ludovic's avatar ludovic
Browse files

mise au propre

parent cd14fb20
<?xml version="1.0" encoding="UTF-8"?>
<capture>
<modules>
<module name="FileImport" src="modules/FileImport/FileImport.php" type="class"/>
<module name="MaarchWSClient" src="modules/MaarchWSClient/MaarchWSClient.php" type="class"/>
<module name="MailCapture" src="modules/MailCapture/MailCapture.php" type="class"/>
<module name="QRSeparator" src="modules/QRSeparator/MaarchQRSeparator.php" type="class"/>
</modules>
<batches>
<!-- lecture des scans entrant avec séparateurs qrcode -->
<batch name="SCAN_MASS" directory="/opt/maarch/MaarchCapture/files/" id="{batchname}-{timestamp}-{rand}" lock="0">
<workflow name="SCAN_MASS" debug="false" logMode="Maarch" maarchLogParam="/var/www/html/MaarchCourrier/apps/maarch_entreprise/xml/log4php.default.xml" maarchLoggerName="loggerTechnique">
<step function="separatePDF" module="QRSeparator" name="separatePDF">
<input name="ScanSource">/opt/maarch/scanentrantqr/</input>
<input name="qrcodePrefix">false</input>
</step>
<step function="processBatch" module="MaarchWSClient" name="SendToMaarch">
<input name="WSDL">MaarchRestWS</input>
<input name="Process">MaarchRestWSProcessFromScan</input>
<input name="CatchError">false</input>
<input name="configFile">MaarchWSClient.xml</input>
<input name="configPath">/opt/maarch/MaarchCapture/config/confModules</input>
</step>
</workflow>
</batch>
<!-- SCAN TO MAARCHCOURRIER SAMPLE -->
<batch name="MAARCH_SCAN_TO_MC" directory="/opt/maarch/MaarchCapture/files/" id="{batchname}-{timestamp}-{rand}" lock="0">
<workflow name="MAARCH_SCAN_TO_MC" debug="true" logMode="Maarch" maarchLogParam="/var/www/html/MaarchCourrier/apps/maarch_entreprise/xml/log4php.xml" maarchLoggerName="loggerTechnique">
<step name="ImportFiles" module='FileImport' function="ImportFiles">
<input name="Directory">/opt/maarch/scan/</input>
<input name="Target">Document</input>
<input name="Action">move</input>
<input name="MoveDirectory">/opt/maarch/scan/backup/</input>
<input name="Recursive">0</input>
<input name="CreateFolders">0</input>
<input name="Extensions"></input>
<input name="NbMaxFoldersToImport">0</input>
<input name="DeleteSubFolders">false</input>
<input name="fileNameStructure">[destination]_[barcode]</input><!-- extension is automatically set in extension metadata -->
</step>
<!-- REST SAMPLE -->
<step name="SendToMaarch" module="MaarchWSClient" function="processBatch">
<input name="WS">MaarchRestWS</input>
<input name="Process">MaarchRestWSProcessFromScan</input>
<input name="CatchError">true</input>
<input name="configFile">MaarchWSClient.xml</input>
<!-- <input name="configPath">/opt/maarch/MaarchCapture/config/</input> -->
</step>
</workflow>
</batch>
<!-- MAIL TO MAARCHCOURRIER SAMPLE -->
<batch name="MAARCH_MAIL_TO_MC" directory="/opt/maarch/MaarchCapture/files/" id="{batchname}-{timestamp}-{rand}" lock="0">
<workflow name="MAARCH_MAIL_TO_MC" debug="true" logMode="Maarch" maarchLogParam="/var/www/html/MaarchCourrier/apps/maarch_entreprise/xml/log4php.xml" maarchLoggerName="loggerTechnique">
<step function="CaptureMails" module="MailCapture" name="CAPTURE_MAIL_1">
<input name="account">account_1</input>
<input name="Action">move</input>
<input name="configFile">MailCapture.xml</input>
<input name="folder">maarch/purge</input>
<input name="attachmentsOutputDir">false</input>
<input name="addHeaderInMailContent">true</input>
<input name="folderError">false</input>
<input name="configPath">/opt/maarch/MaarchCapture/config/confModules/</input>
</step>
<step name="SendToMaarch" module="MaarchWSClient" function="processBatch">
<input name="WS">MaarchRestWS</input>
<input name="Process">MaarchRestWSProcessFromMail</input>
<input name="CatchError">true</input>
<input name="configFile">MaarchWSClient.xml</input>
</step>
<!-- AR -->
<!-- <step name="SendAR" module="MailCapture" function="notifyContact">
<input name="ContentPath">/Batch/Documents/Document</input>
<input name="type">acknowledgement_receipt</input>
</step> -->
</workflow>
</batch>
<!-- RECONCILE WITH QRCODE-->
<batch name="RECONCILE_QR" directory="/opt/maarch/MaarchCapture/files/" id="{batchname}-{timestamp}-{rand}" lock="0">
<workflow name="RECONCILE_QR" debug="true" logMode="Maarch" maarchLogParam="/var/www/html/MaarchCourrier/apps/maarch_entreprise/xml/log4php.xml" maarchLoggerName="loggerTechnique">
<step function="reconcile" module="QRSeparator" name="reconcile">
<input name="ScanSource">/opt/maarch/MaarchCapture/files/TEST_IMPORT/</input>
<input name="qrcodePrefix">true</input>
</step>
<step function="processBatch" module="MaarchWSClient" name="SendToMaarch">
<input name="WSDL">MaarchRestWS</input>
<input name="Process">ReconcileWithQrCode</input>
<input name="CatchError">false</input>
<input name="configFile">MaarchWSClient.xml</input>
</step>
</workflow>
</batch>
<!-- RECONCILE UPDATE COURRIER WITH QRCODE -->
<batch name="UPDATE_COURRIER" directory="/opt/maarch/MaarchCapture/files/" id="{batchname}-{timestamp}-{rand}" lock="0">
<workflow name="UPDATE_COURRIER" debug="true" logMode="Maarch" maarchLogParam="/var/www/html/MaarchCourrier/apps/maarch_entreprise/xml/log4php.xml" maarchLoggerName="loggerTechnique">
<step function="reconcile" module="QRSeparator" name="reconcile">
<input name="ScanSource">/opt/maarch/MaarchCapture/files/TEST_IMPORT/</input>
<input name="qrcodePrefix">true</input>
</step>
<step function="processBatch" module="MaarchWSClient" name="SendToMaarch">
<input name="WSDL">MaarchRestWS</input>
<input name="Process">ReconcilCourrier</input>
<input name="CatchError">true</input>
<input name="configFile">MaarchWSClient.xml</input>
</step>
</workflow>
</batch>
</batches>
</capture>
<?xml version="1.0" encoding="UTF-8"?>
<MaarchWSClient>
<!-- REST FRONTAL -->
<WS name="MaarchRestWS" type="REST" uri="http://superadmin:superadmin@localhost/MaarchCourrier/maarch/rest/" SSL="false" cacheUse="0" />
<!-- DEVELOP SAMPLES -->
<process name="MaarchRestWSProcessFromScan">
<loop xpath="/Batch/Documents/Document">
<call name="/resources" method="POST">
<argument type="entity" name="modelId">1</argument>
<argument type="entity" name="encodedFile" eval="base64_encode(file_get_contents($Element-&gt;path))"/>
<argument type="entity" name="doctype">1323</argument>
<argument type="entity" name="destination">346</argument>
<argument type="entity" name="priority">poiuytre1391nbvc</argument>
<!-- <argument type="entity" name="destination" eval="explode('_', $Element-&gt;filename)&#91;0&#93;"/> -->
<argument type="entity" name="format" attribute="extension"/>
<argument type="entity" name="status">INIT</argument>
<return>
<resId metadata="resId" />
</return>
</call>
</loop>
</process>
<!-- REST SAMPLES -->
<!-- <process name="MaarchRestWSProcessFromScan">
<loop xpath="/Batch/Documents/Document">
<call name="/resources" method="POST">
<argument type="entity" name="modelId">1</argument>
<argument type="entity" name="encodedFile" eval="base64_encode(file_get_contents($Element-&gt;path))"/>
<argument type="entity" name="format" attribute="extension"/>
<argument type="entity" name="doctype">108</argument>
<argument type="entity" name="chrono">true</argument>
<argument type="entity" name="destination">15</argument>
<argument type="entity" name="priority">2</argument>
<argument type="entity" name="status">INIT</argument>
<return>
<resId metadata="resId" />
</return>
</call>
</loop>
</process> -->
<!-- RECONCILE SAMPLES -->
<process name="ReconcilWithQrCode">
<loop xpath="/Batch/Documents/Document">
<call name="/reconcil" method="POST">
<argument type="entity" name="chrono" metadata="destination"/>
<argument type="entity" name="encodedFile" eval="base64_encode(file_get_contents($Element-&gt;path))"/>
<argument type="entity" name="format" attribute="extension"/>
<argument type="entity" name="title" metadata="filename"/>
<return>
<id metadata="id" />
</return>
</call>
<call name="/res/resource/status" method="PUT">
<argument type="entity" name="resId" eval="[$Element-&gt;getMetadata('id')]"/>
<argument type="entity" name="status">END</argument>
<return>
<id metadata="resId" />
</return>
</call>
</loop>
</process>
<!--process name="ReconcileWithQrCode">
<loop xpath="/Batch/Documents/Document">
<call name="/attachments" method="POST">
<argument type="entity" name="chrono" metadata="chrono"/>
<argument type="entity" name="encodedFile" eval="base64_encode(file_get_contents($Element-&gt;path))"/>
<argument type="entity" name="format" attribute="extension"/>
<argument type="entity" name="title" metadata="filename"/>
<argument type="entity" name="resIdMaster" metadata="resIdMaster"/>
<argument type="entity" name="originId" metadata="originId"/>
<argument type="entity" name="title" metadata="title"/>
<argument type="entity" name="type">response_project</argument>
<return>
<id metadata="resId" />
</return>
</call>
</loop>
</process-->
<process name="MaarchRestWSProcessFromMail">
<loop xpath="/Batch/Documents/Document">
<call name="/resources" method="POST">
<argument type="entity" name="modelId">1</argument>
<argument type="entity" name="encodedFile" eval="base64_encode(file_get_contents($Element-&gt;path))"/>
<argument type="entity" name="format" attribute="extension"/>
<argument type="entity" name="status">INIT</argument>
<argument type="entity" name="chrono">true</argument>
<argument type="entity" name="doctype" metadata="type_id"/>
<argument type="entity" name="subject" metadata="subject"/>
<argument type="entity" name="documentDate" metadata="doc_date"/>
<argument type="entity" name="destination" metadata="destination"/>
<argument type="entity" name="initiator" metadata="destination"/>
<argument type="entity" name="priority">poiuytre1357nbvc</argument>
<return>
<resId metadata="resId" />
</return>
</call>
<loop xpath="Attachments/Attachment">
<call name="/attachments" method="POST">
<argument type="entity" name="resIdMaster" xvalue="ancestor::Document/Metadata/resId"/>
<argument type="entity" name="type">incoming_mail_attachment</argument>
<argument type="entity" name="encodedFile" eval="base64_encode(file_get_contents($Element-&gt;path))"/>
<argument type="entity" name="format" attribute="extension"/>
<argument type="entity" name="title" metadata="filename"/>
<return>
<id metadata="resId" />
</return>
</call>
</loop>
</loop>
</process>
<!-- RECONCILE UPDATE COURRIER -->
<process name="ReconcilCourrier">
<loop xpath="/Batch/Documents/Document">
<call name="update_courrier" method="PUT">
<argument type="entity" name="resIdMaster" metadata="resIdMaster"/>
<argument type="query" name="onlyDocument">true</argument>
<argument type="entity" name="encodedFile" eval="base64_encode(file_get_contents($Element->path))"/>
<argument type="entity" name="format" attribute="extension"/>
</call>
</loop>
</process>
</MaarchWSClient>
<?xml version="1.0" encoding="UTF-8"?>
<MailCapture>
<formatters>
<formatter name="date" script="scripts/formatters.php" func="format_mail_date"/>
</formatters>
<accounts>
<account name="account_1" >
<mailbox>{imap.gmail.com:993/imap/ssl/novalidate-cert}maarch_capture</mailbox>
<username>mail@address.com</username>
<password>APassw0rd</password>
</account>
</accounts>
<messagerules>
<messagerule name="from_maarch" info="fromaddress" action="delete">false</messagerule>
</messagerules>
<messageoutputs >
<messageoutput name="doc_date" info="date" formatter="date"/>
<messageoutput name="type_id">108</messageoutput>
<messageoutput name="destination">COU</messageoutput>
<messageoutput name="subject" info="subject" />
<messageoutput name="fromaddress" info="fromaddress"/>
<messageoutput name="frompersonal" info="from[0]/personal" />
<messageoutput name="toaddress" info="toaddress" />
<messageoutput name="xpriority" info="xpriority" />
<messageoutput name="message_id" info="message_id" />
<messageoutput name="ccaddress" info="ccaddress" />
<!-- AR -->
<messageoutput name="email" info="fromaddress"/>
<messageoutput name="res_subject" info="subject" />
</messageoutputs>
<attachmentrules>
<attachmentrule name="images" info="format" op="in">gif jpg jpeg png</attachmentrule>
<attachmentrule name="application" info="format" op="in">pdf msword vnd.oasis.opendocument.text octet-stream</attachmentrule>
</attachmentrules>
<attachmentoutputs mode="attachment">
<attachmentoutput name="filename" info="dparameters[filename]"/>
<attachmentoutput name="description" info="description"/>
</attachmentoutputs>
</MailCapture>
\ No newline at end of file
#!/bin/sh
cd /opt/maarch/MaarchCapture/
php MaarchCapture.php init -BatchName MAARCH_SCAN_TO_MC -ConfigName /SampleConfig/Capture
if [ $? -eq 0 ]
then
echo "ok"
exit 0
else
echo "ko"
exit 1
fi
exit 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment