Oracle9iAS Portal Developer Kit
How to Build a URL-Based Portlet with Inline Rendering of Portlet Links

PDK Release 2 (9.0.2 and later)

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. Since many URL-based applications (including Google.com) display links inside their HTML, you may find it desirable to have these links render inside the portlet container. For example, when you click on a link, you may want to see the portlet render again displaying the destination page as its content (as opposed to seeing the whole browser window display the destination page). The PDK enables you to implement inline rendering as a feature for your URL-based portlets.

This article describes how to build a URL-based portlet that renders its portlet links inside the portlet container. It extends the Google.com sample found in the article How to Build a URL-Based Portlet.

### ASSUMPTIONS

1. You have successfully installed the PDK framework by following the article Installing the PDK Framework and Samples.
2. You understand the steps required to display a URL-based portlet on a portal page. Refer to the article Installing the URL-Based PDK Samples.

### CREATING AN XML PROVIDER DEFINITION

Using a text editor, create an XML file for your portlet provider. Use the inputParameter tag to specify the parameters that this portlet will pass to the URL. You may use the sample XML file below (you must change the httpProxyHost and httpProxyPort values to point to your own proxy server and port). Please refer to the article Understanding provider.xml for URL-Based Portlets for an explanation of the required XML tags and their functions.

After you have created the file, save it somewhere on your file system and call it "provider.xml".

>     <?xml version = '1.0' encoding = 'UTF-8'?>
>     <?providerDefinition version="3.1"?>
>        <provider class="oracle.portal.provider.v2.http.URLProviderDefinition">
>        <providerInstanceClass>oracle.portal.provider.v2.http.URLProviderInstance</providerInstanceClass>
>        <session>true</session>
>        <proxyInfo class="oracle.portal.provider.v2.ProxyInformation">
>           <httpProxyHost>www-proxy.us.oracle.com</httpProxyHost>
>           <httpProxyPort>80</httpProxyPort>
>        </proxyInfo>
>        <portlet class="oracle.portal.provider.v2.http.URLPortletDefinition">
>           <id>1</id>
>           <name>Google.com Portlet</name>
>           <title>Google.com Portlet</title>
>           <description>Display Google.com as a portlet.</description>
>           <timeout>100</timeout>
>           <timeoutMessage>Timed out waiting for Google.com Portlet.</timeoutMessage>
>           <acceptContentType>text/html</acceptContentType>
>           <showEdit>false</showEdit>
>           <showEditToPublic>false</showEditToPublic>
>           <showEditDefault>false</showEditDefault>
>           <showPreview>false</showPreview>
>           <showDetails>false</showDetails>
>           <hasHelp>false</hasHelp>
>           <hasAbout>false</hasAbout>
>           <renderer class="oracle.portal.provider.v2.renderRenderManager">
>              <contentType>text/html</contentType>
>              <showPage class="oracle.portal.provider.v2.render.http.URLRenderer">
>                 <contentType>text/html</contentType>
>                 <charSet>ISO-8859-1</charSet>
>                 <pageUrl>http://www.google.com</pageUrl>
>                 <filter class="oracle.portal.provider.v2.render.HtmlFilter">
>                    <headerTrimTag>&lt;body</headerTrimTag>
>                    <footerTrimTag>/body></footerTrimTag>
>                    <inlineRendering>true</inlineRendering>
>                 </filter>
>              </showPage>
>           </renderer>
>        </portlet>
>     </provider>

### DEPLOYING YOUR PROVIDER ON OC4J

To configure and deploy your provider on OC4J, please see the section called "Deploying Your Provider on OC4J" in the article, How to Build a URL-Based Portlet.

At this point, you are ready to register your provider and then add your new portlet to a page. Please follow the appropriate steps for doing this as described in the Installing the URL-Based Portlet Samples article.

Now that you have successfully created URL-based portlet that uses HTML filtering, please look for other portlet development articles that describe how to add extra features to your portlet, including single sign-on to external URL-based applications, XML filtering and more.

Here are some reference articles to help you better understand the architecture and technical details of URL-based portlets:

> - A Primer on URL-Based Portlets
> - Understanding the PDK Runtime for URL-Based Portlets
> - Understanding the provider.xml for URL-Based Portlets

Revision History:

- January 2002