Administrator Guide

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Pagelets

This chapter describes how to use AquaLogic Ensemble to create and deploy pagelets. It is organized into the following sections:

 


About Pagelets

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.

 


Registering a Pagelet

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.

To register a new pagelet:

  1. Launch the Ensemble Console.
  2. Click the APPLICATIONS tab.
  3. Click the Pagelets sub-tab.
  4. To create a new pagelet, click Create new.
  5. On the General page, type the Name of the pagelet.
  6. Select a parent resource. Next to Parent resource, click select. From the Select a resource picker, select the resource your pagelet is hosted on and click OK.
  7. Type the Library to associate this pagelet with. This can be any text value. The library setting is a user-defined way of grouping pagelets together within the pagelet documentation. This setting is optional.
  8. Type a Description.
  9. On the Location page, type the URL suffix. The Internal URL prefix (taken from the parent resource) appended to the URL suffix forms the URL to the pagelet.
  10. Click Save.

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.

 


Adding a Pagelet to a Web Page

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/

 


Configuring Pagelet Consumers

By default, pagelets can be consumed by any Ensemble proxied application. To restrict which resources can consume a pagelet:

  1. Launch the Ensemble Console.
  2. Click the APPLICATIONS tab.
  3. Click the Pagelets sub-tab.
  4. Click the name of the pagelet you want to configure.
  5. Restrict all resources from consuming the pagelet. On the Consumers page, clear the Allow all consumers check box.
  6. Add resources able to consume the pagelet by clicking Add.
  7. Select one or more resources to add.
  8. Click Add selected items.
  9. Click OK.

To remove a resource from the list of consumers, select the resource to remove and click Delete.

 


Configuring Pagelet Parameters and Transport Type

This section describes how to use pagelet parameters to pass data to pagelets. It is divided into the following sections:

Passing Data with Pagelet Parameters

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:

Configuring Parameters in the Ensemble Console

To configure parameters for a pagelet in the Ensemble Console:

  1. Launch the Ensemble Console.
  2. Click the APPLICATIONS tab.
  3. Click the Pagelets sub-tab.
  4. Click the name of the pagelet you want to configure.
  5. On the Parameters page, type a Name, Description, and Type for the parameter.
  6. 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.
  7. To make the parameter mandatory, select the check-box under Mandatory.
  8. To add the parameter, click Add.
  9. Click Save.

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.

Setting Parameter Values in Pagelet Injection Code

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.

Passing Data with the Pagelet Payload

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.

</pt:ensemble.inject>

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:

  1. Launch the Ensemble Console.
  2. Click the APPLICATIONS tab.
  3. Click the Pagelets sub-tab.
  4. Click the name of the pagelet you want to configure.
  5. On the Parameters page, type the schema URL in the Payload schema URL textbox.

Configuring Pagelet Parameter Transport Type

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:

  1. Launch the Ensemble Console.
  2. Click the APPLICATIONS tab.
  3. Click the Pagelets sub-tab.
  4. Click the name of the pagelet you want to configure.
  5. On the Parameters page, select the appropriate Pagelet Parameter Transport Type from the drop-down.
    • To supply Administrator preferences, select Global - Admin Prefs.
    • To supply Community preferences, select Realm - Community Prefs.
    • To supply CommunityPortlet preferences, select Pagelet Realm - Community Pagelet Prefs.
  6. Add parameters, using the same name as the preferences in the portlet. For details on adding parameters, see Configuring Parameters in the Ensemble Console.
  7. Define the parameters in your pagelet injection code. For details on setting parameter values, see Setting Parameter Values in Pagelet Injection Code.

 


Accessing Pagelet Discovery for Developers

Pagelets configured Ensemble are automatically documented in the Ensemble Pagelet Discovery UI. To access the pagelet discovery UI:

  1. Launch the Ensemble Console.
  2. Click the APPLICATIONS tab.
  3. Click the Pagelet Docs sub-tab.

  Back to Top       Previous  Next