Auxiliary operations and validation operators

Auxiliary operations for the SMIT dialog determine the type of list and input required from the user.

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.

The following auxiliary operations are available:
Item Descriptor
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 the base operating system 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 the base operating system flag operands '0,1,2'. The base operating system 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