In the article, How to Build a URL-Based Portlet, you learned how to create a portlet that displayed the content of a URL-based application. The example used in that article was Google.com. The PDK-URL Services also enables you to create URL-based portlets that display the content of URLs secured by SSL (Secure Sockets Layer protocol).
This article shows you how to create a URL-based SSL portlet. The example used in this article is the United Airlines website (https://www.ual.com).
You have successfully installed the PDK-Java runtime and samples by following the article Installing the PDK-Java Framework and Samples.
You have successfully installed the PDK-URL Services runtime and samples by following the article Installing the PDK-URL Services Samples.
For example, the jssl-1_2.jar file should be included in a line such as:
wrapper.classpath=C:\9iAS\jlib\jssl-1_2.jar
The location of this jar file on your file system may be different.
Note: http_client.jar, javax-ssl-1_2.jar, and jssl-1_2.jar are installed by default with Oracle9iAS Portal.
You must also make sure that the appropriate SSL library is configured in the operating system path.
Add njssl8.dll to the OS path. For example,
set path=%path%;$ORACLE_HOME/bin/njssl8.dll
Add libnjssl8.so to the LD_LIBRARY_PATH. For example,
setenv LD_LIBRARY_PATH ${ORACLE_HOME}/bin:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
This section explains how to create an XML provider definition for your URL-based portlet provider. You can configure provider-specific information like portlet title and portlet description in the XML file. This XML file is also where you specify the URL that gets displayed in your portlet.
You may use the sample below (you must change the httpProxyHost, httpProxyPort, httpsProxyHost and httpsProxyPort values to your own proxy server and port; if you do not need a proxy server then remove those tags). Note that the pageUrl tag specifies the URL that gets displayed in the portlet. Please refer to the article Understanding the provider.xml for PDK-URL Services for an explanation of the required XML tags and their functions.
<?xml version = '1.0' encoding = 'UTF-8'?> <?providerDefinition version="2.0"?> <provider class="oracle.portal.provider.v1.http.URLProvider">
<session>true</session>
<proxyInfo class="oracle.portal.provider.v1.http.ProxyInformation">
<httpProxyHost>www-proxy.us.oracle.com</httpProxyHost>
<httpProxyPort>80</httpProxyPort>
</proxyInfo>
<httpsProxyInfo class="oracle.portal.provider.v1.http.ProxyInformation">
<httpsProxyHost>www-proxy.us.oracle.com</httpsProxyHost>
<httpsProxyPort>80</httpsProxyPort>
</httpsProxyInfo>
<portlet class="oracle.portal.provider.v1.http.URLPortlet">
<id>1</id>
<name>UAL Home Page</name>
<title>UAL Travel Web Site</title>
<description>This portlet is to test Integration services using Secure UAL site</description>
<timeout>100</timeout>
<timeoutMessage>UAL timed out</timeoutMessage>
<showEdit>false</showEdit>
<showEditDefault>false</showEditDefault>
<showPreview>false</showPreview>
<showDetails>false</showDetails>
<hasHelp>false</hasHelp>
<hasAbout>false</hasAbout>
<acceptContentType>text/html</acceptContentType>
<registrationPortlet>false</registrationPortlet>
<accessControl>public</accessControl>
<renderer class="oracle.portal.provider.v1.RenderManager">
<showPage class="oracle.portal.provider.v1.http.URLRenderer">
<contentType>text/html</contentType>
<pageUrl>https://www.ual.com/</pageUrl>
<filter class="oracle.portal.provider.v1.http.HtmlFilter">
<headerTrimTag>/head></headerTrimTag>
<footerTrimTag>/BODY></footerTrimTag>
</filter>
</showPage>
</renderer>
<securityManager class="oracle.portal.provider.v1.http.URLSecurityManager">
<authorizType>public</authorizType>
</securityManager>
</portlet>
</provider>
|
Save the file as "provider.xml", making sure not to overwrite one of the PDK-Java or PDK-URL Services sample files of the same name.
Remember the name of the directory where the file is saved as you will need this later. For example: C:\ssl\provider.xml
These steps describe how to configure the Oracle HTTP Server only. If you are using a third party listener, please take the appropriate steps.
Stop the Oracle HTTP Server.
Open the configuration file zone.properties
Under the Servlet Aliases section, register an alias, ual, for a new instance of the Provider Adapter servlet. This servlet will use the XML provider definition you have just created.
For example, add the line:
servlet.ual.code=oracle.portal.provider.v1.http.HttpProvider
Under the Aliased Servlet Init Parameters section, add settings for the provider_root and sessiontimeout parameters, making sure that provider_root points to the directory where you saved your provider.xml file.
For example, add the line:
servlet.ual.initArgs=provider_root=C:\ssl,sessiontimeout=1800000,debuglevel=1
Note: If the debuglevel parameter is set to 1, you will activate a special "test page" feature which allows you to ensure that your provider is configured properly before you try and register it with a portal.
Save zone.properties.
Start the Oracle HTTP Server.
Access your provider's test page by entering into a browser the URL for the aliased servlet you just set up. For example:
http://host.domain:port/servlet/ual
Note: You will use this URL later when you register the provider on a portal.
Now that you have successfully tested your new alias. You will need to register a new provider that calls this alias. To perform these steps, go to the Oralce9iAS Portal Administrator tab, then click Add a Portlet Provider.
Register your new Provider:
Name: MySSLProvider
Display Name: My PDK-URL SSL Provider
Timeout: 100
Timeout Message: My PDK-URL SSL Portlet Timed Out
Implementation Style: Web
Provider Login Frequency: Never
URL: http://host.domain:port/servlet/ual
Click on OK.
Now add your new portlet to a page. Take note to view the title and description.
Now that you have successfully built your own SSL portlet using URL services, please look for future articles that will guide you through adding services to your portlet such as XML and HTML filtering, inline rendering of links, parameter passing, etc.
Here are some reference articles to help you better understand the architecture and technical details of PDK-URL Services:
Revision History:
November 2001