Oracle9iAS
Portal Developer Kit
Installing
the PDK-URL Services v2 Samples
Welcome to PDK-URL Services. Now that you have successfully installed
the PDK-Java Framework and samples, you may want to create URL-based
portlets. PDK-URL Services has extended the PDK-Java to support
portlets created in any Web-based language. This article describes
how to install and configure the PDK-URL Services framework and samples.
REQUIREMENTS
- Oracle9iAS Portal 3.0.8.9.8 or later. Most features
of PDK-URL Services work with older versions, but is only certified
against this version of Oracle9iAS Portal. Certain features
such as authenticated portlets will not work on older versions of
Oracle9iAS Portal.
- PDK-Java 3.0.9 Version 2.
ASSUMPTIONS
- You have already successfully installed the PDK-Java Framework and
samples by following the article Installing the PDK-Java
v2 Framework and Samples. These samples use the PDK-Java v2 Framework.
CREATING YOUR EAR
AND WAR FILES
To deploy your PDK-URL Services sample provider, you must first assemble
a WAR file that contains the provider and all of its resources. Then
you must assemble an EAR file that contains that WAR file. The following
steps assume you have access to the template.ear file provided by PDK-Java
v2.
- Create a working directory for the EAR file (e.g. pdkurl_ear).
- Extract the template.ear file into your working directory ensuring
that file paths are also extracted.
- Create another working directory for the WAR file (e.g. pdkurl_war).
- Extract the template.war file into the second working directory
ensuring that file paths are also extracted.
- Copy urlservices.jar to the WEB-INF/lib directory of the extracted
WAR file.
- Create a subdirectory called urlsample under the WEB-INF/providers
directory for your provider. The name of the subdirectory is important
because that will be the service identifier for your provider.
- Place your provider definition file in the subdirectory you just
created.
- Make a copy of the WEB-INF/deployment/_default.properties file and
call it <serviceid>.properties (e.g., urlsample.properties).
The file you just copied will look something like this:
serviceClass=oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter
loaderClass=oracle.portal.provider.v2.http.DefaultProviderLoader
showTestPage=true
definition=providers/template/provider.xml
autoReload=true
Edit the "definition" entry so it points to the provider definition
file you copied over in Step 7. For example:
definition=providers/urlsample/provider.xml
- Zip up the contents of your working directory. Be careful to include
the subdirectory paths (but not the working directory itself). After
zipping the contents, rename the resulting file to <filename>.war
(e.g. pdkurl.war).
- Go to the working directory in which you extracted the template.ear
file (from Step 2).
- Open the META-INF/application.xml file. It should look like this:
<?xml version="1.0"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD
J2EE Application 1.2//EN" "http://java.sun.com/j2ee/dtds/application_1_2.dtd">
<application>
<display-name>Template Application</display-name>
<description>This is a template application</description>
<module>
<web>
<web-uri>template.war</web-uri>
<context-root>/</context-root>
</web>
</module>
</application>
- Change the value of the <display-name> and <description>
elements so that they reflect the display name of your application.
Change the value of the <web-url> element to the name of your
WAR file from Step 9.
- Copy the WAR file that was created earlier to the working directory
created in Step 2.
- Zip up the contents of this working directory. Be careful to include
the subdirectory paths (but not the working directory itself). After
zipping the contents, rename the resulting file to <filename>.ear
(e.g. pdkurl.ear).
DEPLOYING YOUR PROVIDER
ON OC4J
- Copy the .EAR file into your OC4J applications subdirectory. Usually,
this directory is: $IAS_HOME/oc4j/j2ee/home/applications
- Add the following to $IAS_HOME/oc4j/j2ee/home/config/server.xml:
<application name="{application name}" path="../applications/{ear
file name}" />
where {application name}
is the name of the application (e.g., pdkurl) and {ear file name} is the name of
your EAR file.
- Bind the web-app to the default site by adding the following to
$IAS_HOME/oc4j/j2ee/home/config/default-web-site.xml:
<web-app application="{application name}" name="{deployment
name}" root="/{application path}" />
where {deployment name}
is the name associated with this deployment of the application and
{application path} is
the relative URI for the application (e.g. pdkurl).
- Copy jssl_1-2.jar, javax-ssl_1_2.jar, and http_client.jar to the
OC4J library subdirectory. Usually, this directory is: $IAS_HOME/oc4j/j2ee/home/lib.
You can usually find jssl-1_2.jar and javax-ssl-1_2.jar in the $IAS_HOME/jlib directory
and you can find http_client.jar in the $IAS_HOME/lib
directory.
- If you have not done so already, start OC4J. Your application is
deployed automatically.
- Access the provider using the following URL:
http://{server}:{port}/{application
path}/servlet/soaprouter/{service id}
For example,
http://myhost.com:8888/pdkurl/servlet/soaprouter/urlsample
You should receive a test page informing you that the sample worked.
REGISTERING YOUR PROVIDER
After setting up the Web provider with the Oracle HTTP Server, you must
now register the provider with Oracle9iAS Portal before adding
the sample portlet(s) to your page.
If you are registering your provider on Oracle9iAS Portal 3.1,
the registration wizard includes fields for both the provider URL and
the service identifier (it will still include fields for name, display
name, description, etc., see the steps below). You should specify both
the URL and the service name. In the example test URL from the previous
section, you would specify the provider URL as http://myhost.com:8888/pdkurl/servlet/soaprouter
and the service id as urlsample.
For Oracle9iAS Portal 3.0.9, you must register the provider by
appending the service ID to the provider URL as shown below.
- On the Administer tab of Oracle9iAS Portal, click Add
a Portlet Provider within the portlet called Provider.
- Enter provider information for the sample.
- Name: URLSamples
- Display Name: PDK-URL Services Samples
- Timeout: 10
- Timeout Message: PDK-URL Services Samples Timed Out
- Implementation Style: Web
- Provider Login Frequency: Never
- Register on Remote Nodes: No
- URL: http://myhost.com:8888/pdkurl/providers/urlsample
(replace this with your URL)
- Check the following radio button: The user has the same
identity in the HTTP providers application as in the Single Sign-On
identity.
- Proxy: No (As long as no proxy is required to contact the
Provider Adapter).
- Click OK.
ADDING YOUR PORTLET TO
A PAGE
Add the PDK-URL Services samples to a page. The portlets are listed under
the provider called "PDK-URL Services Samples". Each portlet much be added
to a page individually.
Revision History:
·
January 2002