OS4X plugin os4xplugin set sender by file
Purpose
Determine the address code of the sender 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 sender 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 yourself and has the following absolute (hard, unchangeable) path:
$OS4X_SCRIPT_DIR/file_addressing_sender.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 output defines the sender of the order.
Useful hint
After the sender 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_sender_in_xml_by_db" at the end of the sender 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 sender by dynamic addresscode via file
- optional: other dynamic address code resolving plugins, such as:
- Promata GmbH - set sender by dynamic addresscode
- 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