Afin de faire fonctionner MaarchCapture, il faut paramétrer le fichier ./config/Capture.xml.
Il permet de déclarer vos batchs et workflows de capture.
Il est structuré de cette façon :
<?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>
<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>
</step>
<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>
</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">none</input>
<input name="configFile">MailCapture_standard_sample.xml</input>
<input name="folder">maarch/purge</input>
</step>
<!-- SOAP SAMPLE -->
<step name="SendToMaarch" module="MaarchWSClient" function="processBatch">
<input name="WS">MaarchSoapWS</input>
<input name="Process">MaarchSoapWSProcessFromMail</input>
<input name="CatchError">true</input>
<input name="configFile">MaarchWSClient_standard_sample.xml</input>
</step>
</workflow>
</batch>
</batches>
</capture>
Le fichier de configuration générale peut comporter plusieurs déclarations de modules.
<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>
La déclaration d’un module comprend les attributs suivants :
<batch name="MAARCH_SCAN_TO_MC" directory="/opt/maarch/MaarchCapture/files/" id="{batchname}-{timestamp}-{rand}" lock="0">
La déclaration d’un batch comprend les attributs suivants :
Un batch peut comporter plusieurs workflows.
<workflow name="MAARCH_SCAN_TO_MC" debug="true" logMode="Maarch" maarchLogParam="/var/www/html/MaarchCourrier/apps/maarch_entreprise/xml/log4php.xml" maarchLoggerName="loggerTechnique">
La déclaration d’un workflow comprend les attributs suivants :
Un workflow peut comporter plusieurs étapes.
<step name="ImportFiles" module='FileImport' function="ImportFiles">
La déclaration d’une étape comprend les attributs suivants :