Oracle Waveset 8.1.1 Deployment Reference

Customizing Forms

After familiarizing yourself with the default operation of the Waveset product, you can identify pages you’d like to customize.

ProcedureTo Customize a Form

  1. Consult the section titled Edited Forms for a list of editable pages and their corresponding forms.

  2. To edit a form, launch the Identity Manager IDE and select Open Repository Object. Select the form you want to edit from the popup dialog that is displayed.

    This section covers the following topics:

Overview of Customization

You can customize a form to make it more user-friendly, change its display characteristics, or include logic for processing field data.

Basic Steps

The basic steps for customizing any form in the Waveset system include:

Typical Tasks

When you edit a form, you typically perform the following tasks:

Table 2–2 Form Elements

Property  

Description  

Title 

Specifies the text that displays adjacent to the form field. 

Class 

Identifies the HTML display class to which the element belongs. 

Required 

Identifies whether the element is required to process the form. This field must have a non-null value upon submission. When set, results in a red asterisk appearing to the right of the field. Message text at the bottom of the form indicates that red asterisk denotes fields that must have a value for submission to proceed. 

Action 

When set, a change causes the page to refresh any Select or MultiSelect controls. In the Waveset Administrator Interface, this causes the underlying view to be refreshed. Role selection exemplifies this behavior. When a new role is selected in the Tabbed User Form, the view is refreshed to reflect the resources that are assigned through that role during that edit session. After the view has been refreshed, resource account attributes on those newly assigned resources can be explicitly set.

No New Row 

Used strictly for form layout. When true, forces the field to appear to the right of the proceeding field. For example, Name fields are examples where this is useful, where it is desirable to allow the user to enter the last name, first name, and middle initial from right to left, rather than down the page. 

Hidden 

Indicates the field should not be visible to the user. The field is typically used to set attribute values that are calculated form other fields, such as constructing the full name from a concatenation of first and last name. 

Title 

Controls the character width of the control (text boxes). 

Class 

Specifies the character width of the control buffer (text boxes). Characters scroll if the user types in a string greater than the value specified by the size property.

Required 

Identifies the name for this form field, typically a path expression in to the view that is used with this form. 

Set the characteristics in the following table from the Main tab view.

Table 2–3 Characteristics Set from Main Tab View

Field  

Description  

Name 

Enter the name for this field. A field name is typically a path expression into the view that is being used with this form. All fields that display as editing components (such as text boxes, checkboxes, and selects) must have a name that specifies a view path. Fields that do not display as editing components (such as SectionHead and Javascript) do not require names. However, you can give non-editing fields names if they need to be referenced by another form through a Field reference.

Title 

Enter a title for the field. This title displays adjacent to the field on the form. Select the data type of this element from the drop-down menu immediately adjacent to this field. To edit the text displayed in this field, click the adjacent Edit button.

Sub Title 

(Optional) Specify text that Waveset can display beneath the form title. Select the data type of this element from the drop-down menu immediately adjacent to this field. To edit the text displayed in this field, click the adjacent Edit button.

Help Catalog 

Enter the help key that associates guidance help with the field. This value is the name of an entry in an associated help catalog specified by the form. Specifying a help key causes an icon to appear to the left of the field. Moving the mouse over the icon causes the text referenced in the help catalog to display. 

Base Context 

(Not typically used in standard user forms.) Enter the base context to avoid the need to specify the full path in every field. Base context identifies the underlying Map (specifically, com.waveset.object.Genericobject and is typically named user or userview. In the Waveset Administrator Interface, the editing context is user, so the base context reference is left blank. In forms launched from manual actions, such as approvals, the workflow context is the context of the form.

Options 

Select one or more display options for the field: 

Required– Identifies whether the element is required to process the form. This field must have a non-null value upon submission. When set, results in a red asterisk appearing to the right of the field. Message text at the bottom of the form indicates that red asterisk denotes fields that must have a value for submission to proceed.

Button– Causes the field to display in a single, horizontal row at the bottom of the form. Otherwise, it displays on the next line of the form. This is most set with fields that use the display class Button.

Action– When set, a change causes the page to refresh any Select or MultiSelect controls. In the Waveset Administrator Interface, this causes the underlying view to be refreshed. Role selection exemplifies this behavior. When a new role is selected in the Tabbed User Form, the view is refreshed to reflect the resources that are assigned through that role during that edit session. After the view has been refreshed, resource account attributes on those newly assigned resources can be explicitly set.

Library– Indicates that a field should only display when it is referenced, rather than when it is declared. This is useful when the order in which fields are evaluated on a form may differ from the order in which they are displayed to the user.

Default 

Specify an expression to calculate a default value for the field. The default expression is called before the form is displayed if the current value for this field is null. 

Derivation 

Specify an expression to calculate the value of a field before it is displayed. It is similar to a Default expression, except that it is evaluated even if the current field value is non-null. The derivation expression is evaluated before the form is first displayed, and then again each time the form is refreshed. 

Validation 

Specify logic to determine whether a value entered in a form is valid. Validation expressions return null to indicate success, or a string containing a readable error message to indicate failure 

Expansion 

Specify an expression to calculate the value of the field after the form has been submitted. Expansion expressions are typically used with fields that are also marked hidden. Since hidden fields are not directly editable by the user, the value can be calculated with an Expansion expression. See Hiding Fields.

Disable 

Specify an expression that, if evaluated to true, disables the field and any of its nested fields. A disabled field does not display on the form. It is used to determine if a user has a specific type of resource. If the user does, the form then displays the appropriate fields for that resource. 

Display Class 

Identify the HTML component class used to render this form component in the browser. By default, the Display Class selection is EditForm. If the form is a link form (such as the End User menu), then select LinkForm from the Display Class options. 

See the HTML Display Class table in Chapter 7, HTML Display Components

size 

Controls the character width of the control (text boxes). 

maxLength 

Specify the maximum number of characters for this element. 


Tip –

A field name is often a path expression into the view that is being used with this form, and is typically associated with a particular attribute on a resource. To browse a list of resources and their attributes, click Browse resources. The Browse resource dialog opens, displaying an expandable tree of resource types. Click the name of the resource type to display a list of resource instances and the names of their attributes. To use the name of resource attribute as your new form field name, click the resource attribute name, then click OK. This inserts the attribute name into the Name field.


Table 2–4 Options for Display Class

HTML Component  

Purpose  

Apple 

Inserts an applet reference into the page. 

BackLink 

Displays a link that returns to the previous page. 

BorderedPanel 

A container that organizes its components into 5 regions: north, south, east, west, and center. 

Button 

Displays a button. 

ButtonRow 

A container that arranges its components in a horizontal row with padding in between. Typically used to display a row of Button components 

CheckBox 

Arranges its components in a horizontal row with padding in between. Typically used to display a row of Button components. (Container) 

DatePicker 

Displays a calendar icon on the page. The user can click this icon to select a calendar date and populate a page field. 

EditForm 

The default container for forms. Displays component titles in one column and components in another. Each row has an alternating gray or white background. 

FileUpload 

Variant of the Text component used for specifying the name of a file to be uploaded. 

Hidden 

A component used to include data into the HTML page that is not displayed 

Html 

Inserts pre-formatted HTML into the page. 

Javascript 

Defines JavaScript functions. 

Label 

Displays read-only text. 

Link 

Places a link on the page. 

LinkForm 

Places components in a bulleted vertical list with no titles. Typically used for pages that contain lists of Link components. Alternative to EditForm container. (Container) 

MultiSelect 

Displays a multiselection box, which displays as a two-part object in which a defined set of values in one box can be moved to a “selected” box. 

NameValueTable 

Displays a list of name/value pairs in a simple table with a beige background. 

Panel 

Organizes its components in either a horizontal or vertical line.(Container) 

Radio 

Displays a horizontal list of one or more radio buttons. A user can select only one radio button at a time. If the component value is null or does not match any of the allowed values, no button is selected. 

SectionHead 

Displays a section heading. These are recognized by the EditForm container to and are rendered in bold text that spans both the title and component columns. 

Select 

Displays a single-selection list box. 

SimpleTable 

Arranges components in a simple grid with a row of column titles. 

SubTitle 

Identifies the text that displays below the form title. 

Text 

Displays read-only text. 

TextArea 

Places a link on the page. 

Title 

Identifies the text that displays at the top of the form. 

Table 2–5 Form Elements

Form Element  

Description  

Name 

Enter the name for this field. A field name is typically a path expression into the view that is being used with this form. All fields that display as editing components (such as text boxes, checkboxes, and selects) must have a name that specifies a view path. Fields that do not display as editing components (such as SectionHead and Javascript) do not require names. However, you can give non-editing fields names if they need to be referenced by another form through a Field reference.

Title 

Enter a title for the field. This title displays adjacent to the field on the form. Select the data type of this element from the drop-down menu immediately adjacent to this field. To edit the text displayed in this field, click the adjacent Edit button.

Help Key 

Enter the help key that associates guidance help with the field. This value is the name of an entry in an associated help catalog specified by the form. Specifying a help key causes an icon to appear to the left of the field. Moving the mouse over the icon causes the text referenced in the help catalog to display. 

Options 

Select one or more display options for the field: 

Required– An entry or selection in this field is required to process the form.

Button– Causes the field to display in a single, horizontal row at the bottom of the form. Otherwise, it displays on the next line of the form. This is most set with fields that use the display class Button.

Action– When set, a change causes the page to refresh any Select or MultiSelect controls. In the Waveset Administrator Interface, this causes the underlying view to be refreshed. Role selection exemplifies this behavior. When a new role is selected in the Tabbed User Form, the view is refreshed to reflect the resources that are assigned through that role during that edit session. After the view has been refreshed, resource account attributes on those newly assigned resources can be explicitly set.

Library– Indicates that a field should only display when it is referenced, rather than when it is declared. This is useful when the order in which fields are evaluated on a form may differ from the order in which they are displayed to the user.

Default 

Specify an expression to calculate a default value for the field. The default expression is called before the form is displayed if the current value for this field is null. 

Derivation 

Specify an expression to calculate the value of a field before it is displayed. It is similar to a Default expression, except that it is evaluated even if the current field value is non-null. The derivation expression is evaluated before the form is first displayed, and then again each time the form is refreshed. 

Validation 

Specify logic to determine whether a value entered in a form is valid. Validation expressions return null to indicate success, or a string containing a readable error message to indicate failure. Validation rules are evaluated only when a form is submitted, not after each refresh or recalculate. 

Expansion 

Specify an expression to calculate the value of the field after the form has been submitted. Expansion expressions are typically used with fields that are also marked hidden. Since hidden fields are not directly editable by the user, the value can be calculated with an Expansion expression. 

Disable 

Specify an expression that, if evaluated to true, disables the field and any of its nested fields. A disabled field does not display on the form. It is used to determine if a user has a specific type of resource. If the user does, the form then displays the appropriate fields for that resource. 

Display Class 

Identifies the HTML component class used to render this form component in the browser. By default, the Display Class selection is EditForm. If the form is a link form (such as the End User menu), then select LinkForm from the Display Class options. 

See the HTML Display Class table in Chapter 7, HTML Display Components

value 

Specifies the property attribute. Typically is a string. 

Variable 

Waveset assigns a scope to all <Variable> elements when the element is declared. If you do not assign a value to the scope attribute, Waveset assigns it a value of local, which means that the variable can be accessed only within the XPRESS section that it is declared in.

Additional Variable attributes that define scope include:

  • input – Declares that the <Variable> element has local scope and that the value can be initialized by the caller.

  • output – Declares that the <Variable> element has local scope but can be returned to the caller.

  • external – Declares that the <Variable> element has non-local scope – that is, assignments to this variable will result in assignment to this variable in the scope it was first declared in.

maxLength 

Specifies the maximum number of characters for this element. 

Table 2–6 Default Services in Forms Toolbox

Service  

Description  

Text 

Displays a regular text entry box. 

Secret Text 

Displays text as asterisks (*). Typically used for encrypted data like passwords 

Select 

Displays a single-selection list box. Values for the list box must be supplied by the allowedValues property.

MultiSelect 

Displays a multiselection text box, which displays as a two-part object in which a defined set of values in one box can be moved to a selected box. Values in the left box are defined by the allowedValues property, values are often obtained dynamically by calling a Java method such as FormUtil.getResources. The values displayed in the right side of a multiselection box are populated from the current value of the associated view attribute, which is identified through the field name.

Checkbox 

Displays a checkbox. When checked, the box represents a value of true. An unselected box represents a false value.

Label 

Displays a multi-line text entry box 

TextArea 

Displays a horizontal list of one or more radio buttons. A user can select only one radio button at a time. If the component value is null or does not match any of the allowed values, no button is selected. 

Radio 

Places a link on the page. 

Link 

Displays a button. 

Button 

Refers to a variable that is defined by the view that is used with this form. 

accountId 

Displays a multi-line text entry box 

Additional Customization-Related Topics

The following topics are covered in this section:

Form Structure

Forms are stored as XML objects within the Waveset repository. Each form is stored as its own object with the following structure.


Note –

You do not need to know the XML structure of a form. Identity Manager IDE simplifies working with form structure. This information is supplied for your reference only.


The following stub form illustrates the general structure of a form.


Example 2–3 Form Structure


<?xml version=’1.0’ encoding=’UTF-8’?>
<!DOCTYPE Configuration PUBLIC ’waveset.dtd’ ’waveset.dtd’>
<!--  id="#ID#UserForm:EndUserMenu" name="End User Menu"-->
<Configuration id=’#ID#UserForm:EndUserMenu’ name=’End User Menu’
reateDate=’1012185191296’ lastModifier=’Configurator’
lastModDate=’1013190499093’ lastMod=’44’ counter=’0’ wstype=’UserForm’>
   <Extension>
   <Form name=’End User Menu’>
      <Display class=’LinkForm’>
         <Property name=’title’ value=’User Self Service’/>
         <Property name=’subtitle’ value=’Select one of the following options’/>
      </Display>
Field content
   </Form>
   </Extension>
<MemberObjectGroups>
   <ObjectRef type=’ObjectGroup’ id=’#ID#Top’ name=’Top’/>
   </MemberObjectGroups>
</Configuration>

The Waveset User Interface implements a second XPRESS form that contains the navigation bar. This means that the rendered page has two <FORM> tags, each with a different name attribute:

<form name="endUserNavigation">

and

<form name="mainform">

Form Components

The following table identifies form components in the order in which they appear in the form. Each form component is discussed in greater detail below.

Table 2–7 Form Components

Form Component  

Purpose  

header 

Introduces information about the form object definition. Includes start tags for <Form>, <Extension>, and <Configuration> elements and defines form properties (such as title, subtitle, titleWidth displayed when the form is launched).

form body 

Contains field definitions, form functions, form variables. This is the part of the form that you will edit. 

footer 

Closing tags for <Form>, <Extension>, and <Configuration> elements.

Header

The form header includes:

The header contains information about the form, including internal identification such as date of creation, login of whoever last modified the file, and the form type. The page processor typically generates this information.


Note –

The system generates the following information for internal use only. Do not edit these attributes.


Table 2–8 Form Header Components

Element  

Definition  

<Extension>

Required to wrap the <Form> element.

<Element>…</Element>

<Configuration>

Contains information that the system uses internally when processing the form object, including the date of last modification and login of the user who last modified this form. Most of this information is typically associated with any persistent object that is stored in the Waveset repository. You typically do not need to edit this information. 

Configuration id=’#ID#UserForm:EndUserMenu’ name=’End User Menu’ createDate=’1012185191296’ lastModifier=’Configurator’ lastModDate=’1013190499093’ lastMod=’44’ counter=’0’ wstype=’UserForm’>

Form Body

The form body is composed of:

The following table lists form header properties.

Table 2–9 Form Header Properties

Property  

Purpose  

title

Identifies the text that appears at the top of the form. Typically, this title is in a bold font typically larger than the other font on the screen. The form title appears under the Waveset page. You cannot edit the display characteristics of title.

In the example given in the section titled Form Components, the value of title is User Self Service

subtitle

Identifies text that appears under title of the form on the page defined by this form. You cannot edit the display characteristics of title. 

In the preceding example, the value of subtitle is Select one of the following options

titleWidth

Defines the width in pixels of the value of title in the browser window. 

The following table lists all elements that can occur within the form body.

Table 2–10 Elements that Can Occur within the Form Body

Component  

Definition  

Example  

defun

Defines an XPRESS function. This element can be called by any field element in a form. 

<defun name=’add100’>

<def arg name=’x’/>

<add><i>x</i><i>100</i>

</add>

</defun>

defvar

Defines an XPRESS variable that is used to hold the results of a computation. 

<defvar name=’nameLength’

<length>

<ref>fullname</ref>

</length>

</defvar>

Display

Identifies the display components that will define the appearance of the field. See the section titled Display Element for more information.

<Display class=’LinkForm’>

<Property name=’title’ value=’User Self Service’/>

<Property name=’subtitle’ value=’Select one of the following options’/>

</Display>

Field

Main element used within the form body. See the section titled Field Element for more information.

<Field name=’fullname’/>

FieldRef

Provides a reference to a field defined in an included form. 

<FieldRef name=’fieldName’/>

Include

Provides a reference to another form object. Once included in the current form, the fields defined in the form can be referenced and displayed. 

<Include>

<ObjectRef type=’UserForm’ id=’#ID#UserForm:UserFormLibrary’/>

</Include>

FormRef

Provides a reference to another form object. 

<FormRef name=’formName’/>

Namespace

Provides a way to define a shortcut to a view. The shortened name can then be used in field names and references instead of the longer name. When using the name substitution, use a colon (:) following the name. 

<Namespace name=’w’ value=’waveset’/>

Form Element

The <Form> element must surround all Field elements and contains the unique name of the form. The elements listed on the previous page are contained within the beginning and ending Form tags.


Example 2–4 Sample Form Element


<Form name=’Create User Form’
   <Field name=’waveset.accountId’>

additional fields

</Form>

Additional example:

<Form name=’Task Launch Form’>
   <Display class=’EditForm’>
      <Property name=’title’ value=’Task Launch’/>
      <Property name=’subTitle’ value=’Enter task launch parameters’/>
   </Display>
...
</Form>

Display Element

A Display element within the Form element describes the component that will be used to render the form. By default, this Display element is the used EditForm component. You will rarely need to change the Form component class, but you can set component properties. The two most common properties to specify are title and subTitle.

EditForm also supports the adjacentTitleWidth property, which can be used to set the width of the titles of adjacent fields. If this property is not defined, it defaults to zero.

If you define adjacentTitleWidth as equal to zero, columns titles will automatically resize. If set to a non-zero value, then the title width of adjacent columns (for example, the second and third columns) will be the value of adjacentTitleWidth.

<Form name=’Default User Form’ help=’account/modify-help.xml’>
   <Display class=’EditForm’>
     <Property name=’titleWidth’ value=’120’>
     <Property name=’adjacentTitleWidth’ value=’60’>
   </Display>

Field Element

The Field element is the main element used within the form body. Fields are used to define each of the user’s attributes. You can use Field elements to include XPRESS logic in form fields. For more information on working with form field elements, refer to the section titled Defining Fields.

The following example creates an editing field with the label Email address.

<Field name=’waveset.email’>
   <Display class=’Text’>
      <Property title=’Email Address’/>
      <Property size=’60’/>
      <Property maxLength=’128’/>
   </Display>
...
</Field>

The name of an editing field is typically a path expression within a view that is being used with the form. In this example, waveset.email refers to the email address associated with a user object in the Waveset repository.

Footer

The footer contains information about the Waveset object group or organization with which the form is associated. It also contains the closing tags for the </Form>, </Extension>, and </Configuration> elements or other elements opened in the header. The footer in the preceding example is:

</Form>
</Extension>
   <MemberObjectGroups>
      <ObjectRef type=’ObjectGroup’ id=’#ID#Top’ name=’Top’/>
   </MemberObjectGroups>
</Configuration>

<MemberObjectGroups> identifies the object group or organization into which the system stores an object. If you do not specify an object group, by default the system assigns the object to the Top organization. For Configuration objects that contain forms, are typically found in the All group with this syntax:

<MemberObjectGroups>
   <ObjectRef type=’ObjectGroup’ name=’All’/>
</MemberObjectGroups>

What Is a Form Field?

The form body contains Field elements that define how each element of the Web page appears and behaves. Each Field can contain other fields, each with its own display component.

Form fields comprise several parts, which are encapsulated by the <Field> tag set:

Creating Variables

Use the following syntax to include variables that contain long lists of constant or static data. This syntax builds a static list once and reuses it on each reference

<defvar name=’states’>
    <List>
      <String>Alabama</String>
            ...
    </List>
</defvar>

The former syntax is preferable to <list><s>Alabama</s>...</list>, which builds a new list each time it is referenced.


Note –

You must use balanced parentheses in form variable values and when naming Waveset objects. If you use parentheses in object names or form variables, they must be balanced (that is, for every ’(’ there is a corresponding ’)’). This allows all form variable expansions to expand properly. (Unbalanced parentheses will result in an error.)

For example, when a resource name contains unbalanced parentheses, you can neither edit or delete the user object of any user to whom this resource has been assigned. However, the pertinent error message will indicate that the failure is caused by unbalanced parentheses in the specific resource name.


Defining Fields

This section describes procedures you perform when customizing any form. These procedures include:

The following sections discuss in more detail the field characteristics you will set.

Defining Field Names

You use the field name to match the attribute defined on the resource to the text entry field that is displayed on the web page. When the resource is defined, the system sets up a schema map that maps resource account attributes to Waveset attributes. For example, your Active Directory resource might have attributes that include firstname, lastname, and Office Phone. When referring to these attributes in the form, you must know the name of the attribute on the Waveset schema plus the path to the attribute from the view.

There are two ways of defining the name attribute of the Field element:

Determining whether a Field name represents a path expression for the view or is simply a reference name depends on the value of the class attribute selected in the Display element. If the display class is the name of an editing component class, then the name is expected to be a path expression for the view. See the section titled HTML Display Components for a detailed explanation of the component classes.

Creating a Path Expression to a View Attribute

Typically, you define a Field name by including the path to an attribute in the user view (the path expression). For a list of these attributes, see Chapter 3, Waveset Views.

The following field definition renders a text field to edit the Waveset email address:

<Field name=’waveset.email’>
   <Display class=’Text’>
      <Property name=’size’ value=’60’/>
   </Display>
</Field>

The string waveset.email is a path expression for the user view that targets the email address stored in the Waveset repository.

Example:

This example field edits the email address defined for a particular resource account. The field name references a resource in the account:

<Field name=’accounts[Active Directory].email’>
   <Display class=’Text’>
      <Property name=’size’ value=’60’/>
   </Display>
</Field>

The string accounts[Active Directory].email is a path expression to another location within the user view that holds information about account attributes for a specific resource. In this example, the resource named Active Directory.

Example:

This example field defines the email address for all resources including Waveset that contain an attribute named email on the left side of the schema map.

<Field name=’global.email’>
   <Display class=’Text’>
      <Property name=’size’ value=’60’/>
   </Display>
</Field>

Identifying the Field for Reference

Naming a field provides you a way to reference the field value in other fields. Use the <ref></ref> tag set to reference a field value from another field. The following example concatenates into the fullname field the firstname and lastname field values with a string, a comma, and a space such as: lastname, firstname. The <s> tag designates a string.


Example 2–5 Referencing Fields


<Field name=’global.firstname’>
   <Display class=’Text’/>
</Field>
<Field name=’global.lastname’>
   <Display class=’Text’/>
</Field>
<Field name=’global.fullname’>
   <Expansion>
      <concat>
         <ref>global.lastname</ref><s>, </s>
         <ref>global.firstname</ref>
      </concat>
   </Expansion>
</Field>

Not all Field names represent path expressions for the view. Some fields are defined to represent containers of other fields and do not correspond to any one attribute of the view. In these cases, the Field name is used to identify the field so that it can be referenced by a FieldRef element. If the field does not need to be referenced, you do not need to specify the name.

For example, a form button performs an action, but does not contain a value or need to be referenced by another form. Therefore, it does not need a field name:

<Field>
   <Display class=’Button’>
      <Property name=’label’ value=’Recalculate’/>
      <Property name=’command’ value=’Recalculate’/>
   </Display>
</Field>

For more information on user views, see the section titled User View and Forms.

Field Display Properties

The Display element is common to all visible form fields. Display elements contain Property elements that define the characteristics of the field rendered by the browser. By defining a Display element for a form, it will be visible on the screen unless there is a Disable element in the field that evaluates to true. There can be conditions in which the form is displayed until another field or value is set and when the form recalculates the field can become hidden from the screen. See the section titled Disabling Fields.

Display

Describes class and properties of the visible field. This element specifies a component class to instantiate and a set of property values to assign to the instance.

<Display class=’Text’>
   <Property name=’size’ value=’20’/>
   <Property name=’maxLength’ value=’100’/>
</Display>

The class attribute of the Display element must be the name of a Component class. By default, these classes are expected to reside in the com.waveset.ui.util.html package and include Applet, Button, and DatePicker among others. A list of all the default classes and their descriptions can be found in the Base Component Class section of Chapter 7, HTML Display Components To reference a class that is not in this package, you must use a fully qualified class name for the class attribute. All classes described in this document are in the default package and do not require qualified names.

Property

Occurs within the Display element. The property value defines the names and values of properties that are to be assigned to the component. The property name is always specified with the name attribute.

Specifying Property Values for a Display Element

You can specify the Property value for a Display element through the use of:

For most property values, you can use the value attribute and let the system coerce the value to the appropriate type.

Use of the value Attribute

The most common way of specifying the property value is with the value attribute. The value of the value attribute is treated as a string, but if necessary, the system will coerce it to the data type desired by the component. In the previous example, the property size is set to the integer value 20, and the property maxLength is set to the integer value 100.

The following example creates a field that uses SimpleTable to organize several subfields. Within XML forms, the most common Container components used are SimpleTable and ButtonRow.


Example 2–6 Field that Uses the SimpleTable Element


<Field name=’SelectionTable’>
   <Display class=’SimpleTable’>
      <Property name=’columns’>
         <List>
            <String>Account</String>
            <String>Description</String>
         </List>
      </Property>

   </Display>
<Field name=’accounts[LDAP].selected’>
   <Display class=’Checkbox’>
      <Property name=’label’ value=’LDAP’/>
   </Display>
</Field>
<Field>
   <Display class=’Label’>
      <Property name=’text’ value=’Primary Corporate LDAP Server’/>
   </Display>
</Field>
<Field name=’accounts[W2K].selected’>
   <Display class=’Checkbox’>
      <Property name=’label’ value=’Windows 2000’/>
   </Display>
</Field>
<Field>
   <Display class=’Label’>
      <Property name=’text’ value=’Primary Windows 2000 Server’/>
   </Display>
</Field>
</Field>

Within the Display element are zero or more Property elements. These define the names and values of properties that are assigned to the component. The Property name is always specified with the name attribute. The property value is most specified with the value attribute. The value of the value attribute treated as a string, but if necessary it will be coerced to the data type desired by the component.

Use of the XML Object Language

You can also specify property values using the XML Objects language. This approach is useful primarily when specifying list values. This language provides a syntax for describing several standard Java objects as well as other objects defined by Waveset.

The more common Java XML objects include:

When you use the XML Object syntax to specify property values, an element is placed inside the Property element. For more information on the XML Object language, see Chapter 6, XML Object Language.


Example 2–7 Property Element


<Property name=’size’>
   <Integer>10</Integer>
</Property>

<Property name=’title’>
   <String>New Password</String>
</Property>

<Property name=’leftLabel’>
   <Boolean>true</Boolean>
</Property>

<Property name=’allowedValues’>
   <List>
      <String>Texas</String>
      <String>Iowa</String>
      <String>Berkshire</String>
   </List>
</Property>

All properties that expect list values recognize the List element. Most attributes, in addition, recognize the comma list syntax for specifying lists.

Use of an Expression to Calculate the Value

You can also specify a Property value through an expression. This allows a value to be calculated at runtime, possibly combining fixed literal values with variable values defined by the page processor. Example:


Example 2–8 Property Value


<Property name=’title’>
   <concat>
      <s>Welcome </s>
      <ref>waveset.accountId</ref>
      <s>, select one of the following options.</s>
   </concat>
</Property>

In the preceding example, waveset.accountId is a reference to a variable. When the system generates the HTML for this component, the page processing system supplies the value for the waveset.accountId variable. The names of the variables that can be referenced are defined by the page processor. In most cases, these are defined by a view that is used with the XML form. Form designers must be aware of the view with which the form will be used and only reference attributes defined by that view.

Disable Element

Calculates a Boolean value. If true, the field and all its nested fields will be ignored during current form processing.

Do not create potentially long-running activities in Disable elements. These expressions run each time the form is recalculated. Instead, use a different form element that will not run as frequently perform this calculation.


Note –

The display.session and display.subject variables are not available to Disable form elements.


Example

This example illustrates a field definition that uses an expression within the <Disable> element to control the visibility of the field. accountInfo.typeNames is used to find the type of all resources that a user is assigned to. The type returned is a list of all the user’s resource types. If the list of returned type names contains Solaris, then this field is displayed on the screen. Otherwise, this field is disabled.


<Field name=’HomeDirectory’ prompt=’Home Directory’>
   <Display class=’Text’/>
      <Disable>
         <not>
            <contains>
               <ref>accountInfo.typeNames</ref>
               <s>Solaris</s>
            </contains>
          </not>
   </Disable>
</Field>

Disable elements are typically used to check values of other fields on the form. Often the other field being referenced is calculated based on other input fields.

<Field name=’special value subfield’>
   <Comment>Show only when otherField has the value ’special value’</Comment>
   <Disable>
      <neq>
         <ref>otherField</ref>
         <s>special value</s>
      </neq>
   </Disable>
</Field>
<Field name=’account correlation rule’>
   <Comment>If synchronization on a resource supports an account correlation rule,
allow one to be selected, otherwise don’t show the field.  If a process rule has been
selected, then a correlation rule won’t be run, so don’t show the field.</Comment>
   <Disable>
      <or>
         <isnull>
            <ref>resourceAttributes[correlationRule].displayName</ref>
         </isnull>
         <notnull>
            <ref>resourceAttributes[processRule].value</ref>
          </notnull>
      </or>
         </Disable>
   </Field
...
</Field>>

Default Element

Calculates a value to be used as the value of this field, but only if the field does not already have a non-null value. Default is essentially the same as Derivation, except that the value applies only if the current value is non-null. Default expressions are calculated when:

Example

This example shows a field definition that uses string manipulation expressions to return a default account ID composed of the first initial of the first name plus the user’s last name.


<Field name=’waveset.accountId’>
   <Display class=’Text’>
      <Property name=’title’ value=’AccountID’/>
   </Display>
   <Default>
      <concat>
         <substr>
            <ref>accounts[AD].firstname</ref>
               <i>0</i>
               <i>1</i>
            <ref>accounts[AD].lastname</ref>
         </substr>
      </concat>
   </Default>
</Field>

Derivation Element

Unconditionally calculates a value for the field. Whenever a Derivation expression is evaluated, the current field value is replaced.

Derivation expressions are calculated when the form is first loaded or data is returned from one or more resources

The following example shows a field definition that uses conditional logic to map one set of values into another set. When this field is processed, the expression in the <Derivation> element is evaluated to determine the descriptive value to be displayed for this field based on the location code returned from the resource.


<Field name=’location’>
   <Display class=’Text’>
      <Property name=’title’ value=’Location’/>
   </Display>
   <Derivation>
         <switch>
            <ref>accounts[Oracle].locCode</ref>
            <case>
               <s>AUS</s>
               <s>Austin</s>
            </case>
               <s>HOU</s>
               <s>Houston</s>
            </case>
            <case>
               <s>DAL</s>
               <s>Dallas</s>
            </case>
            <case default=’true’>
               <s>unknown</s>
            </case>
         </switch>
   </Derivation>
</Field>

Expansion Element

Unconditionally calculates a value for the field. It differs from Derivation in the time at which the expression is evaluated.

Expansion statements are calculated when:

The following example shows a field definition that uses conditional logic to convert the value derived for the location field in the previous example back into a three-letter abbreviation that will be stored on the Oracle resource. Notice the difference in the field names. The location field value is not saved on any resource. It is used to calculate another field.


<Field name=’accounts[Oracle].locCode’>
   <Expansion>
      <switch>
         <ref>location</ref>
         <case>
            <s>Austin</s>
            <s>AUS</s>
         </case>
         <case>
            <s>Houston</s>
            <s>HOU</s>
         </case>
         <case>
            <s>Dallas</s>
            <s>DAL</s>
         </case>
      </switch>
   </Expansion>
</Field>

Validation Element

Determines whether a value entered in a form is valid. Validation rules are evaluated whenever the form is submitted.

This example Validation rule checks to make sure that a user’s zip code is five digits.


<Validation>
   <cond>
      <and>
      <eq><length><ref>global.zipcode</ref></length>
            <i>5</i>
      </eq>
            <gt><ref>global.zipcode</ref><i>99999</i></gt>
      </and>
      <null/>
      <s>zip codes must be five digits long</s>
   </cond>
</Validation>

Editing and Container Fields

When the Display element appears with the Field element, it describes the component that will be used to render that field. There are two types of fields:

Editing fields must have names and are always used with one of the editing components such as Text or Checkbox.

Example Editing Field


<Field name=’waveset.email’>
   <Display class=’Text’>
      <Property title=’Email Address’/>
      <Property size=’60’/>
      <Property maxLength=’128’/>
   </Display>
 ...
</Field>

The name of an editing field is typically a path expression within a view that is being used with the form. In the preceding example, waveset.email refers to the email address associated with a user object in the Waveset repository.

A Container field may not have a name and is always used with one of the Container components, such as ButtonRow, SimpleTable, or EditForm.

One common type of container is the EditForm container, which builds an HTML table that contains titles in one column and components in another. These titles are defined in the title property and are rendered on the Waveset page associated with the form.

Disabling Fields

When you disable a field, the field (and any fields nested within it) is not displayed in the page, and its value expressions are not evaluated or incorporated in to any global.* attributes. If the view already contains a value for the disabled field, the value will not be modified.

<Disable></Disable>

Example


<Field name=’waveset id’>
   <Display class=’Text’>
      <Property title=’accountId’>
   </Display>
   <Disable>
      <eq><ref>userExists</ref><s>true</s></eq>
   </Disable>
</Field>

Note –

Disable expressions are evaluated more frequently than other types of expression. For this reason, keep any Disable expression relatively simple. Do not call a Java class that performs an expensive computation, such as a database lookup.


Use caution when referencing fields with Disable rules. Otherwise, fields inside containers might be disabled.

Hiding Fields

When you hide a field, the field (and any fields nested within it) is not displayed on the page, but its value is included in the form processing.

To hide a field, simply do not assign a Display class to the field.

<Field name=’field A’/>

Calculating Field Values

Field values can be calculated from the values of other fields or any logical expression. For example, you can calculate the user’s full name from the first name, middle initial and last name.


<Field name=’global.fullname’>
   <Expansion>
      <concat>
         <ref>global.firstname</ref>
         <s> </s>
         <ref>global.middle</ref>
         <ref>global.lastname</ref>
         <s> </s>
      </concat>
   </Expansion>
</Field>

Setting Default Values

You can set the email address based on the user’s first initial and the first seven characters of the user’s last name. In this example, the system performs an additional check to ensure that the values have been set before performing the concatenation. This additional check is performed to:


Example 2–9 Setting global.email Default Values


<Field name=’global.email’>
   <Default>
      <and>
         <notnull><ref>global.firstname</ref></notnull>
         <notnull><ref>global.lastname</ref></notnull>
      </and>
         <concat>
         <downcase>
            <substr>
            <ref>global.firstname</ref>
            <i>0</i>
            <i>1</i>
            </substr>
         </downcase>
         <downcase>
            <substr>
            <ref>global.lastname</ref>
            <i>0</i>
            <i>6</i>
            </substr>
         </downcase>
         <s>@waveset.com</s>
      </concat>
   </Default>
</Field>

Deriving Field Values

Some fields are used on the form solely to calculate other fields. These fields cannot be stored on any resource to which the user belongs. When the user record is edited, each of the resources is contacted and the field values for the attributes are populated. To populate the fields that are used for calculations, you can write derivation rules.

Example

A phone number field can be represented on the form as a single text box. However, a more advanced form might have three fields for the area code and phone number, which are used to calculate the phone number that is saved to the resource.

In the simple case of representing a phone number, you can have form fields that resemble the ones listed below.


<Field name=’P1’>
   <Display class=’Text’>
      <Property name=’title’ value=’Office Phone Number’/>
      <Property name=’size’ value=’3’/>
      <Property name=’maxLength’ value=’3’/>
   </Display>
</Field>
<Field name=’P2’>
   <Display class=’Text’>
      <Property name=’title’ value=’-’/>
      <Property name=’size’ value=’3’/>
      <Property name=’maxLength’ value=’3’/>
   </Display>
</Field>
<Field name=’P3’>
   <Display class=’Text’>
      <Property name=’title’ value=’-’/>
      <Property name=’size’ value=’4’/>
      <Property name=’maxLength’ value=’4’/>
   </Display>
</Field>
<Field name=’global.OfficePhone’>
   <Expansion>
      <concat>
         <ref>P1</ref><s>-</s>
         <ref>P2</ref><s>-</s>
         <ref>P3</ref>
      </concat>
   </Expansion>
</Field>

Example

The following example expands on the field definition for the field P1 defined above. It defines how a phone number attribute is read into the form, and consequently expands into the three field displays.


<Field name=’P1’>
   <Display class=’Text’>
      <Property name=’title’ value=’Office Number’/>
      <Property name=’size’ value=’3’/>
      <Property name=’maxlength’ value=’3’/>
   </Display>
</Field>

When a user enters data into Waveset, the form can ensure the data is entered properly. However, Waveset cannot ensure that data entered directly into the resource meets the same requirements. For example, over the years, administrators might have entered the phone number as 123-4567 (8 characters), 123-123-4567 (12 characters), or (123) 123-4567 (14 characters).

Example

The definition of the OfficePhone field remains the same as described previously, but each of the three fields (P1, P2, and P3) should be updated to use derivation rules, as this example illustrates for the P1 field.


<defvar name=’lenOfficePhone’>
   <length><ref>Office Phone</ref></length>
</defvar>
<Field name=’P1’>
   <Display class=’Text’>
      <Property name=’title’ value=’Office Phone Number’/>
      <Property name=’size’ value=’3’/>
      <Property name=’maxLength’ value=’3’>
   </Display>
   <Derivation>
      <or>
      <cond><eq>
      <ref>lenOfficePhone</ref>
         <s>8</s></eq>
         <s> </s></eq>
      </cond>
      <cond><eq>
         <ref>lenOfficePhone</ref>
            <s>12</s></eq>
               <substr>
               <ref>Office Phone</ref>
               <i>0</i>
               <i>1</i>
               </substr>
      </cond>

      <cond><eq>
         <ref>lenOfficePhone</ref>
         <s>14</s></eq>
            <substr>
               <ref>Office Phone</ref>
               <i>0</i>
               <i>1</i>
            </substr>
      </cond>
      </or>
   </Derivation>
</Field>

When you are calculating fields, you must consider the data’s current format and quality in the resource. It is much easier to ensure the correct field values when creating new users. It is much harder to get existing data to conform to the field when reading it off the resource. You can use derivation rules for any field to check the format of the attribute as it is being read in.

Recalculating Fields

The system performs field calculations many times when a user is working on a form. The field is calculated when it is first displayed, which sets any default values, and the form is calculated when the user clicks Save. Two other actions can cause the form to be evaluated: clicking Recalculate on the Edit User page and action fields.

Example

<Field>
   <Display class=’Button’>
      <Property name=’label’ value=’Recalculate’/>
      <Property name=’command’ value=’Recalculate’/>
   </Display>
</Field>

To ensure that the system recalculates the value of a field, set action to true in the Display class element as shown below:

<Display class=’Select’ action=’true’>

Add this value only to fields that the user selects or clicks on. Do not add it to test or text area fields. When a field has action=true set, the form recalculates this form whenever the field is modified in the browser.

Example

<Field name=’Region’>
   <Display class=’Select’ action=’true’>
      <Property name=’title’ value=’Geographic Region’/>
      <Property name=’allowedvalues’ value=’North, South,
Central, Midwest’./>
<Property name=’nullValue’ value=’Select a region’/>
   </Display>
</Field>

Guidelines for Structuring a Form

Use the following guidelines when creating the structure of your new form or editing an existing form.

Optimizing Expressions in Form Fields

Some activities performed in forms can call out to resources external to Waveset. Accessing these resources can affect Waveset performance, especially if the results are long lists of values (for example, compiling a list of groups or email distribution lists). To improve performance during these types of calls, follow the guidelines in the section titled Using a Java Class to Obtain Field Data.

Example Scenario

The following example illustrates a type of expression optimization.

If you want to query a database for information that is not stored in Waveset or accessible as a resource account attribute, follow these general steps:

ProcedureTo Perform Optimizing Expressions

  1. Write a Java class that performs the database access.

  2. Define a form field that uses a default expression to call the Java class.

  3. Reference the hidden variable.

Using a Java Class to Obtain Field Data

You will need to write a Java class that has methods that can be called to retrieve information. The example in the following section, Defining a Hidden Form Field, uses the getJobGrade method, which is a custom method. You should locate this custom class in the idm\WEB-INF\classes\com\waveset\custom directory structure. (If these directories do not exist on your system, you must create them.)

Follow these guidelines when writing this class:

Defining a Hidden Form Field

First, define a hidden form field that uses a default expression to call the Java class by not including any Display class in the field definition:


<Field name=’jobGrade’>
   <Default>
      <invoke name=’getJobGrade’ class=’com.waveset.custom.DatabaseAccessor’>
         <ref>waveset.accountId</ref>
      </invoke>
   </Default>
</Field>
     </Derivation>

Default expressions are evaluated only if the view does not contain a value for the attribute jobGrade. Once the default expression has been run, the result is stored in jobGrade, and the expression is not run again.

ProcedureTo Define a Hidden Form Field

  1. Select Hidden from the Display Class menu.

  2. Click OK.

    The Hidden display class corresponds to the <input type=hidden’/> HTML component. This component supports only single-valued data types because there is no way to reliably serialize and deserialize multi-valued data types.

    If you have a List that you want to render it as a string, you must explicitly convert it to a String, as shown in the following example:


    <Field name=’testHiddenFieldList’ >
       <Display class=’Hidden’/ >
       <Derivation>
         <invoke name=’toString’>
           <List>
             <String>aaaa</String> <String>bbbb</String>
           </List>
         </invoke>
       </Derivation>
    </Field>

Referencing the Hidden Attribute

Once you have defined a hidden attribute, you can reference it in other expressions, such as:

<Field name=’secureKey’>
   <Disable><lt><ref>jobGrade</ref><i>10</i></lt></Disable>
     ...
</Field>

You can use XPRESS defvar variables to hold the results of a computation, but the results are typically not as efficient as using a hidden form field.

Note about Optimizing Variables Beyond a Single Iteration

XPRESS variables typically persist for only a single iteration over the form fields. As a result, you can use a variable within an Expansion phase but not on a subsequent Derivation phase. If you need a computed value to remain relevant beyond one field iteration, use a hidden form field instead. Hidden field values are stored in the view and will persist until the editing session is either canceled or saved.

Disabling Automatic Linking of New Resources and Users

Waveset provides a way to control the linking of existing accounts when new resources are assigned to a user.

When you assign a new resource to a user, and an account with the assigned ID already exists on the resource, Waveset by default automatically links that account to the Waveset user and proceeds with provisioning. Alternatively, you can disable this automatic linking and enter an alternative account ID when creating a new account for the user.

There are two ways to control how new accounts are linked to user:

Enabling Manual Linking in the User Form

To enable manual linking, you must

With these form changes in place, Waveset checks for existing accounts each time the form is refreshed, and before it is saved. If Waveset discovers an existing account, it displays warning messages at the top of the form, and inserts new fields for each discovered account. These new fields include a checkbox that can be used to manually indicate that the account should be linked.

In addition, Waveset generates a field for each attribute in the resource’s Identity template. With this field, you can specify a different identity for the account. Waveset fetches the attribute for the existing accounts and includes it in the view.

You can display these attributes using the MissingFields reference or with your own custom fields. You must either supply an alternative identity for an account that does not exist, or check the option to allow the existing account to be linked before the form can be saved.

Preventing Automatic Linking during Provisioning

When performing non-interactive provisioning from a workflow, you can also control whether Waveset performs automatic account linking. Passing the NoLinking view option to the checkinView call prevents automatic linking. You can specify this option in several ways:

Preventing an Attribute from being Displayed in Clear Text on Results Pages

Waveset displays the value of an attribute in clear text on Results pages, even when you have set the attribute for display with asterisks in an Edit form.

To prevent an attribute from being displayed in clear text on Results pages, you must register it as a secret attribute. To register a secret attribute, add it as follows to the System Configuration object:

<Attribute name=’secretAttributes’>
   <List>
     <String>email</String>
     <String>myAttribute</String>
   </List>
</Attribute>

Calling Resource Methods from Forms

You can invoke methods on a resource from a form by using the invoke method.

The invoke method is called by specifying the class name and name of the method. Arguments can also be passed to the method within the invoke tags as shown in the following example.


<Default>
   <block>
      <defvar name=’vmsResName’>
         <index i=’0’>
         <ref>accountInfo.accounts[type=vms].name</ref>
         </index>
      <defvar>
         <invoke name=’callResourceMethod’class=’com.waveset.ui.FormUtil’>
            <ref>display.session</ref>
            <ref>vmsResName</ref>
         <null/>
         </invoke>
</Default>

From the Form Element dialog for the field

ProcedureTo Call Resource Methods from a Form

  1. Select Javascript from the Display Class menu.

  2. Click OK.

Referencing a Form from Another Form

You can reference particular fields in a separate form (rather than a complete form) through the use of the <FormRef> element.

Use the <FormRef> element to include another form from within an external form. The following example calls the form named MissingFields.

<FormRef name=’MissingFields’/>
   <FieldRef name=’AuthenticationAnswers’/>
   <FieldRef name=’AccountInformation’/>
   <Field name=’waveset.backgroundSave’>
      <Display class=’Hidden’/>
   </Field>

Referencing Fields from Another Form

You can reference particular fields in a separate form (rather than a complete form) through the use of the <FieldRef> element.

Use the <FieldRef> element to include a specific field from within an external form. Include:


<Include>
   <ObjectRef type=’UserForm’
      id=’#ID#04F5F14E01889DFE:2E5C94:F131DD723D:-7FE4’
      name=’Password Library’/>
   <ObjectRef type=’UserForm’
      id=’#ID#04F5F14E01889DFE:2E5C94:F131DD723D:-7FE3’
      name=’Account Summary Library’/>
   <ObjectRef type=’UserForm’
      id=’#ID#UserForm:UserFormLibrary’/>
   <ObjectRef type=’UserForm’ name=’Global Attributes’/>
</Include>

In the following example, the field name itself inserted in the section of the form that matches the location on the page you would like it to be displayed.


<Field name=’global.fullname’ hidden=’true’>
    <Expansion>
      <cond>
        <and>
          <ref>global.firstname</ref>
          <ref>global.lastname</ref>
        </and>
        <concat>
          <ref>global.firstname</ref>
             <s> </s>
          <ref>global.lastname</ref>
        </concat>
      </cond>
    </Expansion>
</Field>

In the following example, the <FieldRef> element identifies the name of the attribute you want to reference.


<Field>
    <Disable>
       <isnull>
          <ref>waveset.id</ref>
       </isnull>
    </Disable>
    <FieldRef name=’DynamicChangePasswordFields’/>
</Field>

Implementing the Waveset Whitelist Feature

You can use the whitelist feature to check forms and workflows that use the SaveNoValidate action against a list of IDs or form names. Waveset checks the whitelist for either form names or form-owner IDs. The list of IDs, called saveNoValidateAllowedFormsAndWorkflows, is located in the security attribute in the System Configuration object. If the form name or owner ID is on the whitelist, the form or workflow can use the SaveNoValidate action. If the form name or the owner ID is not on the list, the form or workflow is processed using a Save action. If the list is not present, all forms and workflows can be processed as SaveNoValidate.

To implement this feature in your deployment, you must add any forms or workflows using SaveNoValidate to the saveNovalidateAllowedFormsAndWorflows list in the System Configuration object. To see the IDs or form names that you must add, check the syslog or turn trace level 4 on for com.waveset.ui.util.GenericEditForm and submit any custom forms or workflows that use SaveNoValidate. Waveset will log a warning including the ID. If you are getting “null” form names in the syslog, confirm that the form in the TaskDefinition that was run has a name attribute.