ShowTable of Contents
There is an update version of this documentation for WebSphere Portal 8.5 in the Portal 8.5 Knowledge Center
.
EL Beans in WebSphere Portal 8.0
Expression Language (EL) beans are available for accessing WebSphere Programming models. These beans are accessed through the PortalBean represented in the global namespace by wp.
The beans documented below provide access to Portal's models and associated classes. For more information on specific models, refer to the Portal 8.0 SPI Javadoc
.
PortalBean
The PortalBean provides access to EL Beans that represent some of Portal's models. You can use these models to access resource information in your jsps.
Example
To access the current user:
${wp.user}
Available accessors in the PortalBean (wp):
- ac - AccessControlRuntimeModelBean - Provides read access to the current access control permissions for a resource.
- clientProfile - ClientProfileBean - Provides access to the client profile.
- identification - IdentificationBean - Provides access to the identification services serialize and deserialize methods.
- languageList - LanguageListBean - Provides access to the interface representing a container in a layout model.
- layoutModel - LayoutModelBean - Provides access to the tree model representation of the layout of a page.
- localizedDescription - DescriptionBean - Provides access to the description of an object in the current locale.
- metadata - AggregatedMetatdataProviderBean - Provides access to the metadata for a specified resource.
- navigationModel - NavigationModelBean - Provides access to the navigation model.
- rep - ResourceEnvironmentProviderAccessorBean - Provides access to the set of configuration entries for the specified resource environment provider.
- selectionModel - NavigationSelectionModelBean - Provides access to a selection model for a navigation model.
- themeConfig - ThemeConfigBean - Encapsulates the theme "configuration" parameter lookup process.
- themeList - ThemeListBean - Provides access to list of theme objects.
- title - TitleBean - Provides access to the title of the currently rendered page or the title information set by a portlet.
- user - UserBean - Provides access to the active user
EL Beans
Bean Name | Description | Example of use |
| Provides read access to the current access control permissions for a resource. | ${wp.ac[node].hasPermission['editor']} |
| Provides access to the metadata for a specified resource | ${wp.metadata[node]} |
| Provides access to the client profile | ${wp.clientProfile['DeviceClass']} |
| Provides access to a content node. This interface offers a way to obtain the type of the content node. | ${wp.node.contentNode} |
| Provides access to the description of an object in the current locale. | ${wp.description[window]} |
| Provides access to the identification services serialize and deserialize methods. | ${wp.identification[node]} |
| Provides access to the interface representing a portal language. | |
| Provides access to the list of languages defined in portal. | ${wp.languageList} |
| Provides access to the interface representing a container in a LayoutModel | |
| Provides access to the interface representing a control in a LayoutModel | |
| Provides access to the tree model representation of the layout of a page. | ${wp.layoutModel[node]} |
| Returns a Map of the current MetaData object | ${wp.node.metadata['metaDataKey']} |
| Provides access to the navigation model. The navigation model describes the toplogy of the navigation visible to a specific user. | ${wp.navigationModel} |
| Provides access to a navigation node in a navigation model. | ${wp.node.description} |
| Provides access to a selection model for a navigation model. | ${wp.selectionModel[node]} |
| Provides access to the set of configuration entries for the specified resource environment provider. | ${wp.rep["REP Name"]} |
| Provides access to the theme object | ${wp.themeList.current} |
| Encapsulates the theme "configuration" parameter lookup process. | ${wp.themeConfig['themeurl']} |
| Provides access to list of theme objects | ${wp.themeList.current} |
| Provides access to the title of the currently rendered page or the title information set by a portlet. | ${wp.title} |
| Provides access to the active user | ${wp.user} |
AccessControlRuntimeModelBean
This bean provides read access to the current access control permissions on one resource.
Attributes:
node
This value represent an entry in a model. This could be a NavigationNodeBean or ContentNodeBean.
Example:
To see if the currently selected page is private:
${wp.ac[wp.selectionModel.selected].isPrivate}
hasPermission
Determine if the resource has a specific permission.
Attribute: com.ibm.portal.ac.data.RoleType
Returns: boolean value
Example:
${wp.ac[node].hasPermission['editor']}
isPrivate
Determine if the specified page is private.
Returns: boolean
Example:
${wp.ac[node].isPrivate}
hasPersonalizePermission
Determine if the specified page is a private page and the current user has PRIVILEGED_USER permission.
Returns: boolean
Example:
${wp.ac[node].hasPersonalizePermission}
hasEditSharedPermission
Determine if the page is a non-private page and the current user has EDITOR, MANAGER, or ADMIN permission for the specified page.
Returns: boolean
Example:
${wp.ac[node].hasEditSharedPermission}
hasAddChildPermission
Determine if the page is a non-private page and the current user has CONTRIBUTOR, EDITOR, MANAGER, OR ADMIN permission for the specified page.
Returns: boolean
Example:
${wp.ac[node].hasAddChildPermission}
AggregatedMetadataProviderBean
Provides access to the aggregated meta data of a node. The meta data that may be provided by individual nodes of the content model are combined according to the hierarchy that the ContentModel exposes for these nodes. Values set on the node itself take precedence over values set for its parents.
Attributes:
node
This value represents an entry in the ContentModel.
Returns: Map of meta data entries. See MetaDataBean (link)
Example:
${wp.metadata[node]}
ClientProfileBean
Provides access to the defined attributes associated with the client profile.
Attributes:
attribute
This is a defined value associated with the client profile.
Returns: value associated with the specified attribute.
Example:
${wp.clientProfile[attribute]}
The following displays how to access the device class information for the client profile:
<c:set var=”deviceClass” scope=”request” value=”${wp.clientProfile['DeviceClass']}” />
<c:choose>
<c:when test=”${deviceClass == 'desktop'}”>
<jsp:forward page=”/jsp/html/desktop/View.jsp”/>
</c:when>
<c:when test=”${deviceClass == 'tablet'}”>
<jsp:forward page=”/jsp/html/tablet/View.jsp”/>
</c:when>
<c:otherwise>
<jsp:forward page=”/jsp/html/View.jsp”/>
</c:otherwise>
</choose>
ContentNodeBean
The ContentNodeBean represents a node in the ContentModel. See the link above for information on the Portal models.
Attributes:
contentNodeType
Returns:com.ibm.portal.content.ContentNodeType – COMPOSITION, EXTERNALURL, LABEL, PAGE, STATICPAGE
Example:
${wp.node.contentNodeType}
The following displays how to check if the currently selected node is a label:
<c:if test=”${wp.selectionModel.selected.contentNode.contentNodeType == com.ibm.portal.content.ContentNodeType.LABEL}”>
description
Returns: DescriptionBean associated with this content node
metadata
Returns: MetaDatabean associated with this content node
objectID
Returns: objectID associated with this content node.
Example:
${wp.contentNode.objectID}
title
Returns: TitleBean associated with this content node
DescriptionBean
Provides access to the description of an object in the current locale.
Attributes:
window
object with description
Returns: String the description of an object
Example:
${wp.localizedDescription[window]}
${wp.node.description}
IdentificationBean
Provides access to the identification services serialize and deserialize methods. The Identification interface provides serialization and deserialization functionality for ObjectID instances.
Attributes:
node
This value represent an entry in a model.
Returns: objectiid or String representation of the node
Example:
${wp.identification[node]}
LanguageBean
Provides access to the interface representing a language that portal supports..
Attributes:
created
Returns: date this language was created.
description
Returns: DescriptionBean associated with this language.
lastModified
Returns: date this language was last modified.
locale
Returns: locale of this language.
locales
Returns: ListModel of the locales associated with this language.
objectID
Returns: objectID associated with this language
title
Returns: TitleBean associated with this content node
LanguageListBean
Provides access to the interface representing a container in a layout model.
Attributes:
LayoutContainerBean
Provides access to the interface representing a container in a layout model.
Attributes:
metaData
MetaDatabean associated with this content node
Returns: Map of metadata keys pairs for the container
objectID
Returns: Object Identifier for the current control.
The following displays an example of getting the layout model for the currently selected node from the selection model. The second line retrieves the children of the root mode of the layout model. The children of the root node will be represented as LayoutContainerBeans.
<c:set var="layoutmodel" value="${wp.layoutModel[wp.selectionModel.selected]}"/>
<c:set var="containers" value="${layoutmodel.children[layoutmodel.root]}"/>
LayoutControlBean
Provides access to the interface representing a control in a layout model.
Attributes:
description
Returns DescriptionBean the description set for the current control
metadata
Returns: MetaDatabean associated with this content node, Map of metadata key pairs for the control
objectID
Returns: Object identifier for the current control.
title
Returns: TitleBean Title of the control
LayoutModelBean
This bean provides access to the tree model for the layout of a page. The nodes of the tree are objects implementing the LayoutNode interface. This model describes the layout of a page (row and column containers, LayoutContainer) and the content (controls representing portlets, LayoutControl).
Attributes:
layoutModel
Provides the layout model of the given node
node
This value represent an entry in a model.
Returns: iterator of layout nodes
Example:
${wp.layoutModel[node]}
The following displays an example of getting the layout model for the currently selected node from the selection model. The second line retrieves the children of the root mode of the layout model.
<c:set var="layoutmodel" value="${wp.layoutModel[wp.selectionModel.selected]}"/>
<c:set var="containers" value="${layoutmodel.children[layoutmodel.root]}"/>
children
Attributes:
node
This value represent an entry in a model.
Returns: children of the specified nodes
Example:
<c:set var="containers" value="${layoutmodel.children[layoutmodel.root]}"/>
hasChildren
Determine if the current layout model has children
Attributes:
node
This value represent an entry in a model.
Returns: boolean
Example:
${layoutmodel.hasChildren[node]}
root
Returns: root node of the model
MetaDataBean
Returns a Map of the current MetaData object
Attributes:
metadata
Returns: Set of metadata key pairs for the specified node
Example:
${wp.node.metadata}
keyname
Metadata key
Returns: Associated value
Example:
${wp.node.metadata["someKey"]}
NavigationModelBean
Provides access to the NavigationModel. The navigation model describes the topology of the navigation visible to a specific user. The nodes of the model are represented by NavigationNodes.
Attributes:
children
Return the children of the specified node
Attributes:
node
This value represent an entry in a model.
Returns: Children of the specified node.
Example:
${wp.navigationModel.children[node]}
hasChildren
Determine if the specified Navigation Node has associated nodes
Attributes:
node
This value represent an entry in a model.
Returns: boolean
Example:
${wp.navigationModel.hasChildren[node]}
navigationModel
Returns: iterator of Navigation Nodes in the navigation model
The nodes are NavigationBean nodes. The accessors for the NavigationBean can be used on a node in the navigationModel. Below is an example,
<c:set var="layoutTemplate" ><c:out value='${wp.navigationModel[wp.selectionModel.selected.contentNode.objectID].metadata["layout"]}' default=""/></c:set>
parent
Attributes:
node
This value represent an entry in a model.
Returns: Parent node of the specified Navigation Node
Example:
${wp.ac[wp.navigationModel.parent[node]}
NavigationNodeBean
Provides access to a navigation node in a navigation model.
Attributes:
contentNode
Returns: ContentNodeBean content node associated with the current navigation node
Example:
${wp.node.contentNode]}
description
Returns: DescriptionBean Returns the description of this object
Example:
${wp.node.description}
isPrivate
Determine if the current node is marked as private
Returns: boolean.
Example:
${wp.node.isPrivate}
metadata
Returns: MetaDatabean Metadata associated with the current node
Example:
${wp.node.metadata}
objectID
Returns: The objectID associated with the current node
projectID
Returns: The project identifier associated with the current node
title
Returns:TitleBean Title associated with the current object.
Example:
${wp.node.title }
NavigationSelectionModelBean
This bean provides access to the interface describing a selection model for a navigation model (NavigationModel). Elements of this model implement the NavigationNode interface. Input and output values must implement this interface.
Attributes:
selectionModel
Returns: The iterator of selected Navigation nodes.
Example:
${wp.selectionModel}
selected
Returns: NavigationNodeBean Selected Navigation node
Example:
${wp.selectionModel.selected}
selectionPath
Returns: List of currently selected Navigation nodes
Example:
${wp.selectionModel.selectionPath}
ResourceEnvironmentProviderAccessorBean
Provides access to the set of configuration entries for the specified resource environment provider.
Attributes:
resourceEnvironmentProvider
Specifies the Resource Environment Provider.
property
Specifies the property defined on the Resource Environment Provider.
Example:
${wp.rep['resourceEnvironmentProvider']['property']}
To retrieve the Portal defined dojo context root.
${wp.rep['WP GlobalThemeConfig']['resources.js.dojo.contextRoot']}
ThemeBean
Provides access to the theme object.
Attributes:
description
Returns:DescriptionBean Description associated with the theme
metadata
Returns: MetaDatabean Metadata associated with this theme.
title
Returns:TitleBean Title associated with the theme
ThemeConfigBean
Encapsulates the theme "configuration" parameter lookup process.
Attributes:
themeConfig
Encapsulates the theme “configuration” parameter lookup process. The lookup order is as follows: 1. Theme metadata 2. Provided Resource Environment Provider
Example:
<c:set var="themeModuleContextRoot" value="${wp.themeConfig['resources.modules.ibm.contextRoot']}" />
ThemeListBean
Provides access to the model for a list of installed portal themes. Elements of this model are implemented by Theme objects. The ThemeBean provides access to the Theme objects.
Attributes:
themeList
Returns: Iterator of theme bean objects.
current
Provides access to the theme of the current selected node
Returns:ThemeBean
Example:
${wp.themeList.current]}
TitleBean
Provides access to the title of the currently rendered page or the title information set by a portlet.
Attributes:
title
Return: The title of the currently rendered page or the title information set by a portlet.
Example:
${wp.title}
UserBean
Provides access to the active user
Attributes:
user
Return: Current active portal user
Example:
${wp.user}
objectID
Return the object identifier for the current user
Example:
${wp.identification[wp.user.objectID]}