Maintain Printers {GPRT-1}


All printers to be used in printing of reports must be defined in this option, as well as their printer instructions and possible Escape Sequences. 


Fields in the option:

Block 1:  Printer Definitions

Field Type
&
Length
Description
Printer Sequence N4  The sequence in which the printers are to be displayed for users, should be entered here.
Printer Code A10 PSEUDO name of this printer. The actual UNIX device (without the "/dev/" part) may be used if preferred.
Printer Description A40 Enter the description to be displayed in the list of available printers on the print menu.
Use Batch A1 The system will default to (N)o. Only printers set up as batch printers will be displayed when reports are generated. When starting a job in the deferred batch module, the question "Do You Want To Select A Printer For The Output At This Stage" will be asked. If a (Y)es is replied, the queue builder will display only those printer names and descriptions with a (Y)es entered here, and prompt for a printer selection. The output files with the extension .pc, .sql, may be printed to printers indicated as Batch 'Y'. A user may then select any of the printers to which he/she is linked.
Printer Definitions:  Printer Instructions
Printer Code A10 The PSEUDO printer name (as defined in Block 1 above). The <LIST> function will display all valid printer codes.
Seq N2 The sequence number of the print instruction, should more than one instruction be necessary.  Printer instructions will be executed in the sequence defined here.
Instruction A80 This field may contain 80 characters although only 58 are displayed. It must contain all the necessary commands to drive the printer (e.g. for a printout on printer lp2, which is not the default system printer, the instruction should be "lp -dlp2 $B").

NOTE: '$B' is a substitution parameter. Whenever '$B' is encountered within the printer instructions, the printer program will replace the parameter with the generated output file name.

Other replacement parameters available are:
  • $A Will be replaced by the menu description of the option selected.
  • $C Will be replaced by the Oracle user name of the person who initiated the request. In the batch processor, this will also work.
  • $D Will be replaced by the REQUEST number if the job was run in BATCH mode, or '0' if the job was run on-line.
  • $F Will be replaced by the form description when, and as defined in {GPRT-2}.      
  • $W  Will be replaced by the current working directory.
Copy from   Specify the printer whose instructions you wish to copy.
Copy to   Specify the printer code to which you want the instructions copied.
Copy Printer Instructions   Copy the instructions.  The procedure to do this is:
  • Create the printer code in block 1
  • Query the new printer code in block 2
  • Enter the from printer code in the "Copy from" field
  • Enter the new printer code in the "Copy to" field
  • Press the "Copy Printer Instructions" button.
  Example 1

Example:

Example of gprt-1b1

 

Block 3:  Printer Escape Sequences

These Escape Sequence Codes may be defined here after a description has been added in Block 3 of this option. The system is supplied with a basic set for two generally used printers. The user may add, alter or change these as seen fit. One can be very resourceful with these sequences.

The output of printouts will be passed through a filter program that will substitute the user-defined codes by the actual printer escape sequences.

This facility can be used in any of the different Letter Documents Subsystems in the Financial, Personnel and Student Systems. For further use, the user should consult the appropriate manuals for a description of the use of the Letter Documents Subsystems.

The procedure here is to query the "Old Printer" name, and insert a "New Printer" name, which has already been defined in Block 3.

The set of escape sequence codes, which existed for the old printer, will now also exist for the new printer and appropriate changes may be made if necessary.

Field Type
&
Length
Description
Printer Code A10 The PSEUDO printer name (as defined in Block 1 above). The <LIST> function will display all valid printer codes.
Escape Code A5 The Code for the Escape sequence. This is the user-defined name for this Escape, as defined on the 3rd TAB of this option. The <LIST> function will display all valid codes.
Escape Sequence A80 This field may contain 80 characters although only 64 are displayed. It must contain all the necessary escape sequences as per the printer manuals. The \nnn notation should be used where nnn = the decimal code. The system will be released with a basic code set for a HP LaserJet, and an Epson dot matrix printer inserted here.
Copy from A10 The PSEUDO printer name (as defined in Block 1) of which the codes are to be copied.
Copy to A10 The new Printer name to which the escape sequences are to be copied.
Copy Printer Escape Sequence    


Example:

Example of gprt-1b2

 

Block 4:  Printer Escape Sequences Descriptions

The Escape Sequence Descriptions are defined here.

Field Type
&
Length
Description
Escape Code A10 The user Name of the Printer Escape.
Description A5 The Description for the Escape Sequence code. This is the user-defined description for this Escape Sequence.

Example:

Example of gprt-1b3

 

Examples  
1. A pseudo printer called "laser123" was defined to print compressed to a HP LaserJet. (The control characters to put the printer into compress mode and to reset it afterwards may differ depending on the printer make and model).

SEQ INSTRUCTION 1 echo "^(s17H" $Bt 5 cat $B $Bt 10 mv $Bt $B 15 echo "^E" $B 20 lp -dls $B
  REMEMBER:

Parts of a report(s) or letter(s)/notices(s) can be sent to system users. For example, if a student/personnel member has books outstanding at the library and he/she has an email address, the user can email the notice to the person. There is also a parameter to indicate whether or not the email text part should be duplicated in the output file. A single letter can also be divided - sending part of it via email and the other part printed.
To mail data from the ITS system to users, the following must be done in Maintain Printers:
Step Block Action
1 1 Define a new printer in block 1 with the code 'itsemail' in lowercase, one word. This printer should not be linked to any user and is only used by the print formatting program.
2
Code Sequence Instruction
itsemail 1 Instruction: cat $B /XX/XX/disclaimer | mailx -s "$A" $E The institution may want to add a disclaimer to all documentation sent by mail. This can be done by creating a disclaimer as a file under a specific directory and entering the full path in the instruction above. Replace /XX/XX/file by the correct path detail.
2 1 Define another printer with the code 'prepemail'. This printer code can be linked to users and must be used when preparing reports to send via email.
Code Sequence Instruction
prepemail 1 $W../g07ccc $B $B.out ls
2 cat $B | mailx -s "System eMail" $E
3 mv $B.out $B
4 #move .out to $B for subsequent viewing or printing
A new variable, $E is used. The various parameters will be substituted in the print process (as normally), and they represent the following:

$B : output file
$B.out : new output file used for splitting of original report (part email/part report)
$W : current working directory
$E : email address
'ls' can be any defined printer which the user wants to send the non-emailed parts of a report / letter to and formatting on this text can be done (e.g. bold and underline, as defined in the escape sequences for that printer).

In the notice/letter text set-up, do the following:

The start and end of an email message is indicated respectively with %ITSPRINTER Y/N itsemail email_address "Subject"
(Y : email text will also be written to output file)
and %ITSPRINTER END Note: the % must be in the first column
Example of sending a part of a document via email This functionality is built into the ITS programs and cannot be added by the user.

Line Number Instruction Outcome
1 Text Line sent to the output file.
2 text %ITSPRINTER N printer1 sent to the output file.
3 text %ITSPRINTER Y itsemail user@institution.ac.za "Overdue notices" sent to printer1, but is NOT written to the output file.
4 text %ITSPRINTER END is sent to "user" via email, and is also printed in the output file
5 text is only printed in the output file
Example of sending a letter/notice via email The users must add this instruction in the text of all notices/letters.

The printer name MUST be to send text to email.

Code Instruction
'itsemail' %ITSPRINTER Y itsemail $E$
** Remember there can be nothing after $E$ **

Content of the documentation:

$D50$ $D56$

Dear student

Your current balance is R $D2$.

You are enrolled for the following subjects: $D1$

%ITSPRINTER END $F$


Processing
Rules
 
  No special processing rules


See Also:



History Of Changes

Date System Version By Whom Job Description
24-Mar-2007 v01.0.0.0 Amanda Nell t134794 New manual format.
10-Mar-2008 v01.0.0.0 Vaughn Dumas t134794 System owner proof read.