Mapout-M-Storage - Script d'export/en

Différence entre versions

De MappingDoc
(Page créée avec « As the extract process is based on the information found in Mapweb / M-Storage Web's MySQL database, M-Storage Web must be installed beforehand and you will need to rebuil... »)
(Page créée avec « ====XSL conversion for Alfresco==== »)
 
(44 révisions intermédiaires par le même utilisateur non affichées)
Ligne 12 : Ligne 12 :
 
As the extract process is based on the information found in Mapweb / M-Storage Web's MySQL database, M-Storage Web must be installed beforehand and you will need to rebuild the database and index of each folder you want to extract the content from. To do this, please refer to the installation and user guide for Mapweb / M-Storage Web.
 
As the extract process is based on the information found in Mapweb / M-Storage Web's MySQL database, M-Storage Web must be installed beforehand and you will need to rebuild the database and index of each folder you want to extract the content from. To do this, please refer to the installation and user guide for Mapweb / M-Storage Web.
  
'''Versions minimales requises :'''
+
'''Minimum versions supported:'''
  
- OS : Windows 2008, 2008r2, 2012, 2012r2, 7, 8, 8.1, 10
+
- OS: Windows 2008, 2008r2, 2012, 2012r2, 7, 8, 8.1, 10
:''Le script étant écrit en php7, il n'est pas possible de l'exécuter sur des serveurs Windows 2003 et antérieurs''
+
:''As the script is written in php7, it won't run on Windows Server 2003 and older''
  
 
- M-Storage 7.2.0.37383 minimum.  
 
- M-Storage 7.2.0.37383 minimum.  
:''Afin d'éviter de faire une mise à jour de M-Storage, un exécutable "M-Storage.exe" à copier dans le dossier d'installation de M-Storage est fourni avec le package du script d'export (dans le sous dossier "bin"). Cependant, si la version existante est encore basée sur "Mapout.exe", il sera tout de même nécessaire de procéder à une mise à jour complète vers M-Storage.''
+
:''To avoid updating M-Storage, a "M-Storage.exe" executable file is provided with the script package (in the "bin" folder). Make sure you place it in the folder where M-Storage is installed. However, if the existing version is the older "Mapout.exe", you will need to fully upgrade to M-Storage.''
  
- M-Storage Web ou Mapweb : 7.1 ou 7.2
+
- M-Storage Web or MapWeb: 7.1 or 7.2
  
'''MapWeb / M-Storage Web nécessite :'''
+
'''MapWeb / M-Storage Web requires:'''
  
*Apache 2.2 ou 2.4
+
*Apache 2.2 or 2.4
*MySQL version 5.1 minimum
+
*MySQL version 5.1 or higher
  
==Installation==
+
==Installation Steps==
Le script est fourni sous la forme d'un package comprenant les modules php ainsi que php 7.1.8 pour Windows.
+
The script is provided as a package including php modules and php 7.1.8 for Windows.
  
  
'''1 - Décompresser le package et copier le dossier "MStorageExport" dans le dossier "MapWebFiles" de Apache.'''
+
'''1 - Uncompress the package and copy the folder "MStorageExport" to Apache's "MapWebFiles".'''
  
Exemple : <code>C:\Program files\Apache Software Foundation\Apache2.2\htdocs\MapWebFiles\MStorageExport</code>
+
Example: <code>C:\Program files\Apache Software Foundation\Apache2.2\htdocs\MapWebFiles\MStorageExport</code>
  
  
'''2- Mettre à jour la version Mapout/M-Storage en 7.2.0.37383 minimum OU copier l'exécutable M-Storage.exe dans le dossier d'installation de M-Storage.'''
+
'''2- Update MapOut/M-Storage to 7.2.0.37383 or higher OR copy the  M-Storage.exe executable to the folder where M-Storage is installed.'''
  
Il est disponible dans le dossier "bin" du package.
+
It is found in the package's "bin" folder.
  
{{warning}}Attention, si M-Storage est toujours utilisé pour prendre en charge de nouveaux documents, il ne faut pas remplacer la version M-Storage installée, mais plutôt procéder à une duplication d'environnement complet sur un autre serveur dédié à l'export des archives existantes.
+
{{warning}}Caution: If M-Storage is still being used and new documents are still being added, do not replace the version installed. In this case, it is best to duplicate the full environment on another server dedicated to exporting archived content.
  
==Utilisation==
+
==Usage==
'''1 - Avant de lancer la première extraction de documents, il est nécessaire de récupérer les informations suivantes permettant de construire la requête'''
+
'''1 - Before extracting the first batch of documents, you will need to find the information below to build the query'''
  
*L'emplacement du programme '''M-storage.exe''' fournie avec le package.
+
*Path to '''M-storage.exe''' supplied with the package.
*L'emplacement du dossier dans lequel se trouve les archives à exporter.
+
*Path where the archived content you want to export is saved.
  
  
'''2 - Ouvrir une invite de commande (cmd) en tant qu'administrateur et se positionner sur le dossier MStorageExport :'''
+
'''2 - Open a DOS prompt (cmd) as an Administrator and go to MStorageExport:'''
  
Exemple :
+
Example:
 
  cd "C:\Program files\Apache Software Foundation\Apache2.2\htdocs\MapWebFiles\MStorageExport"
 
  cd "C:\Program files\Apache Software Foundation\Apache2.2\htdocs\MapWebFiles\MStorageExport"
{{Warning}} Toutes les commandes suivantes devront impérativement être saisies à partir de cet emplacement !!!
+
{{Warning}} All subsequent commands must be run from the same location!
  
 
<br />
 
<br />
  
'''3 - Pour obtenir de l'aide en ligne, saisir la commande suivante'''
+
'''3 - For online help, run this command'''
  
 
<code>php718\php help.php</code>
 
<code>php718\php help.php</code>
Ligne 63 : Ligne 63 :
 
<br />
 
<br />
  
'''4 - Commande de base de l'extraction'''
+
'''4 - Basic extract command'''
  
 
<code>php718\php export.php</code>
 
<code>php718\php export.php</code>
  
  
'''Paramètres obligatoires'''
+
'''Required parameters'''
 
{| class="wikitable"
 
{| class="wikitable"
 
|+
 
|+
!______Paramètre______
+
!______Parameter______
!Commentaire
+
!Comment
 
|-
 
|-
 
|'''''--archive='''''
 
|'''''--archive='''''
|Emplacement du dossier d'archives à exporter (exemple : <code>D:\Archives\Factures</code>). Il s'agit d'un dossier contenant divers fichiers dont ''Spool.cpr'' et ''Passwd.txt''. Le nom du dossier NE DOIT PAS se terminer pas un anti-slash.
+
|Folder you want to export (e.g. <code>D:\Archives\Factures</code>). It is a folder containing files such as ''Spool.cpr'' and ''Passwd.txt''. The folder name must NOT end with a backslash.
 
|-
 
|-
 
|'''''--dest='''''
 
|'''''--dest='''''
|Destination des documents à extraire. Il s'agit du chemin complet du fichier PDF à créer, sans l'extension. Si les dossiers spécifiés n'existent pas, ils seront créés automatiquement. Le chemin peut contenir des valeurs de méta données (entre chevrons <xxxx> ) et d'index (entre doubles crochets <nowiki>[[c_xxxxx]]</nowiki>) et avec le préfixe "c_". Ne pas y mettre l'extension.  
+
|Destination. Full path of the PDF file that will be created, with no extension. If the folders specified don't exist, they will be created automatically. The path may include metadata (like this <xxxx>) and index data( in square brackets<nowiki>[[c_xxxxx]]</nowiki>) with prefix "c_". No extension.  
Facultatif si ''--action="listCriteria"''
+
Optional if ''--action="listCriteria"''
 
|-
 
|-
 
|'''''--pgm='''''
 
|'''''--pgm='''''
|Chemin complet du programme M-Storage.exe ou Mapout.exe (selon la version installée)
+
|Full path to M-Storage.exe or Mapout.exe (according to version installed)
 
|-
 
|-
 
|'''''--action='''''
 
|'''''--action='''''
|Action du script :
+
|Script action:
  
  
<code>--action="''getCommands''"</code> : création de fichiers txt avec la commande M-Storage.exe permettant de créer le fichier PDF. Cette option permet de tester la commande rapidement sans créer les fichiers PDF
+
<code>--action="''getCommands''"</code>: create TXT files using the M-Storage.exe command that will create the PDF file. This option is used to test the command quickly without creating the PDF files.
  
  
<code>''--action="generate''"</code> : génération des fichiers PDF
+
<code>''--action="generate''"</code> : generate PDF files
  
  
<code>''--action="listCriteria''"</code> : liste les index disponibles pour l'archive sélectionnée
+
<code>''--action="listCriteria''"</code>: list of available indexes for the selected archive
 
|}
 
|}
  
  
'''''Exemple de commande simple :'''''
+
'''''Simple command example:'''''
 
  php718\php export.php --archive="D:\Archives\Factures" --dest="D:\Export Archives\<NomUser>\<nowiki>[[c_numfac]]</nowiki>_<nowiki>[[c_numcli]]</nowiki>" --pgm="C:\Mapping\M-Storage\m-storage.exe" --action="getCommands"
 
  php718\php export.php --archive="D:\Archives\Factures" --dest="D:\Export Archives\<NomUser>\<nowiki>[[c_numfac]]</nowiki>_<nowiki>[[c_numcli]]</nowiki>" --pgm="C:\Mapping\M-Storage\m-storage.exe" --action="getCommands"
 
<br />
 
<br />
  
'''Paramètres facultatifs'''
+
'''Optional parameters'''
 
{| class="wikitable"
 
{| class="wikitable"
 
|+
 
|+
!'''''______Paramètre______'''''
+
!'''''______Parameter______'''''
!Commentaire
+
!Comment
 
|-
 
|-
 
|'''''--indexfile'''''
 
|'''''--indexfile'''''
|Si présent, chaque fichier PDF sera accompagné d'un fichier d'index XML portant le même nom
+
|If used, an XML index file will be generated together with each PDF file and will have the same name
 
|-
 
|-
 
|'''''--xsl='''''
 
|'''''--xsl='''''
|Chemin d'un fichier xsl permettant de personnaliser le schéma du fichier xml afin de le rendre compatible avec un outil de GED tiers. La présence de ce paramètre active la transformation XSLTExemple : <code>--xsl="C:\Mapping\Storage_Alfresco.xsl"</code>
+
|Path to XSL file used to customize the structure of the XML file in order to make it compatible with a third-party document management application. When this parameter is used, XSLT transformation is enableExample: <code>--xsl="C:\Mapping\Storage_Alfresco.xsl"</code>
 
|-
 
|-
 
|'''''--rupt='''''
 
|'''''--rupt='''''
|Index de rupture, permettant de générer plusieurs PDF à partir d'un même spool d'impression. Par exemple, si les archives contiennent des spools d'impression multi-factures, il est possible, en spécifiant l'index du numéro de facture dans le paramètre ''--rupt'', de générer un pdf par facture et non un pdf pour le spool complet. Il est possible d'avoir plusieurs ocurences de ce paramètre pour que la rupture se fasse sur plusieurs index différents. Exemple : <code>--rupt="c_numfac"</code>
+
|Break index used to generate several PDF files from the same print spooled file. For example, if the archives contain print spool files with multiple invoices, you can create one PDF per invoice instead of one PDF for the whole spool file. You can do this using parameter ''--rupt'' and there can be more than one to break on different indexes. Example: <code>--rupt="c_numfac"</code>
 
|-
 
|-
 
|'''''--nextpage'''''
 
|'''''--nextpage'''''
|Lors de l'utilisation d'un ou plusieurs index de ruptures, il est possible que certaines pages ne comportent pas de valeur pour ces index, notamment parce que l'un des index en question n'est présent que sur la première page de chaque document. Dans ce cas, si le paramètre ''--nextpage'' est présent, les pages suivantes ne comportant pas de valeur seront incluses dans le document PDF généré.
+
|When using one or more break indexes, some pages may not have any value for the indexes mainly because one index is found only on the first page of each document. In this case, if the ''--nextpage'' parameter is used, the next pages that do not have any value will be included in the generated PDF document.
 
|-
 
|-
 
|'''''--log='''''
 
|'''''--log='''''
|Chemin complet d'un fichier de log. A défaut, la totalité se la log se fera sur la sortie standard.
+
|Full path to log file. If missing, the log will be added to the standard output channel.
 
|-
 
|-
 
|'''--filterindex_egal='''
 
|'''--filterindex_egal='''
Ligne 134 : Ligne 134 :
  
 
'''--filtermeta_begin='''
 
'''--filtermeta_begin='''
|Divers paramètres de filtres, sur les méta données et sur les index sont possible
+
|Different filtering options are supported on metadata and indexes
  
  
Usage : ''<code>--filter_XXXXXX="clé=valeur"</code>'' <br />
+
Usage: ''<code>--filter_XXXXXX="key=value"</code>'' <br />
  
Liste des différents types de filtres
+
Supported filter types
  
:'''-- filtermeta_egal''' : filtre de type ''<u>la méta donnée</u>'' '''est''' '''égale à''' ''<u>la valeur</u>''
+
:'''-- filtermeta_egal''' : filter of type ''<u>metadata</u>'' '''is''' '''equal to''' ''<u>value</u>''
  
:'''-- filtermeta_contains''' : filtre de type ''<u>la méta donnée</u>'' '''contient''' ''<u>la valeur</u>''
+
:'''-- filtermeta_contains''' : filter of type ''<u>metadata</u>'' '''contains''' ''<u>value</u>''
  
:'''-- filtermeta_begin''' : filtre de type ''<u>la méta donnée</u>'' '''commence par''' ''<u>la valeur</u>''
+
:'''-- filtermeta_begin''' : filter of type ''<u>metadata</u>'' '''starts with''' ''<u>value</u>''
  
:'''-- filterindex_egal''' : filtre de type <u>''l'index''</u> '''est égal à''' ''<u>la valeur</u>''
+
:'''-- filterindex_egal''' : filter of type <u>''index''</u> '''is equal to''' ''<u>value</u>''
  
:'''-- filterindex_contains''' : filtre de type <u>''l'index''</u> '''contient''' ''<u>la valeur</u>''
+
:'''-- filterindex_contains''' : filter of type <u>''index''</u> '''contains''' ''<u>value</u>''
  
:'''-- filterindex_begin''' : filtre de type <u>''l'index''</u> '''commence par''' ''<u>la valeur</u>'' <br />
+
:'''-- filterindex_begin''' : filter of type <u>''index''</u> '''starts with''' ''<u>value</u>'' <br />
  
Exemple : ''<code>--filterindex_egal="c_site=Paris" --filtermeta_begin="NomSpool=S2016"</code>'' <br />
+
Example : ''<code>--filterindex_egal="c_site=Paris" --filtermeta_begin="NomSpool=S2016"</code>'' <br />
  
La liste des index disponibles dépend de chaque archive. Cette liste est disponible via la table "''criteres''" de la base MySql. Tous les index doivent être spécifiés avec leur préfixe "c_".
+
The list of indexes available depends on each archive. The list can be found in the "''criteres''" table of the MySql database. All indexes have the same "c_" prefix.
 
|}
 
|}
  
'''Liste des méta données'''
+
'''Supported metadata'''
  
La liste des méta données est quant à elle figée. Il s'agit des colonnes de la table "''spools''" de la base MySQL :<br /> ''{{Warning}} Attention : sensibles à la casse.'' <br /> ''{{Warning}} Il est courant que certaines de ces méta données soient détournées pour contenir des données "métier", surtout pour les archives issues de Mapping sur les plateformes Windows et Unix/Linux.''
+
The list of metadata is always the same and cannot be changed. It is the list of columns in the "''spools''" table of the MySQL database:<br /> ''{{Warning}} Caution: case-sensitive.'' <br /> ''{{Warning}} It often happens that some metadata contains business process data especially with archives coming from Mapping on Windows and Unix/Linux.''
  
:*'''NomSpool''' : ''<small>SPOOLNAME</small>'' au format "Saaaammjjhhmmssxxxxxxxxx". Cette donnée étant indexée, elle convient très bien à une extraction par période, par exemple avec le paramètre ''--filtermeta_begin="NomSpool=S201706"'' pour extraire les documents de juin 2017.
+
:*'''NomSpool''' : ''<small>SPOOLNAME</small>'' in "Syyyymmddhhmmssxxxxxxxxx" format. As the data is indexed, it can be extracted per period e.g. with ''--filtermeta_begin="NomSpool=S201706"'' to extract the documents from June 2017.
:*'''DateDuSpoolFichier''' '':'' ''<small>DATE</small>'' au format "aaaammjj"
+
:*'''DateDuSpoolFichier''' '':'' ''<small>DATE</small>'' in "yyyymmdd" format
 
:*'''NomTravail''' : ''<small>JOBNAME</small>''
 
:*'''NomTravail''' : ''<small>JOBNAME</small>''
 
:*'''NomUser''' : ''<small>USERNAME</small>''
 
:*'''NomUser''' : ''<small>USERNAME</small>''
Ligne 182 : Ligne 182 :
  
  
'''''Exemple de commande avancée :'''''
+
'''''Sample advanced command:'''''
  
Génération des documents PDF issus de l'archive D:\Archives\012018 pour lesquels le format MapDraw/M-Designer est "FACTURE", le nom du client "EXEMPLE" pour la période janvier 2018. Chaque PDF contiendra les données d'un seul client (rupture par c_numcli) et un fichier d'index non personnalisé accompagnera chaque fichier PDF. Le plan de classement des fichiers PDF générés sera dynamique et comportera la date, le nom du client et l'identifiant du spool d'impression.  
+
We want to generate PDF documents taken from D:\Archives\012018 where the MapDraw/M-Designer format is "FACTURE", customer name is "EXEMPLE" for January 2018. We want each PDF to contain the data of only one customer (break using c_numcli) and a standard index file will also come with each PDF. The PDF files will be stored dynamically and shall include the date, customer name, and spool file id.  
 
  php718\php export.php --action="generate" --archive="D:\Archives\012018" --filtermeta_egal="Format=FACTURE" --filterindex_contains="c_nomcli=EXEMPLE" --filtermeta_begin="NomSpool=201801" --rupt="c_numcli" --nextpage --indexfile --dest="D:\Export\<nowiki>[[c_date]]</nowiki>\<nowiki>[[c_nomcli]]</nowiki>_<NomSpool>" --pgm="D:\Mapping\M-storage\M-storage.exe"
 
  php718\php export.php --action="generate" --archive="D:\Archives\012018" --filtermeta_egal="Format=FACTURE" --filterindex_contains="c_nomcli=EXEMPLE" --filtermeta_begin="NomSpool=201801" --rupt="c_numcli" --nextpage --indexfile --dest="D:\Export\<nowiki>[[c_date]]</nowiki>\<nowiki>[[c_nomcli]]</nowiki>_<NomSpool>" --pgm="D:\Mapping\M-storage\M-storage.exe"
 
<br />
 
<br />
==Exemple de XML généré sans transformation XSL==  
+
==Sample XML generated without XSL transformation==  
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
  <?xml version="1.0" encoding="UTF-8"?>
 
  <?xml version="1.0" encoding="UTF-8"?>
Ligne 229 : Ligne 229 :
 
  </Indexes>
 
  </Indexes>
 
</syntaxhighlight>
 
</syntaxhighlight>
==Exemples de XSL==
+
==XSL Examples==
  
====Conversion XSL pour Alfresco====
+
====XSL conversion for Alfresco====
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
  <?xml version="1.0" encoding="UTF-8"?>
 
  <?xml version="1.0" encoding="UTF-8"?>

Version actuelle datée du 5 décembre 2019 à 15:04

Autres langues :
English • ‎français

Introduction

This page explains how to use the script that lets you mass export documents stored in MapOut / M-Storage.

It is a PHP script run on the command line that includes various options for generating PDF files with or without XML index files.

The script processes the documents found in only one folder, which means you need to run the script for each folder where you want to extract the content.

Requirements

The script runs on the Windows system where M-Storage is installed.

As the extract process is based on the information found in Mapweb / M-Storage Web's MySQL database, M-Storage Web must be installed beforehand and you will need to rebuild the database and index of each folder you want to extract the content from. To do this, please refer to the installation and user guide for Mapweb / M-Storage Web.

Minimum versions supported:

- OS: Windows 2008, 2008r2, 2012, 2012r2, 7, 8, 8.1, 10

As the script is written in php7, it won't run on Windows Server 2003 and older

- M-Storage 7.2.0.37383 minimum.

To avoid updating M-Storage, a "M-Storage.exe" executable file is provided with the script package (in the "bin" folder). Make sure you place it in the folder where M-Storage is installed. However, if the existing version is the older "Mapout.exe", you will need to fully upgrade to M-Storage.

- M-Storage Web or MapWeb: 7.1 or 7.2

MapWeb / M-Storage Web requires:

  • Apache 2.2 or 2.4
  • MySQL version 5.1 or higher

Installation Steps

The script is provided as a package including php modules and php 7.1.8 for Windows.


1 - Uncompress the package and copy the folder "MStorageExport" to Apache's "MapWebFiles".

Example: C:\Program files\Apache Software Foundation\Apache2.2\htdocs\MapWebFiles\MStorageExport


2- Update MapOut/M-Storage to 7.2.0.37383 or higher OR copy the M-Storage.exe executable to the folder where M-Storage is installed.

It is found in the package's "bin" folder.

Warning-300px.pngCaution: If M-Storage is still being used and new documents are still being added, do not replace the version installed. In this case, it is best to duplicate the full environment on another server dedicated to exporting archived content.

Usage

1 - Before extracting the first batch of documents, you will need to find the information below to build the query

  • Path to M-storage.exe supplied with the package.
  • Path where the archived content you want to export is saved.


2 - Open a DOS prompt (cmd) as an Administrator and go to MStorageExport:

Example:

cd "C:\Program files\Apache Software Foundation\Apache2.2\htdocs\MapWebFiles\MStorageExport"

Warning-300px.png All subsequent commands must be run from the same location!


3 - For online help, run this command

php718\php help.php


4 - Basic extract command

php718\php export.php


Required parameters

______Parameter______ Comment
--archive= Folder you want to export (e.g. D:\Archives\Factures). It is a folder containing files such as Spool.cpr and Passwd.txt. The folder name must NOT end with a backslash.
--dest= Destination. Full path of the PDF file that will be created, with no extension. If the folders specified don't exist, they will be created automatically. The path may include metadata (like this <xxxx>) and index data( in square brackets[[c_xxxxx]]) with prefix "c_". No extension.

Optional if --action="listCriteria"

--pgm= Full path to M-Storage.exe or Mapout.exe (according to version installed)
--action= Script action:


--action="getCommands": create TXT files using the M-Storage.exe command that will create the PDF file. This option is used to test the command quickly without creating the PDF files.


--action="generate" : generate PDF files


--action="listCriteria": list of available indexes for the selected archive


Simple command example:

php718\php export.php --archive="D:\Archives\Factures" --dest="D:\Export Archives\<NomUser>\[[c_numfac]]_[[c_numcli]]" --pgm="C:\Mapping\M-Storage\m-storage.exe" --action="getCommands"


Optional parameters

______Parameter______ Comment
--indexfile If used, an XML index file will be generated together with each PDF file and will have the same name
--xsl= Path to XSL file used to customize the structure of the XML file in order to make it compatible with a third-party document management application. When this parameter is used, XSLT transformation is enable. Example: --xsl="C:\Mapping\Storage_Alfresco.xsl"
--rupt= Break index used to generate several PDF files from the same print spooled file. For example, if the archives contain print spool files with multiple invoices, you can create one PDF per invoice instead of one PDF for the whole spool file. You can do this using parameter --rupt and there can be more than one to break on different indexes. Example: --rupt="c_numfac"
--nextpage When using one or more break indexes, some pages may not have any value for the indexes mainly because one index is found only on the first page of each document. In this case, if the --nextpage parameter is used, the next pages that do not have any value will be included in the generated PDF document.
--log= Full path to log file. If missing, the log will be added to the standard output channel.
--filterindex_egal=

--filterindex_contains=

--filterindex_begin=


--filtermeta_egal=

--filtermeta_contains=

--filtermeta_begin=

Different filtering options are supported on metadata and indexes


Usage: --filter_XXXXXX="key=value"

Supported filter types

-- filtermeta_egal : filter of type metadata is equal to value
-- filtermeta_contains : filter of type metadata contains value
-- filtermeta_begin : filter of type metadata starts with value
-- filterindex_egal : filter of type index is equal to value
-- filterindex_contains : filter of type index contains value
-- filterindex_begin : filter of type index starts with value

Example : --filterindex_egal="c_site=Paris" --filtermeta_begin="NomSpool=S2016"

The list of indexes available depends on each archive. The list can be found in the "criteres" table of the MySql database. All indexes have the same "c_" prefix.

Supported metadata

The list of metadata is always the same and cannot be changed. It is the list of columns in the "spools" table of the MySQL database:
Warning-300px.png Caution: case-sensitive.
Warning-300px.png It often happens that some metadata contains business process data especially with archives coming from Mapping on Windows and Unix/Linux.

  • NomSpool : SPOOLNAME in "Syyyymmddhhmmssxxxxxxxxx" format. As the data is indexed, it can be extracted per period e.g. with --filtermeta_begin="NomSpool=S201706" to extract the documents from June 2017.
  • DateDuSpoolFichier : DATE in "yyyymmdd" format
  • NomTravail : JOBNAME
  • NomUser : USERNAME
  • DescriptifPC
  • NumeroJob
  • FichierSpool
  • NumeroSpool
  • OUTQ : OUTQ
  • BiliothequeOUTQ
  • Reference : USERDATA
  • Format : FORMAT MapDraw / M-Designer
  • ProgrammeEdition : PROG
  • BibProgrammeEdition
  • Critere1
  • Critere2
  • Critere3
  • Critere4


Sample advanced command:

We want to generate PDF documents taken from D:\Archives\012018 where the MapDraw/M-Designer format is "FACTURE", customer name is "EXEMPLE" for January 2018. We want each PDF to contain the data of only one customer (break using c_numcli) and a standard index file will also come with each PDF. The PDF files will be stored dynamically and shall include the date, customer name, and spool file id.

php718\php export.php --action="generate" --archive="D:\Archives\012018" --filtermeta_egal="Format=FACTURE" --filterindex_contains="c_nomcli=EXEMPLE" --filtermeta_begin="NomSpool=201801" --rupt="c_numcli" --nextpage --indexfile --dest="D:\Export\[[c_date]]\[[c_nomcli]]_<NomSpool>" --pgm="D:\Mapping\M-storage\M-storage.exe"


Sample XML generated without XSL transformation

 <?xml version="1.0" encoding="UTF-8"?>
 <Indexes name="Document_2503576">
   <Meta name="NomSpool">S2019052127391744561449</Meta>
   <Meta name="DateDuSpoolFichier">20190521</Meta>
   <Meta name="NomTravail">ED_BCHARG</Meta>
   <Meta name="NomUser">ADMIN2</Meta>
   <Meta name="NumeroJob">157478</Meta>
   <Meta name="FichierSpool">BR60400C</Meta>
   <Meta name="NumeroSpool">4 </Meta>
   <Meta name="OutQ">RICOH1</Meta>
   <Meta name="BibliothequeOutQ">QUSRSYS </Meta>
   <Meta name="Reference">BR60400C</Meta>
   <Meta name="Format"/>
   <Meta name="ProgrammeEdition">BR60400C</Meta>
   <Meta name="BibProgrammeEdition">MAP400</Meta>
   <Meta name="DescriptifPC">Bon Livraison Mail</Meta>
   <Meta name="Critere1"/>
   <Meta name="Critere2"/>
   <Meta name="Critere3"/>
   <Meta name="Critere4"/>
   <Index name="c_body">
     <Value page="1">c:\Vente_AvisExpedition_FR.txt</Value>
   </Index>
   <Index name="c_client">
     <Value page="1">185830</Value>
   </Index>
   <Index name="c_dosarc">
     <Value page="1">Bon Livraison BONDUES 2019</Value>
   </Index>
   <Index name="c_mois">
     <Value page="1">05</Value>
   </Index>
   <Index name="c_nomclient">
     <Value page="1">MY COMPAGNY - CUISINES & BAINS</Value>
   </Index>
   <Index name="c_numbl">
     <Value page="1">6547951</Value>
   </Index>
 </Indexes>

XSL Examples

XSL conversion for Alfresco

 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
   <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no" cdata-section-elements="field" exclude-result-prefixes="xsl xs"/>
   <xsl:template match="/">
   <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"&gt;
   </xsl:text>
   <xsl:apply-templates/>
   </xsl:template>
 
   <xsl:template match="Indexes">
     <properties>
     <!-- Activation du modele mp: -->                
       <entry key="type">cm:content</entry>
       <entry key="aspects"></entry>
       <xsl:apply-templates/>
     </properties>
   </xsl:template>
 
   <xsl:template match="Meta">
     <entry>
       <xsl:attribute name="key">mp:<xsl:value-of select="translate(@name,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
       </xsl:attribute><xsl:value-of select="."/>
     </entry>
   </xsl:template>
 
   <xsl:template match="Index">
     <entry>
       <xsl:attribute name="key">mp:<xsl:value-of select="translate(@name,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
       </xsl:attribute><xsl:value-of select="Value"/>
     </entry>
   </xsl:template>
 </xsl:stylesheet>