Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Create a JSF Portlet with Oracle WebCenter Suite and JDeveloper : Page 4

A portal provides users with a unified presentation of portlets generated from disparate data sources. Learn how to develop a JSF portlet with JDeveloper and run it in Oracle's WebCenter Framework.


advertisement
Registering the Portlet as a WSRP Producer
WSRP defines a set of interfaces that standardize interactions between portlet components and a user application. The portlet components generate markup that the user application consumes. Before consuming a portlet in a WebCenter application page, you must obtain a WSDL and then register a WSRP Producer for the portlet with the application. You can obtain the WSDL URLs from the URL http://localhost:6688/portletsApp/info, port 6688 being the HTTP port (see Figure 5).

Click to enlarge

Figure 5. WSRP Producer Test Page:
You can obtain the WSDL URLs from http://localhost:6688/portletsApp/info, port 6688 being the HTTP port.

The WebCenter Framework provides a WSRP Producer Registration wizard (see Figure 6), which you will use to register a WSRP Producer with the WebCenter application for the JSF portlet. Select the ViewController project and choose File->New. In the New Gallery wizard, select Web Tier->Portlets and then WSRP Producer Registration. Click OK. This will start the WSRP Portlet Producer Registration Wizard. Click Next. Specify a name for the WSRP Producer and click Next again.



Obtain the WSDL URL for the JSF portlet application from the WSRP Producer Test Page, and specify that URL in the URL Endpoint field. Click Next. Leave the execution timeout for the producer as the default value and click Finish. You have now registered the WSRP Portlet Producer with the WebCenter application, as well as added it to the application (see Figure 6).

Click to enlarge

Figure 6. WSRP Portlet Producer:
You have now registered the WSRP Portlet Producer with the WebCenter application.

Adding a Portlet to a JSF Page
Portlets registered with a WebCenter application using a WSRP Portlet Producer become available in the Component palette. In this section, you will add the JSF portlet to a JSF page. Select the ViewController project and select File->New. Select Web Tier->JSF->JSF JSP and click OK. To enable page customizations, create the WebCenter application JSF page as a .jspx document instead of a JSP document. Click Next. In the Component Binding window, select Do Not Automatically Expose UI Components in a Managed Bean and click Next. In the Tag Libraries window, select the ADF Portlet Components library, which is required to add portlets to a JSF page. If you require page customizations, select the Customizable Components Core library. Customizable components are JSF components such as PanelCustomizable and ShowDetailFrame that add additional features such as layout, scrollbar, provision to maximize, minimize to the JSF page, etc. Click Next.

Next, add the JSF portlet that you generated earlier to the JSF page. Position the cursor in the PortletsPage.jspx page, select WsrpPortletProducer1 in the Component Palette, and then choose the DataTable Portlet. The DataTable Portlet gets added to the JSF page just like any other JSF component would.

A portlet on a JSF page is represented with the adfp:portlet tag, in which you can specify additional attributes such as height, width, icon, isMaximizable, isMinimizable, isMovable, inlineStyle, background, and displayScrollBar. Next, run the WebCenter application JSF page by right-clicking PortletsPage.jspx and selecting Run. The JSF DataTable portlet will display (see Figure 7). You can also add multiple portlets to a JSF page.

Click to enlarge

Figure 7. JSF Portlet:
Run the WebCenter application JSF page by right-clicking PortletsPage.jspx and selecting Run.

Next, specify a SQL query statement in the SQL input field, and click the Create Data Table button. A data table will display with the Oracle database as the data source (see Figure 8).

Click to enlarge

Figure 8. DataTable Portlet:
A data table will display with the Oracle database as the data source.

You're done! Your JSF portlet is running in a WebCenter application, using an Oracle database as the data source and relying on a data table.



Deepak Vohra is an O'Reilly technical reviewer, who reviewed the book WebLogic: The Definitive Guide. He's also a NuBean consultant and web developer, and is a Sun Certified Java 1.4 Programmer and Sun Certified Web Component Developer for J2EE.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap