In the Description field, enter a description for the security role, explaining the Click OK.

Creating Java Portlets 6-23 Figure 6–16 Initialization Parameters Page

40. Initialization parameters provide the Web application developer, who decides

what goes into the .war file, an alternative to JNDI variables for configuring the behavior of all of the different components of the Web application for example, servlets and portlets in a compatible way. These initialization parameters are added to the portlet.xml file. If you want to add an initialization parameter, click New. This adds a new row to the table of parameters. You can then double click the row to edit the details.

41. In the Name field, enter a unique name for the initialization parameter. Use only

letters, numbers, and the underscore character.

42. In the Value field, enter a default value for the parameter.

43. In the Description field, enter a description for the parameter.

44. To delete an initialization parameter, select it in the table and click Remove.

45. Click Next to display the Finish page.

46. Click Finish to generate the files for your portlet. The following files should be

generated for your project node in the Application Navigator see Figure 6–17 : ■ If you selected Generate JSP for the portlet modes, generated code for each mode If you selected Custom Code instead, that code will reside in the portlets Java class. ■ Two Java classes – packagename.portletname.java is invoked by the portlet container and contains all the methods required by the portlet standards Note: If your Portal is WSRP2 enabled, then the Portal Navigation Parameters page appears. Click Next to display the Finish page. 6-24 Oracle Fusion Middleware Developers Guide for Oracle Portal – packagename.portletnameBundle.java contains all the translation strings for the portlet ■ portlet.xml ■ oracle-portlet.xml ■ web.xml Figure 6–17 Application Navigator

6.3.2 Adding Portlet Logic to Your JSR 168 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.3.3 Deploying Your JSR 168 Portlet to the Oracle WebLogic Server

After you finish the wizard and successfully generate your portlet, you are ready to deploy it to the Oracle WebLogic Server. To create and deploy a WAR file, perform the following steps:

1. In the Application Navigator, right-click the project that contains your portlet and

select New. 2. In the New Gallery, expand General 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, webapp.

5. Click OK.

The Edit WAR Deployment Profile Properties dialog box opens. 6. Under Web Application’s Context Root, select Specify J2EE Web Context Root and enter the context root in the corresponding field, for example my-portlet.

7. Click OK.

The Project Properties dialog box opens. 8. Click OK.