Difference between revisions of "OS4X plugin os4xplugin set recipient by file"

From OS4X
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Zweck ==
+
[[Category:Plugins]]
  
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 Adresscode, der aus dem Script ermittelt wird, wird als einzige Ausgabe auf stdout vom Plugin eingelesen und daraus der Empfänger des Auftrags in der Datenbank gesucht. Falls es mehrere User gibt, die dieses Adresscode nutzen, wird der letzte eingetragene genutzt. Falls die Standardausgabe des Scripts leer ist, wird kein Adresscode gesucht.
+
== 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.
  
== Voraussetzungen ==
+
== 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.
*Datei <code>/etc/os4x.conf</code> bzw. Konfigurationsdatei in der Umgebungsvariable <code>$OS4X_CFGFILE</code> definiert. Über die Datenbank, die hier konfiguriert ist, wird das temporäre Verzeichnis sowie das Lizenzfile bezogen.  
+
*The script for determining the address code must be administered by yourself and has the following absolute (hard, unchangeable) path:
*Das Script zur Bestimmung des Adresscodes ist selbst zu administrieren und hat folgenden absoluten (harten, nicht änderbaren) Pfad:
 
 
  $OS4X_SCRIPT_DIR/file_addressing_recipient.sh
 
  $OS4X_SCRIPT_DIR/file_addressing_recipient.sh
*Das Script erhält folgende Parameter:
+
*The script receives the following parameters:
#abs. Filename
+
#abs. filename
#Partnerkurzname
+
#Partner short name
  
Falls mehrere Dateien im Auftrag enthalten sind, wird das Script für jede Datei einzeln aufgerufen. Der letzte Adresscode, der ausgegeben wird, definiert damit den Adressaten des Auftrags.
+
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.
  
== Nützlicher Hinweis ==
+
== Useful hint ==
Nachdem der Adressat definiert ist, ist lediglich der Datenbankwert aktualisiert. Dies ist deshalb so implementiert, um den Datenbank-Overhead so gering wie möglich zu halten, da bei jeder Änderug der XML-Information ein Statement abgesetzt wird. Daher ist es wichtig, am Ende der Adress-Bestimming das "[[OS4X plugin os4xplugin_set_rec_in_xml_by_db]]" zu nutzen, um diese Information (Datenbank -> XML) zu synchronisieren. Ein typischer Ablauf einer als "[[OS4X_Core_configuration#default_receive_plugin_group|default receive plugin group]]" definierten Plugingruppe beinhaltet beispielhaft folgende Reihenfolge:
+
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: andere dynamische Adresscode-auflösende Plugin, wie z.B.:
+
*optional: other dynamic address code resolving plugins, such as:
 
**Promata GmbH - set recipient by dynamic addresscode
 
**Promata GmbH - set recipient by dynamic addresscode
 
**Promata GmbH - set recipient by dynamic addresscode, v2
 
**Promata GmbH - set recipient by dynamic addresscode, v2
Line 24: Line 24:
 
*set sender in XML by OS4X job database value
 
*set sender in XML by OS4X job database value
  
== Konfiguration ==
+
== Configuration ==
(keine)
+
-
 
 
== Rückgabewerte ==
 
0: alles OK
 
 
 
1: Configfile (/etc/os4x.conf bzw. Inhalt der Variable "<code>OS4X_CFGFILE</code>") kann nicht gelesen werden oder die hier konfigurierte Datenbank kann nicht verbunden werden
 
 
 
2: Lizenzfehler
 
  
3: XML-Parameterfile kann nicht geparsed werden
+
== 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:
  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