Oracle® Fusion Middleware Developer's Guide for Oracle WebCenter 11g Release 1 (11.1.1.5.0) E10148-16 |
|
![]() Previous |
![]() Next |
This chapter provides an overview of portlets, and describes, with the help of examples, the use of portlets. It explains portlet anatomy and the resources to create portlets. This chapter also explains the features, technologies, and tools to help you decide which portlet building technology best suits your needs.
This chapter includes the following sections:
A portlet is a reusable Web component that can draw content from many different sources. Figure 57-1 illustrates the Products portlet, a portlet that shows the products available on a shopping web site.
Portlets provide a means of presenting data from multiple sources in a meaningful and related way. Portlets can display excerpts of other web sites, generate summaries of key information, perform searches, and access assembled collections of information from a variety of data sources. Because different portlets can be placed on a common page, the user receives a single-source experience. In reality, the content may be derived from multiple sources.
In a WebCenter Portal application, a portlet may or may not be rendered in an inline frame (IFRAME). Inline frames enable the placement of a document within a rectangular region that includes scroll bars and borders.
Note: For more information about portlets and inline frames, see Section 63.4.12, "What You May Need to Know About IFRAMEs." |
Within this IFRAME, portlets can display many types of content, including HTML, formatted text, images, or elements of an HTML form.
This section includes the following subsections:
Portlet anatomy is the visual representation of the portlet on a page. Figure 57-2 illustrates a typical portlet anatomy on a page in a WebCenter Portal application. Note that the same portlet displayed in a different application could look different.
What is rendered on the page is controlled not only by the portlet's own logic, but by the attributes of the portlet tag that binds the portlet to the page. Values for these attributes are specified at the design time of the application that consumes the portlet, rather than through the portlet's own logic.
Note: For information about attributes of theadfp:portlet tag, see Section 63.4, "Setting Attribute Values for the Portlet Tag." |
For example, at application design time you can specify through portlet tag attributes that the runtime portlet should display a header and that its border should be of a specified thickness and color. In the header, you can include a portlet title and an Actions menu icon. The Actions menu icon is displayed on a portlet only when the portlet header is displayed. If you choose not to display a header, then the Actions menu is displayed on a FadeIn-FadeOut toolbar that renders on a mouse rollover.
These elements are sometimes referred to as portlet chrome. The appearance of portlet chrome can be controlled through a style sheet and through style-related attributes of the adfp:portlet
tag. The values of style-related attributes take precedence over styles specified through a style sheet, or skin.
Note: For information about skins and style-related attributes, see Section 21.10, "Applying Styles to Components." |
Through portlet tag attributes, you can include or omit display commands on the Actions menu. Actions menu items controlled through portlet tag attributes include Maximize and Restore. Maximize causes the maximized portlet to displace all other displayed portlets. These are displayed again when a user selects Restore.
Note: The Maximize attribute is meaningful for a portlet only when the portlet is placed inside aPanelCustomizable core customizable component. |
Other Actions menu items controlled through portlet tag attributes include the display or omission of the mode settings that were specified when the portlet was developed. If the portlet was built without including additional modes, then these commands do not appear on the Actions menu even when you indicate that they should through portlet tag attributes. In other words, portlet tag attributes are sometimes on/off switches that enable or disable the portlet's own built-in functionality.
Mode settings that appear on the Actions menu include such modes as About, and Help.
Users click the Personalize icon to alter their personal view of the portlet. The Personalize icon is displayed in the portlet header only to authenticated users (that is, users who are logged in). It does not display to Public or unauthenticated users. You must implement some form of application security for users to be able to personalize their portlet views.
Note: If you are a developer creating portlets, and you want to test the Personalize mode without creating a complete security model for your application, see Section 67.12, "Configuring Basic Authentication for Testing Portlet Personalization." |
Customization enables application administrators to edit a portlet's default settings at runtime. All users see the results of a customization.
Note: A typical customization setting is Portlet Title. At runtime, the portlet administrator can determine what title should appear in the portlet header. The Portlet Title can also be set at design time through portlet properties, using thetext attribute of the adfp:portlet tag. Consider however that supplying a value to the text attribute at design time prevents customization of the Portlet Title at runtime.
For additional information about portlet tag attributes, see Section 63.4, "Setting Attribute Values for the Portlet Tag." |
Portlet resources include the many prebuilt portlets available out of the box from many sources, including Oracle Portal, Oracle E-Business Suite, and third-party sources. Portlet resources also include programmatic portlets built through the WebCenter Portal application's JSR 286 (standards-based) and Oracle PDK-Java wizards, and through other portlet-building tools. Each of these tools offers different product features that are targeted toward different developer roles.
For specific information about each tool and its benefits, see Section 57.2, "Portlet Technologies Matrix."
This section includes the following subsections:
What Are They?
JSF portlets are created using the Oracle JSF Portlet Bridge. The Oracle JSF Portlet Bridge enables application developers to expose their existing JSF applications and task flows as JSR 286 portlets. The Oracle JSF Portlet Bridge simplifies the integration of JSF applications with WSRP portlet consumers, such as Oracle Portal. You can create JSF portlets using the JSR 286 Java Portlet Wizard by invoking it from the New Gallery.
JSF portlets do not require separate source code from that of the JSF application. Since these portlets are created using the Oracle JSF Portlet Bridge, you need only maintain one source for both your application and your portlets. Similarly, when you deploy your JSF application, JSF portlets are also deployed with it. Therefore, using the bridge eliminates the requirement to store, maintain, and deploy your portlets separately from your application.
Who Is the Intended User?
Application developers with the knowledge of Faces and WSRP.
When Should They Be Used?
JSF portlets are best suited when application developers intend to display contents from a JSF application as a portlet without hosting the entire application, or without separately building a portlet for the same. When portletized, the consumption of the portlet is same as registering any WSRP producer using their provider URLs. ADF components that is task flows, can be exposed using the Oracle JSF Portlet Bridge as well.Figure 57-3 shows two portlets, one where users can enter a department number, and one that displays the employee information for the specified department. These portlets were created from ADF task flows using the Oracle JSF Portlet Bridge.
What Are They?
Prebuilt portlets are available through Oracle's partnerships with leading system integrators, software vendors, and content providers. You can access these portlets by using the keywords portal
or portlet
when searching the Oracle PartnerNetwork Solutions Catalog, available at http://solutions.oracle.com
. Examples of these include portlets for the following purposes:
Generating point-to-point driving directions
Accessing Information Technology (IT) information from a wide variety of sources
Viewing summary information about news, stocks, and weather
Who Is the Intended User?
Fully developed, downloadable portlets are best suited for use by application developers who understand how to download, install, and register producers in Oracle WebCenter Framework. They are available for use by all levels of experience.
When Should They Be Used?
Use prebuilt portlets when your needs are satisfied by the functions the portlets offer and the level of personalization readily available is sufficient to complete the desired task.
Consider alternatives when you want to extend or personalize the portlet, for example, when you need a different user interface or when the functionality you require is not available out of the box.
What Are They?
The Parameter Form and Parameter Display portlets provide a quick and easy way to pass values between components. They are provided by the WSRP Tools producer.
The Parameter Form portlet has three output parameters that are set when values are submitted in the form inside the portlet. The parameters can then be used to drive the content of other portlets. You can customize the Parameter Form portlet to determine how many of the three fields are displayed on the form, depending on how many parameters you require.
The Parameter Display portlet enables you to quickly test the wiring from the Parameter Form portlet. However, typically you use the values passed from the Parameter Form portlet to drive the content of some other portlet, for example to pass a zip code to a weather portlet, or a stock symbol to a stock ticker portlet.
Figure 57-4 Parameter Form and Display Portlets
Who Is the Intended User?
The Parameter Form and Parameter Display portlets are best suited for use by application developers who want to provide contextual linking between portlets on a page. These portlets can be added to a page by any user with the appropriate privileges.
When Should They Be Used?
Use the Parameter Form and Parameter Display portlets when your needs are satisfied by the functions the portlets offer and the level of personalization readily available is sufficient to complete the desired task.
Consider alternatives when you want to extend or personalize the portlet, for example, when you need a different user interface or when the functionality you require is not available out of the box.
What Is It?
Web Clipping is a browser-based declarative tool that enables the integration of any Web application with a WebCenter Portal application. Web Clipping is designed to provide quick integration by leveraging the Web application's existing user interface. Web Clipping has been implemented as a PDK-Java producer.
To create a Web Clipping portlet, the WebCenter Portal application developer uses a Web browser to navigate to a Web page that contains desired content. Through the Web Clipping Studio, the application developer can drill down through a visual rendering of the target page to choose the desired content.
Web Clipping supports the following:
Navigation through various styles of login mechanisms, including form- and JavaScript-based submission and HTTP Basic and Digest Authentication with cookie-based session management.
Fuzzy matching of clippings, If a Web clipping gets reordered within the source page or if its character font, size, or style changes, then it is still identified correctly by the Web Clipping engine and delivered as the portlet content.
Reuse of a wide range of Web content, including basic support of pages written with HTML 4.0.1, JavaScript, applets, and plug-in enabled content, retrieved through HTTP GET and POST (form submission).
Personalization, allowing an application developer to expose input parameters that users can modify when they personalize the portlet. These parameters can be exposed as public parameters that an application developer can map as page parameters. This feature enables users to obtain personalized clippings.
Integrated authenticated Web content through Single Sign-On, including integration with external applications, which enables you to leverage Oracle Single Sign-On and to clip content from authenticated external Web sites.
Inline rendering, enabling you to set up Web Clipping portlets to display links within the context of the portlet. As a result, when a user clicks a link in the Web Clipping portlet, the results display within the same portlet. You can use this feature with internal and external Web sites.
Proxy Authentication, including support for global proxy authentication and authentication for each user. You can specify the realm of the proxy server and whether all users automatically log in using a user name and password you provide, each user logs in using an individual user name and password, or all users log in using a specified user name and password.
Open Transport API for customizing authentication mechanisms to clipped sites.
Who Is the Intended User?
Web Clipping is best suited for use by application developers and component developers who want to leverage an existing Web page for rapid portlet development. This portlet can be added to a page by any user with the appropriate privileges.
When Should It Be Used?
Use Web Clipping when you want to repurpose live content and functionality from an existing Web page and expose it in your WebCenter Portal application as a portlet. Consider alternatives to change the way information is presented in the clipped portlet. That is, you do not want to control the User Interface (UI) or application flow, and you are accessing Web-based applications. For a greater level of control, use OmniPortlet's Web page data source instead of Web Clipping. (For more information, see Section 57.1.2.5, "OmniPortlet.")
The following are some examples of when you can consider using the Web Clipping portlet:
Stock chart portlet. You want to create a portlet that displays the stock market's daily performance chart from your financial advisor's Web site. You could clip this information from an external Web site, even if your company is using a proxy.
Web mail portlet. Your users want to access their confidential Web mail accounts through a portlet and to display their in-boxes in the portlet.
For more information about using Web Clipping, see Chapter 65, "Creating Content-Based Portlets with Web Clipping."
What Is It?
OmniPortlet is a declarative portlet-building tool that enables you to build portlets against a variety of data sources, including XML files, character-separated value files (CSV, for example, spreadsheets), Web Services, databases, and Web pages. OmniPortlet users can also choose a prebuilt layout for the data. Prebuilt layouts include tabular, news, bullet, form, chart, or HTML. HTML layout enables OmniPortlet users to write their own HTML and inject the data into the HTML. Figure 57-5 shows a portlet created with OmniPortlet.
Like Web Clipping, OmniPortlet supports proxy authentication, including support for global proxy authentication and authentication for each user. You can specify whether all users automatically log in using a user name and password you provide, each user logs in using an individual user name and password, or all users log in using a specified user name and password.
Who Is the Intended User?
Business users with a minimum knowledge of the URLs to their targeted data and limited programming skills may find OmniPortlet a valuable tool.
When Should It Be Used?
Use OmniPortlet when you want to build portlets rapidly against a variety of data sources with a variety of layouts. Consider alternatives when you want complete control of the design and functionality of the portlet.
The following are some examples of when you can consider using OmniPortlet:
RSS news feed portlet: You want to create a portlet that displays live, scrolling news information to your users. The data comes from a Really Simple Syndication (RSS) news feed, such as Oracle Technology Network Headlines. You also want the portlet to contain hyperlinks to the news source.
Sales chart portlet: You want to present up-to-date information about your company's sales results. You also want to display data in the form of a pie chart, and your company stores its sales information in a remote relational database.
For more information about OmniPortlet, see Chapter 64, "Creating Portlets with OmniPortlet."
What Are They?
Programmatic portlets are portlets that you write yourself, in Java, using either the standard Java Portlet Specification (JPS) or PDK-Java. Oracle WebCenter Framework provides two declarative wizards for simplifying the creation of standards-based JSR 286 portlets and Oracle PDK-Java portlets. These wizards assist in the construction of the framework within which you create the portlet. Each wizard may include easy steps for the following:
Configuring general portlet properties
Specifying names and search terms
Setting allowable content types and mapping display modes
Specifying user-customizable preferences
Adding security roles
Enabling default caching
Adding initialization parameters
Adding public render parameters
Adding portlet events
Who Is the Intended User?
Use of the wizards is easy, but the creation of portlet logic is best performed by experienced and knowledgeable Java developers who are comfortable with the Java Portlet Specification or PDK-Java and who understand the configuration of producers.
When Should They Be Used?
Use programmatic portlets when you have very specialized business rules or logic or when you require personalized authentication, granular processing of dynamic results, and complete user interface control. Additionally, use programmatic portlets when you want to satisfy any of the following conditions:
Consider using the programmatic approach when the out-of-the-box portlets do not address your needs.
The following list provides a couple of examples of when you can consider using programmatic portlets:
Photo Album portlet: You want to create a a portlet that facilitates uploading, storing, and viewing user photos.
Shopping Cart portlet: You want to create a portlet that facilitates the viewing and purchasing of, for example, company-branded items, such as mouse pads, pens, flash drives, tee shirts, and the like.
For more information about using programmatic portlets, see Chapter 59, "Creating Portlets with the Portlet Wizard" and Chapter 60, "Coding Portlets."
Figure 57-6 illustrates the spectrum of portlet resources described in the previous section. Notice how one end of the spectrum is geared toward a more declarative development environment (that is, develop-through-wizard) while the other end focuses more on hand-coding. You can choose your tool depending on which type of environment is most comfortable and suitable to your skill-base.
For more information about deciding which tool to use, see Section 57.2, "Portlet Technologies Matrix."
Figure 57-6 Portlet Resources from Declarative to Coded Development
Portlet modes exhibit the runtime functionality seen by users. The standard modes supported by Oracle WebCenter are described in the following subsections:
WebCenter defines an extended set of modes that it supports. Different modes are available for both JSR 286 and PDK-Java portlets. For example, the Create JSR 286 Java Portlet wizard includes Print mode, which you can use to provide a printer friendly version of the portlet.
If you are coding portlets to JSR 286, then you can also declare your own custom portlet modes in the portlet.xml
file. You can use these to map to the extra modes offered by PDK-Java (for example, Full Screen mode), or to accommodate any other functionality you may want to provide.
Defining custom modes is especially useful if the portlet must interoperate with portal implementations from other vendors. You can offer any of these modes to users. In fact, it is recommended that some modes like Edit Defaults are offered.
Note: Third party portal products may have their own set of extended modes (JSR 286 custom modes) that producers can offer. In WebCenter Portal applications, the chrome UI for portlets only shows the custom modes that are defined in Oracle WebCenter Framework. Arbitrary custom modes that a third party or custom portlet producer offers are ignored and therefore are not supported. |
A portlet uses View mode (known as Shared Screen mode in PDK-Java) to appear on a page with other portlets. This is the mode most people think about when they envision a portlet. A JSR 286 portlet must have a View mode, the rest are optional.
For guidelines about how to implement View mode, see Section 60.1.1.1, "Guidelines for View Mode."
A portlet uses Edit mode to enable users to personalize the behavior of the portlet. Personalization are visible only to the user that performed them; not to other users. Edit mode provides a list of settings that the user can change. These settings may include the title, type of content, formatting, amount of information, defaults for form elements, and anything that affects the appearance or content of the portlet.
Users typically access a portlet's Edit mode by choosing Personalize from the portlet's dropdown list of options. When users choose Personalize, a new page appears in the same browser window. The portlet typically creates a web page representing a dialog to choose the portlet's settings. After applying the settings, users automatically return to the original page.
For guidelines about how to implement Edit mode, see Section 60.1.1.2, "Guidelines for Edit Mode."
A portlet uses Edit Defaults mode to enable administrators to customize the default behavior of a particular portlet instance. Edit Defaults mode provides a list of settings that the application developer can change. These settings may include the title, type of content, formatting, amount of information, defaults for form elements, and anything that affects the appearance or content of the portlet.
These default personalization settings can change the appearance and content of that individual portlet for all users. Because Edit Defaults mode defines the system-level defaults for what a portlet displays and how it displays it, this mode should not be used as an administrative tool or for managing other portlets.
Administrators access Edit Defaults mode, when editing a page, by choosing Customize from the portlet's dropdown list.
When users click the Customize icon, the portlet displays in the same browser window. The portlet typically creates a web page representing a dialog to personalize the portlet instance settings. After applying the settings, users are automatically returned to the original page.
For guidelines about how to implement Edit Defaults mode, see Section 60.1.1.3, "Guidelines for Edit Defaults Mode."
A portlet uses Help mode to display information about the functionality of the portlet and how to use it. The user should be able to find useful information about the portlet, its contents, and its capabilities with this mode.
Users access a portlet's Help mode by choosing the Help action in the portlet.
For guidelines about how to implement Help mode, see Section 60.1.1.4, "Guidelines for Help Mode."
Users must be able to see what version of the portlet is currently running, its publication and copyright information, and how to contact the author. Portlets that require registration may link to web-based applications or contact information from this mode as well.
User's access a portlet's About mode by choosing About from the dropdown list in the portlet's chrome. A new page appears in the same browser window. The portlet can either generate the content for this new page or take the user to an existing page or application.
For guidelines about how to implement About mode, see Section 60.1.1.5, "Guidelines for About Mode."
A portlet uses Preview mode to show the user how the portlet looks before adding it to a page. Preview mode visually represents what the portlet can do. Not all portlet consumers call this mode. For example, Oracle Portal uses this mode, but Oracle WebCenter Framework does not.
Note: Oracle Portal calls this mode when the user clicks the Preview icon on the Add Portlet page. A window then displays the preview of the chosen portlet. The user has the option to add that portlet to the page. This mode has no particular application in WebCenter Portal applications, but is used in Oracle Portal's Portlet Repository. |
For guidelines about how to implement Preview mode, see Section 60.1.1.6, "Guidelines for Preview Mode."
Portlets use Full Screen mode to provide a larger version of the portlet for displaying additional details. Full Screen mode lets a portlet have the entire window to itself. Not all portlet consumers call this mode. For example, Oracle Portal uses this mode, but Oracle WebCenter Framework does not. In Oracle Portal, users access a portlet's Full Screen mode by clicking the title of the portlet.
For example, if a portlet displays expense information, then it could show a summary of the top ten spenders in Shared Screen mode and the spending totals for everyone in Full Screen mode. Portlets can also provide a shortcut to web applications. If a portlet provided an interface to submitting receipts for expenses in Shared Screen mode, then it could link to the entire expense application from Full Screen mode.
JSR 286 portlets do not have Full Screen mode.
For guidelines about how to implement Full Screen Mode, see Section 60.1.1.7, "Guidelines for Full Screen Mode (PDK-Java Only)."
Table 57-1 summarizes the technologies and tools you can use with Oracle WebCenter Framework. The matrix describes the tools and technologies that are covered in more detail in this guide: Oracle JSF Portlet Bridge, OmniPortlet, Web Clipping portlet, and programmatic portlets, including standards-based (JSR 286) portlets and PDK-Java portlets.
Note: While these are the primary tools for building portlets, additional tools and technologies exist, such as other Oracle products, including Oracle Reports and Oracle BI Discoverer. These other tools are not covered in this guide. |
Use Table 57-1 to quickly scan all the features and characteristics of the different portlet building technologies, then see the subsequent sections for more in-depth information.
Table 57-1 Portlet Building Technologies Comparison Matrix
JSF Portlets | Web Clipping | OmniPortlet | Programmatic Portlets Standards-Based/PDK-Java |
---|---|---|---|
|
|||
Oracle JSF Portlet Bridge exposes JSF and ADF artifacts as JSR 286 portlets. |
A simple wizard-based tool, accessible from a browser, that assists in retrieving and presenting Web content that originates from other Web sites in a WebCenter Portal application. |
Wizard-based tool, accessible from a browser, that assists in retrieving and presenting data from a wide variety of data sources. |
PDK-Java offers Oracle-specific application programming interfaces (APIs) for building portlets for use in WebCenter Portal applications and Oracle Portal. Standards-based portlets additionally work with portals of other vendors. Oracle WebCenter Framework supports both WSRP and JSR 286 standards. |
|
|||
No expertise required. |
No expertise required. |
Basic understanding of one or more supported data sources and the concepts of portlet and page parameters. |
Java, Servlet, JSP knowledge. |
Supported Data Sources (for details, see Section 57.2.2, "Expertise Required") |
|||
No limitations. |
Any Web site accessible on the network over HTTP or HTTPS. |
CSV, XML, Web Service, SQL, Web site, JCA. |
No limitations. |
|
|||
WSRP producers using Oracle JDeveloper or manually. |
PDK-Java producers |
PDK-Java producers |
PDK-Java uses PDK-Java producers. Standards-based portlets use WSRP producers. |
|
|||
Expiry-based caching, validation-based caching (auto invalidate when personalized). |
Expiry-based caching, validation-based caching (auto invalidate when personalized). |
Expiry-based caching, validation-based caching (auto invalidate when personalized). |
Expiry-based, validation, and invalidation caching, Edge Side Includes. Note: JSR 286 does not support validation based caching. WSRP 1.0 does. If you use a pure WSRP portlet, then validation-based caching is also supported. If you host a JSR portlet on WSRP (as is done in Oracle WebCenter Framework) then validation-based caching is not supported. |
|
|||
Oracle JDeveloper Oracle JSF Portlet Bridge/JSF Portletization dialog. |
Browser - wizard. |
Browser - wizard. |
Oracle JDeveloper Java Portlet wizard (or any other Java development environment). |
|
|||
Develop a JSF application first, convert it into a JSF portlet later. |
design time at runtime. |
Develop first, add later. |
|
|
|||
Very Flexible. |
N/A |
Very flexible, by using the HTML layout. |
Very flexible. |
Ability to Capture Content from Web Sites |
|||
No. Depends upon the application being portletized. |
Yes, by its nature. |
Yes, by using the Web Page Data Source. |
Yes. For PDK-Java, use the For standards-based portlets, use the |
Ability to Render Content Inline |
|||
Yes. |
Yes |
No. However, inline rendering can be achieved through public portlet parameters. |
Yes. For PDK-Java, use private portlet parameters. Standards-based portlets include servlets and JSPs, using the method |
|
|||
No. |
No |
Yes, 2D-3D charts. |
Yes, using BI Beans. |
Public Portlet Parameter Support |
|||
Yes |
Yes |
Yes |
Yes |
Private Portlet Parameter Support |
|||
Yes |
No |
No |
Yes |
Ability to Hide and Show Portlets Based on User Privileges |
|||
Yes. |
No, though it is possible to apply security managers that are not exposed through the user interface (UI). |
No, though it is possible to apply security managers that are not exposed through the UI. |
Yes. For PDK-Java, by using the Security managers. For standards-based portlets, the Servlet security model is supported by using methods such as |
|
|||
Yes. |
N/A |
Yes |
Yes |
|
|||
Yes. |
N/A |
No |
Yes, programmatically |
Authenticating to External Applications |
|||
Through custom user attributes. |
External application integration supported. |
Basic authentication support if the data source requires it. |
For PDK-Java portlets, external application integration is supported. LDAP integration is supported when the portlet is running behind the same firewall as the LDAP server. For standards-based portlets, though not specifically supported, external application support is feasible through custom user attributes.) LDAP integration is supported. |
The rest of this chapter includes the following sections that provide more in-depth detail about the different portlet building technologies:
This section describes each portlet-building technology in terms of its usage characteristics (for example, wizard-based or programmatic).
JSF Portlets
The Oracle JSF Portlet Bridge is a dialog-based tool that enables page developers to expose their existing JSF applications and task flows as JSR 286 portlets. Using the Oracle JSF Portlet Bridge to create JSF portlets from JSF applications does not require a technical background.
Web Clipping
Web Clipping is a simple wizard-based tool that assists with retrieving and presenting Web content that originates from other Web sites in a WebCenter Portal application. Web Clipping does not require a technical background.
Examples of portlets you can build using Web Clipping
The examples of portlets that you can build by using Web Clipping are as follows:
Stock chart portlet
Web mail portlet
News portlet containing dynamic content from an existing Web site
OmniPortlet
OmniPortlet is an easy-to-use, wizard-based tool for presenting information from a wide variety of data sources in a variety of formats. OmniPortlet runs completely in the browser. Drop OmniPortlet on a page, click the Define link, and choose a data source and a presentation format. Select from a wide variety of data sources as follows:
Spreadsheet
SQL
XML
Web Service
Web page
OmniPortlet does not require the use of an additional development tool or a strong technical background. Even so, it can be used for building reusable, high-performing portlets.
Examples of portlets you can build using OmniPortlet
The examples of portlets that you can build by using OmniPortlet are as follows:
RSS news feed portlet
Sales chart portlet
Programmatic Portlets
If the wizard-based portlet building tools do not satisfy your needs, then you can build your portlets programmatically using Java. The Java Community Process standardized the Java portlet APIs in 2003. Portlets built against the Java Specification Request (JSR) 286 standard are interoperable across different portal platforms. The Java Portlet Wizard, a tool available through the Oracle WebCenter, assists with building Java portlets.
Note: When building portlets in Java, you have full control over your portlet's functionality. For example, you can control what it looks like and how it behaves. |
Examples of portlets you can build using Java
The examples of portlets that you can build by using Java are as follows:
Discussion forum portlet
E-mail portlet
While some portlet building tools do not require portlet development skills, others assume a strong technical background. This section describes each tool in terms of the level of knowledge required to use it effectively.
JSF Portlets
The Oracle JSF Portlet Bridge does not require a technical background. However, you must have an understanding of Faces and WSRP.
Web Clipping
Web Clipping does not require a technical background. However, to parameterize the Web page content that you clipped, you must have an understanding of public portlet parameters and page parameters.
OmniPortlet
OmniPortlet requires a basic knowledge of the data source you want to leverage in your portlet. Table 57-2 lists the types of data sources that can be used with OmniPortlet and describes the type of information required to work with each type.
Table 57-2 OmniPortlet Data Sources
Data Source | Required Information |
---|---|
Spreadsheet |
The URL that points to the spreadsheet containing the data to display in the portlet. |
SQL |
The connection information to the data source and the SQL query that retrieves the data from the database. |
XML |
The location of the XML source and optionally the address of the XSL filter and the XML schema. |
Web service |
The Web Services Description Language (WSDL) URL, the method of the Web service, and optionally the XSL filter URL and the XML schema URL. |
Web page |
The Web page data source uses the same environment as Web Clipping. No technical background is required. |
J2EE Connector Architecture |
Although not displayed on the OmniPortlet Wizard's Type page, a J2EE Connector Architecture (JCA) 1.0 adapter is also available. JCA provides a mechanism to store and retrieve enterprise data such as that held in ERP systems (Oracle Financials, SAP, PeopleSoft, and so on). |
Programmatic Portlets
To build Java portlets, you must know at least a subset of Java EE. Knowing HTML, Java servlets, and XML is a must, and JSP experience is recommended. Additional Java knowledge is optional, depending on the task you want to perform. Using Java portlets you can access any data source supported by the Java language.
Before a portlet can be consumed by an application, you must first deploy it, then register the producer you've deployed the portlet to. As shown in Figure 57-7, portlets can be deployed through the following two producer types:
PDK-Java producers
WSRP producers
Within WSRP, both version 1.0 and 2.0 are supported.
PDK-Java portlets are deployed to a Java EE application server, which is often remote and communicates with the consumer through Simple Object Access Protocol (SOAP) over HTTP. JSR 286 portlets are deployed to a WSRP producer, which is also remote and communicates with the consumer through WSRP (Web Services for Remote Portlets). JSF Portlets are deployed as JSR 286 portlets, that is, to a WSRP producer, either from Oracle JDeveloper or manually.
PDK-Java producers use open standards, such as XML, SOAP, HTTP, or Java EE for deployment, definition, and communication with applications. Figure 57-8 shows how Oracle Portal incorporates portlets from a PDK-Java producer and the PDK-Java producer communicates with WebCenter Portal application using SOAP over HTTP.
There are several benefits to developing portlets and exposing them through PDK-Java producers as follows:
Deploy portlets remotely.
Leverage existing Web application code to create portlets.
Specify producers declaratively.
Use standard Java technologies (for example, servlets and JSPs) to develop portlets.
To expose your portlets using a PDK-Java producer, you must first create a producer that manages your portlets and communicates with Oracle WebCenter Framework using SOAP. To learn how to expose your portlets using a PDK-Java producer, see Section 59.2, "Creating Java Portlets."
Oracle WebCenter supports Web Services for Remote Portlets (WSRP) versions 1.0 and 2.0. This emerging standard provides support for inter-portlet communication and export or import of portlet customizations.
The Producer Registration wizard is the entry point for registering both WSRP 1.0 and 2.0 producers. The wizard automatically recognizes whether WSRP 1.0 or 2.0 is in play.
Architecturally, WSRP producers are very similar to PDK-Java producers. WSRP is a communication protocol between WebCenter Portal application servers and portlet containers. WSRP is a standard that enables the plug-and-play of visual, user-facing Web services with intermediary Web applications.
Being a standard, WSRP enables interoperability between a standards-enabled container based on a particular language (such as JSR 286, .NET, Perl) and any WSRP portal. So, a portlet (regardless of language) deployed to a WSRP-enabled container can be rendered on any application that supports this standard.
Note: For more information about the WSRP architecture, see "The Relationship Between WSRP and JSR 286" in Chapter 59, "Creating Portlets with the Portlet Wizard." |
To make standard portlets (such as JSR 286, .NET, Perl) available to a WebCenter Portal application, you must package them in a portlet application and deploy them to a WSRP container.
To learn how to package your portlets in a WSRP container, see Chapter 61, "Testing and Deploying Your Portlets."
Figure 57-9 illustrates the basic architecture of portlet producers.
When users display a page in their Web browsers, the flow of the request works as follows:
The user requests a page from the Web browser by entering a URL in the browser's address field.
The browser transmits the request to the application over HTTP.
The application contacts the portlet producers that provide the portlets that display on the requested page.
The producers make the necessary calls to their portlets so that the portlets generate the portlet content in the form of HTML or XML code.
The producers return the portlet content back to the application using their relevant protocols:
JSR 286 portlets and JSF portlets are initialized by WSRP producers, which communicate using the WSRP 1.0 or 2.0 protocol.
PDK-Java portlets are initialized by PDK-Java producers, which communicate using SOAP over HTTP.
JSF portlets, Web Clipping, OmniPortlet, and Java portlets communicate with Oracle WebCenter Framework through either WSRP or PDK-Java producers. You must register these producers with Oracle WebCenter Framework before you can use the portlets they produce in your WebCenter Portal application.
The latest versions of Web Clipping and OmniPortlet are available through Application Development Runtime Service (ADRS). For more information, see Section 3.4, "Working with the Integrated WebLogic Server."
Portlet caching is key to rapid response to user requests. Portlets implement validation-based and expires-based caching using Java Object Cache. Invalidation-based caching continues to be implemented by a Web Cache that fronts the PDK-Java producer running the Web Clipping portlet and OmniPortlet.
Caching rules can be specified at a portlet's container level, encoded in the portlet's own logic, or, for JSR 286 portlets, established through the portlet wizard. Provided it is specified, container-level caching takes over when caching is not part of the portlet code.
At the application level, Oracle WebCenter Framework supports use of a Java cache for the establishment of application-level caching rules.
When not using caching, you may find accessing various data sources with Web Clipping and OmniPortlet to be time consuming. When you enable caching at the application level, you instruct the Java cache to maintain a copy of the portlet content. When data that was previously cached is requested, no time is lost in contacting the data source and regenerating its content. Instead, the previously cached portlet content is returned.
A portlet's content weighs heavily in determining the type of caching the portlet should use. For example:
Expiry-based caching: Consider using expiry-based caching when the portlet content is static or when it is not critical that the most up-to-date content be displayed. When using expiry-based caching, you must specify the caching period.
Validation-based caching: Consider using validation-based caching for portlets with dynamic content that changes frequently or unpredictably. The portlet associates its content with a caching key and returns the key value along with the content. When the portlet content is requested, the portlet decides, based on the caching key, if the current content is valid. If the portlet content is valid, then it returns a response indicating that the cached content can be used (that is, the content is valid) or generates the new portlet content and returns it along with a new caching key for that content.
JSF Portlets
Oracle JSF Portlet Bridge supports expiry- and validation-based caching. JSF portlets can be cached in full, or you can use Edge Side Includes (ESI) to cache fragments of portlets.
Web Clipping and OmniPortlet
In addition to invalidation-based caching, expiry-based caching can be specified for the Web Clipping portlet and OmniPortlet. Additionally, these portlets are refreshed automatically when they are personalized.
Programmatic Portlets
Java portlets support expiry- and validation-based caching. These portlets can be cached in full, or you can use Edge Side Includes (ESI) to cache fragments of portlets.
This section describes the development tools you can use to build different types of portlets.
JSF Portlets
Oracle JSF Portlet Bridge/JSF Portletization dialog is used to create a JSF portlet based upon a page or a task flow.
Web Clipping and OmniPortlet
OmniPortlet and Web Clipping use a browser-based wizard as the development tool.
Programmatic Portlets
Although you can use any Java development environment to build Java portlets, it is highly recommended that you use Oracle JDeveloper, a professional IDE. While you can consider other IDEs, Oracle JDeveloper includes the Java Portlet Wizard, to minimize your Java portlet development efforts.
The Java Portlet Wizard generates a starting skeleton and file structure for both JSR 286 and PDK-Java portlets. You need only add your own business logic to the skeleton. Oracle JDeveloper can also package and deploy your applications to your Java EE container. Also, Oracle JDeveloper helps you test your portlet producer. Oracle recommends that you use the Integrated WLS, provided through Oracle WebCenter Framework, as your development Java portlet runtime environment. For more information, see Chapter 3, "Preparing Your Development Environment."
Oracle WebCenter Framework supports the following types of portlet creation (Figure 57-10):
Develop first, add later
Design time at runtime
Develop first, add later portlet creation is usually the task of the portlet developer; design time at runtime portlet creation is the application developer's responsibility.
JSF Portlets
Develop a JSF application first and then portletize the application using the JSF Portletization dialog at design time.
OmniPortlet and Web Clipping
OmniPortlet and Web Clipping both offer a "design time at runtime" portlet creation style. Register the portlet producers with the application that consumes the portlets, add the portlets to an application page, run the application, and then define the portlets in-place on the page.
Programmatic Portlets
Typically programmatic portlets offer a "develop first, add later" portlet creation style. Two wizards are available through Oracle WebCenter Framework to assist with the creation of Oracle PDK-Java and JSR 286 portlets. The wizards generate the basic files required for portlet creation. The developer hand-codes the portlet logic. The development sequence for programmatic portlets is to create the portlet, deploy it to a producer, register the producer with the application that consumes the portlet, and then add the portlet to an application page.
Note: With extensive coding, you can create "design time at runtime" Java portlets. For example, Web Clipping and OmniPortlet are both Java portlets. |
This section describes the portlet building tools in terms of the control you have over the user interface.
JSF Portlets
Oracle JSF Portlet Bridge ensures that the portletized JSF application functions as a JSF portlet.
Web Clipping
Because of its nature, Web Clipping always displays the remote Web site content, therefore UI flexibility is not a requirement for this portlet.
OmniPortlet
OmniPortlet enables you to use different pre-built layouts, such as scrolling news, tabular, and chart. You can also use the built-in HTML layout to personalize the look and feel of your portlet using HTML and JavaScript.
Note: When using JavaScript in portlets, developers must ensure that the JavaScript identifiers are qualified. That is, identifiers must be unique for each portlet instance and must not clash with the JavaScript on the page. |
Programmatic Portlets
In Java portlets, you have full control over your portlet's user interface. Your portlet is free to generate any HTML content that conforms to the rendering rules for pages.
This section describes the portlet building tools in terms of their ability to include content from other sources.
JSF Portlets
Oracle JSF Portlet Bridge's capability to capture contents from Web sites depends upon the JSF application being portletized.
Web Clipping
For portlets that display content from a remote Web site as it is presented at the source location, the best tool to use is Web Clipping. Web Clipping can tolerate the changes of the source HTML page to some extent. If a clipped table moves from one place to another in the source page, then the Web Clipping engine can find the table again using the internal "fuzzy match" algorithm. Portlets built with Web Clipping can also maintain sessions to the remote Web sites. Web Clipping also supports user personalization of HTML form values.
OmniPortlet
For portlets using the data but not the layout from a remote Web site, the best choice is OmniPortlet. Use OmniPortlet to retrieve the data, process the data (format, filter, and so on), and present it in a portlet in a tabular, chart, or news format. OmniPortlet is a powerful tool that extracts data from Web pages by using its Web Page data source.
Programmatic Portlets
Java portlets can take advantage of low-level Java networking APIs to retrieve and process content from remote Web sites. To avoid unnecessary development efforts, before choosing Java always ensure that Web Clipping or OmniPortlet are not viable options.
Active elements in portlets, such as links or form buttons, enable users to navigate to remote URLs. In a News portlet, for example, a user can click a hyperlink to navigate to a news site with detailed information about news of interest. For example, a user clicks a news-summary link in a News portlet, leaves the application page, and lands on the news site.
You may have a requirement to keep your users within the context of the application page by rendering the requested content within the same portlet container. For example, a user clicks a news-summary link in a News portlet, and the portlet refreshes with the detailed news article.
This maintenance of context is what rendering content inline means .
JSF Portlets
Oracle JSF Portlet Bridge converts a JSF application with multiple pages into JSF portlets. The contents of these pages are rendered inline.
Web Clipping
The Web Clipping portlet supports URL rewriting for achieving inline content rendering. It can process the links originating from the source Web site and rewrite them to achieve the desired functionality.
The following options are available:
Select not to rewrite the URLs within the portlet, in which case clicking the links takes users out of the WebCenter Portal application to the Web site that provides the clipping. Whenever the link brings the user to a place that requires authentication, the user must enter login information before the link target is displayed.
If the Web Clipping provider is registered with an external application and the clipping requires authentication, then you can instruct Web Clipping to rewrite all URLs within the portlet to point to the Login Server. In this case, navigation causes the user to leave the WebCenter Portal application, while also using the Login Server to log the browser into the External Application.
Select to rewrite all URLs within the portlet (inline rendering) to point back to the page so that all browsing within the Web Clipping portlet remains within the WebCenter Portal application. If the Web Clipping provider is registered with an External Application, then this causes the Web Clipping provider to log itself in to the External Application. In this case, the navigation within the WebCenter Portal application through the Web Clipping provider is authenticated in the External Application.
OmniPortlet
Rendering content inline is not supported, but you can achieve inline rendering using public portlet parameters.
Programmatic Portlets
As you have full control over the links and buttons in Java portlets, you can easily implement the inline rendering functionality. To achieve inline rendering, you must append the private portlet parameters to the page URL.
If you use Struts in your portlet, then the PDK-Struts integration framework renders your content always in the same portlet container. Oracle recommends, however, that you use ADF Faces navigation for your new WebCenter Portal application portlets.
If your portlet consists of multiple JSPs (for example, several steps in a survey or wizard), then your portlet can make use of a special parameter to specify at runtime the JSP to use to render the content.
This section describes the portlet building tools in terms of their charting capability.
JSF Portlets
Oracle JSF Portlet Bridge does not have charting capability. However, it supports portletization of a JSF application that contains ADF charts.
Web Clipping
Web Clipping clips pre-existing content. So, while it does not create charts, it can retrieve and present HTML content that contains charts.
OmniPortlet
OmniPortlet supports bar, line, and pie chart types. Charts are dynamically generated images, which can include hyperlinks.
Programmatic Portlets
You can create sophisticated charts programmatically in Java portlets using Oracle's Business Intelligence (BI) Beans.
Typically, a portlet's state is opaque (private); however, in Oracle WebCenter Framework portlets can describe public inputs (parameters) so values can be coordinated by the consuming application with other constituents of that application.
Inputs can include, public portlet parameters and private portlet parameters. These can be described as follows:
Public portlet parameters: Use public portlet parameters to pass values to a portlet. Public parameters can assist with rendering portlet content that is specific to a particular page or user. Portlet parameters are created by the component developer and then exposed to the application developer through the user interface. After adding a portlet to a page, application developers can assign values to public portlet parameters to make the information displayed in the portlet specific to the page.
Assigned values can be specific (such as a constant), a system variable (for example, the user name), or a page parameter. At runtime, the portlet receives the values from the sources specified.
Private portlet parameters: Use private portlet parameters to implement internal navigation in a portlet. Parameters are passed to the portlet every time the page is requested. Private portlet parameters can be passed exclusively from the portlet instance to the same portlet instance. Private portlet parameters do not require a full page refresh.
Note: A Refresh action is available for inclusion on the portlet's Actions menu (isNormalModeAvailable ). It refreshes the portlet without triggering a full page refresh. For details about setting this action programmatically, see Section 63.4, "Setting Attribute Values for the Portlet Tag." |
Portlets supporting public portlet parameters enable application developers to tailor data input for each portlet instance. The component developer can focus on the portlet logic, while the application developer can address the interaction between the application page and its portlets.
All portlet building technologies discussed in this chapter (OmniPortlet, Web Clipping, and programmatic portlets) support public portlet parameters. OmniPortlet and Web Clipping provide complete support through their wizard interface. You can add public portlet parameter support to your programmatic portlets programmatically or with the Java Portlet wizard.
This section describes the portlet building tools in terms of their support for private parameters.
JSF Portlets
In your JSF portlets, you can implement internal navigation using private portlet parameters.
OmniPortlet and Web Clipping
With the OmniPortlet and Web Clipping portlets, component developers do not have access to private portlet parameters.
Programmatic Portlets
In your Java portlets, you can implement internal navigation using private portlet parameters.
This section describes the portlet building tools in terms of their support for authorization functionality.
JSF Portlets
Oracle JSF Portlet Bridge supports the standard servlet mechanisms.
Web Clipping and OmniPortlet
Dynamically hide and show portlets built with Web Clipping and OmniPortlet by using security managers. Although Web Clipping and OmniPortlet do not expose security managers through the user interface, they make them available for editing through their XML provider definition files.
Programmatic Portlets
PDK-Java provides security managers for Java portlets. For example:
Group security manager: The group security manager controls access to portlets based on group membership. For example, it shows the portlet to users who are members of a specified group, and hides the portlet from non-members.
Authentication level security manager: The authentication level security manager controls access to the portlets based on authentication level. For example, it shows the portlet to authenticated users, and hides it from public users.
JSR 286 portlets support the standard servlet mechanisms.
This section describes the portlet building tools in terms of their support for other languages.
Web Clipping, OmniPortlet, JSF portlets, and Java portlets display textual information in the language selected by the end user.
Support for pagination is useful when a portlet must display a relatively large set of records.
JSF Portlets
Oracle JSF Portlet Bridge supports pagination, if the application portletized has pagination implemented in it.
Web Clipping
Web Clipping does not support pagination.
OmniPortlet
OmniPortlet does not support pagination.
Programmatic Portlets
With Java, portlet pagination can be implemented programmatically.
This section describes the portlet building tools in terms of authentication for external applications.
JSF Portlets
Since any portletized application can function as a WSRP portlet, the external application support is feasible through custom user attributes.
Web Clipping
Web Clipping's integration with the external application framework provides a fully automated mechanism to store passwords to external Web sites. All you must do is provide an External Application ID when registering the Web Clipping producer.
OmniPortlet
OmniPortlet enables you to store connection information when the data source is password protected. The credentials to access the data source can either be shared across all users or saved individually for each user. OmniPortlet can storing database credentials and HTTP basic authentication user name-password pairs. Credentials are stored in a secured metadata services repository.
Programmatic Portlets
Java portlets support programmatic integration with the external application framework and any LDAP server, such as Oracle Internet Directory.