Updating the XML Provider Definition

Enhancing Java Portlets 7-7 Figure 7–3 Add Portlet Page

3. Click the magnifying glass icon next to the portlet and a preview window similar

to the one in Figure 7–4 displays. 7-8 Oracle Fusion Middleware Developers Guide for Oracle Portal Figure 7–4 Preview Window

7.2.2 Adding Personalization

In Section 7.2.1, Adding Show Modes you learned how to use the PDK Provider Framework to activate and render additional Show modes that were either not activated when creating the portlet with the wizard or not available through the wizard such as Link and Preview modes. This section describes the two Personalization modes Edit and Edit Defaults in more detail. When selected in the Java Portlet Wizard, Edit page and Edit Defaults page cause the generation of skeleton code for the two Personalization modes. The skeleton code enables you to access the personalization framework with a few lines of code rather than completely hand coding a personalization framework and a data store to hold the values. To add personalization to your portlet, you need to do the following: ■ Update the Edit page of your portlet to set and retrieve personalization changes. ■ Update the Edit Defaults page of your portlet to set and retrieve personalization changes. ■ Update the Show page of your portlets to use the personalization set by the user. The Edit and Edit Defaults modes allow portlet users to change a set of customizable parameters supported by the portlet, which typically drive the way the portlet is rendered in other modes. For a particular instance of a portlet on an Oracle Portal page, the personalizations made in the Edit and Edit Defaults modes apply only to that instance of the portlet. This is explained as follows: ■ Edit mode personalizations are specific to the individual user making the personalizations. This mode is activated by clicking the Personalize link on the portlet header in show mode. ■ Edit defaults mode personalizations apply to all users in the same locale who have not yet made specific personalizations to that portlet instance. This mode is generally only available to page designers, and can be activated by following the Edit icon on the page. When rendering Edit and Edit Defaults modes, a PortletRenderer can carry out either of the following tasks to support the personalization process: