0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; } obj.visibility=v; } } //Define function to show one layer and hide others: function show(whichLayer) { if(layerDisp) { showHide(layerDisp,'','hide'); } showHide(whichLayer,'','show'); layerDisp = whichLayer; } //Define function to keep score and display feedback: function Engine(question, answer, layerSuffix) { if (answer != ans[question]) { show('incorrect'+layerSuffix); } else { if (!done[question]) { score++; } show('correct'+layerSuffix); } done[question] = -1; } //Define function to verify answer for checkbox: function checkAnswer(question, whichform, whichbox) { var checkTotal = 0; with (whichform) { for (i = 0; i < whichbox.length; i++) { if (whichbox[i].checked == true) { checkTotal = checkTotal + eval(whichbox[i].value); } } } Engine(question,checkTotal,question*10); } //Define function to show correct answer for checkbox: function showAnswer(question, whichform, whichbox) { var residue = ans[question]; var currAnswer = 1; if(layerDisp) { showHide(layerDisp,'','hide'); } with (whichform) { for (i = 0; i < whichbox.length; i++) { if ((residue>0) && (residue%(currAnswer*2)==currAnswer)){ whichbox[i].checked = true; residue-=currAnswer; } else { whichbox[i].checked = false; } currAnswer*=2; } } } //Define function to init a form function clearForm(form) { //Set all checkboxes and radio buttons on form to unchecked: for (xx=0; xx < form.elements.length; xx++) { if (form.elements[xx].type == 'checkbox' | form.elements[xx].type == 'radio') { form.elements[xx].checked = false; } } } //Define function to init all forms on reload: function InitForm() { clearForm(document.form1) clearForm(document.form2) clearForm(document.form3) } // End --> function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i

Migrating from URL-Based Portlets to Web Clipping Portlets

Purpose

This lesson explains how to migrate existing URL-based portlets to Web Clipping portlets.

Topics

This lesson covers the following topics:

 Overview
 Prerequisites
 Installing the OracleAS PDK URL-Based Sample Portlets
 Testing the Deployment of the URL Provider
 Registering the Provider for URL-Based Portlet Samples
 Adding a URL-Based Sample Portlet to a Portal Page
 Registering the Web Clipping Provider
 Running the Migration Tool
 Updating the Provider Registration
 Accessing the Migrated Portlets
 Summary
 Related Topics

Viewing Screenshots

Move your mouse over this icon to see all images on the page Place the cursor on this icon to display all screenshots. You can also place the cursor on each icon to see only the screenshot associated with it.

Overview

Back to Topic List

OracleAS Portal provides two ways to integrate content from different Web sites into a centralized portal environment:

bullet   URL-based portlets, which are implemented by using a manual, XML file-based approach

bullet   Web Clipping, which provides a declarative approach to Web content integration

The OracleAS PDK URL-based portlet framework, a part of the Oracle Application Server Portal Developer Kit (OracleAS PDK), enables you to create portlets by accessing existing content by using URLs. This utility enables you to declaratively publish both secured and public Web content as portlets. The OracleAS PDK simply takes the URL of an application, parses the content, and uses the OracleAS PDK-Java framework of OracleAS Portal to create a URL-based portlet.

Web Clipping is a comprehensive suite for Web application integration that enables clipping and scraping of Web content. The Web Clipping portlet, which is installed as part of OracleAS Portal, enables page designers and content contributors to easily compose rich pages by visually selecting portions of existing Web content and presenting them as portlets. Web Clipping enables you to aggregate content from numerous Web sites into a centralized portal environment. You can clip sections of HTML code, as well as non-HTML components such as applets or JavaScript, on a Web page and render the clipped sections as Web Clipping portlets.

The OracleAS PDK 9.0.4.0.2 provides the URL-based Portlets Migration Kit to enable portal administrators to migrate their existing URL-based portlets to Web Clipping portlets. Web Clipping is built upon a robust architecture and supports all the features and functions available with URL-based portlets. The advantages of migrating from URL-based portlets to Web Clipping portlets include:

bullet   Single and straightforward method to publish Web content

bullet   Ability to leverage the Web Clipping features to the migrated portlets

bullet   Simple method to create portlets declaratively

bullet   Intuitive user interface for business users when they need to edit the clipped Web content

Prerequisites

Back to Topic List

Before starting this lesson, complete the following tasks:

1. Complete the Installing the Oracle Application Server 10g Infrastructure lesson.
2. Complete the Installing the Oracle Application Server 10g Portal and Wireless lesson.
3 . Register the OracleAS PDK Java 9.0.4.0.2 sample providers on an OracleAS Portal instance by following the instructions provided in the Installing the PDK-Java Framework and Sample Providers article.
4. Upgrade to Portal Tools 9.0.4.0.2 or later releases by following the instructions provided in the Portal Tools: Upgrading to Release 9.0.4 and later article. The OracleAS PDK 9.0.4.0.2 includes new features for OmniPortlet and Web Clipping, such as new data sources and layouts, external application integration, inline rendering of links and forms, and URL-based Portlets Migration Kit.

Note: You must have access to the command prompt and local file system on the machine where you are planning to run the migration tool, because the migration process is largely accomplished through file manipulation. In particular, you must have access to the files where the OracleAS Portal providers are deployed.

Installing the OracleAS PDK URL-Based Sample Portlets

Back to Topic List

Note: If you have already deployed URL-based portlets and added the existing URL-based portlets to your portal, you can skip this topic. You can directly go to the Running the Migration Tool topic to perform the migration of URL-based portlets. However, the screenshots shown in this lesson may differ from what you actually see.

The OracleAS PDK URL-based sample portlets use the OracleAS PDK-Java Framework. Before performing the steps in this section, you must have successfully installed the OracleAS PDK-Java Framework and registered the sample providers.

There are three portlets available in the URL-based sample portlet provider: Google.com, MIT XML Filter, and Stardeveloper ASP portlet. To use these portlets in OracleAS Portal, you must first deploy the sample portlet provider to a Java 2, Enterprise Edition (J2EE) container. Oracle Application Server Containers for J2EE (OC4J) is the J2EE server component of Oracle Application Server. The URL-based portlets are preconfigured within the jpdk.ear file, which is a J2EE Enterprise Application Archive file. In this lesson, you use OC4J to simplify the Web provider deployment.

The provider.xml file stores information that is used by the URL provider. You can configure provider-specific information, such as portlet title and portlet description, in the provider.xml file. This XML file is used to specify the URL that is displayed in your portlet.

1.

Open the provider.xml file for the URL-based portlets.

You can find it in the < OC4J_HOME>\j2ee\home\applications\jpdk\jpdk\WEB-INF\providers\urlsample directory.

Note: < OC4J_HOME> refers to the root directory of your OC4J installation.

 

Move your mouse over this icon to see the image

 

2.

Configure the proxy server settings in the provider.xml file (if required), because the URL-based portlets access URLs over the Internet. Depending on your setup, you may not need a proxy server to access external URLs. The URL-based portlet provider uses the proxy server settings that you specify in this file to connect to external Web sites.

 If you are using a proxy server, alter the following tags appropriately. If you are not using a proxy server, remove the following tags:

<proxyInfo class="oracle.portal.provider.v2.ProxyInformation">
<httpProxyHost>proxyServer.myDomain.com</httpProxyHost>
<httpProxyPort>80</httpProxyPort>
</proxyInfo>

For example, you can edit the provider.xml file to provide the proxy information, as shown below:

<proxyInfo class="oracle.portal.provider.v2.ProxyInformation">
<httpProxyHost>www-proxy.us.oracle.com</httpProxyHost>
<httpProxyPort>80</httpProxyPort>
</proxyInfo>

 

3.

Modify the <stylesheet> tag to point to the correct location of the XML style sheet for the XML Filter portlet. It is located in the < OC4J_HOME>\j2ee\home\applications\jpdk\jpdk\htdocs\urlsample directory.

For example, you can edit the provider.xml file to provide the style sheet information, as shown below:

<stylesheet>
D:\pdk_oc4j\j2ee\home\applications\jpdk\jpdk\htdocs\urlsample\default_mit.xsl
</stylesheet>

 

Testing the Deployment of the URL Provider

Back to Topic List

Note: If you have already deployed URL-based portlets and added the existing URL-based portlets to your portal, you can skip this topic. You can directly go to the Running the Migration Tool topic to perform the migration of URL-based portlets. However, the screenshots shown in this lesson may differ from what you actually see.

The OracleAS PDK URL-based sample portlet provider is now deployed. Next, you can test whether the portlet provider is properly configured with OC4J.

1.  Access the provider test page by using the following URL:

http://< host name> :< port>/ jpdk/providers/urlsample

where < host name> and < port> are the host name and port number of the HTTP listener for your target OC4J instance.

Move your mouse over this icon to see the image

 

Note: In an OracleAS installation with Web Cache installed, the port number should be the Web Cache listener port, for example 7777. In a stand-alone OC4J installation, the default HTTP port number is 8888.

 

2.

Review the content of the displayed test page. This page lists the portlets that are included with the URL provider that has a service name of urlsample.

Move your mouse over this icon to see the image

 

Registering the Provider for URL-Based Portlet Samples

Back to Topic List

Note: If you have already deployed URL-based portlets and added the existing URL-based portlets to your portal, you can skip this topic. You can directly go to the Running the Migration Tool topic to perform the migration of URL-based portlets. However, the screenshots shown in this lesson may differ from what you actually see.

After deploying the URL provider and its portlets, you must register the provider with OracleAS Portal. The provider registration is the process by which OracleAS Portal is informed about the access details of the provider. Providers are registered through the OracleAS Portal Web user interface. After you register a provider, the provider and its portlets are available in the Portlet Repository. They are also listed in the OracleAS Portal Navigator.

1.

Access your OracleAS Portal instance. Click the Login link in the Login portlet.

 

Move your mouse over this icon to see the image

 

2.

Enter your username and password. Click Login.

 

Move your mouse over this icon to see the image

 

Note: If you do not know your username or password, contact your portal administrator.

 

3.

Click the Administer tab.

 

Move your mouse over this icon to see the image

 

4.

Click the Portlets sub-tab.

 

Move your mouse over this icon to see the image

 

5.

In the Remote Providers portlet, click the Register a Provider link.

 

Move your mouse over this icon to see the image

 

Note: To register your provider, you must have Manage or Edit privileges on providers. If you do not have these privileges, you must request them from your portal administrator.

 

6.

On the Provider Information page, provide the following details:

Fields Values
Name URL_Sample
Display Name URL Sample Portlets
Timeout 100
Timeout Message URL Sample Portlets Timed Out after 100 seconds
Implementation Style Web

 

Click Next.

Move your mouse over this icon to see the image

 

7.

The portal and the provider communicate with each other over HTTP. Before using the provider and its portlets, you must specify the access details of the provider.

On the Connection page, specify the following provider information in the appropriate fields:

Fields Values
URL http://< host name> :< port> /jpdk/providers/
Service Id urn:urlsample
User/Session Information User
Login Frequency Once Per User Session

 

Move your mouse over this icon to see the image

 

8.

Click Finish.

Move your mouse over this icon to see the image

 

9.

You should receive a message indicating that your registration is successful.

Click OK.

 

Move your mouse over this icon to see the image

 

Adding a URL-Based Sample Portlet to a Portal Page

Back to Topic List

Note: If you have already deployed URL-based portlets and added the existing URL-based portlets to your portal, you can skip this topic. You can directly go to the Running the Migration Tool topic to perform the migration of URL-based portlets. However, the screenshots shown in this lesson may differ from what you actually see.

URL-based sample portlets can now be added to pages just like any other portlet in the Portlet Repository.

In this section, you add a URL-based sample portlet to your portal page.

1.

Click the Navigator link.

 

Move your mouse over this icon to see the image

 

2.

Access your portal page.

To help you perform the steps in this section, a page group named Migrating URL Portlets and a page named URL Portlets Page within that page group have already been created.

Note: To learn more about creating page groups and pages, see the Building the Portal Site lesson.

Your path should be Path: Page Groups > <Migrating URL Portlets> Pages.

 

Move your mouse over this icon to see the image

 

3.

Click the Edit link to the right of the URL Portlets Page link.

 

Move your mouse over this icon to see the image

 

4.

Click the Add Portlet  icon on the region header. OracleAS Portal displays the Portlet Repository.

 

Move your mouse over this icon to see the image

 

5.

Click the Portlet Staging Area link.

 

Move your mouse over this icon to see the image

Note: By default, all the newly registered providers and portlets are available in the Portlet Staging Area in the Portlet Repository.

 

6.

Click the URL Sample Portlets provider link.

 

Move your mouse over this icon to see the image

 

7.

Click the Google.com Portlet link to move it to the Selected Portlets area.

 

Move your mouse over this icon to see the image

 

8.

Click the ASP Portlet link to move it to the Selected Portlets area.

 

Move your mouse over this icon to see the image

 

9.

Click OK to return to the portal page.

 

Move your mouse over this icon to see the image

 

10.

Note that the URL-based sample portlets have been added to your portal page.

You can see your URL-based sample Google portlet, as shown below.

Note that the Refresh link is not available in the Portlet Header for the URL-based portlets.

 

Move your mouse over this icon to see the image

 

11.

You can see your URL-based sample ASP portlet, as shown below.

Note that the content rendered by the URL-based portlet is unorganized and poorly formatted.

 

Move your mouse over this icon to see the image

 

Registering the Web Clipping Provider

Back to Topic List

Note: If you have already upgraded to Portal Tools 9.0.4.0.2 or later releases by following the instructions provided in the Portal Tools: Upgrading to Release 9.0.4 and later article, you can skip this topic.

The Web Clipping provider is implemented as a Web provider of OracleAS Portal 10g (9.0.4). It provides all the information required to publish external Web content within the Web Clipping portlet. The Web Clipping provider fetches the content selected by the user in the Web Clipping Studio, and renders it inside the Web Clipping portlet.

You must configure the Web Clipping provider by defining a proxy server and port that enable the provider to connect to content sources outside the firewall. You can also specify a list of host names for which the proxy will be bypassed. To configure the Web Clipping provider, follow the instructions in the Configuring the Web Clipping Provider document.

You can access the Web Clipping Provider Test page by using the following URL:
http://< host name> :< port> /portalTools/webClipping/providers/webClipping
The Web Clipping Provider Test page enables you to know whether the provider is functioning properly.

Next, you must register a Web Clipping provider with OracleAS Portal.

1.

Click the Navigator link at the top right of the page.

 

Move your mouse over this icon to see the image

 

2.

Click the Providers tab.

 

Move your mouse over this icon to see the image

 

3.

Click the Registered Providers link.

 

Move your mouse over this icon to see the image

 

4.

Click the Provider link to register a new Web provider.

 

Move your mouse over this icon to see the image

 

5.

The Register Provider page is displayed. Enter the following details in the Provider Information section:

Fields Values
Name Web_Clipping
Display Name My Web Clipping
Timeout 60
Timeout Message My Web Clipping Provider timed out
Implementation Style Web

 

Move your mouse over this icon to see the image

 

6.

Click Next.

 

Move your mouse over this icon to see the image

 

7.

Enter the Web Clipping Provider URL in the URL field.

The URL format is
http://< host name> :< port> /portalTools/webClipping/providers/webClipping .

 

Move your mouse over this icon to see the image

 

8.

In the User/Session Information section, select the User option button to send user-specific information to the provider.

Select Once Per User Session from the Login Frequency list.

 

Move your mouse over this icon to see the image

 

Make sure that you have specified the correct proxy settings in the Proxy Settings section of the page. OracleAS Portal uses the proxy server settings that you specify in this section to connect to the Web Clipping provider.

Move your mouse over this icon to see the image

 

10.

Click Finish.

Move your mouse over this icon to see the image

 

11.

Click OK to complete the Web provider registration.

Move your mouse over this icon to see the image

 

Running the Migration Tool

Back to Topic List

The migration process involves writing configuration data from the URL-based portlet's configuration files into the Web Clipping portlet's configuration files. During the migration process, the service deployment properties file and the provider.xml file are copied into the Web Clipping application, along with the existing customizations to these files. Because the original files used by the existing URL-based portlets are not modified, there is no need to back up any of these files before beginning the migration process. After completing the migration process, the new Web Clipping portlets are available in the Web Clipping Repository.

The migration tool parses the service deployment properties file to find the corresponding provider.xml file, which contains the XML definition of the URL-based portlets to be migrated. For each of the URL-based portlets defined in the provider.xml file, an equivalent clipping definition is created and inserted into the current Web Clipping Repository. The migration tool changes the XML snippet of the provider definition class from URLProviderDefinition to WcProviderDefinition. For each migrated URL-based portlet, the replacement XML snippet contains a clip ID, which is a pointer to the newly inserted clipping definition. The new portlet definition XML snippet no longer contains the same information as it did when it was a URL portlet definition.

You must run the migration tool once for each URL-based portlet. The location of these service deployment properties files that is used for the URL-based portlets may vary depending on individual deployment scenarios. For the shipped URL-based sample portlets, you can find the service deployment properties files in the < OC4J_HOME>/j2ee/home/applications/jpdk/jpdk/WEB-INF/deployment directory.

The service names of the URL-based portlet providers are:

bullet    urlsample - demonstrates the basic capabilities of URL-based portlets
bullet    urlparams - demonstrates how to build a parameter-driven URL-based portlet provider
bullet    urlnls - demonstrates how to build a URL-based portlet provider that performs character set conversion to correctly display multibyte characters, such as Chinese, Japanese, Korean, and Arabic
bullet    urlbasicauth - demonstrates how to build a URL-based portlet provider that displays data from a source that is secured by using basic authentication
bullet    urlexternalauth - demonstrates how to build a URL-based portlet provider that displays data from a password-protected external application

 

1.

Before you initiate migration, ensure that no other users have modified the files that you intend to migrate.

Shut down the OC4J instance in your Oracle Application Server instance or the stand-alone OC4J instance where your Portal Tools application is running.

To shut down a stand-alone OC4J instance, you can use the following command from the < OC4J_HOME>\j2ee\home directory:

java -jar admin.jar ormi://< host name> admin admin_password -shutdown

Note: Do not restart OC4J until the migration has finished.

 

Move your mouse over this icon to see the image

 

To shut down the OC4J instance in your OracleAS instance, execute the following command from the < INSTALL_HOME>/opmn/bin directory:

opmnctl stopproc gid="< OC4J_INSTANCE>"

For example, if your Portal Tools application is running in the OC4J_Portal instance, enter
opmnctl stopproc gid="OC4J_Portal" at the command prompt, as shown below:

 

Move your mouse over this icon to see the image

 

Note: < OC4J_INSTANCE> refers to the OC4J instance where your Portal Tools application was deployed.

< INSTALL_HOME> refers to the OracleAS installation home, which is the root directory of your OracleAS installation.

 

2.

Open the command window. If you are using a stand-alone OC4J instance, change your current directory to < OC4J_HOME>/portal/jlib .

 

Move your mouse over this icon to see the image

 

If you are using OC4J in your OracleAS installation, change your current directory to < INSTALL_HOME>/portal/jlib .

 

Move your mouse over this icon to see the image

 

3.

Execute the following command:

java -jar wcwebdb.jar -import -from urlservices < WEBCLIP_SVC_DEP_PROPS> < URLSVCS_SVC_DEP_PROPS>

where

< WEBCLIP_SVC_DEP_PROPS> refers to the path to your Web Clipping service deployment properties file.
It is typically found in the < INSTALL_HOME>/j2ee/< OC4J_INSTANCE>/applications/portalTools/webClipping/WEB-INF/deployment/webClipping.properties directory.

< URLSVCS_SVC_DEP_PROPS> refers to the path to the URL-based portlets service deployment properties file pointing to URL-based portlets that you want to migrate.
It is typically found in the < INSTALL_HOME>/j2ee/home/applications/jpdk/jpdk/WEB-INF/deployment directory.

 

Move your mouse over this icon to see the image

 

For example, you can see the command that is executed on a stand-alone OC4J instance.

 

Move your mouse over this icon to see the image

 

4.

Look for the “ Importing into Web Clipping was successful” message to check that your URL portlet has been imported.

 

Move your mouse over this icon to see the image

 

Note: If you encounter any problems or errors during the migration process, please see the Limitations and Troubleshooting section in the Migrating From URL-Based Portlets to Web Clippings Portlets document in Portal Center.

 

5.

After migrating all the URL-based portlets, you must verify that the migration is successful. First, restart the OC4J instance that hosts your provider.

To start a stand-alone OC4J instance, execute the following command from the < OC4J_HOME>\j2ee\home directory:

java -jar oc4j.jar -err errors.log

 

Move your mouse over this icon to see the image

Note: The errors.log file is an arbitrary file where the standard error messages are written. You can access the errors.log file to identify the errors that might have occurred when you started the OC4J instance.

 

To start the OC4J instance in your OracleAS instance, execute the following command from the < INSTALL_HOME>/opmn/bin directory:

opmnctl startproc gid="< OC4J_INSTANCE>"

 

Move your mouse over this icon to see the image

 

Updating the Provider Registration

Back to Topic List

Next, you must update the provider information in all OracleAS Portal instances where your URL-based portlet provider was previously registered.

1.

Access the Portal Navigator page.

 

Move your mouse over this icon to see the image

 

2.

Access the Registered Providers. Your path should be Path: Providers > Registered Providers.

 

Move your mouse over this icon to see the image

 

3.

Click the Edit Registration link to the right of the URL Sample Portlets link.

 

Move your mouse over this icon to see the image

 

4.

Click the Connection tab.

 

Move your mouse over this icon to see the image

 

5.

Update the provider URL value to:

http://< host name> :< port> /portalTools/webClipping/providers

 

Move your mouse over this icon to see the image

 

Note: If you registered your URL-based portlet provider by using a provider URL that contained the Service ID, you must update the provider URL to:

http://< host name> :< port> /portalTools/webClipping/providers/urlsample

 

6.

Click OK.

 

Move your mouse over this icon to see the image

 

7.

Click the Refresh link to update the provider registration.

 

Move your mouse over this icon to see the image

 

Accessing the Migrated Portlets

Back to Topic List

Access your portal page to check whether the URL-based portlets that were added to your page were successfully migrated.

1.

Click the Page Groups tab.

 

Move your mouse over this icon to see the image

 

2.

Click the Migrating URL Portlets link.

 

Move your mouse over this icon to see the image

 

3.

Click the Pages link.

 

Move your mouse over this icon to see the image

 

4.

Click the Edit link to the right of the URL Portlets Page link.

 

Move your mouse over this icon to see the image

 

5.

You can now see your migrated URL-based sample Google portlet, as shown below. Note that the Refresh link is available by default in the Portlet Header for the Web Clipping portlet.

 

Move your mouse over this icon to see the image

 

6.

You can see your migrated URL-based sample ASP portlet, as shown below.

Note the difference in the rendering of content in the Web Clipping portlets. You can see that the style sheet has been applied and the content is better organized.

 

Move your mouse over this icon to see the image

 

7.

Access the test page for the migrated URL-based sample portlets by using the following URL:
http://< host name> :< port> /portalTools/webClipping/providers/urlsample

 

Move your mouse over this icon to see the image

 

8.

Click the Edit link to edit the Google.com portlet.

 

Move your mouse over this icon to see the image

 

9.

Note that you can alter the clipping for the migrated URL-based portlet without modifying the provider.xml file.

 

Move your mouse over this icon to see the image

 

Summary

Back to Topic List

In this lesson, you should have learned how to migrate existing URL-based portlets to Web Clipping portlets.

Related Topics

Back to Topic List

For more information about how to clip content by using the Web Clipping portlet, please refer to the Publishing External Content Using the Web Clipping Portlet OBE lesson.

For more information about OracleAS Portal, please visit Oracle Portal Center Home.

If you have questions or comments, please post them in the Oracle by Example discussion forum on the Oracle Technology Network.

 Place the cursor on this icon to hide all screenshots.

Copyright © 2004, Oracle Corporation. All rights reserved. Contact Us • Legal Notices and Terms of Use • Privacy Statement