Commit 07129700 authored by Henri Queneau's avatar Henri Queneau
Browse files

add file xml

parent b7fb9d65
<?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"/>
</modules>
<batches>
<!-- 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/MaarchCapture/files/TEST_IMPORT/</input>
<input name="Target">Document</input>
<input name="Action">none</input>
<input name="MoveDirectory">/opt/maarch/MaarchCapture/files/TEST_IMPORT/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_standard_sample.xml</input>
</step>
</workflow>
</batch>
<!-- MAIL TO MAARCHCOURRIER SAMPLE -->
<batch name="MAARCH_MAIL_TO_MC" directory="/opt/maarch/MaarchCaptureDeof/files/" id="{batchname}-{timestamp}-{rand}" lock="0">
<workflow name="MAARCH_MAIL_TO_MC" debug="true" logMode="Maarch" maarchLogParam="/var/www/html/MaarchCourrier/custom/cs_deof/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">none</input>
<input name="configFile">MailCapture_standard_sample.xml</input>
<input name="folder">purge_mail_maarch_capture</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_standard_sample.xml</input>
</step>
<step name="LinkInMaarch" module="MaarchWSClient" function="processBatchLinkedResources">
<input name="WS">MaarchRestWS</input>
<input name="CatchError">true</input>
<input name="configFile">MaarchWSClient_standard_sample.xml</input>
</step>
</workflow>
</batch>
</batches>
</capture>
<?xml version="1.0" encoding="UTF-8"?>
<MaarchWSClient>
<!-- REST FRONTAL -->
<!-- <WS name="MaarchRestWS" type="REST" uri="http://cchaplin:maarch@localhost/deof/cs_deof2/rest/" SSL="false" cacheUse="0" /> -->
<WS name="MaarchRestWS" type="REST" uri="http://cchaplin:maarch@localhost/deof/cs_deof2/rest/" SSL="false" cacheUse="0" />
<!-- DEVELOP SAMPLES -->
<process name="MaarchRestWSProcessFromMail">
<loop xpath="/Batch/Documents/Document">
<loop xpath="Attachments/Attachment">
<loop xpath="ancestor::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" />
<res_linked name="resId" info="resId" metadata="resId" formatter="integer"/>
</return>
</call>
</loop>
<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>
</MaarchWSClient>
\ No newline at end of file
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