Oracle9iAS Portal Developer Kit
Installing the Multipage Form Portlet Sample

Now that you have successfully installed the PDK-Java Framework and Samples, you may now want to build portlets that pass parameters from on JSP to another JSP and render each result in the same portlet container (window). This portlet sample is implemented as a JSP and displays a portlet that asks the user to complete a survey. The survey takes place over two JSPs and displays information based on the user's answers in the third JSP. The information from the second and third JSP is displayed in the same portlet container as the original JSP. This article describes how to install and view the Multipage Form Portlet sample.

### ASSUMPTIONS

1. You have already successfully installed PDK-Java Framework and Samples by following the Installing the PDK-Java Framework and Samples article.

2. You have already download and extracted the sample into the following directory: D:\pdk\jpdk\providers\multipageform\. This article assumes that you are using the directory specified. For other directories, simply adjust as needed.

### CONTENTS

- Installing the Multipage Form Portlet Sample (this article).

- provider.xml - XML provider definition that points to the first JSP (Page1.jsp).

- Page1.jsp - First page of survey.

- Page2.jsp - Second page of survey.

- Page3.jsp - Survey results.

### SETUP

Note: It is important to backup all files prior to making changes. This section will update one Oracle9iAS HTTP Server configuration files (zone.properties and jserv.properties).

### Configure the Multipage Form Portlet Sample

1. Stop the Oracle9iAS HTTP Server.

2. Under the D:\pdk\jpdk\providers\multipageform directory is another directory called multipageform. Copy this directory under your document root for Oracle9iAS.

   > For example: D:\Oracle9iAS\Apache\Apache\htdocs\

   > becomes

   > D:\Oracle9iAS\Apache\Apache\htdocs\multipageform

   So, under D:\Oracle9iAS\Apache\Apache\htdocs\multipageform, you should have four files: Page1.jsp, Page2.jsp, Page3.jsp, and UserInfo.class.

3. Open the zone.properties file. This document uses the root zone which has a virtual path of "/servlets". For manageability, you may choose to use a different zone.

4. Under the Servlet Aliases section, add the alias that points to the Provider Adapter:

   servlet.multiform.code=oracle.portal.provider.v1.http.HttpProvider

5. Under the Aliased Servlet Init Parameters section, add the initial arguments needed by the sample. This points the Adapter (sample) to the location of the provider.xml file. Make sure to modify the directory to point to the correct location of the provider.xml file.

   servlet.multiform.initArgs=provider_root=D:\pdk\jpdk\providers\multipageform,sessiontimeout=1800000,debuglevel=1

4. Save and close the zone.properties file.

### Updating the XML provider definition

The sample includes a XML provider definition called provider.xml. You will need to modify the physicalRoot and provide the correct location of your document root.

1. Open the provider.xml file. It is location in D:\pdk\jpdk\providers\multipageform.

2. Edit the physical root to point to your document root. Currently, this provider.xml combines the physicalRoot and appRoot tags to point to the following directory: D:\ORACLE9iAS\Apache\Apache\htdocs\multipageform.

   You should not need to modify the appRoot tag if you have a directory called multipageform below your document root.

> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?providerDefinition version="2.0"?> <!DOCTYPE provider [ <!ENTITY virtualRoot "/"> <!ENTITY physicalRoot "D:\ORACLE9iAS\Apache\Apache\htdocs\"> ]> <provider class="oracle.portal.provider.v1.http.DefaultProvider"> <session>true</session> <useOldStyleHeaders>false</useOldStyleHeaders> <portlet class="oracle.portal.provider.v1.http.DefaultPortlet"> <id>1</id> <name>MultipageFormPortlet</name> <title>Multipage Form Portlet</title> <description>This portlet sample displays parameter passing from one JSP to another in the same portlet window.</description> <timeout>30</timeout> <timeoutMessage>Multipage Form Portlet timed out</timeoutMessage> <acceptContentType>text/html</acceptContentType> <defaultLocale>en.US</defaultLocale> <renderer class="oracle.portal.provider.v1.RenderManager"> <appPath>&virtualRoot;multipageform</appPath> <appRoot>&physicalRoot;multipageform</appRoot> <contentType>text/html</contentType> <charSet>UTF-8</charSet> <renderContainer>true</renderContainer> <renderCustomize>false</renderCustomize> <showPage>Page1.jsp</showPage> <pageParameterName>next_page</pageParameterName> </renderer> </portlet> </provider>

3. Save and close the provider.xml file.

### Testing the sample

You can test that you have properly setup the sample by using Oracle9iAS.

1. Start the Oracle9iAS HTTP Server

2. Execute the sample from the Oracle9iAS listener. This refers to the Oracle9iAS listener where you configured your sample.

   For example: http://myserver.mydomain.com:port/servlet/multiform

3. You should receive a test page informing you that the sample worked. If you did not receive the test page, verify that you can execute standard servlets using Oracle9iAS. Then, verify all the steps within the SETUP section.

### Registering the Provider

After setting up the Web Provider with the Oracle9iAS HTTP Server, you can now register the provider with Oracle9iAS Portal.

1. Under the Administer tab, click on Add a Portlet Provider within the portlet called Provider.

2. Fill out Provider information for the Sample. Leave other entries as default.

   1. Name: MultiPageFormProvider

   2. Display Name: Multipage Form Provider

   3. Timeout: 40

   4. Timeout Message: Multipage Form Provider Timed Out

   5. Implementation Style: Web

   6. Register on Remote Nodes: No

   7. Provider Login Frequency: Once per User Session

   8. URL: http://myserver.mydomain.com:port/servlet/multiform (replace this with your URL)

   9. Check the following radio button: The user has the same identity in the HTTP providers application as in the Single Sign-On identity.

   10. Proxy: No (As long as no proxy is required to contact the Provider Adapter).

3. Click OK.

### Add Portlet to a Page

1. Add the Multipage Form portlet to your page. The portlet will be listed under the Provider called "Multipage Form Provider". Use and extend this sample for your own JSP application.

Revision History:

- February 28, 2002.