Oracle9iAS Portal Developer Kit
Reusing Portlets (Based on the Sample Event Web Provider)
The PDK Sample Event Web Provider included with Oracle9iAS Portal showcases portlets that make use of public portlet parameters and events. This article shows a page designer how to reuse the Sample Event Web Provider portlet to perform a different function without altering the portlet code. For a discussion of parameters and events review the article A Primer on Parameters and Events.
SETTING UP THE SAMPLE
Follow the Designing Pages Using the Sample Event Web Provider article to properly setup the PDK Sample Event Web Provider.
NEW APPLICATIONS
This article will map the PDK sample to a Portal Report and Portal Chart that accepts the parameter 'deptno'.
Example Wizard Chart
Make sure to add a public parameter called deptno to both of these components.
Add both of these components to Page 1 (from the Designing Pages Using the Sample Event Web Provider article).
REUSING THE SAMPLE
Go to Page 1.
Edit Page 1 Properties.
Click on the Parameters tab and create a parameter called PageDeptno. Do not set any default values.
Under Portlet Parameter Values, map the Report and Chart portlet parameters to the Page Parameter, PageDeptno.
Click on OK.
Go to Page 2 and Edit Page Properties.
Click on the Events tab.
Expand All and click on Submit.
Submit should already be mapped to Page 1, so you should only need to map the Event Output of the Page Parameter, PageDeptno, to the portlet parameter, name. Leave everything else as it was before.
Click OK.
Note: The Event and Parameter Form portlet display Name
and Age next to the textbox fields. For sample demonstration
purposes, this text is hardcoded in the portlet code. When building a
reusable portlet, you should either allow users to custom the names next to the
textfield or use generic parameter names such as parameter1, parameter2.
Revision History: