Guidelines for Mobile Portlets

6-12 Oracle Fusion Middleware Developers Guide for Oracle Portal pcbrowser, pdabrowser, or microbrowser cell phones. A portlet developer may use this attribute to adjust the responses layout or quantity of data.

6.1.4.6 Tailor Personalization Pages

A single portlet instance must maintain a single set of user personalizations spanning all devices, mobile and desktop. Therefore, the same personalization page appears even if the instance is shared between a standard and mobile page, and some fields apply only to one environment, desktop or mobile. In this situation, the portlet should identify these fields that pertain to only one environment. For example, a portlet might display a mobile-only section on its personalization page. Furthermore, because the mobile capability is configurable, a portlet could remove mobile-only references from its personalization page when it detects that the mobile functionality is disabled.

6.2 Introduction to Java Portlet Specification JPS and WSRP

Organizations engaged in enterprise portal projects have found application integration to be a major issue. Until now, users developed portlets using proprietary APIs for a single portal platform and often faced a shortage of available portlets from a particular portal vendor. All this changes with the introduction of the following standards: ■ Web Services for Remote Portlets WSRP ■ Java Portlet Specification JPS 1 based on JSR 168 These two standards enable the development of portlets that interoperate with different portal products, and therefore widen the availability of portlets within an organization. This wider availability can, in turn, dramatically increase an organizations productivity when building enterprise portals. WSRP is a Web services standard that enables the plug-and-play of visual, user-facing Web services with portals or other intermediary Web applications. Being a standard, WSRP enables interoperability between a standards-enabled container and any WSRP portal. WSRP defines the following: ■ Web Services Definition Language WSDL interface for the invocation of WSRP services ■ Markup fragment rules for markup emitted by WSRP services ■ The method to publish, find, and bind WSRP services and metadata JPS is a specification that defines a set of APIs to enable interoperability between portlets and portals, addressing the areas of aggregation, personalization, presentation, and security. JPS defines container services which provide the following: ■ A portlet API for coding portlet functionality ■ The URL-rewriting mechanism for creating user interaction within a portlet container ■ The security and personalization of portlets Oracle actively participates in the WSRP committee and is also a member of the expert group for JPS. 1 The Java Portlet Specification 1.0 arose from Java Specification Request 168 and the JSR168 Expert Group. Creating Java Portlets 6-13 The Relationship Between WSRP and JPS WSRP is a communication protocol between portal servers and portlet containers, while JPS describes the Java Portlet API for building portlets. Combining these standards enables developers to integrate their applications from any internal or external source as portlets with WSRP portals. Building portal pages becomes as simple as selecting portlets from the Oracle Portal repository. Figure 6–3 shows the architecture of the WSRP specification. Figure 6–3 WSRP Specification Architecture Since Oracle Portals existing architecture is so similar to the one specified by the WSRP committee, Oracle Portal is able to support communication between our portal and both the new Java Portlet APIs as well as our existing APIs PDK-Java. Figure 6–4 shows the architecture of the WSRP portal. Notice that the JPS-compliant portlet container uses the WSRP protocol for communication and the PDK-Java portlet container uses Oracles proprietary SOAP protocol for communication. Note: HTML forms can be submitted using either the get or post method, but the WSRP standard only requires the consumer portal to use the post method. Support of the get method is optional according to the standard. Since portal consumers are not required to support the get method, Oracle recommends that you use the post method when developing your portlets. Note: Figure 6–3 illustrates the use of JPS portlets with WSRP, but it should be noted that WSRP can also work with non-JPS portlets. 6-14 Oracle Fusion Middleware Developers Guide for Oracle Portal Figure 6–4 Oracle Portals WSRP Architecture

6.3 Building JPS-Compliant Portlets with Oracle JDeveloper

Using the JSR 168 Portlet Wizard in Oracle JDeveloper you can expose your portlet over WSRP quickly and easily. This section assumes the following: ■ You are familiar with portlet terminology such as portlet Show modes. See Chapter 1, Understanding Portlets and Section 6.1, Guidelines for Writing Java Portlets. ■ 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 This section contains the following subsections: ■ Section 6.3.1, Creating a JSR 168 Portlet ■ Section 6.3.2, Adding Portlet Logic to Your JSR 168 Portlet ■ Section 6.3.3, Deploying Your JSR 168 Portlet to the Oracle WebLogic Server ■ Section 6.3.4, Registering and Viewing Your JSR 168 Portlet ■ Section 6.3.5, Registering WSRP Producers in Enterprise Configurations

6.3.1 Creating a JSR 168 Portlet

This section walks you through the JSR 168 Java Portlet Wizard. You can choose which portlet Show modes you want to implement and the implementation method JSP, HTTP servlet, Java class, or HTML. The wizard then creates a simple sample implementation for each of the selected modes. The steps to create a portlet using the JSR 168 Java Portlet Wizard are as follows: 1. Start Oracle JDeveloper. 2. In the Application Navigator, expand the application under which you want to create your portlet.