|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MemoryMenuService
MemoryMenuService
is a portlet service that allows the creation of a dynamic out-of-the-box portlet menu
implementation that greatly facilitates the implementation of the MenuProvider
interface.
This service creates 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.
MemoryMenuService
also exposes the following
controller interfaces: MenuTreeInfoCtrl
, MenuTreeInfoCopyCtrl
,
MenuTreeTopologyCtrl
and MemoryMenuTreeTopologyCtrl
.
The following code shows how MenuProvider.getMenu(com.ibm.wps.portlet.menu.MenuContext)
can be implemented
to return a MenuTree
using
MemoryMenuService
.
public MenuTree getMenu(MenuContext menuContext) throws PortletException { // get service MemoryMenuService service=null; try { service = (MemoryMenuService) portletContext.getService(MemoryMenuService.class); } catch ( PortletServiceUnavailableException e ) { throw new PortletException ("MemoryMenuTreePortlet: Exception: MemoryMenuService is unavailable"); } catch ( PortletServiceNotFoundException e ) { throw new PortletException ("MemoryMenuTreePortlet: Exception: MemoryMenuService has not been found"); } // get tree try { menuTree = service.getMenuTree("myRootId", contextOnLocalThread); } catch ( MenuTreeException mte ) { throw new PortletException ("MemoryMenuTreePortlet: Exception getting menu tree from service"); } return (menuTree); }
Method Summary | |
---|---|
MenuTree |
getMenuTree(MenuTree parent,
MenuContext menuContext)
Deprecated. Creates an in-memory copy of the portlet menu tree represented by parent . |
MenuTree |
getMenuTree(java.lang.String rootID,
MenuContext menuContext)
Deprecated. Creates an empty in-memory tree with just one unnamed root element and identifier rootID . |
Method Detail |
---|
MenuTree getMenuTree(java.lang.String rootID, MenuContext menuContext) throws MenuTreeException
rootID
.
Use the MenuTreeTopologyCtrl
and
MenuTreeInfoCtrl
to fill the tree with information.
rootID
- identifier of the root elementmenuContext
- context to get access to the current PortletRequest
and
PortletResponse
.
MenuTreeException
- if the tree cannot be createdMenuTree getMenuTree(MenuTree parent, MenuContext menuContext) throws MenuTreeException
parent
.
If the parent
tree topology contains cycles, e.g., a child node is parent of its grand-parent,
the nodes are only copied once.
parent
- menu tree to copymenuContext
- context to get access PortletRequest
and
PortletResponse
MenuTreeException
- if the tree cannot be createdMenuTreeInfoCopyCtrl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |