Sommaire |
Light and simple to use, Maarch AutoImport enables a fast mass importation of documents in Maarch Maarch DMS. The 3.2 AutoImport version works with Maarch Enterprise 1.2 and Maarch Letterbox 2.9.
Maarch AutoImport scans every document that need to be imported. To be able to perform the indexation, the file must be associated to an XML file with the same name. It contains the metadata necessary to reference the document (description, status, date of creation, documentary collection , etc…).
Maarch AutoImport needs the installation of a console PHP 5.3 or later to execute the script.
The Maarch appication must be previously configured. The DocServer must exist as well and it must be linked to the database.
The size limit of the DocServer in the database must be adapted to the quantity of documents to import. If the size limit is reached, importation will not be authorized.
When first using Maarch Autoimport, work_batch_autoimport_id must be set to 0 in the table parameters
No installation procedure is needed for this application. The script can be run from any folder, but the different configuration files must be set up accordingly.
To configure Maarch AutoImport, it is necessary to edit the file config.xml. It contains the information necessary to the connection to the database and to file importation in the DocServer. The mapping.xml is the link between the different XML files and the database. You will find below a detailed description for each of these files.
Config.xml is the configuration file for Maarch AutoImport. It allows the connection to the database and sending files to Maarch DocServer.
Each tag is a configuration entry. The values can be changed.
Description of config.xml tags
mapping_file.xml allows the indexation of properties in the desired fields of the database. The configuration of this file is imperative to perform the indexation.
Every field to index must be described in a XML tag: the <ELEMENT> tag. It contains two child tags: <COLUMN> and the <VALUE> tags.
<COLUMN>: Maarch column in RES_X table (or other table according to settings) <VALUE>: index file tag or constant value between single quotes. <FORMAT>: 'DATE' for date format, nothing for others. Date format is taken in config.xml file.
Example of file mapping file.xml
<ROOT>
<MAPPING_FILE>
<ELEMENT>
<COLUMN>DOC_DATE</COLUMN>
<VALUE>DATE_OF_DOCUMENT </VALUE>
<FORMAT>DATE</FORMAT>
</ELEMENT>
<ELEMENT>
<COLUMN>DESCRIPTION</COLUMN>
<VALUE>SUM</VALUE>
</ELEMENT>
<ELEMENT>
<COLUMN>TYPE_ID</COLUMN>
<VALUE>TYPE_ID</VALUE>
</ELEMENT>
<ELEMENT>
<COLUMN>TITLE</COLUMN>
<VALUE>INVOICE</VALUE>
</ELEMENT>
<ELEMENT>
<COLUMN>IDENTIFIER</COLUMN>
<VALUE>CLIENT</VALUE>
</ELEMENT>
<ELEMENT>
<COLUMN>CUSTOM_T4</COLUMN>
<VALUE>ADRESS</VALUE>
</ELEMENT>
<ELEMENT>
<COLUMN>STATUS</COLUMN>
<VALUE>'NEW'</VALUE>
</ELEMENT>
</MAPPING_FILE>
</ROOT>
In order to perform the indexation of a document in Maarch, the information of indexation must be written in another file without compromising the original file. The file containing these information is an XML file with the same name as the original file.
The information to be indexed in the chosen fields are palced between tags having the same name that the tag <VALUE> contains in mapping_file.xml
Example of file XML of property: <?xml version='1.0' encoding='iso-8859-1'?> <ROOT> <DATE_OF_DOCUMENT>2007-01-11 00:00:00</DATE_OF_DOCUMENT> <TYPE_ID>Customer Invoice</TYPE_ID> <INVOICE>ACME F-003</INVOICE> <CLIENT>ACCOVA RADIATEURS</CLIENT> <ADRESS>7 rue Jean Mermoz</ADRESS> <CP>91080</CP> <CITY>COURCOURONNES</CITY> <SUM>803,71</SUM> </ROOT>
When config.xml and mapping_file.xml are correctly configured, Maarch AutoImport can be executed to import the documents in Maarch.
Maarch AutoImport needs an command-line interpreter to be executed.
With Microsoft Windows: in the "Start Menu", select "Execute". In the execution window, enter "cmd" and click OK.
First, you need to execute PHP interpreter. you need to enter the folder php.
DOS Piloting Indexes: Location by default of Php 5.0:
cd « C:\xampp\php\php.exe »
When in the folder of the PHP interpreter, you must execute it with the names of Maarch AutoImport Script and config file:
php [application location] [configuration file]
Example of command to launch the mass importation with a standard config file:
C:\xampp\php\php.exe C:\autoimport\maarch_autoimport\maarch_auto_import.php C:\autoimport\maarch_autoimport\config.xml
Then press "Enter": the PHP interpreter is now executing the script.
The different actions performed during the importation process stored in an event log. It is located in the same folder as Maarch AutoImport and it is called log.txt. This document is overwritten after every new execution of the script.
If an error occurs during the execution of the script, its execution is immediately stopped and the indexation will not perform.
An SQL file is created in Maarch AutoµImport folder. It contains the SQL request to execute in the database for documents indexation.
When the documents are correctly inserted in Maarch, the importation file copies the documents in the /backup/ folder. If an error occurs during the execution, the documents are sent in the folder /failed/.
During the execution of the application, it creates a lock file named AutoImport.lck<tt>. It will be deleted when the execution is over.
This file aim at avoiding any mishandle of the documents. A single instance of Maarch AutoImport can be launched at a time.
In Maarch AutoImport folder, you will find a file named <tt>log.txt.
It records the different evolutions of the script during its execution. This log make possible to follow AutoImport does. This file is overwritten every time the script is executed.
When that an error occurs, it will be notified in the log, as well as the error number to guide through the resolution of the problem.
The most frequent error codes are:
Only the documents are sent to the DocServer. The XML Files are destroyed when they are inserted in the database.
In the DocServeur folder, documents are sorted first by year and then by month.
The third level is the number of the batch of the AutoImport. This number can be modified in the database through the table parameters, but it is strongly advised against while indexing documents.
To organize the documents in the DocServer, they are renamed and classified by folder. Every thousand documents, a new folder is created to receive the following thousand of files.