This chapter describes how to use AquaLogic Ensemble to create and deploy pagelets. It is organized into the following sections:
A pagelet is a fragment of HTML that describes a self-contained, reusable UI element. With a portal system, a portlet is a self-contained UI element that can be used in the portal. A pagelet is like a portlet that you can easily insert into any web page proxied by Ensemble.
A pagelet is an application hosted on an Ensemble resource. Before registering a pagelet in Ensemble, a you must create a resource and configure it to point to the application server where the pagelets are hosted. For details on creating resources, see Proxy Resources.
Once you save the pagelet, sample code for inserting the pagelet into a web page is available on the General page of the pagelet configuration. For details on inserting pagelets into web pages, see Adding a Pagelet to a Web Page.
Ensemble can restrict the resources that can insert each pagelet into its web pages. For details, see Configuring Pagelet Consumers.
Parameters can be configured to be passed to the pagelet. For details, see Configuring Pagelet Parameters and Transport Type.
You can add a pagelet to any web page that is proxied by Ensemble. Sample code for adding a pagelet to a web page is provided on the General page of the pagelet configuration. The basic format of the pagelet injection code is:
<pt:ensemble.inject pt:name="library:pagelet" />
Library is the library name and pagelet is the pagelet name, as entered in the Ensemble pagelet configuration.
Any data passed to the pagelet is also included in the pagelet injection code. For details on configuring pagelet parameters, see Configuring Pagelet Parameters and Transport Type.
Note: | You must define the namespace prefix `pt' in the web page as xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/ |
By default, pagelets can be consumed by any Ensemble proxied application. To restrict which resources can consume a pagelet:
To remove a resource from the list of consumers, select the resource to remove and click Delete.
This section describes how to use pagelet parameters to pass data to pagelets. It is divided into the following sections:
You configure the pagelet parameters that can be passed to the pagelet in the pagelet configuration in the Ensemble Console. You include pagelet parameter values in the pagelet injection code that is added to a web page. This section is divided into the following sub-sections:
To configure parameters for a pagelet in the Ensemble Console:
Note: | The Description and Type fields are used for pagelet documentation and are optional. Pagelet documentation is automatically created and can be viewed in the Pagelet Discovery UI. For details on the Pagelet Discovery UI, see Accessing Pagelet Discovery for Developers. |
To delete a parameter, select the checkbox to the left of the parameter and click Delete.
The Pagelet Parameter Transport Type setting is provided for porting AquaLogic Interaction portlets to Ensemble pagelets. For details, see Configuring Pagelet Parameter Transport Type.
You set pagelet parameter values in the pagelet injection code using the parameter names configured in the Ensemble Console. For example:
<pt:ensemble.inject pt:name="library : pagelet"
param1="foo"
param2="bar"
In this example, Ensemble passes the pagelet library:pagelet two parameters: param1 with a value of foo, and param2 with a value of bar.
Any text data can be passed to the pagelet by including it within the <pt:ensemble.inject>
tag. For example:
<pt:ensemble.inject pt:name="library:pagelet">
This is the payload.
In this example, Ensemble passes the text This is the payload to the pagelet as the pagelet payload.
The pagelet retrieves the payload through the Ensemble Proxy API. In addition to extracting the payload as raw text, the Proxy API provides methods to extract an XML payload as an XML document.
For more information on the Proxy API, see the following documentation:
Ensemble allows you to configure a payload schema URL to point to an XML schema that can 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.
To configure the payload schema URL:
Pagelet parameter transport type allows you to port AquaLogic Interaction portlets to work as pagelets within Ensemble. AquaLogic Interaction portlets may require Administrator, CommunityPortlet, or Community level preference settings.
For details on portlet settings and preferences, see the ALUI developer documentation for Portlet Settings.
To supply these preferences from Ensemble:
Pagelets configured Ensemble are automatically documented in the Ensemble Pagelet Discovery UI. To access the pagelet discovery UI: