ONYX - 9.0 - Utilisation - Gestion d'indexation/en

Différence entre versions

De MappingDoc
(Page créée avec « The box parameters specify its dimensions: xx.xx,xx.xx,xx.xx,xx.xx[,cm|in|mm] »)
(Page créée avec « Concatenation in several times, in the case where we do not know in advance the number of input XPS files (generally in a loop): map_xps -tempfile:/tmp/final.xps -add:/tm... »)
 
(37 révisions intermédiaires par le même utilisateur non affichées)
Ligne 128 : Ligne 128 :
 
The box parameters specify its dimensions: xx.xx,xx.xx,xx.xx,xx.xx[,cm|in|mm]
 
The box parameters specify its dimensions: xx.xx,xx.xx,xx.xx,xx.xx[,cm|in|mm]
  
- quatre nombres décimaux spécifiant dans l’ordre : top (haut), bottom (bas), left (gauche), right (droite)
 
  
- le séparateur de décimale est le ‘.’
+
- four decimal numbers specifying in order: top, bottom, left, right
  
- le séparateur de valeurs est ‘,’ ou ‘;’
 
  
- le dernier paramètre (optionnel) est l’unité des coordonnées : en points (pour une résolution de 96dpi) par défaut, en millimètres (mm), en pouces (in) ou en centimètres (cm)
+
- the decimal separator is ‘.’
  
===Export des index et de leurs valeurs===
 
  
Le principe est la création d’un fichier d’index à partir d’un document en vue de son archivage dans un logiciel tiers.
+
- the value separator is ‘,’ or ‘;’
Les fichiers d’index produits en standard par ONYX Server peuvent être au format TXT, XML, ou IND (compatible avec Content Manager).
 
Cet export des index dans un fichier est commandé par le commutateur '''-indexfile:xxx'''. L’extension du fichier d’export pilote son type.
 
  
Le paramètre <code>-duplicateindex</code> permet d’exporter également les index dont la valeur est la même sur plusieurs pages.
 
  
Le paramètre <code>-exportemptyindex</code> permet d’exporter également les index qui n’ont pas de valeur.
+
- the last parameter (optional) is the coordinate unit: in points (for a resolution of 96dpi) by default, in millimeters (mm), in inches (in) or in centimeters (cm)
  
  
Exemples :
+
===Export of indexes and their values===
 +
 
 +
The principle is the creation of an index file from a document with a view to archiving it in third-party software.
 +
The index files produced as standard by ONYX Server can be in TXT, XML, or IND format (compatible with Content Manager).
 +
This export of indexes to a file is controlled by the '''-indexfile:xxx''' switch. The extension of the export file controls its type.
 +
 
 +
The <code>-duplicateindex</code> parameter allows you to also export indexes whose value is the same on several pages.
 +
 
 +
 
 +
The <code>-exportemptyindex</code> parameter allows you to also export indexes that have no value.
 +
 
 +
 
 +
 
 +
Examples:
 
  map_xps -infile:/tmp/invoice.xps -indexfile:/tmp/file.txt [-duplicateindex] [-exportemptyindex]
 
  map_xps -infile:/tmp/invoice.xps -indexfile:/tmp/file.txt [-duplicateindex] [-exportemptyindex]
  
Ligne 154 : Ligne 161 :
 
  map_xps -infile:/tmp/invoice.xps -indexfile:/tmp/file.ind [-duplicateindex] [-exportemptyindex]
 
  map_xps -infile:/tmp/invoice.xps -indexfile:/tmp/file.ind [-duplicateindex] [-exportemptyindex]
  
==Traitements sur les index==
 
  
===Tri===
+
==Processing on indexes==
 +
 
 +
===Sorting===
  
Le principe est de trier (commutateur '''-sort:xxx''') un document XPS suivant les valeurs d’un ou plusieurs critères d’indexation. Un seul fichier sera créé en sortie. Le tri s’effectue par ordre croissant sur des valeurs numériques par défaut. L’utilisation de l’option ALPHA permet de réaliser un tri sur des valeurs alphanumériques, l’option REVERSE permet un tri par ordre décroissant.
+
The principle is to sort ('''-sort:xxx''' switch) an XPS document according to the values ​​of one or more indexing criteria. Only one file will be created as output. Sorting is done in ascending order using numeric values ​​by default. Using the ALPHA option allows you to sort on alphanumeric values, the REVERSE option allows you to sort in descending order.
  
  
Exemples :
+
Examples :
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -sort:CustomerID -toPDF
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -sort:CustomerID -toPDF
  
Ligne 171 : Ligne 179 :
  
  
===Éclatement===
+
===Spliting===
 +
 
  
Le principe est d’éclater un document suivant les valeurs d’un ou plusieurs critères d’indexation. Autant de fichiers peuvent être créés en sortie qu’il y a de valeurs différentes du ou des critères utilisés.
+
The principle is to split a document according to the values ​​of one or more indexing criteria. As many output files can be created as there are different values ​​of the criteria used.
Ici, pas de commutateur particulier, mais une syntaxe précise à respecter pour commander l’éclatement : <nowiki>[[Nom_index]]</nowiki>.
+
Here, no particular switch, but a precise syntax to follow to control the splitting: <nowiki>[[Index_Name]]</nowiki>.
  
Exemples :
+
Examples :
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_<nowiki>[[CustomerID]]</nowiki>.pdf -toPDF
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_<nowiki>[[CustomerID]]</nowiki>.pdf -toPDF
  
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_[<nowiki>[CustomerID]</nowiki>]_<nowiki>[[InvoiceID]]</nowiki>.pdf -toPDF
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_[<nowiki>[CustomerID]</nowiki>]_<nowiki>[[InvoiceID]]</nowiki>.pdf -toPDF
  
===Éclatement volumique===
+
===Volume spliting===
  
Le mode '''BUNDLEONINDEX''' permet de créer des lots en fonction du nombre de pages pour chaque valeur de critère (par exemple : un fichier avec les documents comptant de 1 à 4 pages pour chaque valeur de critère, un fichier pour les documents comptant de 5 à 9 pages, un fichier pour les documents de plus de 10 pages). Il est possible de créer autant de lots que souhaité.
+
The '''BUNDLEONINDEX''' mode allows you to create batches according to the number of pages for each criterion value (for example: a file with documents having 1 to 4 pages for each criterion value, a file for documents of 5 to 9 pages, one file for documents of more than 10 pages). It is possible to create as many batches as desired.
  
  
Exemple :
+
Example :
  
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice<nowiki>_[[BUNDLEONINDEX,MAPSEND,1,5,10]]</nowiki>.pdf -toPDF
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice<nowiki>_[[BUNDLEONINDEX,MAPSEND,1,5,10]]</nowiki>.pdf -toPDF
  
  
En mode '''BUNDLEONINDEX''', l’éclatement peut également se faire suivant un nombre de feuilles (en fonction des informations de recto/verso), la syntaxe devient alors :
+
In '''BUNDLEONINDEX''' mode, splitting can also be done according to a number of sheets (depending on the front/back information), the syntax then becomes:
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice<nowiki>_[[BUNDLEONINDEX=SHEET,MAPSEND,1,5,10]]</nowiki>.pdf -toPDF
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice<nowiki>_[[BUNDLEONINDEX=SHEET,MAPSEND,1,5,10]]</nowiki>.pdf -toPDF
  
===Filtres ou extraction de pages===
 
  
Le principe est d’isoler certaines pages d’un document XPS en fonction des valeurs d’un ou plusieurs critères d’indexation. Cela peut servir notamment pour créer un document en sortie ne concernant que certains clients.
+
===Filters or page extraction===
Le commutateur '''-filter:xxx''' est utilisé dans ce cas. Les opérateurs mathématiques (=, <, >, <=, >=) et logiques (AND, OR) peuvent être employés pour des filtres complexes sans oublier les parenthèses de priorités.
+
 
 +
The principle is to isolate certain pages of an XPS document based on the values ​​of one or more indexing criteria. This can be used in particular to create an output document that only concerns certain clients.
 +
The '''-filter:xxx''' switch is used in this case. Mathematical (=, <, >, <=, >=) and logical (AND, OR) operators can be used for complex filters without forgetting priority parentheses.
  
Exemples :
+
Examples :
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_426.pdf -toPDF -filter:CUSTOMER=426
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_426.pdf -toPDF -filter:CUSTOMER=426
  
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/extract.pdf -toPDF-filter:(CUSTOMER=4026) OR (CUSTOMER=1458) AND (PRICE=15)
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/extract.pdf -toPDF-filter:(CUSTOMER=4026) OR (CUSTOMER=1458) AND (PRICE=15)
  
Cela peut également s’avérer très utile pour n’effectuer des actions que sur certaines pages dépendant de valeurs de critères, notamment la gestion des options de finition (PrintTickets).
+
This can also be very useful for performing actions only on certain pages depending on criteria values, in particular the management of finishing options (PrintTickets).
  
  
Hors gestion des index, un autre commutateur permet d’extraire des pages d’un document XPS : '''-pages:xxx'''. Les valeurs des pages peuvent être définies par :
+
Apart from index management, another switch allows you to extract pages from an XPS document: '''-pages:xxx'''. Page values ​​can be defined by:
  
- des numéros unitaires séparés par des virgules : -pages:1,5,6,7,12
 
  
- des intervalles de pages : -pages:5-7
+
- unit numbers separated by commas: -pages:1,5,6,7,12
  
- une combinaison des deux : -pages:1,5-7,12
+
- page intervals: -pages:5-7
  
- le caractère ‘*’ peut être utilisé dans un intervalle pour préciser la fin du document
+
- a combination of both: -pages:1.5-7.12
  
- les pages à extraire peuvent être inscrites dans un fichier texte externe avec la syntaxe : page[CRLF]
 
  
 +
- the character ‘*’ can be used in an interval to specify the end of the document
  
Exemples :
+
 
 +
- the pages to extract can be written in an external text file with the syntax: page[CRLF]
 +
 
 +
 
 +
Examples :
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -pages:1,5,6,7,12 -toPDF
 
  map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -pages:1,5,6,7,12 -toPDF
  
Ligne 230 : Ligne 243 :
  
  
==Concaténation de documents==
 
  
Le principe est d’ajouter plusieurs documents les uns à la suite des autres. Le document de sortie est la concaténation de tous les fichiers précisés sur la ligne de commande dans l’ordre où ils ont été précisés.  
+
==Document concatenation==
Deux commutateurs peuvent être utilisés : '''-add:xxx''' (=concaténation de plusieurs documents XPS en un XPS mono document) ou '''-adddoc:xxx''' (=concaténation de plusieurs documents XPS en un XPS multi documents avec conservation des options de finition de chaque document d’origine).
+
 
 +
The principle is to add several documents one after the other. The output document is the concatenation of all the files specified on the command line in the order in which they were specified.  
 +
Two switches can be used: '''-add:xxx''' (=concatenation of several XPS documents into a single XPS document) or '''-adddoc:xxx''' (=concatenation of several XPS documents into an XPS multi documents with preservation of the finishing options of each original document).
  
  
Remarque:
+
Noticed:
On peut ensuite imaginer un tri suivant des critères d’indexation préalablement définis sur chaque fichier pour faire du regroupement de fichiers de plusieurs sources différentes (facture + CGV + lettre d’information…)
+
We can then imagine sorting according to indexing criteria previously defined on each file to group together files from several different sources (invoice + T&Cs + newsletter, etc.)
  
  
Exemples :
+
Examples :
  
Concaténation de plusieurs fichiers XPS en une seule fois :
+
Concatenating multiple XPS files at once:
 
  map_xps -outfile:/tmp/final.xps -add:/tmp/test1.xps -add:/tmp/test2.xps -add:/tmp/test3.xps
 
  map_xps -outfile:/tmp/final.xps -add:/tmp/test1.xps -add:/tmp/test2.xps -add:/tmp/test3.xps
  
  
Concaténation en plusieurs fois, dans le cas où l’on ne connait pas d’avance le nombre de fichiers XPS en entrée (généralement dans une boucle) :
+
Concatenation in several times, in the case where we do not know in advance the number of input XPS files (generally in a loop):
 
  map_xps -tempfile:/tmp/final.xps -add:/tmp/test1.xps
 
  map_xps -tempfile:/tmp/final.xps -add:/tmp/test1.xps
  

Version actuelle datée du 2 janvier 2025 à 16:17

Autres langues :
English • ‎français

List of indexes and their values

The -dumpIndex toggle allows you to list all the indexing criteria present in the XPS document.


Example:

map_xps -infile:/tmp/invoice.xps -dumpIndex
CustomerID
InvoiceID
InvoiceDate
CustomerName
MAPSUBJCT
MAPSEND
NUMPING

Used with the name of a particular index, it lists all the different values ​​of this index:

map_xps -infile:/tmp/invoice.xps -dumpIndex:CustomerID
10638
4274
11426
4533
...


By adding the -duplicateindex switch, the index values ​​are listed on all pages of the XPS document including those with the same value:

map_xps -infile:/tmp/invoice.xps -dumpIndex:CustomerID -duplicateindex
10638
4274
11426
11426
4533
4533
...

Indexing a document

Replications of index values

In certain cases, it may be that an indexing criterion is present on all pages but without a defined value for certain pages or that the indexing criterion is not present on all pages. The copyEmptyIndex switch then allows you to reindex the document by copying, for pages without an index value, the index value found on the previous page.


Example :

map_xps -infile:/tmp/invoice.xps -copyEmptyIndex:InvoiceID

Indexing the file before placing the order:

Page Index Index value
1 InvoiceID 1
2 Cell text
3 InvoiceID 2
4 InvoiceID 3
5 InvoiceID Cell text


Indexing the file after placing the order:

Page Index Valeur de l’index
1 InvoiceID 1
2 InvoiceID 1
3 InvoiceID 2
4 InvoiceID 3
5 InvoiceID 3


Addition of indexing criteria (Static)

The -addCriteria switch allows you to add one or more criteria to a document. The general syntax is:

-addCriteria:IndexName=value


Example: adding one or more indexes with the same value on all pages

map_xps -infile:/tmp/in.xps -outfile:/tmp/out.xps -addCriteria:NumOrder=123456 -addCriteria:Date=17.02.2015


Addition of indexing criteria (Dynamic)

More generally, the values ​​of the added index will come from a prior extraction of text information contained in the XPS document itself on each of its pages. This information, temporarily stored in a /tmp/values.txt file, is reused to add the criterion with the following syntax:


map_xps "-infile:/tmp/in.xps" "-outfile:/tmp/out.xps" "-addCriteria:NumOrder=FILE:/tmp/value.txt"

Extracting criterion values

The principle is to search for information contained in the document and extract it (-extract:xxx switch) into a temporary file and then add them as values ​​of an indexing criterion of the same document. The temporary file created is in text format, in Unicode, with the following syntax: "value[TAB]page[CRLF]". The collection of information in the document can be done by keyword (-filter:xxx switch) or by position (-box:xxx switch). The returned information can be cleaned of extraneous spaces before and/or after the text with the following switches:

-ltrim: removing spaces before the text


-rtrim: removing spaces after the text


-trim: removal of spaces before and after the text

Example 1: Keyword search

map_xps "-infile:/tmp/invoice.xps" "-extract:/tmp/values.txt" "-filter:Invoice for order" "-length:10" "-shift:2" "-rtrim"

⇒ extraction of 10 characters located two characters after the keyword Invoice for order by removing unnecessary spaces after the returned text.

Example 2: search by position

map_xps "-infile:/tmp/invoice.xps" "-extract:/tmp/values.txt" "-box:100,150,180,30,mm"


The box parameters specify its dimensions: xx.xx,xx.xx,xx.xx,xx.xx[,cm|in|mm]


- four decimal numbers specifying in order: top, bottom, left, right


- the decimal separator is ‘.’


- the value separator is ‘,’ or ‘;’


- the last parameter (optional) is the coordinate unit: in points (for a resolution of 96dpi) by default, in millimeters (mm), in inches (in) or in centimeters (cm)


Export of indexes and their values

The principle is the creation of an index file from a document with a view to archiving it in third-party software. The index files produced as standard by ONYX Server can be in TXT, XML, or IND format (compatible with Content Manager). This export of indexes to a file is controlled by the -indexfile:xxx switch. The extension of the export file controls its type.

The -duplicateindex parameter allows you to also export indexes whose value is the same on several pages.


The -exportemptyindex parameter allows you to also export indexes that have no value.


Examples:

map_xps -infile:/tmp/invoice.xps -indexfile:/tmp/file.txt [-duplicateindex] [-exportemptyindex]
map_xps -infile:/tmp/invoice.xps -indexfile:/tmp/file.xml [-duplicateindex] [-exportemptyindex]
map_xps -infile:/tmp/invoice.xps -indexfile:/tmp/file.ind [-duplicateindex] [-exportemptyindex]


Processing on indexes

Sorting

The principle is to sort (-sort:xxx switch) an XPS document according to the values ​​of one or more indexing criteria. Only one file will be created as output. Sorting is done in ascending order using numeric values ​​by default. Using the ALPHA option allows you to sort on alphanumeric values, the REVERSE option allows you to sort in descending order.


Examples :

map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -sort:CustomerID -toPDF
map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -sort:ALPHA:CustomerName -toPDF
map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -sort:CustomerID,InvoiceID -toPDF
map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -sort:ALPHA:CustomerName,REVERSE:InvoiceID -toPDF


Spliting

The principle is to split a document according to the values ​​of one or more indexing criteria. As many output files can be created as there are different values ​​of the criteria used. Here, no particular switch, but a precise syntax to follow to control the splitting: [[Index_Name]].

Examples :

map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_[[CustomerID]].pdf -toPDF
map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_[[CustomerID]]_[[InvoiceID]].pdf -toPDF

Volume spliting

The BUNDLEONINDEX mode allows you to create batches according to the number of pages for each criterion value (for example: a file with documents having 1 to 4 pages for each criterion value, a file for documents of 5 to 9 pages, one file for documents of more than 10 pages). It is possible to create as many batches as desired.


Example :

map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_[[BUNDLEONINDEX,MAPSEND,1,5,10]].pdf -toPDF


In BUNDLEONINDEX mode, splitting can also be done according to a number of sheets (depending on the front/back information), the syntax then becomes:

map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_[[BUNDLEONINDEX=SHEET,MAPSEND,1,5,10]].pdf -toPDF


Filters or page extraction

The principle is to isolate certain pages of an XPS document based on the values ​​of one or more indexing criteria. This can be used in particular to create an output document that only concerns certain clients. The -filter:xxx switch is used in this case. Mathematical (=, <, >, <=, >=) and logical (AND, OR) operators can be used for complex filters without forgetting priority parentheses.

Examples :

map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice_426.pdf -toPDF -filter:CUSTOMER=426
map_xps -infile:/tmp/invoice.xps -outfile:/tmp/extract.pdf -toPDF-filter:(CUSTOMER=4026) OR (CUSTOMER=1458) AND (PRICE=15)

This can also be very useful for performing actions only on certain pages depending on criteria values, in particular the management of finishing options (PrintTickets).


Apart from index management, another switch allows you to extract pages from an XPS document: -pages:xxx. Page values ​​can be defined by:


- unit numbers separated by commas: -pages:1,5,6,7,12

- page intervals: -pages:5-7

- a combination of both: -pages:1.5-7.12


- the character ‘*’ can be used in an interval to specify the end of the document


- the pages to extract can be written in an external text file with the syntax: page[CRLF]


Examples :

map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -pages:1,5,6,7,12 -toPDF
map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -pages:5-7 -toPDF
map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -pages:1,5-7,10-* -toPDF
map_xps -infile:/tmp/invoice.xps -outfile:/tmp/invoice.pdf -pages:FILE:/home/extern/pages.txt -toPDF


Document concatenation

The principle is to add several documents one after the other. The output document is the concatenation of all the files specified on the command line in the order in which they were specified. Two switches can be used: -add:xxx (=concatenation of several XPS documents into a single XPS document) or -adddoc:xxx (=concatenation of several XPS documents into an XPS multi documents with preservation of the finishing options of each original document).


Noticed: We can then imagine sorting according to indexing criteria previously defined on each file to group together files from several different sources (invoice + T&Cs + newsletter, etc.)


Examples :

Concatenating multiple XPS files at once:

map_xps -outfile:/tmp/final.xps -add:/tmp/test1.xps -add:/tmp/test2.xps -add:/tmp/test3.xps


Concatenation in several times, in the case where we do not know in advance the number of input XPS files (generally in a loop):

map_xps -tempfile:/tmp/final.xps -add:/tmp/test1.xps
map_xps -tempfile:/tmp/final.xps -add:/tmp/test2.xps
map_xps -tempfile:/tmp/final.xps -add:/tmp/test3.xps