Oracle WebCenter Technical Note ORACLEAS PORTAL 10g (10.1.4) INTEGRATE YOUR ENTERPRISE CONTENT MANAGEMENT SYSTEMS INTO ORACLE PORTAL April 2007
INTRODUCTION In many enterprise portal environments, it is important for enterprises to surface content from the external content stores that the company has adopted as its standard. In many cases, this content is located in high-end enterprise content management systems such as Oracle ContentDB, Stellent, and other systems with similar capabilities. How can this content be seamlessly surfaced in Oracle Portal? This paper introduces one very effective way of solving this problem: Leverage Oracle WebCenter. Oracle WebCenter provides powerful capabilities to integrate content from several different content management systems, including Oracle Content DB, Stellent, Documentum, Microsoft Sharepoint, IBM Lotus Domino, and file systems, as well as Oracle Portal, into JSF/ADF Faces applications. The easiest way to build these contentcentric applications is to use the JCR (Java Content Repository) based content data control. The content data control abstracts the complex JCR API to several, easy-to-use content operations that are tightly integrated with ADF components and allow for a wizard-driven, drag-and-drop development experience. Now that building content-centric applications in WebCenter is so easy, the next logical step is to directly leverage these development efforts in an enterprise portal such as Oracle Portal without having to modify a single line of application code. Oracle WebCenter provides the JSF Portlet Bridge, which allows you to take an existing WebCenter application and deploy it as a standards-based portlet that can be directly consumed in Oracle Portal and any other enterprise portal that supports the WSRP standard. The JSF Portlet Bridge provides the mechanism that permits the same application to be accessed in two different ways: As a standalone JSF/ADF Faces WebCenter application As a portlet producer that exposes this same application as a portlet The same deployed J2EE application can be accessed both as a portlet in a portal page and as an application in a browser. This technote explains how to take an existing WebCenter application that surfaces content from Oracle Content DB, and expose it as a portlet in Oracle Portal. ASSUMPTIONS AND PREREQUISITES The assumption is that an existing content-centric WebCenter application is available to be portletized. You can create such an application by following the instructions of the Integrating Content from a JCR 1.0 Repository viewlet that is provided on the Oracle WebCenter Demos and Samples page on OTN. Figure 1 shows an application that is similar to one created in the viewlet. 2
Figure 1 A sample WebCenter application More information on how to build content-centric applications in Oracle WebCenter can be found in the Oracle WebCenter Developer s Guide, as well as the Oracle WebCenter Tutorial. EXPOSE THE APPLICATION AS A PORTLET The JSF/ADF Faces application can be portletized using the JSF Portlet Bridge feature of Oracle WebCenter. In accomplish this, you need to perform two simple steps in JDeveloper: add a library and create a portlet deployment descriptor, as described below. 1. In the ViewController project that contains the application s.jspx page, edit the project properties. Figure 2 - Project Properties 2. In the Libraries section of the Project Properties dialog, click Add Library and select the Portlet Faces Bridge library. 3
Figure 3 - Add Portlet Faces Bridge library 3. Also in the ViewController project, add a new portlet.xml deployment descriptor. Select File > New to bring up the New Gallery. At the top, set Filter By to All Technologies. Now select portlet.xml from General > Deployment Descriptors. Figure 4 - Add portlet.xml to the project 4. Edit the newly added portlet.xml file to configure it. You can find it in your project under the WEB-INF directory. 4
Figure 5 - Portlet.xml in the project hierarchy 5. Replace the portlet.xml file content with the following XML code: <?xml version="1.0" encoding="iso-8859-1"?> <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portletapp_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/portlet/portl et-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portletapp_1_0.xsd"> <portlet> <description>veeva CDB Portlet</description> <portlet-name>veevacdbportlet</portlet-name> <display-name>veeva CDB Portlet</display-name> <portletclass>oracle.portlet.server.bridges.jsf.facesportlet </portlet-class> <init-param> <name>defaultpage.view</name> <value>/veeva.jspx</value> </init-param> <init-param> <name>bridgelifecyclelisteners</name> <value> oracle.portlet.server.bridges.jsf.adf.adffacesbridgelifecycl elistener, 5
oracle.portlet.server.bridges.jsf.adf.bindingfacesbrid gelifecyclelistener </value> </init-param> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> </supports> <supported-locale>en</supported-locale> <portlet-info> <title>veeva CDB Portlet</title> <short-title>veevacdbportlet</short-title> </portlet-info> </portlet> </portlet-app> The most important parameter in this XML configuration file is DefaultPage.view. It must be set to the application.jspx page that you want to expose as a portlet. Be sure to retain the forward slash (/). In this example, the veeva.jspx page would be executed when the portlet is displayed on a portal page. You will probably want to modify other tags in the portlet.xml, such as <title> and <description>, as indicated by the highlighted text. Now all the required steps have been performed to prepare the application to be exposed as a portlet. And we did not touch any application code! Note: You can find similar portlet.xml code in the JSF Portlet Bridge section of the Oracle WebCenter Framework Developer s Guide. PORTLET DEPLOYMENT The deployment process to deploy the application as a portlet is exactly the same as if the application is deployed stand alone. 1. In the ViewController project in JDeveloper, add a new WebCenter Application WAR Deployment Profile by selecting File > New. Note that no other deployment profile type should be used for the deployment of WebCenter applications. 6
Figure 6 - WebCenter deployment profile 2. Create a new application server connection to the OC4J instance that you are planning to deploy to. Test the connection to make sure that it works. Figure 7 - New application server connection 3. Double-click the WebCenter Application WAR Deployment Profile to edit it. 7
Figure 8 - Deployment profile in the project hierarchy 4. In the General options of the Deployment Profile, specify the Enterprise Application Name and the J2EE Web Context Root. For simplicity, both values should be the same. Figure 9 - Deployment profile configuration 5. In the Platform Settings of the Deployment Profile, select the previously created application server OC4J connection as the Target Platform, and click OK to apply the configuration changes. Now you are ready to deploy the application. 6. Right click the Deployment Profile and select Deploy to > Application Server Connection. Note that this is the simplest case where a one-click deployment is sufficient. A more complex application might need to be modified with the predeployment tool. For more information, refer to the Deployment chapter of the Oracle WebCenter Developer s Guide. 7. To run the deployed application, enter this URL in your browser, for example: http://<oc4j instance>:<port>/veeva/faces/veeva.jspx 8
8. To consume the same application as a portlet, you first need to obtain the URL of the producer. In your browser, enter the URL similar to the one below to display the WSRP Producer Test Page. http://<oc4j instance>:<port>/veeva/info Figure 10 - WSRP Producer Test Page 9. To consume the portlet in Oracle Portal, you need the WSRP v1 WSDL endpoint: http://<oc4j instance>:<port>/veeva/portlets/wsrp1?wsdl WSRP v1 is the production standard of WSRP. WSRP v2 is an early version of the future WSRP 2.0 standard. PRODUCER REGISTRATION IN ORACLE PORTAL 1. The final step is to register the WSRP portlet producer in Oracle Portal. In Oracle Portal, go to Administer > Portlets > Register a Provider. 2. Provide the Name and Display Name, and select WSRP as the Implementation Style. 3. In the next step, provide the WSRP WSDL URL from step 9 (above), and then register the provider: http://<oc4j instance>:<port>/veeva/portlets/wsrp1?wsdl 4. Now the portlet is ready to be added to a portal page. When adding the portlet, look for the producer in the Portlet Repository under the Portlet Staging Area. 9
Figure 11 Success! The same application exposed as portlet on a portal page RESTRICTIONS For a list of restrictions regarding the JSF Portlet Bridge, refer to the Guidelines for Oracle ADF Faces Applications section of the Oracle WebCenter Framework Developer s Guide. In addition, the application that you portletize should not contain portlets. RELATED MATERIAL Oracle Portal Center on OTN Oracle Portal Documentation Oracle WebCenter Documentation Oracle WebCenter Home Page on OTN Oracle WebCenter Demos and Samples 10
Oracle Application Server Portal (10.1.4) - Integrate your Enterprise Content Management Systems into Oracle Portal April 2007 Author: Christian Hauser Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065 U.S.A. Worldwide Inquiries: Phone: +1.650.506.7000 Fax: +1.650.506.7200 www.oracle.com Copyright 2007, Oracle. All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.