OS4X plugin os4xplugin set recipient by file

From OS4X
Revision as of 09:17, 29 July 2024 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


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:
  1. abs. filename
  2. 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