Defining Layout Initialization Parameters and Values

This section discusses how to define layout initialization parameters and values.

You must add a row to begin defining initialization parameters. After you define the parameter, add arguments by clicking the Add Parameter link.

Image: Layout Initialization section of the Initialization page

The following example illustrates the Layout Initialization section of the Initialization page after a new row is added and the Add Parameter link has been clicked

Adding initialization parameters

In the Description field add information that describes the parameters to pass and the data returned as a result. This is important because the information will assist other developers determine whether to call the layout from their layouts.

The parameter values/arguments you specify are primitive elements defined in the PeopleSoft document linked to the layout, or constants that you define.

Important! The order in which you add parameter values is important, as that is the order in which the system constructs the URL.

If the parameter to pass is a primitive click the Select Primitive link to access the Select a Primitive page and click the appropriate element.

Image: Select a Primitive Page

Select a primitive in the document tree to pass as a parameter.

Select a Primitive page

After you select a primitive from the document tree, the Layout Initialization page appears as shown in the following example:

Image: Layout Initialization section of the Initialization page

The primitive selected in the Select a Primitive page appears in the Parameter List section.

Parameter and value added for layout initialization

You’ll note that the system assigns an index of 2 to the parameter and the generated URL for this initialization parameter and value is:

http://<machinename>:<port>//PSIGW/RESTListeningConnector/<NODE-NAME>/
DEMO_LAYOUT1_MAP.v1/INIT/-2

To add additional parameter values click the Add Parameter link. Another row appears in the Parameter List section.

After you’ve completed defining all values for the parameter, click the OK button. The Layout Designer – Layout page appears. Then, click the Save button to save the changes to the layout.

This section discusses using constants for initialization parameter values.

Understanding Using Constants for Initialization Parameter Values

For the Mobile Application Platform framework to determine which URI is called, all URIs must be unique.

The following example shows two URIs that are not unique:

/<PAGE_ID>/<LAYOUT_ID/<primitive state>
/<PAGE_ID>/<LAYOUT_ID/<primitive city>

If the following values were passed in, the framework would be unable to determine to which URI these values belong:

/2/12/Kansas City

A simple solution for this problem is to use a constant for one of the URIs as shown below:

/<PAGE_ID/<LAYOUT_ID/State/<primitive city>

When the URI /2/12/State/Kansas City is passed in, the framework will be able to determine the proper URI and properly populate the URI document within the MAP object. You can now properly get this initialization/URI index from the MAP Object.

Defining Constants for Initialization Parameter Values

If a parameter value is a constant, enter the constant name in the Name field. This example shows adding a list of parameters, including a constant:

Image: Layout Initialization section of the Initialization page

This example shows defining a constant as a initialization parameter value. In the example the value, state, is a constant. The value, city, is a primitive.

Defining constants for initialization parameters

In this example, the first parameter value, state, is a constant and the second value, city, is a primitive selected from the Select a Primitive page. The URL the system generates from the parameter list values is:


http://<machinename>:<port>//PSIGW/RESTListeningConnector/<NODE-NAME>/
DEMO_LAYOUT1_MAP.v1/INIT/-3

To add a layout initialization parameter:

  1. Access the Layout Initialization section of the Initialization page. (Select PeopleTools > Mobile Application Platform > Layout Designerand click the Initialization link.)

  2. In the Layout Initialization Parameters section, click the Add a Row button (+).

  3. In the Description field enter a description of the parameter.

  4. Click the Add Parameter link.

  5. In the Name field enter a parameter value.

    • To define a constant, enter it in the field.

    • To define a primitive, click the Select Primitive field to access the Select a Primitive page and select the primitive to add.

  6. To add additional parameter values, repeat Steps 4 -5.

  7. Click the OK button. The Layout Designer – Layout page appears.

  8. Click the Save button.

To better illustrate defining initialization parameters, consider an example where the following PeopleSoft document is defined for a layout:

Image: PeopleSoft Document

This example illustrates a sample PeopleSoft document defined for a layout.

Example: PeopleSoft document defined for a layout

The following parameters are defined on the Layout Initialization Parameters page:

Image: Layout Initialization section of the Initialization page

This example illustrates layout initialization parameters and values defined.

Example: Initialization parameters and values defined

In this case, four URI templates are created for the layout to use when mapping the record data on a list view or table.

Image: URI Document page

The following example illustrates the URI document created based on these definitions and that you access using the URI Document link at the top of the Layout Initialization section.

Example: URI document created based on the example initialization parameters defined.

To see rows of data in a list view of QE_ARMAMENT record data, select the compound element QE_ARMAMENT to map to the list view and the URL selected becomes an external page where the URI template selected is Layout Initialization 2. The key data define in the primitive element QE_ACNUMBER is passed as part of the URL. The resulting external page has a list view defined with the compound QE_WPN_PRESETS to map to the list view, and the URL selected is an external page where the URI Template selected is Layout Initialization 3. The key data defined in primitive QE_ACNUMBER and QE_STATION_NBR are passed as part of the URL. This sort of pattern can be used to show the data for compound QE_STAT_CONFIG.