Click the Design tab to see the new form field that you just added

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. 7-6 Oracle Fusion Middleware Developers Guide for Oracle Portal For more information on the syntax of provider.xml, refer to the provider Javadoc on OTN: http:www.oracle.comtechnologyproductsiasportalhtmljavadocxml_tag_ reference_v2.html For example, if you want to render Preview mode, perform the following steps: 1. Edit the provider definition file, provider.xml and add the tag to activate Preview mode within the portletportlet tags: showPreviewtrueshowPreview 2. Specify the preview page to be the HTML page that you created in Section 7.2.1.2, Implementing Extra Show Modes : previewPagehtdocsmyportletMyPortletPreviewPage.htmlpreviewPage 3. Save the updates to provider.xml. 4. Redeploy your portlet. Refer to step 11 in Section 6.5.4, Deploying Your Oracle PDK-Java Portlet to an Application Server. . When you redeploy, Oracle JDeveloper automatically saves and compiles the code before deploying the portlet.

7.2.1.4 Viewing the Portlet

To view the new Show modes, you must ensure that your updated XML provider definition is re-parsed. To do this, perform the following steps: 1. Copy the HTML file you created in Section 7.2.1.2, Implementing Extra Show Modes and provider.xml to the WebLogic Server instance where you plan to deploy the portlet. 2. Refresh the provider. 3. Refresh the portal page containing your portlet. To view Preview mode, do the following:

1. Edit a page or create a new page and choose Add Portlet.

2. Navigate to the location of your provider in the Portlet Repository for example, Portlet Staging Area and find your portlet. Note the magnifying glass icon next to the portlet shown in Figure 7–3