Difference between revisions of "OS4X plugin os4xplugin set recipient by file"
(New page: == Zweck == Bestimmen des Adresscodes des Empfängers eines Auftrags anhand der Rückgabe eines Scripts, welches den absoluten Filenamen der Datei(en) des Auftrags enthält. Der Adresscod...) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | [[Category:Plugins]] | |
− | + | == Purpose == | |
+ | Determine the address code of the recipient of a job by returning a script that contains the absolute file name of the file(s) in the job. The address code, which is determined from the script, is read as the only output on stdout by the plugin and the recipient of the order is searched for in the database. If there are several users who use this address code, the last one entered will be used. If the script's standard output is empty, no address code is searched. | ||
− | == | + | == Requirements == |
− | + | * File <code>/etc/os4x.conf</code> or configuration file referenced by environment variable <code>$OS4X_CFGFILE</code>. The temporary directory and the license file are obtained via the database that is configured here. | |
− | * | + | *The script for determining the address code must be administered by yourself and has the following absolute (hard, unchangeable) path: |
− | * | ||
$OS4X_SCRIPT_DIR/file_addressing_recipient.sh | $OS4X_SCRIPT_DIR/file_addressing_recipient.sh | ||
− | * | + | *The script receives the following parameters: |
− | #abs. | + | #abs. filename |
− | # | + | #Partner short name |
− | + | If several files are included in the order, the script is called individually for each file. No guarantee can be given about the order of the files. The last address code that is issued defines the addressee of the order. | |
− | == | + | == Useful hint == |
− | + | After the addressee is defined, only the database value is updated. This is implemented to keep the database overhead as low as possible, as a statement is issued every time the XML information changes. It is therefore important to use the "[[OS4X plugin os4xplugin_set_rec_in_xml_by_db]]" at the end of the address determination to synchronize this information (database -> XML). A typical sequence of a plugin group defined as "[[OS4X_Core_configuration#default_receive_plugin_group|default receive plugin group]]" includes the following sequence as an example: | |
*Set recipient by dynamic addresscode via file | *Set recipient by dynamic addresscode via file | ||
− | *optional: | + | *optional: other dynamic address code resolving plugins, such as: |
+ | **Promata GmbH - set recipient by dynamic addresscode | ||
**Promata GmbH - set recipient by dynamic addresscode, v2 | **Promata GmbH - set recipient by dynamic addresscode, v2 | ||
*ENGDAT v2 decode | *ENGDAT v2 decode | ||
Line 23: | Line 24: | ||
*set sender in XML by OS4X job database value | *set sender in XML by OS4X job database value | ||
− | == | + | == Configuration == |
− | + | - | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | 3: XML | + | == Return codes == |
+ | *0: everything OK | ||
+ | *1: Number of parameters != 1; Config file <code>/etc/os4x.conf</code> not found; Config in database not readable | ||
+ | *2: License not valid | ||
+ | *3: XML file invalid |
Latest revision as of 09:17, 29 July 2024
Purpose
Determine the address code of the recipient of a job by returning a script that contains the absolute file name of the file(s) in the job. The address code, which is determined from the script, is read as the only output on stdout by the plugin and the recipient of the order is searched for in the database. If there are several users who use this address code, the last one entered will be used. If the script's standard output is empty, no address code is searched.
Requirements
- File
/etc/os4x.conf
or configuration file referenced by environment variable$OS4X_CFGFILE
. The temporary directory and the license file are obtained via the database that is configured here. - The script for determining the address code must be administered by yourself and has the following absolute (hard, unchangeable) path:
$OS4X_SCRIPT_DIR/file_addressing_recipient.sh
- The script receives the following parameters:
- abs. filename
- Partner short name
If several files are included in the order, the script is called individually for each file. No guarantee can be given about the order of the files. The last address code that is issued defines the addressee of the order.
Useful hint
After the addressee is defined, only the database value is updated. This is implemented to keep the database overhead as low as possible, as a statement is issued every time the XML information changes. It is therefore important to use the "OS4X plugin os4xplugin_set_rec_in_xml_by_db" at the end of the address determination to synchronize this information (database -> XML). A typical sequence of a plugin group defined as "default receive plugin group" includes the following sequence as an example:
- Set recipient by dynamic addresscode via file
- optional: other dynamic address code resolving plugins, such as:
- Promata GmbH - set recipient by dynamic addresscode
- Promata GmbH - set recipient by dynamic addresscode, v2
- ENGDAT v2 decode
- set recipient in XML by OS4X job database value
- set sender in XML by OS4X job database value
Configuration
-
Return codes
- 0: everything OK
- 1: Number of parameters != 1; Config file
/etc/os4x.conf
not found; Config in database not readable - 2: License not valid
- 3: XML file invalid