OS4X plugin os4xplugin transmission pdf

From OS4X
Revision as of 11:40, 20 August 2013 by Admin (talk | contribs)
Jump to navigation Jump to search

Summary

The plugin "os4xplugin_transmission_pdf" dynamically creates a PDF file containing information about an OS4X job (like sender, recipient, meta information and files). It optionally sends this PDF file as an email to the corresponding person (see below for details).

"Corresponding person"

In this documentation, a "corresponding person" is often noted. This person is:

  • outgoing jobs: the sender
  • incoming jobs: the recipient

of the OS4X job. All data extracted person are being used.

Configuration

This plugin is highly configurable. There are mainly two topics covered which are configurable:

  • layout (text and graphics)
  • behaviour

TransmissionPDF preview.png

Layout configuration

You can configure the following entities of the created PDF:

  • The logo (PNG and JPEG files are supported)
  • Header lines. If not configured (or configured to an empty string), the values are calculated dynamically by the person's data (line 1:company name, line2: location information, line 3: person's telephone and/or fax number)
  • Page title text
  • Language for all labels ("de" for german, "en" for english" version supported)
  • An optional footer text, two lines max.

In any textual situation, it's your responsability to check if the text fits into the line.

Behaviour configuration

  • Use initial state instead of actual state: Filenames will be extracted from the initial XML of the job. This has advantages of you're using plugins such as TAR or ZIP creation plugins which use technical temporary filenames. File sizes and contents will be first checked at the position of the original state, as a fallback in the configured job directory (set by the filemove plugin).
  • Render unknown filesizes: If no filesize is retrievable, a text block will be added stating that the size is not known.
  • Analyze archive files: Known archive files (which are ZIP, TAR and gzip'ed TAR archives) will be scanned for the contained filenames and sizes. The content of these archives are also listed in the PDF per file. The mechanism is non-recursive.
  • Disable mail sending: If enabled, no mail will be sent to the corresponding person.
  • Debug mail execution: Mail sending might not work if not configured properly, so all commands which are used for mail transmission are logged in the plugin logs.

Templating

A configurable mail template must be configured. This text file is the body of the mail sent to the corresponding person. The default mail template is as follows:

Sehr geehrter OS4X-Nutzer,

Ihr OS4X-Auftrag $/OS4X_job/job_information/job_number wurde erfolgreich transferiert. Anbei der zugehoerige Lieferschein.

MfG
OS4X

As you can see, a variable is contained in this template. You can use as many variables as you want, the plugin will replace them with the content of the variables. All variables are indicated by a dollar sign "$" (as in shell scripts). The end of the variable name is a whitespace, tab or end of text. The variable itself is an XPath expression, i.e.:

/OS4X_job/job_information/job_number

This XPath information is executed on the configured XML (either actual or initial one, see above).