Click Next to display the Public Portlet Events page

6-40 Oracle Fusion Middleware Developers Guide for Oracle Portal

6.5.2 Adding Portlet Logic to Your Oracle PDK-Java Portlet

After you create the default implementation of your portlet, you can extend the sample code with your own business logic to implement the desired functionality and features. See the JPS or Javadoc for more information on adding functionality and features.

6.5.3 Validating Your Oracle PDK-Java Portlet and Provider

After you have built your portlet, you need to check the configuration to ensure that the portlet and its provider operate correctly. To validate your portlet and provider: 1. In Oracle JDeveloper, open the project you created in the previous sections. 2. In the Application Navigator, right-click the index.jsp file for you portlet and select Run. Your browser opens a page similar to the one shown in Figure 6–31 . Figure 6–31 Portlet Application Test Page

3. Click the link underneath Service Name.

Your browser opens with a page similar to the one shown in Figure 6–32 . Note that you need the URL from this page to register your provider, which is the next task. Note: This procedure is for testing purposes only. After this procedure, you still need to register your provider as described in Section 6.5.5, Registering and Viewing Your Oracle PDK-Java Portlet . For development and production, you should always deploy your portlet to an application server as described in Section 6.5.4, Deploying Your Oracle PDK-Java Portlet to an Application Server . Creating Java Portlets 6-41 Figure 6–32 Provider Test Page

6.5.4 Deploying Your Oracle PDK-Java Portlet to an Application Server

After you finish the wizard and successfully generate your portlet, you are ready to deploy it to the Oracle WebLogic Server WLS. The following sections describe how to deploy an Oracle PDK-Java portlet to WLS. To create and deploy the WAR file: 1. In the Application Navigator, right-click the project that contains your portlet and select New.

2. In the New Gallery, expand the General category and select Deployment Profiles.

3. In the Items list, select WAR File and click OK. The Create Deployment Profile --

WAR File dialog box opens. 4. In the Deployment Profile Name field, enter a meaningful name for the deployment profile for example, myj2eeportlet.

5. Click OK. The WAR Deployment Profile Properties dialog box opens.

6. Under Web Application’s Context Root, select Specify Java EE Web Context Root

and enter the context root in the corresponding field, for example myj2eeportlet1.

7. Select the Contributors node under WEB-INFlib.

8. Select Portlet Development.

9. Click OK. The Project Properties dialog opens.

10. Click OK.

11. In the Application Navigator, right-click your project and select Deploy, then

select the deployment profile, next select to, and finally select the application server connection to which you want to deploy the portlet.

12. When the Deployment Finished message displays in the Deployment Log at the

bottom of Oracle JDeveloper, verify that no errors occurred. 13. Construct the URL for your portlet as follows: http:host:portcontext-rootproviders