Oracle9iAS Portal Developer Kit

Designing Pages Using the PDK-Java V2 Sample Event Web Provider

The PDK-Java V2 Sample Event Web Provider included with Oracle9iAS Portal showcases portlets that make use of public portlet parameters and events. This white paper shows a page designer how to add these portlets to a page and how to make use of the public portlet parameters and events. For a discussion of parameters and events review the article Oracle9iAS Portal Developer Kit: A Primer on Parameters and Events.

Enabling Parameters and Events

Parameters and events are not enabled in a page group by default. At any point after creating a page group, you may enable parameters and events by performing the following steps:

- Edit your page group’s Properties by clicking on the Edit Properties link in Oracle9iAS Portal Navigator.

- Go to the Configure tab.

- Under the Parameters and Events category click on Edit.

- Check the box labeled Enable Parameters and Events and press OK.

You will now be able to view and manipulate parameters and events associated with pages in that page group.

Adding the Public Parameter Portlet

Performing the following steps demonstrates how to use the Public Parameter Portlet:

- Create a new page titled page1.

- Add the Public Parameter Portlet from the PDK-Java V2 Sample Event Web Provider to page1.

- Go to the Parameters tab of page1’s Page Properties.

- Add a new page parameter named PageParameter1 by filling the in the text box labeled Parameter Name and pressing Add.

- Pressing on Add commits the addition of the new page parameter.

- Add another page parameter named param2.

- Give PageParameter1 the default value ‘February’ by filling in the text box labeled Default Value beside PageParameter1.

- Changes to the properties of a page parameter are not committed until Apply or OK has been pressed or a different Page Properties tab has been selected.

- Click on the Expand All link under Portlet Parameter Values.

- You should see the Public Parameter Portlet listing two portlet parameters - Input Parameter #1 and Input Parameter #2.

- Map PageParameter1 to Input Parameter #1 by selecting Page Parameter from the list beside Input Parameter #1. Then, select PageParameter1 from the list of page parameters that appears.

- You have just mapped a page parameter value to a portlet parameter value. When page1 is displayed, the portlet parameter Input Parameter #1 will be assigned the value of PageParameter1.

- Changes to the mapping of a public portlet parameter are not committed until Apply or OK has been pressed or a different Page Properties tab has been selected.

- Map param2 to Input Parameter #2 and press OK.

- View page1 by clicking on the Return to View Page link.

- param1, the portlet’s internal name for Input Parameter #1, takes on the value of PageParameter1 which has the default value ‘February’.

- param2, the portlet’s internal name for Input Parameter #2, takes on the value of PageParameter2 which has no default value. The portlet recognizes that no value has been assigned to param2 and displays a message indicating this.

Adding the Event and Parameter Form Portlet

The Event and Parameter Form Portlet defines two portlet events Submit and Cancel that can be used by the page designer to control page navigation based on user actions.

Performing the following steps demonstrates how to use the Event and Parameter Form Portlet:

- Create a new page titled page2.

- Add the Event and Parameter Form Portlet from the PDK-Java V2 Sample Event Web Provider.

- View page2 and try pressing both the Submit and Cancel buttons.

- This demonstrates how firing an unmapped portlet event always causes the current page to be redisplayed.

- Go to the Events tab of page2’s Page Properties.

- Add the Public Parameter Portlet from the PDK-Java V2 Sample Event Web Provider to page2.
- Create page parameter called UserName and UserAge on the Parameters tab of page2's Page Properties.
- Give page parameter UserName a default value of 'Default Name'.
- Give page parameter UserAge a default value of 'Default Age'.
- Map page parameter UserName to the Public Parameter Portlet's parameter Input Parameter #1.
- Map page parameter UserAge to the Public Parameter Portlet's parameter Input Parameter #2.
- Click on the Expand All link under Portlet Parameter Values.

- You should see the Event and Parameter Form Portlet listing two portlet events submit and cancel.

- Click on submit.

- Click on the icon .

- Select page2 from the page selector.

- Map the page parameters UserName and UserAge to the event outputs param1 and param2 respectively.

- Map page1 to the be the page displayed when cancel is raised.

- Map the page parameters UserName and UserAge to the system variable ‘USER_NAME’ and the constant value ‘green’ respectively.

- Press OK and view page2.

- Notice that the last submitted values for UserName and UserAge are the default page parameter values and these are mapped to the Public Parameter Portlet's portlet parameters.

- Enter values in the Parameter #1 and Parameter #2 text fields

- Press the Submit button.

- You should see page2 redisplayed with the Public Parameter Portlet displaying the values entered for Parameter #1 and Parameter #2.

- Press the Cancel button.

- You should see page1 displayed with the system variable 'USER_NAME' and the constant value 'green' being passed to the Public Parameter Portlet.

- Go to the Events tab of page2’s Page Properties.

- Map page1 to be the page displayed when the submit event is raised.

- Map the page parameters PageParameter1 and PageParameter2 to the event outputs param1 and param2 respectively.

- Press OK and view page2.

- Enter values in the Parameter #1 and Parameter #2 text fields and press the Submit button.

- You should see page1 displayed with the values entered for Parameter #1 and Parameter #2 on page2 now being passed to the Public Parameter Portlet.

Revision History:

January 14, 2002.