Skip Headers
Oracle® WebCenter Framework Developer's Guide
10g (10.1.3.2.0)

Part Number B31074-05
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

17 Creating Content-Based Portlets with Web Clipping

This chapter provides a brief description of Web Clipping portlets and producers and explains how you can register a Web Clipping producer and use this producer to add Web Clipping portlets to a JSP document created through Oracle JDeveloper.

This chapter contains the following sections:

See Appendix B, "Additional Portlet Configuration" for additional Web Clipping portlet configurations like configuring the repository, configuring proxy settings, and securing the Web Clipping producer.

17.1 Introduction to Web Clipping

Web Clipping is a browser-based declarative tool that enables you to integrate any Web application with your WebCenter application. It is designed to give you quick integration by leveraging the Web application's existing user interface. You can drag-and-drop Web Clipping portlets on to a *.jspx page. The Web Clipping producer and portlets are available when you install the WebCenter Preconfigured Oracle Containers for J2EE (OC4J), which is available by default as part of an Oracle WebCenter Framework installation. When this producer is registered, the portlets become available on the Oracle JDeveloper Component Palette. From here, you can drag-and-drop the portlets onto your *.jspx page.

Notes:

With Web Clipping, you can collect Web content into portlets in a single centralized Web page. You can use Web Clipping to consolidate content from Web sites scattered throughout a large organization.

Web Clipping enables clipping of an entire Web page or a portion of it and reusing it as a portlet. Basic and HTML-form-based sites may be clipped. Use Web Clipping when you want to copy content from an existing Web page and expose it in your WebCenter application as a portlet. Web Clipping portlets supports the following:

You can select one of the following as the Web Clipping repository:

Oracle Metadata Services is the default option, which saves the Web Clipping definition in the file system. If you select Oracle Metadata Services as your Web clipping repository, then you can use Web Clipping even without a database. Web Clipping definitions can be stored persistently in the repository.

Any secure information, such as passwords, is stored in encrypted form, according to the Data Encryption Standard (DES), using Oracle encryption technology.

See Also:

Section B.3.1, "Configuring the Web Clipping Repository" for details about configuring a repository.

17.2 Adding Web Page Content to a Page

To add Web page content to a page, follow the steps described in the following sections:

17.2.1 Registering a Web Clipping Producer

To add Web Clipping portlets to your page, you must first register the Web Clipping producer. Register your Web Clipping producer by referring to Section 4.3.1, "Registering Portlet Producers" for details.

17.2.2 Adding a Web Clipping Portlet to a Page

To add a Web Clipping portlet to a *.jspx page, perform the following steps:

  1. Start Oracle JDeveloper and the WebCenter Preconfigured OC4J (see Section 3.2.2, "Starting and Stopping the Preconfigured OC4J").

  2. In the Applications Navigator, right-click the *.jspx file, and select Open from the context menu.

    The *.jspx file is available in the following hierarchy:

    Applications
     <ApplicationName>
      <ProjectName>
       Web Content
    
  3. In the Component Palette, select the Web Clipping producer that you registered earlier.

  4. Select a Web Clipping portlet, and drag it on top of the h:form component in the Structure pane in Oracle JDeveloper.

    If you are using a PanelCustomizable or ShowDetailFrame component, then drag the portlet on top of that component instead of h:form. In the Structure pane, the Web Clipping portlet should display under the PanelCustomizable or ShowDetailFrame component. In the Page Editor, the portlet should display inside the PanelCustomizable or ShowDetailFrame component.

    Note:

    Ensure that the new Web Clipping portlet is selected in the Structure pane, and in the Property Inspector set AllModesSharedScreen to false.

    If you do not set this property to false, when you personalize the Web Clipping portlet at run time, the text displayed on the page may be distorted.

  5. Right-click the *.jspx file and select Run from the context menu.

    This will start the embedded OC4J server, start your default browser, and display the Web Clipping Portlet. On the resulting page, you can select a Web page that you want to expose in your WebCenter application. You can then use Web Clipping Studio to select a section of the Web page for inclusion.

17.2.3 Selecting a Section of a Web Page to Display in the Web Clipping Portlet

To select a section of a Web page to display in the Web Clipping portlet, you use the Web Clipping Studio. Using the Web Clipping Studio, you can do the following:

  • Browse for Web content

  • Section the chosen target page

  • Choose the exact portion of the Web content to clip

  • Preview the clipped content as a portlet

  • Save the clipped content as a portlet

  • Set portlet properties and save the updated portlet information

To select a section of a Web page to display in the Web Clipping portlet, perform the following steps:

  1. Click the Actions icon on the header of the Web Clipping portlet, and select either of the following:

    • Customize, to select a Web page that can be used by all users.

    • Personalize, to enable end users to personalize their own view of the content in a Web Clipping portlet.

      Note:

      When running a portlet that has an Edit mode, the Personalize option in the portlet's menu only appears to authenticated users of the application. Anonymous or public users will not see the option to personalize the portlet through Edit mode. Therefore, you must have implemented some form of security for your application in order for users to personalize their portlets. If you are a developer creating portlets and pages, then you may want to quickly test the Edit mode of your portlet without creating a complete security model for your application. See Section 10.6, "Configuring Basic Authentication for Testing Portlet Personalization" for an explanation of how you can quickly add the necessary security for testing portlet personalization.

    Figure 17-1 Editing Default Settings

    Description of Figure 17-1 follows
    Description of "Figure 17-1 Editing Default Settings"

    The Find a Web clipping page is displayed.

  2. In the URL Location field, enter the location of the starting Web page that links to the content you want to clip, as shown in Figure 17-2.

    Figure 17-2 Specifying a URL

    Description of Figure 17-2 follows
    Description of "Figure 17-2 Specifying a URL"

  3. Click Start.

    The Web Clipping Studio displays the page you specified, as shown in Figure 17-3.

    Figure 17-3 Browsing to a Page Containing Content for a Web Clipping

    Description of Figure 17-3 follows
    Description of "Figure 17-3 Browsing to a Page Containing Content for a Web Clipping"

  4. Browse to the page that contains the content you want to clip.

    As you click hyperlinks in the Web page, your navigation links are recorded.

    Note:

    Any browsing operations that do not contribute to the eventual Web clipping will be discarded. Only the significant browsing operations are recorded for later playback during the show mode; any discarded links are not visited.

    For any Web sites that require HTTP Basic or Digest Authentication, a form is displayed that requests user name and password information. This encoded authentication information is recorded as part of the browsing information.

  5. Once you display the page that contains the content you want to clip, in the Web Clipping Studio banner, click Section, as shown in Figure 17-4.

    Figure 17-4 Sectioning the Target Web Page

    Description of Figure 17-4 follows
    Description of "Figure 17-4 Sectioning the Target Web Page"

    Sectioning divides the target Web page into its clippable sections, as shown in Figure 17-5. After you click Section, you are no longer able to browse links in the displayed page. If you want to continue navigation, then click Unsection in the Web Clipping Studio banner.

    Figure 17-5 Sectioned Target Web Page

    Description of Figure 17-5 follows
    Description of "Figure 17-5 Sectioned Target Web Page"

  6. At the top-left corner of the section of the Web content you want to clip, click Choose.

    You can choose only one section as a clipping at a time.

    Note:

    To increase the number of sections available from which to choose, click Section Smaller in the Web Clipping Studio banner. For example, you would click Section Smaller to drill down one level of nested tables. To decrease the number of sections available from which to choose, click Section Larger.
  7. Web Clipping Studio displays a preview of your chosen section. If it is the section you want, then click Select in the Web Clipping Studio banner. The Web Clipping Studio displays the Find a Web clipping page, with the properties of the clipping.

    If you do not want to use the section you clipped in your portlet, then click Unselect to return to the page containing the section. You can choose another section on the page, or click Unsection to navigate to another page.

    Some sections may contain no data, only whitespace. For example, a Web page may contain an HTML <DIV> tag that contains no text or images. If you click Choose on a section that contains no data, then Web Clipping displays a preview, but the preview correctly shows only whitespace. In this case, click Unselect in the preview page to return to the sectioned page. Then, select a section containing data.

  8. In the Find a Web clipping page, click OK to display the selected Web Clipping in the Web Clipping portlet on your page. (You can edit default properties in the page. See Section 17.2.4, "Setting Web Clipping Portlet Properties" for more information.)

    Figure 17-6 shows the content added to the Web Clipping portlet.

    Figure 17-6 Clipped Content Added to the Web Clipping Portlet on a WebCenter Application Page

    Description of Figure 17-6 follows
    Description of "Figure 17-6 Clipped Content Added to the Web Clipping Portlet on a WebCenter Application Page"

Note:

The Refresh link in the Web Clipping Portlet retrieves fresh data from the originating Web site. This link reloads the portlet, but it may retrieve the data from the cache, depending upon the settings for expiration.

17.2.4 Setting Web Clipping Portlet Properties

You can edit various portlet settings to change the appearance of the Web Clipping portlet and to specify how end users can interact with the portlet.

To set Web Clipping portlet properties, perform the following steps:

  1. Click the Actions icon on the header of the Web Clipping portlet, and select Customize. Web Clipping Studio displays the Find a Web clipping page with a Properties section, as shown in Figure 17-7.

    Figure 17-7 Properties Section of Find a Web Clipping Page

    Description of Figure 17-7 follows
    Description of "Figure 17-7 Properties Section of Find a Web Clipping Page "

  2. From the URL Rewriting list in the Properties section, choose Inline if you want link targets to be displayed inside the portlet, or choose None if you want link targets to replace the current page in the browser.

    Note:

    If you have integrated with an external application or are logged into the clipped site, and if you choose Inline for URL Rewriting, then the session is maintained to the clipped site while browsing.
  3. In the Title field, enter a title to display in the portlet banner.

  4. In the Description field, enter a description of the portlet.

  5. In the Time Out (seconds) field, enter the amount of time (in seconds) for the Web Clipping producer to attempt to contact the Web page from which the content was clipped.

  6. In the Expires (minutes) field, enter the amount of time (in minutes) that cached content is valid. Any requests for portlet content that occur within the time period you specify will be satisfied from the cache.

    Once the cache period is exceeded, requests for portlet content will be satisfied by retrieving content from the portlet's Web Clipping data source. The cache will also be refreshed with this content.

  7. If you entered any information in a form while clipping content for the Web Clipping portlet, then the Parameterize Inputs section is available. Select the Click to start parameterizing check box to customize parameters associated with the Web Clipping portlet content. Then perform the following steps:

    1. From the Parameters list, choose the parameters that you want to customize.

    2. From the Personalizable list, select a parameter if you want to enable end users to provide their own values for the parameters when they personalize the portlet. Select None if you do not want to enable this.

    3. In the Display Name field, enter a name to be displayed for the parameter.

    4. In the Default Value field, enter a value to use by default for the parameter.

    Section 17.4.2, "Personalizing a Web Clipping Portlet" provides an example of personalizing parameters.

  8. Click OK.

17.3 Integrating Authenticated Web Content Using Single Sign-On

This section walks you through an example that demonstrates how you can leverage Oracle Single Sign-On to integrate content from external Web sites that require authentication into a Web Clipping portlet.

The example incorporates a secured page from Oracle Metalink (an external application) into a Web Clipping portlet.

To integrate an external application, perform the following steps:

  1. Register the external application in Oracle JDeveloper, specifying the authentication information by performing the following steps.

    1. Start Oracle JDeveloper.

    2. In the Applications Navigator, right-click your project and select New.

    3. In the New Gallery dialog box, under the General category, select External Application.

    4. From the list of items displayed, select External Application, and click OK.

    5. In the Register External Application wizard, click Next on the welcome screen.

    6. On step 1 of the wizard, enter a name for the application, for example, Metalink.

    7. On step 2 of the wizard, enter the following details:

      • For Login URL, enter the URL to log in to the application, for example, http://metalink.oracle.com/metalink/plsql/sit_main.showSitemap?p_showTitle=0. To determine the URL, navigate to the desired application in a browser and note the URL.

        For Form-based Authorization, view the source of the login page for the external application and note the URL to be accessed during the login action.

      • For User Name/ID FieldName, enter the field name that the external application uses for the user name. Determine the field name by viewing the source for the desired page. If the Authentication method uses Basic Authentication, then you do not need to enter a field name. For Metalink, you do not need to enter anything in this field

      • For Password FieldName, enter the field name that the external application uses for the password. Determine the field name by viewing the source for the desired page. If the Authentication method uses Basic Authentication, then you do not need to enter a field name. For Metalink, you do not need to enter anything in this field.

      • Select BASIC as the authentication method.

        Figure 17-8 shows step 2 of the Register External Application wizard.

        Figure 17-8 Registering an External Application

        Description of Figure 17-8 follows
        Description of "Figure 17-8 Registering an External Application"

    8. On step 3 of the wizard, you can enter names and values of any additional fields that are submitted with the login form of the external application. To specify a field name that is used to indicate a redirection URL, enter redirectFieldName for Field Name. For this example, you do not need to enter additional fields. Figure 17-9 shows step 3 of the Register External Application wizard.

      Figure 17-9 Specifying Redirection

      Description of Figure 17-9 follows
      Description of "Figure 17-9 Specifying Redirection"

    9. Click Finish.

  2. Create a credential provisioning page that will store the credentials for the external application. To do this, perform the following steps:

    1. In the Applications Navigator, right-click your project and select New.

    2. In the New Gallery dialog box, under the General category, select External Application.

    3. From the list of items displayed, select Credential Provisioning Page, and click OK.

    4. This creates the CredentialProvisioner.jspx page, which stores the external application login information. This information is used while implementing external application-related portlets.

  3. For the Web Clipping portlet, create a new Web Clipping producer by performing the following steps:

    1. In the Applications Navigator, right-click your project and select New.

    2. In the New Gallery dialog box, under the Web Tier category, select Portlets.

    3. From the list of items displayed, select Oracle PDK-Java Producer Registration.

    4. On step 1 of the Register Oracle PDK Portlet Producer wizard, enter webClippingMetalink for the Name.

    5. Click Next.

    6. On step 2 of the wizard, do the following:

      • Specify the URL for the Web Clipping producer in the following format:

        http://host:port/portalTools/webClipping/providers/webClipping
        

        Note that host:port refers to the host and port where the producers are located.

      • If you use a proxy server to contact the Web producers from your application, then enter the proxy details.

      • Click to select the Associate producer with an external application option, and from the list of values, select Metalink that you created earlier. The Enable Producer Sessions option also gets selected in this step.

        Figure 17-10 shows step 2 of the Register Oracle PDK Portlet Producer wizard.

        Figure 17-10 Specifying an External Application for a Web Clipping Producer

        Description of Figure 17-10 follows
        Description of "Figure 17-10 Specifying an External Application for a Web Clipping Producer"

    7. On step 3 of the wizard, specify the execution timeout, subscriber ID, and shared key values, if required.

    8. Click Finish.

    9. In the registration confirmation dialog box, click OK.

  4. Add a portlet to a *.jspx page, using the webClippingMetalink producer that you just created. Section 17.2.2, "Adding a Web Clipping Portlet to a Page" describes in detail how to add a portlet.

  5. Run the *.jspx page.

  6. If you have not entered your credentials for the External Application representing Metalink, then the portlet will contain an Update login information link. Click the link and enter your credentials. Then, click OK.

  7. Select a section of a page to display in the Web Clipping portlet, by performing the following steps:

    1. Click the Actions icon on the header of the Web Clipping portlet, and select Customize.

      The Find a Web Clipping page is displayed.

    2. In the URL Location field, the default URL for the External Application is displayed.

    3. Click Start. The Web Clipping Studio displays the page from the integrated external application.

    4. Browse to the page that contains the content you want to clip. After you display the page that contains the content you want to clip, click Section in the Web Clipping Studio banner. Figure 17-11 shows the external application displayed in Web Clipping Studio.

      Figure 17-11 External Application in Web Clipping Studio

      Description of Figure 17-11 follows
      Description of "Figure 17-11 External Application in Web Clipping Studio"

    5. At the top-left corner of the section of the Web content you want to clip, click Choose.

    6. Web Clipping Studio displays a preview of your chosen section. If it is the section you want, then click Select in the Web Clipping Studio banner.

      The Web Clipping Studio displays the Find a Web Clipping page, with the properties of the clipping as shown in Figure 17-12.

      Figure 17-12 Properties of the External Application

      Description of Figure 17-12 follows
      Description of "Figure 17-12 Properties of the External Application"

    7. In the Find a Web Clipping page, from the URL Rewriting list, choose Inline to specify that you want link targets displayed inside the portlet, rather than in a new browser window. Click OK to display the selected Web clipping in the Web Clipping portlet on your page, as shown in Figure 17-13.

      Figure 17-13 External Application Displayed in Portlet

      Description of Figure 17-13 follows
      Description of "Figure 17-13 External Application Displayed in Portlet"

Now, the Web clipping, even though it is from a page requiring authentication, is available in your portlet.

Note that you can associate only one external application with a producer. For each external application, you must register a new producer. Each WebCenter application user accesses the authenticated content using their user name and password for that system, not the page designer's credentials.

Accessing External Application Images without Authentication

If you have integrated content from an external application that requires authentication into a Web Clipping portlet, and this content contains URLs that are links to images in the external application, then to ensure that the images are rendered without having to authenticate the browser with the external application, you must rewrite the URLs to use resource proxy. To do this, set the rewriteImageLink element in the Web Clipping producer's web.xml file to true as shown in the following example:

<!-- Rewrite the Image links to use Resource Proxy -->
<env-entry>
   <env-entry-name>oracle/webclipping/rewriteImageLink</env-entry-name>
   <env-entry-type>java.lang.Boolean</env-entry-type>
   <env-entry-value>true</env-entry-value>
</env-entry>

17.4 Adding a Web Clipping That Users Can Personalize

This section walks you through an example that demonstrates how you can enable end users to personalize their own view of the content in a Web Clipping portlet.

In the example, you perform the following tasks:

17.4.1 Selecting a Clipping in OTN

In this task, you navigate to the Oracle Technology Network (OTN) and search for specific information, then select the results as the clipping for your portlet. To do this, perform the following steps:

  1. Click the Actions icon on the header of the Web Clipping portlet, and select Customize.

  2. In the Web Clipping Studio's Find a Web clipping page, in the URL Location field, enter:

    http://www.oracle.com/technology/products/ias/portal/index.html
    

    Click Start. OTN displays the Portal Center page.

  3. Enter a search string in the Search field at the top of the page. For this example, enter "web clipping portlet" (including the quotation marks), then click the Search icon.

    The Search result is displayed in the Web Clipping Studio, as shown in Figure 17-14.

    Figure 17-14 Searching for information about OTN

    Description of Figure 17-14 follows
    Description of "Figure 17-14 Searching for information about OTN"

  4. Click Section. Web Clipping Studio divides the target Web page into its clippable sections, as shown in Figure 17-15.

    Figure 17-15 Sectioning the Target Web Page

    Description of Figure 17-15 follows
    Description of "Figure 17-15 Sectioning the Target Web Page"

  5. At the top-left corner of the search result, click Choose.

    A preview of the search result section displays.

    Some sections may contain no data, only whitespace. For example, a Web page may contain an HTML <DIV> tag that contains no text or images. If you click Choose on a section that contains no data, then Web Clipping displays a preview, but the preview correctly shows only whitespace. In this case, click Unselect in the preview page to return to the sectioned page. Then, select a section containing data.

  6. Click Select to confirm that the search result section is the one you want to clip.

  7. In the Find a Web Clipping page, click OK to display the selected Web Clipping in the Web Clipping portlet on your page. Figure 17-16 shows the Web Clipping displayed in the page.

Figure 17-16 Selected Web Clipping Displayed in Web Clipping Portlet

Description of Figure 17-16 follows
Description of "Figure 17-16 Selected Web Clipping Displayed in Web Clipping Portlet"

17.4.2 Personalizing a Web Clipping Portlet

In this task, you edit the properties of the Web Clipping portlet to enable end users to display different search results in the portlet. To do this, perform the following tasks:

  1. On the Web Clipping portlet you just added, click the Actions icon on the header of the Web Clipping portlet, and select Customize.

  2. In the Find a Web Clipping page, modify the following items in the Properties section:

    • From the URL Rewriting list, choose Inline to specify that you want link targets displayed inside the portlet, rather than in a new browser window.

    • In the Title field, enter OTN Search. This title displays in the header of your Web Clipping portlet, as well as the pages where users can personalize parameters for the Web clipping.

    Figure 17-17 shows the Properties and Parameterize Inputs sections of the Find a Web Clipping page.

    Figure 17-17 Setting Properties for a Web Clipping

    Description of Figure 17-17 follows
    Description of "Figure 17-17 Setting Properties for a Web Clipping"

  3. Because the content displayed in the portlet was reached by entering information in the Search field on OTN, you can customize the parameters used by the search to enable end users to specify their own search string.

  4. Under the Parameterize Inputs section, select Click to start parameterizing, and make the following changes in the parameters table:

    • In the Parameters column, choose keyword from the list.

    • In the Personalizable column, choose Param1 from the list.

    • In the Display Name column, enter OTN Search.

    • Make sure that Default Value displays "web clipping portlet" to be sure you have selected the right parameter.

  5. Click OK to display the default search results in the Web Clipping portlet on your page.

  6. Click the Actions icon on the header of the Web Clipping portlet, and select Personalize.

    Note:

    When running a portlet that has an Edit mode, the Personalize option in the portlet's menu only appears to authenticated users of the application. Anonymous or public users will not see the option to personalize the portlet through Edit mode. Therefore, you must have implemented some form of security for your application in order for users to personalize their portlets. If you are a developer creating portlets and pages, then you may want to quickly test the Edit mode of your portlet without creating a complete security model for your application. See Section 10.6, "Configuring Basic Authentication for Testing Portlet Personalization" for an explanation of how you can quickly add the necessary security for testing portlet personalization.
  7. In the page that displays, scroll down to the Inputs section. Notice that the parameter field for the search string is labeled OTN Search, as you specified for the Display Name for this parameter. In the OTN Search field, enter a different search string. For example, enter OmniPortlet 2004, as shown in Figure 17-18.

    Figure 17-18 Specifying Input for Parameters

    Description of Figure 17-18 follows
    Description of "Figure 17-18 Specifying Input for Parameters"

  8. Click OK.

    The Web Clipping portlet now displays the results of performing a search on OTN for OmniPortlet 2004 information, as shown in Figure 17-19.

    Figure 17-19 New Web Clipping Result Based on Customer Input Parameter

    Description of Figure 17-19 follows
    Description of "Figure 17-19 New Web Clipping Result Based on Customer Input Parameter"

17.5 Current Limitations for Web Clipping

This section describes current limitations for Web Clipping. For information about the latest limitations in this release, be sure to read the "Oracle Oracle WebCenter Framework" chapter in the Oracle Application Server Release Notes. Following are the limitations:

For troubleshooting information, see Appendix G, "Troubleshooting WebCenter Applications".

17.6 Summary

In this chapter, you learned how to use Web Clipping to add Web content to a page, including adding authenticated content and personalized content to a page. For more information about using Web Clipping, click the Help link on any of the Web Clipping pages.