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

From OS4X
Jump to navigation Jump to search
 
Line 1: Line 1:
 
[[Category:Plugins]]
 
[[Category:Plugins]]
== Zweck ==
 
  
Bestimmen des Adresscodes des Absenders 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 Absender 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 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.
  
== 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 yourself and has the following absolute (hard, unchangeable) path:
*OS4X Enterprise Lite-Lizenz oder höher
 
*Das Script zur Bestimmung des Adresscodes ist selbst zu administrieren und hat folgenden absoluten (harten, nicht änderbaren) Pfad:
 
 
  $OS4X_SCRIPT_DIR/file_addressing_sender.sh
 
  $OS4X_SCRIPT_DIR/file_addressing_sender.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. Es kann keine Garantie über die Reihenfolge der Dateien gegeben werden. Der letzte Adresscode, der ausgegeben wird, definiert damit den Absender 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 output defines the sender of the order.
  
== Nützlicher Hinweis ==
+
== Useful hint ==
Nachdem der Absender 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 Absender-Bestimming das "[[OS4X plugin os4xplugin_set_sender_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 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 "[[OS4X_Core_configuration#default_receive_plugin_group|default receive plugin group]]" includes the following sequence as an example:
 
*Set sender by dynamic addresscode via file
 
*Set sender 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 sender by dynamic addresscode
 
**Promata GmbH - set sender by dynamic addresscode
 
*ENGDAT v2 decode
 
*ENGDAT v2 decode
Line 25: Line 23:
 
*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:19, 29 July 2024


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:
  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 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