Always use the IDK. Using IDK methods ensures that your pagelets work correctly in multiple implementations of Ensemble and the ALI portal.
The IDK Proxy API supports cross-product pagelet development. It provides 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.
The IDK Portlet API provides portal-specific support for portlet development, including manipulating settings in the ALI database, accessing user information, and managing communication with the portal.
IDK Remote APIs provide access to functionality within the ALI portal, Collaboration, Publisher, and Search Service. These APIs can be used by any pagelet deployed in an environment with access to these applications.
This page provides a comparison of the IDK Proxy and Portlet APIs. For details on installing the IDK, see Setting Up the IDK. For more details on objects and methods, see the IDK API Documentation. Note: The IDK was formerly called the Plumtree Development Kit (EDK); some package names retain old naming conventions.
The bea.alui.proxy and plumtree.remote.portlet packages/namespaces include the following interfaces:
|
|
In general, these interfaces are called in the following order.
The first method is slightly
different depending on the interface.
A pagelet uses ProxyContextFactory.getInstance().createProxyContext
to initiate a connection for communicating with Ensemble or the portal.
A portlet uses PortletContextFactory.createPortletContext
to initiate a connection with the portal.
Pagelet:
Java
<%@ page language="java" import="com.bea.alui.pagelet.*,java.util.*"%>
<%
IPageletContext pageletContext = PageletContextFactory.getInstance.createPageletContext(request, response);
%>.NET
ProxyContextFactory factory;
factory = ProxyContextFactory.getInstance();
proxyContext = factory.CreateProxyContext(request, response);
Portlet:
Java
<%@ page language="java" import="com.plumtree.remote.portlet.*,java.util.*"%>
<%
IPortletContext portletContext = PortletContextFactory.createPortletContext(request, response);
%>.NET
Dim portletContext As IPortletContext
portletContext = PortletContextFactory.createPortletContext(Request, Response)
The IProxyContext / IPortletContext object returned allows the pagelet to access information about the request and response, the current user, and the session. The pagelet uses this information as needed, in arbitrary order, to generate a proper response. Using IP*Context, the pagelet can access IP*Request, IP*User, IRemoteSession and IP*Response.
The pagelet retrieves parameters from the request using IProxyRequest / IPortletRequest. These interfaces provide access to the following information:
|
Parameter |
IProxyRequest Method |
IPortletRequest Method |
Description |
|
Resource / Pagelet ID |
GetIdentifier / GetInstanceIdentifier |
GetPortletID |
This value is useful for appending to the names of HTML forms and client-side JavaScript functions to ensure unique form and function names. This value is also used in Adaptive Tags and by the IDK Remote APIs. |
|
Content Mode |
IEnvironment. GetAggregationType |
GetAggregationMode |
The aggregation mode for the pagelet. These
methods are not exactly equivalent. |
|
Return URL |
GetHostPageURI |
GetHostPageURI / GetReturnURI |
The URL to the page that hosts the pagelet. Preference pages need this URL to return the user to the correct page after settings are configured. (IPortletRequest.getReturnURI allows you to set the return URL to something other than the page that hosts the portlet.) |
|
Image Service URL |
GetImageServerURI |
GetImageServerURI |
The absolute URL to the root virtual directory of the Image Service in the current implementation. This base URI is used to access images on the Image Server that should not be gatewayed. |
|
Stylesheet URL |
GetStylesheetURI |
GetStylesheetURI |
The absolute URL to the current user's stylesheet. This URI can be used to display associated pages in the style of the current implementation. Using AquaLogic styles ensures that pagelets match their environment. You can also access the stylesheet using Adaptive Tags. |
|
Settings |
GetSetting |
GetSettingValue |
These methods are not exactly equivalent. |
|
User |
GetUser |
IPortletContext.GetUser |
The user making the request (IProxyUser or IPortletUser). For details on this interface, see the next section. |
|
Payload |
GetPayload |
n/a |
Ensemble only. The (optional) payload content available with the request (IPayload). |
|
Environment |
GetEnvironment |
n/a |
Ensemble only. The environment in which the
pagelet is running (IEnvironment). IEnvironment.GetType
returns the environment of execution for the request: |
|
Community ID |
n/a |
GetCommunityID |
ALI portal only. The Community ID for the Community in which the portlet appears. (If CommunityID=0, the portlet appears on a My Page.) To check if the portlet is in a community, use IsInCommunity. (If false, the portlet is on a My Page.) For a list of all Communities that contain the portlet, use the PRC method IPortlet.QueryContainingCommunities. |
|
Page ID |
n/a |
GetPageID |
ALI portal only. The Page ID for the current portal page. This value allows a single Portlet object to display different content on different portal pages. The PageID is also useful for appending to the names of HTML forms and client-side JavaScript functions in a portlet. You must configure the portal to send the PageID to the portlet on the Advanced Settings page of the Web Service editor. |
|
Experience Definition ID |
n/a |
GetSubportalID |
ALI portal only. The ID for the Experience Definition the current user belongs to. |
|
Alignment |
n/a |
GetAlignment |
ALI portal only. The alignment of the portlet: |
|
Gateway Status |
n/a |
IsGatewayed |
ALI portal only. Checks to see if the request is gatewayed. All requests to portlets should be gatewayed; all other methods will throw NotGatewayedException if the request is not gatewayed. |
|
Browser Type |
n/a |
GetUserInterface |
ALI portal only. The type of device being
used to access the portal: |
|
Time Zone |
n/a |
GetTimeZone |
ALI portal only. A TimeZone object representing the time zone of the current user in the format used by the portal. This value should be used to localize any time-specific data in the portlet. For additional user information, use the IPortletUser interface. You must configure the portal to send the time zone to the portlet on the Advanced Settings page of the Web Service editor. |
|
Portlet Mode |
n/a |
GetPortletMode |
ALI portal only. The mode in which the portlet
is running: |
The pagelet retrieves user information and preferences from IProxyUser / IPortletUser. This interface provides access to the following information:
|
Parameter |
IProxyUserMethod |
IPortletUserMethod |
Description |
|
User ID |
GetUserID |
GetUserID |
The User ID of the currently logged in user. This value can be used to determine if the session has expired. (In ALI portal, if UserID=2, the default Guest user is logged in; any other user's session has ended.) |
|
User Name |
GetUserName |
GetUserName |
The name of the logged in user. The user's name can be used to personalize display or pre-fill form fields. |
|
Login Status |
IsAnonymous |
IsGuestUser |
Flag indicating if current user is the Anonymous (Ensemble) or Guest (ALI portal). These user types are not exactly equivalent. For details, see the ALI portal or Ensemble online help. |
|
Permissions: Role |
GetRoles |
n/a |
Ensemble only. The role(s) for the user in
the current context. |
|
Permissions: Activity Rights |
n/a |
HasActivityRight |
ALI
portal only.
HasActivityRight returns a flag indicating whether or not the current
user has the specified portal Activity Right. |
|
Permissions: Settings |
n/a |
HasSettingsRight |
ALI
portal only. HasSettingsRight
returns a flag indicating whether or not the current user has the right
to change a particular type of SettingType (Admin, Community, CommunityPortlet,
Portlet, User, and UserInfo). |
|
Permissions: Community |
n/a |
GetCurrentCommunityAccessLevel |
ALI
portal only. The Community Access Level (in the Community ACL)
the current user has for the current Community: You must configure the portal to send the Community ACL to the portlet on the Advanced Settings page of the Web Service editor. |
|
Locale |
n/a |
GetCharacterSet |
ALI portal only. The current user's character set. This value is essential when determining the correct content to return in an internationalized implementation of the portal. Tokens are defined by the IANA Character Set registry (http://ietf.org/rfc/rfc1700.txt pp. 100-116). |
The pagelet can access functionality in AquaLogic applications using IRemoteSession. For details, see Remote APIs.
The pagelet constructs a response using IProxyResponse / IPortletResponse. The response includes content to be displayed and any settings to be stored or removed. These interfaces provide access to the following functionality:
|
Parameter |
IProxyResponse Method |
IPortletResponse Method |
Description |
|
Settings |
SetSetting |
SetSettingValue |
Methods
are not exactly equivalent. |
|
Portlet Title |
n/a |
SetTitle |
ALI portal only. Sets the portlet's title in the title bar on the portlet page. The string passed in will override the title set in the portlet editor. If the title bar is suppressed, the title will not be displayed. |
|
Hosted Display Mode |
n/a |
SetHostedDisplayMode |
ALI portal only. Tells the portal how pages associated with the portlet should be displayed (with or without the portal banner). Calling this function makes the Portal Server display the page in the style of the current portal implementation, including the portal banner. Generally, a portlet's preference pages and any click-through pages should be in Hosted Display Mode. Note: Popup windows should not be displayed in Hosted Display Mode. You can also set Hosted Display Mode using Adaptive Tags. |
|
Return to Portal |
n/a |
ReturnToPortal |
ALI portal only. Redirects users to the portal page they started on. |
For a simple example of how to use IProxy* methods in a pagelet, see IDK Quickstart: Hello World Pagelet (Java | .NET).
For a simple example of how to use IPortlet* methods in a portlet, see IDK Quickstart: Hello World Portlet (Java | .NET).
For a complete listing of interfaces, classes, and methods, see the IDK API Documentation.