Configuration

Top  Previous  Next

The XSPOOL web application is based on JSP technology. Tomcat must be configured according to the following directives in order to execute XSPOOL.

As general guideline, the XSPOOL application must have the right to manage the files contained in the XSPOOL repository, therefore it must be deployed on a webserver run as a user with the right to read and write the repository. Normally it means that tomcat should be started by one of the following users:

root
the same user that owns the repository
an user that has read/write permissions on the repository

There are three aspects to configure, to have the web application working properly:

the web context
the users
XSPOOL behaviour

When tomcat  is started, it load the the web context configuration from xspool.xml and the users definitions from tomcat-user.xml. XSPOOL web application reads the configuration information directly from xspool.conf.

xspool.xml

This file defines the web application context for XSPOOL.

The file xspool.xml must be located into $CATALINA_HOME/webapps directory and it must contain the context configuration of the spool for Tomcat.

i.e.

<Context path="/spoolacme"
   docBase="/opt/xspool/webapp/xspool.war" debug="0"
   reloadable="true">
   <Logger className="org.apache.catalina.logger.FileLogger"
       prefix="spool_acme_log."
       suffix=".txt"
       timestamp="true"/>
     <Parameter name="xspoolConf"
       value="/home/acme/spool/conf/xspool.conf"
       override="false"/>
     <Parameter name="languageId"
       value="EN"
       override="false"/>
     <Parameter name="spoolRootName"
       value="Spool Acme"
       override="false"/>
     <Parameter name="spoolRootPath"
       value="/home/acme/spool"
       override="false"/>
     <Parameter name="xspoolprCmd"
       value="/opt/xspool/bin/xspoolpr"
       override="false"/>
</Context>

Description:

path

identifier for the access to visual application by Internet browser (eg. http://localhost:8080/spoolacme).

xspoolConf

absolute pathname of the configuration file (xspool.conf).

languageId

setting for language application. The possible values are:

EN (English)
IT (Italian)

spoolRootName

Title of the web application

spoolRootPath

absolute path of the spool directory.

xspoolprCmd

absolute pathname of the script that executes the print command (xspoolpr).

For further information on web context definition with Tomcat, please refer to http://tomcat.apache.org.

tomcat-users.xml

The file tomcat-users.xml is located into $CATALINA_HOME/conf directory and contains the list of users authorized to login to the web application.

I.e.

<user name="user1" password="abc"  roles="xspool"/>
<user name="user2" password="defg" roles="xspool,otherrole"/>
<user name="user3" password=""     roles="xspool"/>

 

All the users enabled to use XSPOOL, must be defined with the role "xspool". The administrator user must be named "root". This name in not modifiable.

Storing users on the tomcat XML users file is a suitable solution only when a limited amount of users must be defined. If you want to define a large number of user, it would be better to store them on a database. For further information on own to administer tomcat users, please refer to http://tomcat.apache.org.

xspool.conf

The file xspool.conf must be located in the directory defined in xspoolConf parameter of xspool.xml and it contains the configuration of spool environment.

The information are stored in tags and each single tag contains its properties.

The syntax of this file must respect the follow rules:

each row must contain a remark or a tag or a property only
the remarks must begin with the "#" character
the formalism of the tags is [tag]
the formalism of the properties is property = value
the value of id properties cannot contain the "." character

There are three fundamental groups of tags:

tags that define printing information ( [Priority], [Form], [Class] )
tags that define user commands ( [Cmd] )
tags setting the defaults ( [Default], [User] )

Class tag

Each class tag defines a printing class.

id

Class destination identifier (used in the file names and given to xspooladd)

Each id can't be repeated in tags of the same kind

value

Corresponding value for lp command

description

Description

filter

(optional) Pathname of the filter program to process the file before printing

lpoptions

Extra options to add in the lp command

Priority tag

This tag defines a printing priority

id

priority identifier (used in the file names and given to xspooladd)

Each id can't be repeated in tags of the same kind

value

Corresponding value for lp command

description

Description

Form tag

(deprecated) This tag defines a printing form.

id

Form identifier (used in the file names and given to xspooladd)

Each id can't be repeated in tags of the same kind

value

Corresponding value for lp command

description

Description

User command

The user commands group is optional and you can use it to define the programs should be made available in the "User Commands" page of the web application.

Cmd tag

This tag defines an user command that will be available in the "User Commands" page of the web application.

id

User command identifier. Each id can't be repeated in tags of the same kind

name

Indicate the fullname of the executable script or program to run.

description

Description

Default tag

This tag contains the default settings for all the users.

priority

General default priority identifier

form

General default form identifier

class

General class identifier

cmds

Default command identifiers

User tag

This tag defines user specific defaults

id

user name

priority

user's default priority

form

user's default form

class

user's default class

isAdmin

if set to "yes", the user is considered as administrator.

priorities_enabled

This field indicate all the priority identifiers available for user. Each value must be separated by space

forms_enabled

This field indicate all the form identifiers available for user. Each value must be separated by space

classes_enabled

This field indicate all the print class available for user. Each value must be separated by a blank

cmds

This field indicate all the command identifiers available for user. Each value must be separated by a blank

The priorities_enabled, forms_enabled and classes_enabled properties may be used to limit the user's choice in the menus of the web application. These properties must contain the allowed identifiers separated by blanks, if they are empty or not defined, the user can see all values available. The use of the reserved keyword "none" permits to deny the access to all values and consequently the printing.

The keyword "df" may be specified in any tag, indicate the system's default value.

I.E

#############################################################################
#                                                                           #
#                          xspool.conf.Example                              #
#                                                                           #
#############################################################################
 
#===========================================================================#
#   Priority                                                                #
#===========================================================================#
[Priority]
    id = L
    value = 0
    description = low
[Priority]
    id = M
    value = 4
    description = medium
[Priority]
    id = H
    value = 7
    description = high
 
#===========================================================================#
#   Forms                                                                   #
#===========================================================================#
[Form]
    id = FA
    value = formA
    description = description of form A
[Form]
    id = FB
    value = formB
    description = description of form B
[Form]
    id = FC
    value = formC
    description = description of form C
 
#===========================================================================#
#   Destinations (printers or classes of printers)                          #
#===========================================================================#
[Class]
    id = CL01
    value = lpDev01
    description = printer 01
#     filter = cat -n
#     lpoptions = extra options
[Class]
    id = CL02
    value = lpDev02
    description = printer 02
 
#===========================================================================#
#   Global default                                                          #
#===========================================================================#
[Default]
    class = CL01
    form = df
    priority = L
    sysout = 0
    cmds = cmd01 cmd02
 
#-----------------------------------------------------------
# tree_arranged_by: start value for tree arrangement
# possible values: OWNER (default), JOB, CLASS, FORM, DATE
#-----------------------------------------------------------
 
#     tree_arranged_by = JOB
#-----------------------------------------------------------
# set dialog of xspooladd and xspoolpr to verbose
#-----------------------------------------------------------
    xspooladdVerbose = yes
    xspoolprVerbose = yes
 
#-----------------------------------------------------------
# defines the priority option of "lp" command of "xspoolpr"
# es. HP  - HPUX           -->  -p
#     IBM - AIX (System V) -->  -q
#     SUN - Solaris        -->  -q
#-----------------------------------------------------------
#     lpPriorityOption = -p
 
#===========================================================================#
#   Users default                                                           #
#===========================================================================#
[User]
    id = user1
    isAdmin = yes
    class = CL01
    priority = A
    form = FA
    cmds = cmd01 cmd02 cmd03
[User]
    id = user2
    class = CL02*
    classes_enabled = none
    priority = L
    priorities_enabled = none
    form = FB
    forms_enabled = FB df
[User]
    id = user3
    class = CL02
    classes_enabled = df CL01 CL2
    priority = M
    priorities_enabled = M B
    form = FC
    forms_enabled = FB FC df
    cmds = cmd02
 
#===========================================================================#
#   User commands                                                           #
#===========================================================================#
 
[Cmd]
    id = list
    name = ls -l
    description = list command
[Cmd]
    id = cmd02
    name = <path>/cmd02.sh
    description = cmd02 description
[Cmd]
    id = cmd03
    name = <path>/cmd03.sh
    description = cmd03 description

How to start Tomcat

Before using XSPOOL, make sure  tomcat has started.

If it's down, it can be launched with startup.sh script, located into $CATALINA_HOME/bin

sh startup.sh

At this point, you can type on your browser the address of xspool and start work.