A portlet is a reusable user interface widget displayed in the context of an enterprise portal environment. Modeled after the “window” metaphor from desktop user interfaces, portals typically display portlets as a series of windows or boxes arranged in columns on a page with borders, title bars, buttons, headers and footers rendered by the portal framework.
A pagelet is also a reusable user interface widget, but while portlets are intended for display only in portals, pagelets are designed to run on any web page. Any HTML fragment can be a pagelet, but pagelet developers can also take advantage of many of the APIs available to portlet developers to write pagelets that are parameterized and configurable, to dynamically interact with other pagelets, and respond to user input using Ajax patterns.
Pagelets can be consumed by both Ensemble and ALI portal. Portlets may have functionality that is tightly integrated with the portal, including a range of settings stored in the portal database, but most portlets can be modified or configured to work with Ensemble.
This page provides an introduction to cross-product development and an explanation of the differences between pagelets and portlets.
ALI portal and Ensemble both support AquaLogic development tools, including the AquaLogic Development Kit (IDK), Adaptive Tags, and the ALI Scripting Framework. These tools provide cross-product APIs that allow you to write a single pagelet for both ALI portal and Ensemble, as well as product-specific APIs to implement advanced functionality.
The AquaLogic Development Kit (IDK) includes APIs to support pagelets and portlets in Ensemble and ALI portal.
The bea.alui.proxy package supports cross-product pagelet development. The interfaces in this package provide access to information about the environment in which the pagelet is displayed and the user currently accessing the pagelet, including session preferences associated with that user. This package also includes Ensemble-specific methods to implement security and access XML payloads.
The plumtree.remote.portlet package provides portal-specific support for portlet development, including manipulating settings in the ALI database, accessing user information, and managing communication with the portal.
For a comparison of the methods in the bea.alui.proxy plumtree.remote.portlet packages, see IDK Proxy and Portlet APIs.
The plumtree.remote.prc package includes a collection of APIs that provide access to functionality within the ALI portal, Collaboration, Publisher, and Search Service. These APIs are supported by Ensemble and ALI portal, and can be used by any pagelet deployed in an environment with access to these applications. For details, see IDK Remote APIs.
As noted above, the methods in the bea.alui.proxy package can be used
in pagelets for both Ensemble and ALI portal. This package includes the
IProxyRequest.getEnvironment
method to support product-specific functionality within a cross-product
pagelet. This method returns NONE if the page is executed outside a proxy/gateway,
PLUMTREE or PORTLET if the page is gatewayed by the portal, and PROXY
if the page is gatewayed (proxied) by Ensemble. To implement product-specific
functionality, simply wrap the code in an if-then statement based on the
environment, as shown in the code snippet below.
_proxyContext = ProxyContextFactory.getInstance().CreateProxyContext(request,
response); _proxyRequest = _proxyContext.GetProxyRequest(); { |
For a list of product-specific functionality, see the next section, Product-Specific Functionality and Configuration.
Adaptive Tags are used to display contextual data and control Ensemble and ALI portal functionality from remote pagelets.
Unlike the IDK, Adaptive Tags use XML in pagelet content instead of code, which avoids a network round trip. Tags can be included in the markup returned by any proxied page (HTML, JSP or ASP.Net). Using the attributes defined in the tag, the Ensemble or ALI portal gateway transforms the XML and replaces it with standard HTML and/or executes the relevant operations.
The Adaptive Tag collection currently includes libraries for use in both ALI portal and Ensemble, as well as libraries that are specific to each environment.
The cross-product libraries pt:core and pt:logic provide key functionality for use in cross-product pagelets.
The ALI portal tag libraries include tags to display portal navigation components (pt:plugnav and pt:ptdata), portal ui components (pt:ptui), and standard ui elements (pt:standard). Tags in the pt:standard and pt:transformer libraries also provide access to useful functionality, including URL transformation and logic based on user and group membership.
The Ensemble tag libraries include tags to display pagelets and resources (pt:ensemble) and access key URLs (pt:constants). Tags in the pt:common library provide access to useful functionality, including URL transformation, error information, and control over the Head element in a proxied HTML page.
The Pages tag library allows you to insert Pages elements in ALI portal navigation.
The Pathways tag library allows you to insert Pathways search in ALI portal navigation.
For detailed information on Adaptive Tags, including sample code and instructions on creating custom tags, see Adaptive Tags.
The ALI Scripting Framework is a set of client-side JavaScript libraries that provide services to pagelets and proxied/gatewayed pages. The ALI Scripting Framework allows portlets to:
Store and share session state through browser level variables. Browser-level variables can be stored and shared among pagelets, even pagetlets that are not on the same page. For example, a value entered by the user in one portlet can be retrieved by another.
Leverage page-level events. A pagelet can respond when specific events happen, such as when the page loads or when the browser focus changes.
Refresh pagelet content without reloading the entire page. Pagelets can reload their internal content without refreshing the rest of the page.
Open any ALI object from anywhere within the portal (ALI portal only). The CommonOpener_OpenObject function is included in every page generated by the ALI application, and can be called from any piece of UI or from within a pagelet.
For details on using the ALI Scripting Framework in your pagelets, see ALI Scripting Framework.
There are some key differences between Ensemble and ALI portal that affect pagelet development.
Pagelet security is implemented differently in Ensemble and ALI portal. In both cases, there are two steps to securing pagelet content: authentication and access control.
Authentication
In Ensemble, each pagelet is associated with a resource that represents a web application. Authentication information for the web application is configured through the resource. Ensemble supports SSO and credential mapping. For details, see AquaLogic Ensemble Administrator Guide Chapter 5, "Proxy Authentication" and Chapter 6, "Credential Mapping." When a pagelet requires authentication with a back-end application, Ensemble uses the settings for the associated resource.
In ALI portal, each pagelet (portlet) is associated with a set of portal objects that represent the host server, web application, and pagelet file. Authentication information is configured through these objects. ALI portal also supports SSO and credential mapping. For details, see Portlet Security: Using the Credential Vault.
Access Control
To control access to specific content or functionality, Ensemble uses roles. Pagelets and resources can access a user's role(s) in the current context through Adaptive Tags or IDK methods. For details, see Securing Pagelets and Proxied Applications.
In the ALI portal, access is controlled through a combination of roles (also known as settings rights), activity rights, and Access Control Lists (ACLs). For details, see Portlet Security.
Ensemble supports a subset of the setting types available to portlets through the ALI portal. The following settings are available in both Ensemble and ALI portal:
Session preferences apply to one user and are persisted for the duration of the user's session. Session preferences can be accessed by multiple pagelets and used to communicate between pagelets. Session preferences can be set and retrieved using the IDK Proxy and Portlet APIs or the ALI Scripting Framework.
In Ensemble, you must enter any session preferences in the resource editor on the CSP tab (for details, see Ensemble Pagelet Configuration).
In the ALI portal, you must enter any session preferences in the Web Service editor on the Preferences page (for details, see ALI Portlet Configuration).
User information is read-only user-specific settings from back-end applications. User information can be accessed by any pagelet with access to the back-end application using the IDK Proxy and Portlet APIs.
In Ensemble, you must enter any user information settings in the resource editor on the CSP tab (for details, see Ensemble Pagelet Configuration).
In the ALI portal, you must enter any user information in the Web Service editor on the User Information page (for details, see ALI Portlet Configuration).
Attributes are hard-coded in an HTML page and sent in the HTTP Request header. Attributes can be used by pagelets in the same way as any HTML page. The IDK proxy API getSetting method also retrieves all settings, including attributes.
In Ensemble, you must enter attributes used by a pagelet in the pagelet editor on the Parameters tab. Ensemble can be configured to send attributes as Administrative, Community or CommunityPagelet preferences to support portlets that use these ALI preference types. For details, see Ensemble Pagelet Configuration.
In the ALI portal, attributes are always sent in the HTTP Request header and can be used by portlets in the same way as any HTML page. No extra configuration is necessary.
The ALI portal also stores five types of settings in the portal database (Portlet, User, Community, CommunityPortlet and Administrative). For details on using these settings, see Portlet Settings and Preferences.
In Ensemble, data can also be passed to a pagelet through a payload, covered next.
In Ensemble, data can be passed to a pagelet through a payload. In addition to extracting the payload as raw text, the IDK Proxy API provides methods to extract an XML payload as an XML document.
You can configure a payload schema URL to point to an XML schema that can be used to validate an XML payload. Ensemble only supplies the URL to the pagelet; it is up to the pagelet to use the schema to validate the XML payload. For information on using payloads, see the AquaLogic Ensemble Administrator Guide "Chapter 9, "Pagelets" and IDK Quickstart: Hello World Pagelet (Java | .NET).
The deployment steps for pagelets are different in Ensemble and the ALI portal.
In Ensemble, three objects are required to deploy a pagelet:
Resource (producer): The producer resource defines the location of the web application that implements the pagelet code and how it is accessed. In most cases, a single producer resource is used for multiple pagelets.
Pagelet: The pagelet defines the pagelet file and any associated parameters.
Resource (consumer): The consumer resource defines the location of the web application that displays the pagelet code and how it is accessed.
In ALI portal, two objects are required to deploy a pagelet/portlet:
Remote Server (optional): The remote server defines the location of the server that hosts the web application that implements the pagelet/portlet. In most cases, a single remote server object is used for multiple pagelets/portlets.
Web Service - Remote Portlet: The web service defines the location of the web application that implements the pagelet/portlet code and how it is accessed.
Remote Portlet: The portlet defines the display options for the pagelet/portlet and provides access to the administrative settings page (if there is one). The ALI portal also allows you to create an optional portlet template for use by multiple portlets.
The options available for these objects are summarized in the next section, Configuration.
The configuration options for pagelets are different in Ensemble and the ALI portal. The table below lists the locations of specific configuration components and summarizes the differences.
For details on pagelet configuration in Ensemble, see Ensemble Pagelet Configuration.
For details on portlet configuration in the ALI portal, see ALI
Portlet Configuration. For summarized instructions on deploying ALI
portlets in Ensemble or Ensemble pagelets in ALI portal, see the bottom
of this page.
Component |
Ensemble Configuration Page: Tab |
ALI Portal |
Notes |
Server name and URL |
Resource: General, Connections |
Remote Server: Main Settings |
In Ensemble, the server that hosts the pagelet is defined using a resource. The server name is entered on the General tab, and the URL is entered on the Connections tab. Ensemble allows you to define an External URL for the server to be displayed to users. In ALI portal, the server that hosts the pagelet/portlet is defined using a remote server (optional). If a remote server object is used, the base URL for the server is entered in the remote server editor. If a remote server object is not used, the complete pagelet/portlet URL is entered in the web service editor on the Main Settings page. |
Timeout |
Resource: General |
Web Service: Main Settings |
In Ensemble, the timeout is set for a resource, which includes all pagelets using that resource. In ALI portal, the timeout is set for the specific pagelet/portlet. You can set a different timeout for gatewayed and non-gatewayed content. |
Caching |
n/a |
Web Service: HTTP Configuration |
In ALI portal, you can define a minimum and maximum cache time for pagelet/portlet content. (Caching is not configurable in Ensemble.) |
Security |
Resource: General, |
Remote Server: Main Settings |
Security is implemented differently in Ensemble and ALI portal. For a summary, see the Security section above. In both Ensemble and ALI portal, security settings are defined on a collection of pages. For details on configuring security, see Securing Pagelets and Proxied Applications (Ensemble) and Portlet Security (ALI portal). |
Header forwarding |
Resource: Headers |
n/a |
In Ensemble, this page allows you to define which headers are forwarded to a pagelet. (In ALI, all headers are forwarded to portlets and gatewayed pages.) |
Gateway/proxy transformation |
Resource: Connections |
Web Service: HTTP Configuration |
In Ensemble, you can choose whether or not to enable URL rewriting for URLs in the same directory as the resource. (URLs are transformed to use the External URL defined on the Connections tab.) In ALI portal, you can
define which pages are gatewayed and transformed by listing them on the
HTTP Configuration page. You can also choose whether or not to transform
JavaScript and CSS, and whether to display gatewayed pages with a portal
header (hosted display mode). |
Preferences |
Resource: CSP |
Web Service: Preferences, User Information |
Settings are implemented differently in Ensemble and ALI portal. For a summary, see the Settings section above. In Ensemble, you must enter the session preferences and user information used by a pagelet on the CSP tab of resource configuration. Any attributes used by the pagelet must be configured on the Parameters tab of pagelet configuration. In ALI portal, you must enter configure preferences used by a pagelet/portlet on the Preferences page of the web service editor, and any user information on the User Information page. |
Pagelet name and description |
Pagelet: General |
Portlet: Main Settings |
In Ensemble, the General tab of pagelet configuration also provides pagelet sample code for use in a consumer page. |
Pagelet host server |
Pagelet: General |
Web Service: Main Settings |
In Ensemble, each pagelet has an associated resource, entered on the General tab of pagelet configuration. In ALI portal, each pagelet/portlet has an associated web service, entered on the Main Settings page of the portlet editor. (Web services may have an associated remote server, entered on the Main Settings page of the web service editor.) |
In-place refresh |
Pagelet: General |
Web Service: Advanced Settings |
In Ensemble, you can define the refresh interval for the pagelet on the General tab of pagelet configuration. In ALI portal, you can add refresh button to a pagelet/portlet by selecting the option on the Advanced Settings page of the web service editor. In both Ensemble and ALI portal, you can use the ALI Scripting Framework to refresh pagelet content. |
Pagelet URL |
Pagelet: Location |
Web Service: Main Settings |
In Ensemble, the pagelet path is entered on the Location tab of pagelet configuration. This path is relative to the URL of the associated resource. In ALI portal, the pagelet/portlet path is entered on the Main Settings page of the web service editor. If a remote server is used, the path is relative to the remote server URL; if not, the path must be an absolute URL. |
Login token forwarding |
Resource: CSP |
Web Service: Advanced Settings |
In both Ensemble and ALI portal, you must select the option to send the login token to access IDK Remote APIs. |
Allowed consumers |
Pagelet: Consumers |
Web Service: Alternative Browsing Devices |
In Ensemble, you can limit the resources that can consume a pagelet. In ALI portal, there is no way to limit the pages that can use a pagelet/portlet. This page allows you to configure which devices are supported by a pagelet/portlet. |
Associated pages |
Pagelet: General |
Web Service: Advanced URL Settings |
In Ensemble, you can choose whether or not to include a pagelet in the Developer Pagelet Catalog. In ALI portal, pagelets/portlets do not have documentation that can be surfaced through the portal. This page allows you to define associated pages for a pagelet/portlet, including help and configuration pages. |
Debugging |
n/a |
Web Service: Debug Settings |
In ALI portal, you can configure HTTP tracing to filter user or portlet debugging information. |
Portlets designed for use in ALI portal can be used in Ensemble with some limitations, described above. Follow the steps below to register a portlet in Ensemble.
For a comparison of configuration settings, see Configuration above. For details on specific configuration settings, see Ensemble Pagelet Configuration.
Create a Resource that points to the remote server that hosts the portlet application (the same URL used to configure the Remote Server for the portlet in the portal).
Create a Pagelet that points to the portlet file on the remote server (enter the name of the portlet file as the URL suffix on the Location tab).
If the portlet uses preferences in the portal database, enter the preference names on the Parameters tab and set the Pagelet Parameter Transport Type to the appropriate preference type.
Save the pagelet. Copy the Sample code XML declaration displayed on the General tab.
Create an HTML page and paste in the XML declaration for the pagelet. If the pagelet uses preferences, they must be defined in the pt:ensemble.inject tag. Deploy the HTML page on a web server.
Create a Resource that points to the web server that hosts the HTML page created in step 4.
If links within the portlet should be gatewayed, configure the external prefix and select Enable URL Rewriting on the Connections tab.
If the portlet requires authentication, configure the appropriate settings on the Credential Mapping tab.
If the portlet uses session preferences or user information, enter the preference names on the CSP tab.
If the portlet uses Remote APIs, select Send login token on the CSP tab.
To view the pagelet in Ensemble, hit the HTML page on the resource created in step 5: http://<Ensemble_proxy_host>:<Ensemble_proxy_port>/HTMLserver/pagelet.html
Note: By default, new pagelets and resources are only accessible by the "administrator" user. For additional information on configuration, see the Ensemble documentation.
Ensemble pagelets are designed to support cross-platform implementations. The only Ensemble functionality that is not available in the ALI portal is pagelet payloads. Follow the steps below to register a pagelet in the ALI portal.
For a comparison of configuration settings, see Configuration above. For details on specific configuration settings, see ALI Portlet Configuration.
Create a Remote Server that points to the pagelet server.
If the pagelet requires authentication, choose the authentication type.
Create a Web Service - Remote Portlet that points to the pagelet application file.
If links within the pagelet should be transformed, configure the appropriate options on the HTTP Configuration page.
If the portlet uses Remote APIs, select Send login token on the Advanced Settings page.
If the portlet requires authentication, configure the appropriate settings on the Authentication Settings page.
If the pagelet uses session preferences, enter the names on the Preferences page.
If the pagelet uses user information, enter the attribute names on the User Information page.
Create a Portlet that uses the Web Service created in step 2.
To view the portlet in ALI portal, add it to a portal page.