Difference between revisions of "OS4X plugin os4xplugin filemove"

From OS4X
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
== Configuration ==
 
== Configuration ==
  
The target filename can be set up to contain variables. These variables are exchanged by runtime information of the OS4X job, in which context the plugin is run.
+
The target directory can be set up to contain variables. These variables are exchanged by runtime information of the OS4X job, in which context the plugin is run.
  
 
The usable variables are:
 
The usable variables are:
Line 30: Line 30:
 
*%w: recipient family name
 
*%w: recipient family name
 
*%x: recipient address code
 
*%x: recipient address code
*%g: Sender Standortname
 
 
*%g: sender location name
 
*%g: sender location name
 +
*%h: sender department name
 
*%i: sender first name
 
*%i: sender first name
 
*%J: sender family name
 
*%J: sender family name
 
*%k: sender address code
 
*%k: sender address code
  
Seit OS4X 3 Build 20140227 sind folgende Variablen nutzbar:
+
Since OS4X 3 Build 20140227 the following variable is available:
*%e: Abhängig von der Auftrags-Richtung, ist diese Variable der Firmenkurzname des externen Kommunikationspartners:
+
*%e: depending on the job direction, the company shortname of the external communication partner:
**bei Eingangs-Aufträgen: Sender-Firmenkurzname (analog "<code>%s</code>")
+
**incoming jobs: sender's company shortname (= "<code>%s</code>")
**bei Ausgangs-Aufträgen (oder nicht definierbarer Auftrags-Richtung): Empfänger-Firmenkurzname (analog "<code>%r</code>")
+
**outgoing jobs or undefined job direction: recipient's company shortname (= "<code>%r</code>")
  
Seit OS4X 3 Build 201508117 sind folgende Variablen nutzbar:
+
Since OS4X 3 Build 201508117 the following variables are available:
*%a: ENGDAT Message Reference [UNH0062] (falls angegeben, ansonsten leer)
+
*%a: ENGDAT Message Reference [UNH0062] (if available, otherwise empty)
*%b: ENGDAT Document Number [MID1004] (falls angegeben, ansonsten leer)
+
*%b: ENGDAT Document Number [MID1004] (if available, otherwise empty)
  
Seit OS4X 3 Build 20160407 sind folgende Variablen nutzbar:
+
Since OS4X 3 Build 20160407 the following variables are available:
*%y: Empfänger Benutzername ("unknown" falls leer)
+
*%y: recipient's username ("unknown" if empty)
*%l: Sender Benutzername ("unknown" falls leer)
+
*%l: sender's username ("unknown" if empty)
  
== Beispiele ==
+
Since OS4X 3 Build 20180129 the following variables are available:
Alle Beispiele basieren auf einem OS4X-Sendeauftrag mit der Nummer 76 von und an Firma "c-works"
+
*%p: sender partner's event parameter
 +
*%P: recipient partner's event parameter
 +
*%Q: depending on the job direction, the event parameter of the external communication partner:
 +
**incoming jobs: sender's event parameter (= "<code>%p</code>")
 +
**outgoing jobs or undefined job direction: recipient's company shortname (= "<code>%P</code>")
 +
 
 +
Since OS4X 3 Build 20210615 the following variable is available:
 +
*%A: job year (short, two digits)
 +
 
 +
Since OS4X 3 Build 20211130 the following variable is available:
 +
*%%: represents the character "<code>%</code>"
 +
 
 +
== Examples ==
 +
All examples rely on an outgoing job 76 from and to the company "c-works"
 
  /opt/os4x/tmp/%r/os4x_job_%j/
 
  /opt/os4x/tmp/%r/os4x_job_%j/
wird zu:
+
renders to:
 
  /opt/os4x/tmp/c-works/os4x_job_76
 
  /opt/os4x/tmp/c-works/os4x_job_76
  
 
----
 
----
 
  /opt/os4x/tmp/%D/%r/%j
 
  /opt/os4x/tmp/%D/%r/%j
wird zu:
+
renders to:
 
  /opt/os4x/tmp/outgoing/c-works/76
 
  /opt/os4x/tmp/outgoing/c-works/76
----
 
Ein SWAN-ähnliches Konstrukt wäre z.B.:
 
/opt/os4x/data/%Y/%m/%d/%j
 
welches aufgelöst wird zu:
 
/opt/os4x/data/2008/03/18/76
 
 
== 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
 
  
4: Datei(en) konnten nicht bewegt werden
+
== Return values ==
 +
*0: everything OK
 +
*1: Configfile (/etc/os4x.conf or value of environment variable "<code>OS4X_CFGFILE</code>", read in as file) cannot be found or database unavailable.
 +
*2: License error
 +
*3: XML parameter file cannot be parsed
 +
*4: Files cannot be moved

Latest revision as of 14:29, 30 November 2021

Puropose

Move all files of a job into a defined target directory. The default assumption is:

Requirements

  • File /etc/os4x.conf or configuration file pointed to in environment variable $OS4X_CFGFILE. Via the used configuration file, the information are retrieved used by the plugin (such as default configuration etc.).

Configuration

The target directory can be set up to contain variables. These variables are exchanged by runtime information of the OS4X job, in which context the plugin is run.

The usable variables are:

  • %j: job number
  • %d: day of job creation (two digits)
  • %m: month of job creation (two digits)
  • %Y: year of job creation (four digits)
  • %H: hour of job creation (two digits, 24h format)
  • %M: minute of job creation (two digits)
  • %S: second of job creation (two digits)
  • %D: job direction: "incoming" or "outgoing"
  • %r: recipient partner shortname
  • %s: sender partner shortname
  • %t: recipient location name
  • %u: recipient department name
  • %v: recipient first name
  • %w: recipient family name
  • %x: recipient address code
  • %g: sender location name
  • %h: sender department name
  • %i: sender first name
  • %J: sender family name
  • %k: sender address code

Since OS4X 3 Build 20140227 the following variable is available:

  • %e: depending on the job direction, the company shortname of the external communication partner:
    • incoming jobs: sender's company shortname (= "%s")
    • outgoing jobs or undefined job direction: recipient's company shortname (= "%r")

Since OS4X 3 Build 201508117 the following variables are available:

  • %a: ENGDAT Message Reference [UNH0062] (if available, otherwise empty)
  • %b: ENGDAT Document Number [MID1004] (if available, otherwise empty)

Since OS4X 3 Build 20160407 the following variables are available:

  • %y: recipient's username ("unknown" if empty)
  • %l: sender's username ("unknown" if empty)

Since OS4X 3 Build 20180129 the following variables are available:

  • %p: sender partner's event parameter
  • %P: recipient partner's event parameter
  • %Q: depending on the job direction, the event parameter of the external communication partner:
    • incoming jobs: sender's event parameter (= "%p")
    • outgoing jobs or undefined job direction: recipient's company shortname (= "%P")

Since OS4X 3 Build 20210615 the following variable is available:

  • %A: job year (short, two digits)

Since OS4X 3 Build 20211130 the following variable is available:

  • %%: represents the character "%"

Examples

All examples rely on an outgoing job 76 from and to the company "c-works"

/opt/os4x/tmp/%r/os4x_job_%j/

renders to:

/opt/os4x/tmp/c-works/os4x_job_76

/opt/os4x/tmp/%D/%r/%j

renders to:

/opt/os4x/tmp/outgoing/c-works/76

Return values

  • 0: everything OK
  • 1: Configfile (/etc/os4x.conf or value of environment variable "OS4X_CFGFILE", read in as file) cannot be found or database unavailable.
  • 2: License error
  • 3: XML parameter file cannot be parsed
  • 4: Files cannot be moved