Package com.ibm.wps.portletservice.portletmenu

This package contains convenience implementations of menu trees that can be used out-of-the-box.

See:
          Description

Interface Summary
LogMenuService Deprecated. since 6.0.
MemoryMenuService Deprecated. since 6.0.
MemoryMenuTreeTopologyCtrl Deprecated. since 6.0.
XMIMenuService Deprecated. since 6.0.
 

Exception Summary
MemoryMenuTreeException Deprecated. since 6.0.
XMIMenuTreeException Deprecated. since 6.0.
 

Package com.ibm.wps.portletservice.portletmenu Description

This package contains convenience implementations of menu trees that can be used out-of-the-box.

The IBM portlet API is deprecated since 6.0. Support of the IBM portlet API may be removed in a future release of WebSphere Portal. Use of the Java Portlet API (javax.portlet) is recommended instead. The user can choose one of following implementations of the tree model,

Static XMI tree

A programmer wants to write a portlet that reads the static menu tree configuration from a XML file. For convenience, the programmer is recommended to derive the portlet from the abstract class XMIMenuTreePortlet which uses the XMIMenuService interface internally. The path of the tree configuration XML file must be specified in the portlet deployment descriptor. Once the portal navigation displayed a static tree on a page, it will not change until either the portlet is deleted from the page, or the corresponding portlet application is updated or re-installed. The javadoc of XMIMenuTreePortlet is placed in the <WPS_HOME>/dev/samples/Javadoc directory.

Dynamic In-Memory tree

When a portlet implements the dynamic menu tree structure itself, it is recommended to derive the portlet from the abstract class MemoryMenuTreePortlet which takes MemoryMenuService interface internally. This service can create an In-Memory tree that either has only one unnamed root node or incorporates an existing tree model, which can be both static or dynamic. The javadoc of MemoryMenuTreePortlet is placed in the <WPS_HOME>/dev/samples/Javadoc directory.

The instance of the controller interface MenuTreeTopologyCtrl, which extends the tree model MenuTree enables adding or removing tree nodes and setting the scope of the root node. The scope of a node defines how often the Portal Framework needs to check whether the children of a specific node have changed and the tree has to be re-built from the tree model. The Portal Framework stores the menu entries and the tree topology in a cache to hasten up rendering. When the MemoryMenuService creates an instance of MenuTree and the method MenuTreeTopologyCtrl.setScope(com.ibm.wps.portlet.menu.MenuNode, int) is used to change the scope of one MenuNode, the scope is simultaneously set for all nodes of the tree.

Note for programmers who implement the MenuTree interface: When the scope of the menu nodes is MenuNode.SCOPE_SESSION or MenuNode.SCOPE_GLOBAL, the MenuTree methods MenuTree.getRoot() and MenuTree.getChildren(com.ibm.wps.portlet.menu.MenuNode) have to return the same objects when the portlet receives the next request.

The controller interface MenuTreeInfoCtrl, which wraps the tree model MenuTree is used to set title and description of the node for different locales, and to add an URI action and one or more action parameters to the node.

To include an existing instance of MenuTree into an In-Memory tree, so that the new child of the In-Memory tree node refers to the root node of the tree to be included, the instance of the controller MemoryMenuTreeTopologyCtrl can be useful.