Paramétrage du modèle de capture général
=========================================

Le fichier général de configuration de MaarchCapture se trouve dans :
**./config/Capture.xml**

Il est commun à toutes les instances MaarchCourrier sur votre serveur d’instances mutualisées MaarchCourrier. Il est par contre unique sur vos postes de numérisation.

## Réconcilliation des fichiers numérisés

Voici un exemple de workflow à ajouter a votre fichier Capture.xml

Le paramétrage type pour la réconcilliation de fichiers numérisé dans un répertoire et à destination de MaarchCourrier est le suivant (opt/maarch/MaarchCapture/config/Capture.xml) :

    <batch name="MAARCH_SCAN_RECO" directory="/opt/maarch/MaarchCapture/files/" id="{batchname}-{timestamp}-{rand}" lock="0">
       <workflow name="MAARCH_SCAN_RECO" debug="true" logMode="Maarch" maarchLogParam="/var/www/html/MaarchCourrier/apps/maarch_entreprise/xml/log4php.xml" maarchLoggerName="loggerTechnique">

           <!-- QRSeparator  -->

           <step function="separatePDF" module="QRSeparator" name="separatePDF">
               <input name="ScanSource">/opt/maarch/MaarchCapture/files/scan/</input>
               <input name="qrcodePrefix">false</input>
           </step>

           <!-- REST -->

           <step name="SendToMaarch" module="MaarchWSClient" function="processBatch">
               <input name="WS">MaarchRestWS</input>
               <input name="Process">MaarchRestWSProcessFromScanReco</input>
               <input name="CatchError">true</input>
               <input name="configFile">MaarchWSClient_standard.xml</input>
           </step>
       </workflow>
    </batch>


Le paramétrage type pour la partie webservice de MaarchCapture est la suivante (opt/maarch/MaarchCapture/modules/MaarchWSClient/MaarchWSClient_standard.xml):

    <process name="MaarchRestWSProcessFromScanReco">
        <loop xpath="/Batch/Documents/Document">
            <call name="/res" method="POST">
                <argument type="entity" eval="base64_encode(file_get_contents($Element-&gt;path))" name="encodedFile"/>
                <argument type="entity" name="data">
                     <column>title</column>
                     <value metadata="filename"/>
                     <type>string</type>
                </argument>
                <argument type="entity" name="data">
                     <column>res_id_master</column>
                     <value metadata="destination"/>
                     <type>integer</type>
                </argument>
                <argument type="entity" name="data">
                     <column>coll_id</column>
                     <value>letterbox_coll</value>
                     <type>string</type>
                </argument>
                <argument type="entity" name="data">
                     <column>attachment_type</column>
                     <value>signed_response</value>
                     <type>string</type>
                </argument>
                <argument type="entity" name="collId">letterbox_coll</argument>
                <argument type="entity" name="table">res_attachments</argument>
                <argument type="entity" name="format" attribute="extension"/>
                <argument type="entity" name="status">SIGN</argument>
                <return>
                    <resId metadata="resId" />
                </return>
            </call>
        </loop>
    </process>
