Open edit.jsp in the visual designer and click the Design tab. Notice that the

7-4 Oracle Fusion Middleware Developers Guide for Oracle Portal Your JSR 168 Portlet to the Oracle WebLogic Server for a reminder of how to perform this step. 8. In Oracle Portal, reload the page that contains the portlet. The portlet displays the text Portlet Content, which was one of the changes you made in Oracle JDeveloper.

9. Click the Customize link. You can see the new form field that you added in Oracle

JDeveloper. 10. Enter the following HTML in the Content field, replacing the words Portlet Content. pRead emThe Path to Portlet Interoperabilityem by John Edwards in strongOracle Magazinestrong, Nov-Dec 2003. p pIt discusses JSR 168 and WSRP open portals. p

11. Click Apply and then click Close. The HTML is rendered in the portlet.

7.2 Enhancing PDK-Java Portlets

Once you have built your initial portlet in the Portlet Wizard as described in Section 6.5, Building Oracle PDK-Java Portlets with Oracle JDeveloper , you may perform the following tasks to enhance it: ■ Section 7.2.1, Adding Show Modes ■ Section 7.2.2, Adding Personalization ■ Section 7.2.3, Passing Parameters and Submitting Events ■ Section 7.2.4, Using JNDI Variables ■ Section 7.2.6, Accessing Session Information ■ Section 7.2.7, Implementing Portlet Security ■ Section 7.2.8, Controlling the ExportImport of Portlet Personalizations ■ Section 7.2.9, Enhancing Portlet Performance with Caching ■ Section 7.2.11, Writing Multilingual Portlets This section assumes the following: ■ You are familiar with portlet terminology such as portlet Show modes. Refer to Chapter 1, Understanding Portlets and Section 6.1, Guidelines for Writing Java Portlets . ■ You have already downloaded and installed the Java Portlet Container. ■ You are already familiar with Oracle JDeveloper and know how to build and deploy Java components using it. You can download Oracle JDeveloper from OTN. Visit the Oracle JDeveloper page on OTN: http:www.oracle.comtechnologyproductsjdevindex.html

7.2.1 Adding Show Modes

In the Portlet Wizard, you add Show modes by checking boxes on the wizard pages. Refer to Section 6.5, Building Oracle PDK-Java Portlets with Oracle JDeveloper for more information about using the wizard. For each Show mode that you select in the wizard, a basic HelloWorld skeleton is created. If you need to add a Show mode after creating the portlet or you are adding one of the modes preview or link not available Enhancing Java Portlets 7-5 through the wizard, you can do that manually by updating provider.xml and HTML or JSPs in Oracle JDeveloper. The following sections explain how to add Show modes to a PDK-Java portlet: ■ Section 7.2.1.2, Implementing Extra Show Modes ■ Section 7.2.1.3, Updating the XML Provider Definition ■ Section 7.2.1.4, Viewing the Portlet Once you have completed this section, you will be able to implement any Show mode using RenderManager because the principles are the same for all modes. For example, even though this section does not describe how to implement the Help mode in detail, you will understand how to do it, as the process is the same as for Preview mode, which is described here. For more detailed information on the PDK runtime classes used in this section, refer to the Javadoc on OTN by clicking Java Doc API on the Portlet Development page available at http:www.oracle.comtechnologyproductsiasportalportlet_development_ 10g1014.html For more information on the syntax of provider.xml, refer to the provider Javadoc: http:www.oracle.comtechnologyproductsiasportalhtmljavadocxml_tag_ reference_v2.html

7.2.1.1 Assumptions

To perform the tasks in this section, we are making the following assumption: ■ You built a portlet using the wizard, successfully registered the producer, and added the portlet to the page.

7.2.1.2 Implementing Extra Show Modes

Your first task when creating Show modes manually is to create an HTML file or JSP for each mode. For example, if you want to implement Preview mode, you need to create an HTML file to provide preview content. To create an HTML file to preview content, perform the following steps:

1. In Oracle JDeveloper, open the project that contains your portlets.

2. Under Web Content, htdocs\myportlet, create an HTML page called PreviewPage.html. The content of the file could be something similar to the following: pThis is the ipreviewi mode of your portletp Once you have created the HTML file for previewing content, you are ready to update the XML provider definition.

7.2.1.3 Updating the XML Provider Definition

When you want to expose additional Show modes you must update your XML provider definition as follows: ■ Set a boolean flag that indicates to the PDK Framework that a link or icon to that mode should be rendered. ■ Point to the HTML file or JSP that you created for that mode.