Tree PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD com.ibm.wps.portletservice.portletmenu
Interface MemoryMenuServiceDeprecated. 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.
- All Superinterfaces:
- org.apache.jetspeed.portlet.service.PortletService
public interface MemoryMenuService- extends org.apache.jetspeed.portlet.service.PortletService
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.
A menu tree instance that is created by the 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); }
- Since:
- 5.0
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 getMenuTree
MenuTree getMenuTree(java.lang.String rootID, MenuContext menuContext) throws MenuTreeException
- Deprecated.
- Creates an empty in-memory tree with just one unnamed root element and identifier rootID. Use the MenuTreeTopologyCtrl and MenuTreeInfoCtrl to fill the tree with information.
- Parameters:
- rootID - identifier of the root element
- menuContext - context to get access to the current PortletRequest and PortletResponse.
- Returns:
- in-memory menu tree
- Throws:
- MenuTreeException - if the tree cannot be created
getMenuTree
MenuTree getMenuTree(MenuTree parent, MenuContext menuContext) throws MenuTreeException
- Deprecated.
- Creates an in-memory copy of the portlet menu tree represented by 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.
- Parameters:
- parent - menu tree to copy
- menuContext - context to get access PortletRequest and PortletResponse
- Returns:
- in-memory tree that represents a copy of the original tree
- Throws:
- MenuTreeException - if the tree cannot be created
- See Also:
- MenuTreeInfoCopyCtrl
Tree PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD