[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Guide to Printers and Printing

Printer Colon File limits Field Operators

The limits field in the colon file contains two types of information:

The SMIT dialog information is used to build SMIT objects to represent colon file attributes in the Object Data Manager (ODM) database. Objects are used in the Print a File, Printer Setup, and Default Job Characteristics dialog screens.

The limits field gives the creator of the colon file control over the type of ODM object built for a given attribute. All objects built for the limits field are part of the sm_cmd_opt object class. The limits field allows control over the following fields in a sm_cmd_opt object class:

These attributes can be set to be displayed always, never, or only if the attribute is referenced in the pipeline. Detailed descriptions of these fields are in "sm_cmd_opt (SMIT Dialog/Selector Command Option) Object Class" in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.

The validation information is used to validate attribute values when the colon file is digested and when a print job is submitted.

To learn more about the limits field, see the following information:

Contents of the limits Field

The limits field is the fourth field in the colon file. Colon file attributes have the following format:

Message_Catalog:Message_Number:Attr_Name:Limits:Value

Information in the limits field has two components. The first component is a single letter operator specifying an action. The letter value can be one of the following values: C, D, E, F, G, H, I, L, M, Q, R, S, T, or V. The second component is the data. If the data is more than one character, it should be enclosed in square brackets ( [ ] ).

For example, if the limits field contained 'E#' , the sm_cmd_opt object class entry_type field equals the numeric value assigned to #. The entry_type field with a 'E#' value takes only numeric input.

In another example, when the limits field contains '[none,full,emulator=0,1,2]' then the sm_cmd_opt object class contains the following values:

Field Name      Values
disp_values     none, full, emulator
 
aix_values      0,1,2

The limits field operators provide the following types of control in SMIT:

For example, in the qprt and admvirprt SMIT dialogs, the following rules apply:

In qprt SMIT dialogs, the following additional rules apply:

Rules specific to the admvirprt SMIT dialog are as follows:

limits Field Operators

Definitions and examples of the limits field operators are organized into the following groups:

Display Operators

C Defines how multiple flags relate within the SMIT dialog, how the options for the flags are displayed, and what flags and options are available. To support interdependent flags (for example, flags that affect typestyle and pitch), combinations of flags must be used. Typically, there is a single match between a SMIT dialog field and a command line flag. The combination flag operator allows one field in a SMIT dialog to represent more than one command line flag. Referenced flags should be marked as non-display (Dn ) type for SMIT dialogs, so that only the combination flag is displayed instead of the individual flags.

The C operator syntax is:

C[xx,yy,...]

The xx and yy values are flag attributes. When a C attribute is defined, the limits field must also contain an R ring operator to define the pop-up list that is displayed to SMIT users. The R operator also defines how the options on the list map to command-line flags.

:111:Cs:C[_s,_p]R[Courier 10, Prestige 12= -s Courier
   -p10, -s Prestige -p12]):-s %I_s -p %I_p
:999:_s:Dn:Courier
:222:_p:Dn:10

In this example, the C operator defines that the -s and -p flags are combination attributes. The R ring defines that when the Courier 10 option is chosen from the pop up menu, the flags on the command line are -s Courier -p10 . The -s %I_s -p%I_p attribute value is resolved when the SMIT dialog is built and determines which item in the ring is displayed as the default.

D Designates the display mode. If the value is y , an object is built in the sm_cmd_opt object class. If the value is n , no object is built. The D operator allows programmers to suppress certain flags from being displayed in SMIT. If this operator is not specified, the object is built if the flag is referenced in the input pipeline.
S Designates the sequence number in the id_seq_num field of the sm_cmd_opt object class. The sequence number controls the position of the item in relation to other items in the dialog screen. If no S operator is specified, the dialog starts with the ID number 100, and items are numbered in the sequence they are found in the colon file.

The value for the S operator can be a string with a maximum length of 16 characters. For example, the following S operator entry places the item in position 100:

:100:_1:S[100]:60

Field Characteristics Operators

E Controls the entry_type field of the sm_cmd_opt object. The possible values for the E option are:
# Indicates that numerical entry is allowed.
f Indicates that a file entry is allowed. A valid file name must be specified.
n Indicates no entry is allowed. The field cannot accept typed input.
r Indicates an alphanumeric entry is allowed.
t Indicates that text entry is allowed.
x Indicates that a hexacimal entry is allowed.

To allow numerical entry into the SMIT dialog field, enter:

:100:_L:E#:60
Q Controls the value of the required filed of the sm_cmd_opt object. The required field determines if the field value should be sent to the cmd_to_exec command for this dialog.

A single character specifies the value type. The default value is n which means that the flag and value for the sm_cmd_opt object is passed only if the field value is changed. Possible values for the required field are:

n Represents no. Do not send flag unless user changes the initially displayed value. The n value is the default.
y Represents yes. Always sends the prefix field and value of the entry field even if it is null.
+ Send the prefix field and value. The value must contain 1 non-blank character.
? Always send the prefix field and values except when the value is null.

To ensure that the prefix field and the value of the entry field is always sent to cmd_to_exec, enter:

:100:_L:Qy:60

Auxiliary Operations and Validation Operators

Auxiliary operations for the SMIT dialog definitions determine the type of list and input required from the user. The types of lists available in the dialogs are list, multi-select list, range list, option ring, or multi-select option ring. The limits field operators that specify the type of auxiliary operation used by an attribute are L, M, G, and R.

Only one type of auxiliary operation is supported at a time. The default is op_type=n . The n value means that no auxiliary operation is permitted for the field.

F Allows control of the cmd_to_list_mode field of the sm_cmd_opt object. The cmd_to_list_mode field specifies how much of an item from a list should be used. The list is produced by the command specified in the cmd_to_list field object. For example, if the cmd_to_list field produced the following list:
60 (6 line per inch)
80 (8 line per inch)
66

Possible values for the F operator are:

a Get all fields. This is the default value.
1 Get the first field.
2 Get the second field.

To instruct SMIT to retrieve the first field from the list, enter:

:100:_l:F1:60
G Specifies a range list. The G operator gives the cmd_to_list_mode an r value. The r value specifies that the information displayed by the cmd_to_list field is a range of information rather than a list.

Validity checking is always done on a range. The data in a range list is in the form of x..y (1..30) or ..y (..30) or x.. (1..) where x and y are integers and specify the upper and lower bounds of a range. Validity checking ensures that the attribute value is in the range specified. The integer can be negative; however the upper bound (y value) must be greater than or equal to the lower boundary (x value). To designate that the field list operation is a range between 50 and 100, enter:

:100:_l:G[50..100]:60
H Specifies the message catalog specification for help text for a corresponding attribute. The message catalog specification includes message catalog name, set number, and message number. The help text is used in SMIT dialog that use the attributes for which help is assigned.

To assign help to a flag, -b, from the pioattrl cat dialog, enter:

:100:_b:H[pioattr1.cat,5,123]:60
I Specifies the publication specification for help text for a corresponding attribute. The publication specification includes values for the help_msg_id , help_msg_base , and help_msg_book fields in the sm_cmd_opt SMIT object class. The help text is used in the SMIT dialog that uses the attributes for which help is assigned.

To assign help to a flag, -b, from the publication specification, enter:

:100:_b:I[100145]:60
L Specifies that a pop-up list is displayed when the user selects F4. The pop up list allows users to select only one option from a given list of options. The pop up list is constructed from the cmd_to_list field values. The op_type field value for a pop up menu is l (lowercase L).

Validity checking is done only when typed user input is prohibited. The entry type for a field that does not allow direct user input is n . The cmd_to_list field returns a newline-separated list. The values from that list are compared with the attribute value.

The possible values for the L operator are the shell command strings for the cmd_to_list field. The list generated from the command is a list of output values separated by newline characters. For example:

:100:_l:L[print "50\n55\n60\n65"]:60
M Specifies a multi-select list which allows users to select more than one value from a given list of options. The M operator works exactly like the L operator list except that the multi-select field must be set to an m value.

An example of a multi-select list operator entry is:

:100:_l:M[print "50\n55\n60\n65"]:60
R Specifies an option ring type of list. The op_type field is set to r . A ring list differs from a regular list in that the user can continue to display list options by pressing either the tab (forward) or backtab (reverse) keys. When a ring list reaches the bottom of the options, it recycles to the top of the list. The ring list recycles in forward or reverse. A ring list becomes a regular list when the F4 key is pressed.

The option ring operator can control the disp_values , aix_values , values_msg_file , values_msg_set , and value_smg_id fields. The no message ID, just a message ID, message set and ID, or message set, catalog and ID are valid in a ring option list.

Validity checking is done if direct entry by the user is prohibited with the entry type value set to n. The ring has hardcoded values that are either stand-alone or are mapped to AIX values.

An example of stand-alone values would include a list of possible baud rates ('1200,2400,9600,19200' ) where the rate values themselves are used as the flag arguments.

An example of mapped values would be an attribute to designate which paper drawer on the printer is to be used. In this example, the three possible display values are lower drawer, upper drawer, and envelope feed. These possibilities are mapped to AIX flag operands '0,1,2' . The AIX values are passed to the executed command.

Validity checking verifies that the attribute value is within the set of hardcoded values. The following examples illustrate several types of option ring lists:

:100:_l:R[0,1,2]:0
:100:_l:R[none,full,emulator=0,1,2]:0
:100:_l:R[;none,full,emulator=0,1,2]:0
:100:_l:R[21,none,full,emulator=0,1,2]:0
:100:_l:R[1,21;none,full,emulator-0,1,2]:0
:100:_l:R[pioattr9.cat,1,21;none,full,emulator=0,1,2]:0
T Allows multiple selections to be made from a pop up list and works identical to the R operator. The multi-select field equals m .

To allow multiple choices to be made from a pop up menu, enter:

:100:_l:T[none,full,emulator=0,1,2]:0
V Specifies additional validation for any attribute. The V operator does not affect how an ODM stanza is built for an attribute. The data specified with the V operator is colon file type code (% operators). The % operators do the validation. The colon file code resolves to one value. The value is either 0 or non-zero. If the resolved value is 0, then the attribute value is valid. If the value is non-zero, then the attribute value is invalid.

To verify that the value of _l is in the range 0 to 100, enter:

:100:_l:V[%?%G_l%{100}%>%t1%e%?%G_l%{0}%<%tl%e0%;%;]:60

[ Previous | Next | Contents | Glossary | Home | Search ]