Batch Interface

Top  Previous  Next

XSPOOL repository is fed by means of its scripting interface herewith described.

xspooladd

xspooladd is the command used to insert a file in the repository of XSPOOL. Usually this command is invoked by a script (JCL).

When the command is invoked, some information must be provided.

unique identify for the source process (usually the PID number or the value of XBM_REQID, if running under XBM)
name of the source script
the file description
the print class (optional)
priority (optional)
number of copies (optional)
form name (optional)

XSPOOL stores the print file in its repository with name composed as follow:

job_name . pid . date . time . class . priority . copies . form . description

Once added to the repository, the file is removed from the working directory (unless -k specified).

Unless -N option is specified, xspooladd prints the file.

Some information (identifier, jobname and description) are directly extracted from the source file name, therefore it must conform to this format:

job_name . pid . description

The remaining file attributes may be provided:

by command line options
by environment variables
using the default values contained in the configuration of XSPOOL (xspool.conf)

The command line options override the environment variables settings. The environment variable settings override the default configuration.

Usage

xspooladd [options] <filename>

Options

-N

just add (no lp spooling)

-a<filename>

appends the print command (xspoolpr) to the specified file, instead of printing directly (the file will contain the print commands and it could be invoked separately)

-F<filter>

runs the specified filter over the file before to add it to the repository

-k

keeps the file (does not remove the input file)

-u<username>

feeds the <username> repository. Multiple users may be specified using ',' (comma)

i.e.    -u user01,user02,user99

-d<YYYYMMDD>

forces the specified creation date

-t<HHMMSS>

forces the specified creation time

-c<class>

sets the spool class id (as defined in xspool.conf). Multiple classes may be specified using ',' (comma)

i.e.    -c C01,C02,C99

-p<priority>

sets the spool priority

-n<copies>

sets the desired number of copies

-f<form>

sets the form id. Multiple forms may be specified using ',' (comma)

i.e.    -f F01,F02,F99 (deprecated)

-s<sysout>

sets the SYSOUT parameter

-v

verbose mode

-h

shows help

Environments variables

XSPOOLDIR

path of the spool directory

XSPOOLCONF

pathname of the configuration file (xspool.conf)

XSPOOL_USER

default user assigned to files. If not defined username is get from XBM_USER or LOGNAME.

XSPOOL_CLASS

default spool class id

XSPOOL_PRI

default priority id

XSPOOL_COPIES

default number of copies

XSPOOL_FORM

default form id

XSPOOL_SYSOUT

default SYSOUT parameter

XSPOOLADD_FILTER_BY_ARGUMENTS

if set to YES, filters are invoked by argument

if set to NO (default), filter are invoked by pipe

XSPOOLADD_DELETE_EMPTY_FILES_AFTER_FILTER 

if set to YES, empty output files produced by filters are deleted

XSPOOLADDVERBOSE

is set to "yes", verbose mode is enabled

xspoolpr

It is the script used to send files to printer: to do that It uses the lp system command.

xspoolpr is executed directly from xspooladd or from the web application, whenever the printing is requested

Accordingly to the settings provided in the XSPOOL configuration, xspoolpr composes the lp command to spool the file and invokes it.

Setting the environment variable XSPOOLPRVERBOSE to "yes", it displays the lp command issued.

i.e.

xspoolpr: lp command is 'lp -c -dlaser -n1 /home/spool/GA/U0/queque/aaa.10805.20021006.171302.laser.df.1.A.df.txt

Usage

xspoolpr [options] <filename>

Options

-N

do not print (just echo information)

-c<class>

sets the spool class id (defined in xspool.conf)

-p<priority>

sets the spool priority

-n<copies>

sets the number of copies

-f<form>

sets the form id

-v

verbose mode

-h

shows help

Environment variables

XSPOOLDIR

path of the spool directory

XSPOOLCONF

pathname of the configuration file (xspool.conf)

XSPOOLPRVERBOSE

is set to "yes", verbose mode is enabled