Using JSP Templates for Form Controls

This chapter provides an overview of the form control templates and discusses:

Click to jump to top of pageClick to jump to parent topicUnderstanding Form Control Templates

Each decision point in the model maps to a selection point for the client and can be implemented by an HTML form control. This chapter describes the Configurator templates for the form controls supported in the Configuration Client, which is the midtier application. A form control template is a separate JSP page that generates a form control, using the selection point data, for a web page. Configurator provides a JSP template file for each type of form control.

Your application JSP page(s) can contain form controls by including their corresponding form control templates.

Note. All form control templates, Configurator-specific related scriptlets, and Java code should be inserted between the inclusion of the CalicoStartFormInc.jsp and CalicoEndFormInc.jsp processor pages. The JSP initializing method, jspInit(), must precede CalicoStartFormInc.jsp.

You can modify the look-and-feel of the form control display in the following ways:

With the existing Configurator form control templates you can set either the HTML-level display properties, such as the text color of the form control item’s display data and/or selection state, or customize the form control’s presentation of the model’s data.

You can specify the data display in the form control to:

Click to jump to top of pageClick to jump to parent topicProperties, Parameters, and Attributes

The presentation of a form control is determined by the application’s HTML display properties, by the included form control’s HTML display properties and its data, and by the decision point’s domain member’s display attributes.

Click to jump to top of pageClick to jump to parent topicProperties

The properties for a form control are the configurable display characteristics of the form control items that present their selection states and their delta pricing. All form controls properties are located in the CalicoUI.properties file. These properties are available application-wide, but to be used by a form control, they must be passed to the form control as parameters.

Click to jump to top of pageClick to jump to parent topicParameters

The parameters for a form control are both HTML and data presentation characteristics your application page(s) passes to included form control templates. Typically, the properties are passed to the templates as parameter values.

Click to jump to top of pageClick to jump to parent topicAttributes

The attributes for a form control are determined by the attributes in the model for the domain members. Typically, the attributes are passed to the templates as parameter values. Use the PARAM_ATTRIBUTES parameter to display the specified attributes’ data.

Click to jump to top of pageClick to jump to parent topicForm Control Templates

PeopleSoft Advanced Configurator provides a JSP code template for all HTML-compatible form controls. This section provides describes the usage and behavior of each. JSP code and the HTML output are located in the referenced appendix for each.

Note. The form control template filenames are in mixed case, i.e. SingleSelectGroup.jsp. For the deployments running on Solaris systems, make sure the characters of the filename match correctly (case-sensitive) with the template filenames.

Single-Select Group

The single-select group form control SingleSelectGroup.jsp consists of a list of form control items, of which only one can be chosen. If one item in a list is selected, any previously selected item in the same list is de-selected. The items of a form control are displayed as radio buttons.

You can create the following single-select group form control for the decision point, “OSSelection,” with the caption “Operating System,” and the ‘Generate None’ option.

The following code generates the previous form control:

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[MyComputerConfig].OSSelection"); params.put(PARAM_ATTRIBUTES, "Desc"); params.put(PARAM_CONTROLID, "OSSelectionCtrl"); params.put(PARAM_CAPTION, "Operating System"); params.put(PARAM_GENERATENONEMODE, "1"); params.put(PARAM_GENERATENONETEXT, "None"); generateSingleSelectGroup(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Single-Select Group Form Control.

Multi-Select Group

A multi-select group form control consists of a list of form control items, of which more than one item can be chosen. The items of a form control are displayed as check box buttons. Each item can be either selected or de-selected.

You can create the following multi-select option group form control for the decision point “CDSelection” with the caption “Multimedia.”

The following code generates the control in the figure:

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[MyComputerConfig].CDSelection"); params.put(PARAM_ATTRIBUTES, "Desc"); params.put(PARAM_CONTROLID, "CDSelectionCtrl"); params.put(PARAM_CAPTION, "Multimedia"); generateMultiSelectGroup(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Multi-Select Group Form Control.

Single-Select List

A single-select list form control consists of form control items in a drop-down list, of which only one can be chosen. It’s similar in functionality to a single-select group form control, but it requires less form control space for the display.

The StateTag indicates the domain member state of the form control item in the drop-down list. The following table shows the default text symbols used to connote the domain member states:

Symbolic tags

Domain member states

Selectable

>>

User-selected

>

Computer-selected

>

Default-selected

X

User-eliminated

X

Computer-eliminated

!

Conflict

Note. These state tags can be customized by modifying the property values in the CalicoUI.properties file, which is located in your application directory.

You can create the following single-select list form control for the decision point “OSSelection” with the caption “Operating System” and the ‘None’ option.

The following code generates the form control in the figure:

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[MyComputerConfig].OSSelection"); params.put(PARAM_ATTRIBUTES, "Desc"); params.put(PARAM_CONTROLID, "OSSelectionCtrl"); params.put(PARAM_CAPTION, "Operating System"); params.put(PARAM_GENERATENONEMODE, "1"); params.put(PARAM_GENERATENONETEXT, "None"); generateSingleSelectList(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Single-Select List Form Control.

Multi-Select List

A multi-select list form control consists of form control items in a list, of which more than one item can be chosen. To select or de-select more than one item, a user presses the Ctrl/Shift keys and clicks on the subsequent items to select them or clicks (on selected items) to de-select them.

The StateTag indicates the domain member state of the form control item in the drop-down list. The following table shows the default text symbols used to connote the domain member states:

Symbolic tags

Domain member states

Selectable

>>

User-selected

>

Computer-selected

>

Default-selected

X

User-eliminated

X

Computer-eliminated

!

Conflict

Note. These state tags can be customized by modifying the property values in the CalicoUI.properties file, which is located in your application directory.

You can create the following multi-select list form control for the decision point “CDSelection” with the caption “Multimedia”.

The following code generates the previous form control:

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[MyComputerConfig].CDSelection"); params.put(PARAM_ATTRIBUTES, "Desc"); params.put(PARAM_CONTROLID, "CDSelectionCtrl"); params.put(PARAM_CAPTION, "Multimedia"); generateMultiSelectList(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Multi-Select List Form Control.

Single-Select Table

A single-select table form control consists of form control items in the row/column format based on radio buttons and table HTML elements. Each row in the table contains a radio button and attributes for each available form control item. Only one of the form control items can be chosen at a time.

You can create the following single-select table form control for the decision point “OSSelection” with the caption “Multimedia” and the ‘None’ option.

The following code generates the form control in the figure:

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[MyComputerConfig].OSSelection"); params.put(PARAM_ATTRIBUTES, "Desc, PN, UC"); params.put(PARAM_CONTROLID, "OSSelectionCtrl"); params.put(PARAM_CAPTIONIMAGE, "/MyComputer/images/cd.gif"); params.put(PARAM_COLUMNHEADINGS, "Description, Part Number, Unit Cost"); params.put(PARAM_GENERATENONEMODE, "1"); params.put(PARAM_GENERATENONETEXT, "None"); generateSingleSelectTable(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

In the code block above, the PARAM_OBJECTNAME example value [MyComputerConfig].OSSelection is the name of a decision point in the model. MyComputer is the model name, appended with the string, Config. MyComputerConfig must be bracketed between “[“ and “]” characters. [MyComputerConfig] OSSelection is the decision point name.

See Single-Select List Form Control.

Multi-Select Table

A multi-select table form control consists of form control items in the row/column format based on check box buttons and table HTML elements. Each row in the table contains a check box button and attributes for each available form control item. More than one of the form control items can be chosen at a time.

You can create the following multi-select table form control for the decision point “CDSelection” with the caption “Multimedia.”

The following code generates the form control in the figure:

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[MyComputerConfig].CDSelection"); params.put(PARAM_ATTRIBUTES, "Desc, PN, UC"); params.put(PARAM_CONTROLID, "CDSelectionCtrl"); params.put(PARAM_CAPTION, "MultiMedia"); params.put(PARAM_COLUMNHEADINGS, "Description, Part Number, Unit Cost"); generateMultiSelectTable(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Multi-Select Table Form Control.

Single-Select Image

The single-select image template places an image on the page where you indicate, to select a domain member. Specify an image and location for each domain member of the selection point. At run time, selecting one image de-selects another. Include the template for the single-select image as follows:

<%@ include file="/calico/templates/html/SingleSelectImage.jsp" %>

For example, you can create the following single-select image controls for a selection point with three domain members.

When the “selectable” blue image is selected and submitted, it is replaced by a corresponding “selected” blue image.

Note. Single-select images can be placed on the page where you specify. If you do not specify a location, they are placed on a line, bottom-aligned.

The following code generates the first (the blue image) of the two controls in the figure.

<!-- METADATA TYPE="CalicoControl" startspan --> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[AudioConfig].kitSelection"); params.put(PARAM_DOMAINMEMBERNAME, "DashSpacer"); params.put(PARAM_IMAGENAME, "blue.gif"); params.put(PARAM_IMAGEPATH, "SSImages"); params.put(PARAM_AUTOSUBMIT, "true"); generateSingleSelectImage(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

Parameters are:

See Single-Select Image, Parameters in the Inclusion Set.

Note. Provide either the image attribute or the image name, but not both.

Optional image parameters are:

A JavaScript object, calicoSSI, is created for each image generated by the image templates, and is passed to JavaScript callback functions to identify the image being created, selected, deselected, moused over, moused off of, or auto-submitted. Each of these objects has these properties:

Property Name

Property Type

Description

objectName

String

Control’s decision point.

ctrItemName

String

Item’s domain member.

state

Number

1 if the image is selected, 0 if it is not selected.

tagName

String

Value of the <IMG NAME> attribute for the item.

attributes

Array of Strings

An array having all of the item’s attributes.

altText

String

Alternative text for the item’s image.

priced

Boolean

True if the control is priced.

delta price

Number

Item’s delta price.

Optional callback parameters are:

Single-Select Image Table

The single-select image table template places images for every domain member of a selection point either horizontally in a row, or vertically in a column on the page, to select among them. Specify an image for each domain member of the selection point, and whether you want them placed in a row or a column. At run time, selecting one image de-selects another.

Include the template for the single-select image table as follows:

<%@ include file="/calico/templates/html/SingleSelectImageTable.jsp" %>

For example, you can create the following single-select image table control for a selection point with three domain members.

When the “selectable” green image is selected and submitted, it is replaced by a corresponding “selected” green image.

Note. The images of a Single-Select Table Image control are placed in a table row (in a table cell) and centered.

The following code generates the control in the figure:

<!-- METADATA TYPE="CalicoControl" startspan --> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[AudioConfig].kitSelection"); params.put(PARAM_IMAGEATTRIBUTE, "SSImage"); params.put(PARAM_IMAGEPATH, "SSImages"); params.put(PARAM_AUTOSUBMIT, "true"); generateSingleSelectImageTable(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Parameters in the Inclusion Set.

The optional table parameters are:

See Single-Select Image Table.

Application Why Help

An Application Why Help template is used to represent a set of violation items of the current configuration in an unordered list format.

You can create the following application-level why help:

The following code generates the form control in the figure:

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_CAPTION, "Application Why Help:"); generateApplicationWhyHelp(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Application Why Help.

Form Control Why Help

A Form Control Why Help template is used to represent a set of violation items of a form control for the current configuration in the unordered list format.

You can create a Form Control Why Help like the example in the Application Why Help:

The following code generates the example form control:

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[MyComputerConfig].HDSelection"); params.put(PARAM_CAPTION, "Control Why Help:"); generateControlWhyHelp(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Form Control Why Help.

Text Input Form Control

The text input template generates a text box for entering any text value. Unlike values entered into extern entry templates, text input values are not submitted to the engine. They are instead passed from page to page and loaded into the configuration object contained within the COP on each page. This allows any information stored using the text input template to be included with standard configuration information, such as that acquired when using the BOM item generator, saved when running against a compound model, or integrating with other applications.

include the template for the extern entry text box as follows:

<%@ include file="/calico/templates/html/TextInput.jsp" %>

For example, you can create the following text input control with an initial default value.

The following code generates the control in the example.

<!-- METADATA TYPE="CalicoControl" startspan --> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "TextInput_Ctrl01"); params.put(PARAM_CAPTION, "Phone Number:"); params.put(PARAM_ TEXTINPUTDEFAULT, "212-555-1212"); params.put(PARAM_ ENTRYSIZE, "12"); generateTextInput(params, request, out, session, cop.getConfiguration()); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Parameters in the Inclusion Set.

The two optional parameters are:

PARAM_TEXTINPUTDEFAULT —A default value that shows up when the text input box is initially shown.

PARAM_ENTRYSIZE—Width in characters of the text entry field. The default value is 15.

See Text Input Form Control.

Numeric Data Form Control

A numeric data control consists of a control caption or a caption image and a value of the numeric data that are displayed in the same line.

The include file required for the numeric data template is:

<%@ include file="/calico/templates/html/NumericData.jsp" %>

For example, you can create the following numeric data control for the decision point “WattsSummation” with the caption “Total Watts”.

The following code generates the control in the figurel.

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[_Application].WattsSummation"); params.put(PARAM_CAPTION, "Total Watts"); generateNumericData(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Numeric Data Form Control.

Extern Entry

The extern entry template generates a text box for entering a value that is submitted to the Configurator engine using the extern() function.

Include the template for the extern entry text box as follows:

<%@ include file="/calico/templates/html/ExternEntry.jsp" %>

For example, you can create the following extern entry control to enter a floating point value.

The following code generates the previous control.

<!-- METADATA TYPE="CalicoControl" startspan --> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[_Application].ExtVar1"); params.put(PARAM_CONTROLID, "ExEn01"); params.put(PARAM_CAPTION, "Enter Number Here"); params.put(PARAM_FLOATENTRY, "true"); params.put(PARAM_ENTRYSIZE, "3"); generateExternEntry(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

See Parameters in the Inclusion Set.

The two optional parameters are:

Click to jump to top of pageClick to jump to parent topicUsing Configuration Form Control Templates

PeopleSoft Advanced Configurator supplies 11 form control templates. Each is a JSP page that generates HTML. Six of them enable the Web user to select an item on an HTML form, using radio buttons, check boxes, drop-down lists, or selection lists. The other four form control templates generate output display information. One allows the Web user to enter a text value using en edit box. Two of these form controls display constraint violations; one for the entire configuration session, and the other for its corresponding form control. The last display form control template generates a visible numeric value.

There are three types of user-selectable form controls:

Each type of user-selectable form control can be either single-selectable or multi-selectable. A multi-select form control enables the Web client user to pick more than one item for the selection point, whereas a single-select form control limits the user to a single pick for the selection point. A single-select list is drop-down, whereas a multi-select list is a list, typically scrollable. The following table itemizes the form control templates available in this release.

JSP Filename

HTML Implementation

Comment

SingleSelectGroup

<INPUT TYPE="radio">

radio buttons

MultiSelectGroup

<INPUT TYPE="checkbox">

check boxes

SingleSelectList

<SELECT>

drop-down list; single-selectable

MultiSelectList

<SELECT MULTIPLE>

list: multi-selectable

SingleSelectTable

<INPUT TYPE="radio"> and <TABLE></TABLE>

multiple columnal radio buttons

MultiSelectTable

<INPUT TYPE="checkbox"> and <TABLE></TABLE>

multiple columnal check boxes

SingleSelectImage

<IMG SRC>

an image for selecting a domain member

SingleSelectImageTable

<IMG SRC> and <TABLE></TABLE>

a row or column of images for selecting among domain members

ApplicationWhyHelp

<LI>

violation messages for all form controls: application scope

ControlWhyHelp

<LI>

violation messages for an individual form control: form control scope

NumericData

caption text or image, and number text

display number value aside caption or image

ExternEntry

<INPUT TYPE=”text”>

a text box for entering a value

TextInput

<INPUT TYPE=”text”>

a text box for entering a text value

Click to jump to top of pageClick to jump to parent topicPlugging Form Controls into the Application Page(s)

To use the form control templates, you need to be familiar with the following directories:

To use a form control template, your application page(s) needs:

Using a JSP Include Directive

The syntax to include a form control template, such as the SingleSelectGroup template, is:

<%@ include file="/calico/templates/html/SingleSelectGroup.jsp" %>

Place the form control templates’ include directives immediately following the include directive for the CalicoStartFormInc.jsp that is in each application JSP page.

For example:

<%@ include file="/calico/CalicoStartFormInc.jsp" %> <%@ include file="/calico/templates/html/SingleSelectGroup.jsp" %> <%@ include file="/calico/templates/html/MultiSelectTable.jsp" %>...

Note. Only one include directive <% include file="templateFile" %> is required for each type of form control template in the application JSP page. If you have five single-select list form control templates in an application JSP page, use only one JSP include directive to include them.

Using a Form Control Inclusion Set

To include a form control template using an inclusion set, bracket the inclusion set within these start and end tags:

<!-- METADATA TYPE="CalicoControl" startspan--> // set the parameters and include the path name for a form // control template here <!-- METADATA TYPE="CalicoControl" endspan -->

Between the start and end tags, insert these required statements:

params.clear();

Initializes all parameters.

params.put(parameter, value);

Sets the required and optional parameters after params.clear().

The four required parameters for the interactive form controls are: PARAM_OBJECTNAME

PARAM_ATTRIBUTES

PARAM_CAPTION or PARAM_CAPTIONIMAGE

PARAM_CONTROLID

generateTemplateName(params, request, out);

Generates the included form control template file after the params.put() calls where you’ve set parameters.

The params.put() statements can be in any order, provided that params.clear() precedes them and that generateTemplateName() follows them.

Example:

<!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "VehicleSelection)"; params.put(PARAM_ATTRIBUTES, "Desc"); params.put(PARAM_CAPTION,"Select a Vehicle"); params.put(PARAM_CONTROLID, "VehicleSelectionControlID"); generateSingleSelectGroup(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan -->

Click to jump to top of pageClick to jump to parent topicParameters in the Inclusion Set

At run time, the parameters in the inclusion set are passed to the form control template, which uses them when it runs at the point where generateTemplateName() is called.

Any blank spaces between the values are ignored. For example, “Description, Part Number, Unit Cost” (with spaces) is the same as “Description,Part Number,Unit Cost” (without spaces).

Form control parameter values are specified as a string. The syntax for assigning multi-valued parameters (in the application page) is a single string that uses a comma character delimiter between each value. Both the PARAM_ATTRIBUTES and PARAM_COLUMNHEADINGS parameter values may be multi-valued.

These parameters are required for using the selection point form control templates:

Required parameter

Comments

PARAM_OBJECTNAME

The object name is the unique object name (“<modelnameConfig>.decisionpointname”), which is used to retrieve the items of a form control.

PARAM_CONTROLID

The control ID is the unique identifier for the HTML form control. The application needs a unique identifier for each form control other than the object name since there might be multiple controls mapping to the same decision point. This identifier will be used for client-side scripting and server-side processing.

PARAM_ATTRIBUTES

The attributes are the selection point’s data attributes to be displayed on the form control in the UI. Only Table form controls may use multiple display attributes from the model.

For internal domain members specified in the if PARAM_ATTRIBUTES parameter, there must be a corresponding attribute(s) defined in the model for the domain members.

For external domain members, if the attribute name (column names of the table that stores the description for the domain members) is ambiguous (more than one table has the same column name), you must specify its fully qualified database name—tablename.columnname.

params.put(PARAM_ATTRIBUTES, <attribute name, attribute name ...>);

or

params.put(PARAM_ATTRIBUTES, <tablename.columnname, tablename.columnname ...>)

Setting the PARAM_ATTRIBUTES parameter in your inclusion set is optional; however, for deployment you should set it so that the model’s attributes are displayed. If PARAM_ATTRIBUTES is not explicitly set, the default display will be the domain member names, which may be useful during development in that you do not need to add attributes to test-case models.

PARAM_CAPTION

The caption is the string to be displayed as the form control caption. This parameter is applicable to all the form control templates.

PARAM_CAPTIONIMAGE

The caption Image is the image to be displayed as the form control caption. This parameter is applicable to all the form control templates

Specify either a Caption or a Caption Image, but not both.

The following are optional parameters for the form control templates:

Optional parameter

Comments

PARAM_SORT

The sort parameter specifies whether to sort form control data based on the form control states; “true” or “false” are the valid values.

PARAM_FILTERELIMINATEDITEMS

The filter-eliminated items parameter renders all eliminated domain members in the model unavailable to the form controls in the application page. If set to true, the eliminated domain members in the model are not available to the form control. If unspecified or set to false, the eliminated domain members in the model are available to the form control.

You can restrict the filtering to outside a range of elimination levels captured between a lower and an upper elimination level specified by the parameters: PARAM_ELIMINATIONLEVEL_LOWER and PARAM_ELIMINATIONLEVEL_UPPER.

Therefore, if PARAM_ELIMINATIONLEVEL_LOWER is 4, and PARAM_ELIMINATIONLEVEL_UPPER is 7, then the eliminated domain members with elimination levels greater than 3 and less than 8, are available to the form control.

PARAM_ELIMINATIONLEVEL_LOWER

The lower elimination level is used to specify the lower bound of the elimination level range for form control items.

PARAM_ELIMINATIONLEVEL_UPPER

The upper elimination level is used to specify the upper bound of the elimination level range for form control items.

Note. To specify the range for elimination levels, you must set both parameters, PARAM_ELIMINATIONLEVEL_LOWER and PARAM_ELIMINATIONLEVEL_UPPER.

PARAM_COMPARATOR

Specifies a Java class name to be used with a custom comparator for sorting control items. The class specified must implement the java.util.Comparator interface. It passes a custom-written Comparator object to the ControlData.iterator method. The iterator method then sorts domain members using Comparator before returning the iterator to the front-end. Sort can be performed on quantity or any other attribute from the model.

PARAM_COLUMNHEADINGS

The column headings are the labels the Table form control displays for the columns of domain member attributes.

PARAM_GENERATENONEMODE

The Generate None mode is the position for the None item (explicitly selecting none of the picks). This option is available only for single-select controls. The corresponding decision point must be optional. Available options are:

0 — do not generate none value.

1 —generate none value before other options.

2 —generate none value after other options

PARAM_GENERATENONETEXT

The Generate None text is the string to be displayed for the ‘None’ item. This option is available only for single-select controls. The corresponding decision point must be optional.

PARAM_EVENTHANDER

The event handler is the JavaScript event handler for the standard JavaScript events of form control items.

Put your JavaScript event handler function in the body of the application page(s), outside of the inclusion set.

For the event handlers, you must write your own JavaScript function to handle the events, such as onClick or onBlur, and then set the parameter PARAM_EVENTHANDER to that function name. Otherwise, you can use the standard event handlers, such as:

this.<form-name>.submit()

Syntax:

params.put(PARAM_EVENTHANDER, "onClick='this.<form-name>.submit()'

" or

params.put(PARAM_EVENTHANDER, "onChange='myJavascriptSubmit()'"

Note. Common functions such as onClick, onChange, and onFocus, are JavaScript events. onClick is an event for Group and Table form controls, but you can use different JavaScript events. onChange typically is used for List form controls, but you can use other JavaScript built-ins such as onFocus and onBlur.

PARAM_CONTROLSIZE

The control size is the number of visible items for the HTML form control. This parameter only applies to the List form controls.

PARAM_GENERATEFIRSTITEMTEXT

You can add an item with any description (string type) to the beginning of a single-select list control. For example, "Select a hard drive" can be added to be displayed as the top element in the drop-down list. Once the user selects an item from the drop-down list, (for example, "12 GB Hard Drive"), the first item entry ("Select a hard drive") then disappears.

Click to jump to top of pageClick to jump to parent topicSpecifying the Solution's Model and Locale Properties

A solution's UI properties are contained in the configuration file, CalicoUI.properties. Each solution, or version of a solution, requires a separate copy of CalicoUI.properties to be modified and maintained for that solution only. It must be placed in the application folder that houses your application JSP pages.

CalicoUI.properties contains mainly display properties, which are optionally used by the application. However, there are four model properties and two locale properties that the form control templates need and that you must specify in the solution CalicoUI.properties file:

To specify model and locale properties:

  1. If you haven't already done so, transfer a copy of CalicoUI.properties from <install directory>\weblogic81\config\CalicoDomain\applications\CalicoApp\solutions\ComponentSample to the application folder where the JSP pages are kept.

  2. Call the property value(s) from each form control that uses the display properties:

  3. If the language to use in the UI is other than the United States variant of English, specify which by inserting the code for the desired language and variant. If you have a custom language variant set, specify the desired language code in calico.locale.country=en, comment out calico.locale.country=US, uncomment calico.locale.variant=, and insert in it the correct code.

Assigning a Specific Model Version to Use for Configuration

If you use only the major number and the minor number of the model version for setting the calico.model.version property (such as calico.model.version=0-1), then by default, the form control templates use the latest compiled version from among all models within the subversions folder under version 0.1.

The model name and version (major-minor) are set in the model by the modeler. By changing these in the CalicoUI.properties file, you tell the application which model to use rather than the default latest compiled version. The compiler assigns the micro (sub-version) and compile versions. The WebLogic server by default loads only the most recent version (major-minor-micro) and compile version of every model.

To assign a specific model version to use:

  1. Set the calico.model.version property to the complete version number. For example, calico.model.version=0-1-4 represents version 0.1.4.

  2. Uncomment the calico.model.compileversion property in CalicoUI.properties.

  3. Set the calico.model.compileversion property to the name of the folder that houses the compiled model. For example, using the following directory tree for Configurator models, you would set calico.model.compiledversion property to 200030825-161346-823:

Click to jump to top of pageClick to jump to parent topicSpecifying Solution Information Properties

Solution information property values are used in generating a Solution List for Configurator client application. A Solution is the collection of pages, images, model files, and supporting files that comprise the application(s) that solve a business problem, such as online configuration and order management. The Solution list is the filenames, structures, and version information for that solution.

The Solution List could also be used in a server-based deployment.

Solution properties are:

calico.solution.name

Name of the solution. Acts as the key in the solution list. By default (if this property isn't specified), the name will be the name of the directory the solution resides in (the value of calico.solution.root, which is not specified here). Default is the name of the directory in which the solution resides.

calico.solution.version

The version of the solution. Helps identify different versions (revisions) of the same solution, but isn't used in this version of Configurator. Default is calico.solution.root or as specified in the properties file.

calico.solution.description

The text to be displayed in the solution list as a link to this application. Default is calico.solution.name or as specified in properties file.

calico.solution.restorePolicy

The restore policy to use when launching stored configurations. The policy determines which version of the model to use in launching the configuration in the web application. Default is 1 or as specified in the properties file.

calico.page.start

The page to redirect to when starting a new configuration.

calico.page.restore

The page to redirect to when restoring an existing configuration. If calico.page.restore is blank, the restore will go to the page specified in calico.page.start.

If these properties aren't specified, the SolutionInfo class will assign default values.

Click to jump to top of pageClick to jump to parent topicSpecifying Display Properties

The names of the form control property types correspond to the names of the display attributes, as shown in the following list:

Display property types in CalicoUI.properties file

Applicable form control template types

calico.control.tag.<property>

List

calico.control.image.<property>

Group and Table

calico.control.textcolor.<property>

Group and Table

calico.control.captioncolor.<property>

List, Group, and Table

PeopleSoft Advanced Configurator provides a set of properties to indicate the state of an item in a control:

These properties cause the display of designated text symbols and/or images beside the items in a control to indicate to the user their availability for selection.

You can use the item state properties as examples for creating your own properties or modify them to your needs.

Click to jump to top of pageClick to jump to parent topicDisplaying Delta Information

Using the COP XML interface, Advanced Configurator generates two types of delta configuration information at run time:

Advanced Configurator returns delta information using an XML interface. The existing ConfigDetails request in the messaging interface (COPXML) can include requests for delta information. By default, the deltas returned represent the latest set of saved changes or those from a specified date range. In addition, the available component delta information will be enhanced to include changed expression values. Peoplesoft Enterprise CRM 8.9 Order Capture and Service Management use delta information in transactions.

See Also

Retrieving Configuration Information

Click to jump to top of pageClick to jump to parent topicDisplaying Delta Pricing

You can modify the pricing display for either all form control items or for the form control items belonging to specified selection points. To display delta prices, you must first enable delta pricing in the application and then specify how it is displayed. Enabling delta pricing occurs in initial implementation of jspInit() in the body of your application page(s).

  1. Enable delta pricing:

    To enable delta pricing for all form controls use this statement:

    setPricing(true);

    This statement also enables total pricing for the entire configuration.

    To enable delta pricing for specific form controls, use this statement:

    setPricingControls(); // accepts as arguments a map of the // decision points’ object names (strings) // and price attributes (strings).

    Pass to setPricingControls() the object names you specify in the form controls’ PARAM_OBJECTNAME parameters along with the price attribute for that object.

    Note. For better performance, set the pricing variables rather than calling the corresponding set methods.

  2. Set display properties.

    The basic format is:

    calico.pricing.add=[+ {0}] calico.pricing.subtract=[- {0}]

    The values shown result in a display string that appear alongside the selection. If the delta price is an additional $20.00, the delta price appears as follows:

    [+ $20.00]

    By replacing the characters, you can change the display, for example, by replacing the square brackets with angle brackets, and “+” with “Add”, the display becomes <Add $20.00> for a positive delta price. Replacing “-” with “Subtract” gives [Subtract $20.00] for negative deltas.

Sample code:

public void jspInit() { setPricing(true); Map pricingControls = new HashMap(); pricingControls.put("[BMWConfig].SeriesSelection", "UnitPrice"); pricingControls.put("[BMWConfig].OptionsSelection", "UnitPrice"); pricingControls.put("[BMWConfig].EngineSelection", "basePrice"); setPricingControls(pricingControls); }

Click to jump to top of pageClick to jump to parent topicApplication Page Example

The following code provides a complete example of an application JSP page.

<HTML> <HEAD> <TITLE>Sample Page</TITLE> </HEAD> <BODY> <%! public void jspInit() // turn on pricing for controls setPricing(true); Map pricingControls = new HashMap(); pricingControls.put("[myPCConfig].ProcessorSelection", "UnitPrice"); setPricingControls(pricingControls); } %> <FORM name="TestForm" method="POST" action="CalicoProcessForm.jsp"> <%@ include file="/calico/CalicoStartFormInc.jsp" %> <%@ include file="/calico/templates/html/SingleSelectGroup.jsp" %> <!-- Inclusion set starts below --> <!-- METADATA TYPE="CalicoControl" startspan--> <% if (params != null) { params.clear(); params.put(PARAM_OBJECTNAME, "[myPCconfig].ProcessorSelection"); params.put(PARAM_ATTRIBUTES, "Desc"); params.put(PARAM_CAPTION, "[myPCConfig].ProcessorSelection"); params.put(PARAM_CONTROLID, "ProcessorSelectionCtrl"); generateSingleSelectGroup(params, request, out); } %> <!-- METADATA TYPE="CalicoControl" endspan --> <%@ include file="/calico/CalicoEndFormInc.jsp" %> </FORM> </BODY> </HTML>

Click to jump to top of pageClick to jump to parent topicCustomizing a Form Control Template

You must use getControlData() in customized form control template JSP pages, as in the following Java statement:

ControlData varName = getControlData(objectName, request, params);

Application Scope

You can customize HTML-level display properties, such as the form controls’ text color, by modifying the properties in the CalicoUI.properties file. The form control templates load these properties upon their initialization.

Template Scope

You can customize how the display data is altered depending upon the model’s data. You can customize the behavior of the display to:

To customize the state of an individual instance of a form control:

  1. Make a copy of the type of form control template you want, rename the copy, and put that copy in your application directory. When you use the JSP include directive to include your template, be sure to use the path to your application directory.

    Note. Do not modify any of the form control template JSP files: they are installed as read-only files.

  2. Modify its JSP code.

  3. Include your custom form control template in any of your application JSP pages whenever you use that type of form control.

Loading the Form Control Data from the Model

The form control templates get their corresponding selection point (decision point) data from the model with the following JSP template code:

String objectName = (String)params.get(PARAM_OBJECTNAME); ControlData ctrlData = getControlData(objectName, request, params);

Loading the UI Properties for a Control

The form control templates load the specified UI properties (from the CalicoUI.properties file) with the following JSP template code:

// set up display properties String[] stateMap = (String[])request.getAttribute(STATEMAP); String[] tagMap = (String[])request.getAttribute(TAGMAP); String[] imgMap = (String[])request.getAttribute(IMAGEMAP); String[] textColorMap = (String[])request.getAttribute(TEXTCOLORMAP); Properties props = (Properties)request.getAttribute(UIPROPS);

The form control templates set their properties with the following JSP template code:

// set up the display properties for control items state = (int)ctrlItem.getFlags(); stateFlags = stateMap[state]; tagItemState = tagMap[state]; imgItemState = imgMap[state]; colorItemText = textColorMap[state];

The names of the form control property types correspond to the names of the display attributes, as shown in the following list:

Display property types in CalicoUI.properties file

Applicable form control template types

calico.control.tag.<property>

List

calico.control.image.<property>

Group and Table

calico.control.textcolor.<property>

Group and Table

calico.control.captioncolor.<property>

List, Group, and Table

Click to jump to top of pageClick to jump to parent topicRegistering Custom Form Control Templates

The addCtrl() function should be called within any customized form control template. addCtrl() registers a Configurator form control. It adds each control along with its selection point name to a form hidden attribute called CalicoCtrlMap, which is generated by CalicoEndFormInc.jsp for each Configurator page. This is necessary so that the Configurator JSP processor page (CalicoProcessFormInc.jsp) knows which form controls need to be processed and which to ignore (non-Configurator form controls).

addCtrl() is used by most of the Configurator form control templates.

Click to jump to top of pageClick to jump to parent topicExample Custom Form Control Template

The purpose of providing the sample template is to explain how developers could customize the behavior of a Configurator control by displaying eliminated control items differently based on their elimination levels returned from COP:

If the elimination level for an eliminated control item is >= 0 and <= 4, the item is hidden (not shown).

If the elimination level for an eliminated control item is >= 5 and <= 9, the item is displayed as grayed out with the X image.

If the elimination level for an eliminated control item is >= 10, the item is displayed as normal (without being grayed out or the X image).

In this example template, we use 0, 4, 5, 9, 10 etc. for the lower and upper bounds to display control items differently. Developers can define a range of values for the elimination level they want to handle in the template they create since these values depend on the elimination levels defined for the constraints by the modelers.

In the following figures, after the “Prima Base Celeron 43 Mhz MiniTower” pick is submitted, the control on the right only has one item left and is shown as user-selected (finger icon). All other items in the control have elimination levels that are >= 0 and <= 4. Therefore, they are not shown on the page.

The following web page illustrates using the same model decision point: the top left form control with the SingleSelectGroup.jsp template, and the top right form control with the SingleSelectGroupElimLevel.jsp template:

The next figure illustrates the differing effects of using the standard SingleSelectGroup.jsp form control template and of using a customized (sample) SingleSelectGroupElimLevel.jsp form control template. The top left form control was generated by the SingleSelectGroup.jsp template, and the top right form control was generated by the SingleSelectGroupElimLevel.jsp template:

Click to jump to top of pageClick to jump to parent topicCommon Errors

The following is a checklist of common errors for those who implement the web applications using Configurator JSP pages: