Implementing Personalization for Show Pages

7-14 Oracle Fusion Middleware Developers Guide for Oracle Portal

7.2.3.1 Assumptions

To perform the tasks in this section, the following assumptions are made:

1. You have followed through and understood

Section 6.5, Building Oracle PDK-Java Portlets with Oracle JDeveloper .

2. You built a portlet using the wizard and successfully added it to a page.

7.2.3.2 Adding Public Parameters

Using the wizard in Section 6.5, Building Oracle PDK-Java Portlets with Oracle JDeveloper , you built a basic portlet and specified a parameter called MyParam. If you did not create a parameter, you can create a new portlet now by right clicking on provider.xml in the Applications - Navigator of Oracle JDeveloper, selecting Add Portlet , and following the steps in Section 6.5, Building Oracle PDK-Java Portlets with Oracle JDeveloper . By default, the wizard creates a portlet to which you can easily map page parameters without updating any code or files. In this section, you will use the default parameter created for you by the wizard. To use the default parameter, you need only register the provider and add the portlet to a page. After that, you perform the following tasks: ■ Create a page parameter. ■ Wire the page parameter to your Java portlet. ■ Enter parameter values in the URL or another portlet that passes this page parameter. To add parameters to your portlet:

1. Go to the Parameter tab of the page properties. Note that parameters should be

enabled by default, but, if not, you must enable them before proceeding. 2. Create a page parameter called MyParameter with a default value of My Default Value. 3. Expand your Java portlet and map the page parameter you just created to the portlet parameter. The portlets parameter should map to the page parameter called MyParameter. 4. Go back to the page. Notice that, in the portlet, a value of My Default Value appears. 5. View the page and enter the parameter and a value at the end of the URL: MyParameter=This20portlet20works Figure 7–5 shows an example of a parameter portlet. Note: Each portlet is limited to 4K of data. The lengths of parameter and event names, display names, and descriptions all contribute toward this 4K limit. Hence, you should not use an excessive number of parameters and events for each portlet, or give them lengthy names and descriptions.