Oracle Applications Capability

India Delivery Center

Oracle Application Server Portal – J2EE Integration
By Gopinath Ganesan


• Oracle AS Portal Architecture • Why use JSP in Oracle Portal? • Requirements for JSP in Portal • Java Portal Development Kit (JPDK)
- Installation & Configuration

Convert JSP to Portlets Information Resource

Portal Architecture

Oracle9i Application Server Oracle HTTP Server mod_oc4j Oracle9iAS Portal Parallel Page Engine Web Provider

Client Portal Cache Oracle9iAS Web Cache mod_plsql Portal Repository

DB Provider

Process Flow of Portal Architecture
HTTP Request

HTTP Server

Mod_PLSQL Mod_oc4j DB Provider PPE / Portal Cache

Web Provider HTTP Response

Why Use JSP in Oracle Portal ?

They add functionality to Portal that cannot be achieved by native Portal Examples: Export to other formats (MS Word, Excel) Java Charts

Some JSP applications are compatible than native Portal applications pertaining the requirements . Java code is portable (to other application servers)

Requirements for JSP in Portal

– Oracle Database Server 8.1.6 or higher installed – Oracle 9iAS Portal 3.0.6 or higher installed – Oracle Portal Development Kit for Java (JPDK) • Does not come with Portal by default • Needs to be downloaded from Oracle Technet, installed, and configured. • URL :

Java Portal Development Kit (JPDK)

The JPDK is the framework for integration of Java/JSP into Oracle9iAS Portal – Use it to develop JSP Portlets and services on any platform that take advantage of the Oracle9iAS Portal platform. – The PDK is regularly updated to provide you with the latest tools and techniques. – Good info at:

Downloading the PDK - Installation

• • • • • • • •

Go to Portal Studio ( Click on “Download the Latest PDK” Accept the license terms Download Unzip it to a directory (i.e.. C:\oracle\pdk) Under pdk you’ll find a jpdk directory Extract into a directory (i.e.. C:\jpdk) Click on installing.jpdk.html for instructions.

PDK - Configuration
• Requires Editing 2 primary 9iAS Property Files  JSERV & ZONE 1) 9iAS / Apache / Jserv / conf / Add the following lines in the last: wrapper.classpath = C:\ jpdk \ lib\ provider. jar wrapper.classpath = C:\ jpdk \ lib\ samples. jar Save the file and close. 2) 9iAS / Apache / Jserv / servlets / Under Servlet Aliases add the following line: Servlet.sample.code=oracle.portal.provider.v1.http.HttpProvider Under Aliased Servlet Init Parameters add: servlet.sample.initArgs=provider_root=C:\jpdk\providers\sample,sessio ntimeout=1800000,debuglevel=1 Save the file and close.

PDK - Configuration

3) Go to C:\jpdk\ htdocs  Copy all the subdirectories into your default JSP Directory in 9iAS: C: \ 9iAS Apache \ Apache \ htdocs Create a folder called jpdk under the above location and place the copied files into this: C: \ 9iAS Apache \ Apache \ htdocs \ jpdk 4) Edit Provider.XML file C:\ jpdk \ providers \ sample \ provider.xml Replace physical root path to :
C: \ 9iAS \ Apache \ Apache \ htdocs \ jpdk \ Save the file and close. 5) Restart the Oracle HTTP Server to accept all the changes.

In order to check the JPDK configuration access the url: Output should be GUI SAMPLE:

Convert JSP To Portlets
Configuring JSP Application in 9iAS Server 1) • Create a JSP application For example, existing “application,” which consisted of 2 Sample JSP’s – Date.jsp – Emp.jsp Create a provider.xml file Copy samplejspprovider.xml from the C:\jpdk\providers directory Edit the tags where appropriate. Refer to Portal JPDK reference for complete XML tag reference Available at: Stop Oracle 9iAS services. Make entries in file

2) • • •

3) 4)

Add the following lines at the end servlet.JSPDemo.code=oracle.portal.provider.v1.http.HttpProvider servlet.JSPDemo.initArgs=provider_root=C:\WebSites\JSP,sessiontimeout=1 800000,debuglevel=1 Note – if you leave off debuglevel=1, you’ll receive a “Forbidden” message Logical path (JSPDemo) and Location of provider.xml file (c:\Websites\JSP) is all you need to change

1. 2.

Start the Oracle 9iAS Services. Access the URL : Output should be : Providers Test Page with demo JSP Applications along with the Configured Custom JSP’s i.e. Date.JSP & Emp.JSP

Steps To Integrate Custom JSP Pages To Portal
1) Login into 9iAS Portal as PORTAL ADMIN USER. 2) Add JSP as a Portlet Provider : Administer Tab  Add Portlet Provider. GUI Sample for step 2 :

3) Give the Provider information such as Name : JSPDemo / Display Name : MyFirstJSP / Timeout Message : Demo Application Time out / Implementation Style : Web Login Frequency : Once Per User Session URL : http :// GUI Sample for Step 3 :

4) Go to the region of the portal page where portlet is supposed to be added and click “ADD PORTLET” icon. 5) You can fine the custom JSP portlets in the available portlets listing from the Portal Repository, move the same towards the “SELECTED PORTLETS” area. GUI Sample for step 5 :

6) Final Result is Portal Page created with 2 custom JSP Portlets integrated. GUI for Final Result :

Resources for Oracle 9iAS Portal - J2EE integration methodologies
•  Java  Building Java Portlets.  Technology Centers  Java Technology Center Top Technical Docs  Oracle Containers for J2EE (OC4J)