Package com.znize.platform.model.menu
Class ShortcutMenuNodeFactory
- java.lang.Object
-
- com.znize.platform.model.menu.MenuNodeFactory
-
- com.znize.platform.model.menu.ShortcutMenuNodeFactory
-
- All Implemented Interfaces:
MenuNodeActionHandler,MenuNodeLazyInitializer,java.io.Serializable
public class ShortcutMenuNodeFactory extends MenuNodeFactory implements MenuNodeLazyInitializer, MenuNodeActionHandler
Shortcut menu node factory. A shortcut menu node is a link to another menu node in its target MenuBean.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.znize.platform.model.menu.MenuNodeFactory
context, menuBean, rootMenuNode, viewConfig
-
-
Constructor Summary
Constructors Constructor Description ShortcutMenuNodeFactory(MenuNodeFactoryContext context, MenuBean menuBean, MenuViewConfig viewConfig, MenuBean targetMenuBean)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PageNavigationclickMenuNode(MenuNode menuNode)Handle the action of the menu nodeMenuNodecreateMenuTree(MenuNode parentMenuNode)not used private ShortcutMenuNodeFactory(MenuNodeFactoryContext context, MenuBean menuBean, MenuViewConfig viewConfig, String shortcutXml) { super(context, menuBean, viewConfig); this.shortcutXml = shortcutXml; }MenuNodecreateShortcutMenuNode(MenuBean menuBean, java.lang.String name, boolean nameLocalized, java.lang.Integer icon, java.lang.String module, java.lang.Class entityType, java.lang.String command, java.lang.String contextDataId, java.lang.String contextTypeName, boolean checkPermission, ModuleScopedName permissionRequired)Create shortcut menuNode.MenuNodecreateShortcutMenuNode(MenuBean menuBean, java.lang.String name, java.lang.Integer icon, java.lang.String module, java.lang.Class entityType, java.lang.String command)Create shortcut menuNode without context.MenuNodecreateShortcutMenuNode(MenuBean menuBean, java.lang.String name, java.lang.Integer icon, java.lang.String module, java.lang.Class entityType, java.lang.String command, TypedMenuNodeFactoryContext context)Create shortcut menuNode with context.protected voidcreateSubMenu()Create sub menu (subtree of the root menu node) to initialize root menu node.-
Methods inherited from class com.znize.platform.model.menu.MenuNodeFactory
addTypedMenuNodes, addTypedMenuNodes, createDialogContent, createMenuTreeRootNode, createMenuTreeRootNode, getAuthenticatedUser, getContainerBean, getContainerMenuBean, getContainerRenderRegions, getContainerRenderRegions, getContext, getDataAccessUnit, getDataAccessUnit, getDomEventDynamicHandler, getMenuBean, getMenuNodeKey, getMenuNodeUID, getMenuNodeUID, getMenuNodeUID, getParentMenuNodeFactory, getPersistenceEntityManager, getProgressDescriptor, getQueryHints, getRootMenuNode, getTitleFromMenuNodePath, getViewConfig, handlePartialBehaviorEvent, init, isEntityTypeAccessible, isMenuNodeRenderable, isOpenInputDialog, release, setContext, setViewConfig
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.znize.platform.model.menu.MenuNodeActionHandler
createDialogContent, getContainerBean, getContainerRenderRegions, getDomEventDynamicHandler, getProgressDescriptor, getViewConfig, handlePartialBehaviorEvent, isMenuNodeRenderable, isOpenInputDialog
-
Methods inherited from interface com.znize.platform.model.menu.MenuNodeLazyInitializer
init, release
-
-
-
-
Constructor Detail
-
ShortcutMenuNodeFactory
public ShortcutMenuNodeFactory(MenuNodeFactoryContext context, MenuBean menuBean, MenuViewConfig viewConfig, MenuBean targetMenuBean)
Constructor- Parameters:
context- factory contextmenuBean- the MenuBean for which menu nodes are createdviewConfig- factory viewConfigtargetMenuBean- the MenuBean to which the shortcut menu nodes of this factory refers
-
-
Method Detail
-
createMenuTree
public MenuNode createMenuTree(MenuNode parentMenuNode) throws BackingBeanException, SystemException
not used private ShortcutMenuNodeFactory(MenuNodeFactoryContext context, MenuBean menuBean, MenuViewConfig viewConfig, String shortcutXml) { super(context, menuBean, viewConfig); this.shortcutXml = shortcutXml; }- Specified by:
createMenuTreein classMenuNodeFactory- Parameters:
parentMenuNode- the parent menuNode under which the rootMenuNode (or its descendants) of this MenuNodeFactory will be added- Returns:
- the root menu node of tree created
- Throws:
SystemException- throw if an error occursBackingBeanException
-
createSubMenu
protected void createSubMenu() throws SystemExceptionDescription copied from class:MenuNodeFactoryCreate sub menu (subtree of the root menu node) to initialize root menu node.- Specified by:
createSubMenuin classMenuNodeFactory- Throws:
SystemException- throw if an error occurs
-
clickMenuNode
public PageNavigation clickMenuNode(MenuNode menuNode) throws BackingBeanException, SystemException
Description copied from interface:MenuNodeActionHandlerHandle the action of the menu node- Specified by:
clickMenuNodein interfaceMenuNodeActionHandler- Overrides:
clickMenuNodein classMenuNodeFactory- Parameters:
menuNode- the menu node clicked.- Returns:
- webPage
- Throws:
SystemException- throw if an error occurs in handling actionBackingBeanException
-
createShortcutMenuNode
public MenuNode createShortcutMenuNode(MenuBean menuBean, java.lang.String name, java.lang.Integer icon, java.lang.String module, java.lang.Class entityType, java.lang.String command) throws SystemException
Create shortcut menuNode without context.- Parameters:
menuBean- menuBeanname- menuNode name (not localized). name is use as id and must be unique within the menuBean.icon- menuNode icon for commandLink/Buttonmodule- the module to which the targeted menuNode belongsentityType- the targeted menuNode entity type, can be nullcommand- the command of targeted menu node, can not be null.- Returns:
- shortcut menu node, return null if permission is denied.
- Throws:
SystemException- throw if an error occurs
-
createShortcutMenuNode
public MenuNode createShortcutMenuNode(MenuBean menuBean, java.lang.String name, java.lang.Integer icon, java.lang.String module, java.lang.Class entityType, java.lang.String command, TypedMenuNodeFactoryContext context) throws SystemException
Create shortcut menuNode with context. If the command is to create/import entities, return null if the current user does not have such permissions.- Parameters:
menuBean- menuBeanname- menuNode name (not localized). name is used as id and must be unique within the menuBean.icon- menuNode icon for commandLink/Buttonmodule- the module to which the targeted menuNode belongsentityType- the targeted menuNode entity type, can be nullcommand- the command of targeted menu node, can not be null.context- TypedMenuNodeFactoryContext of targeted menu node- Returns:
- shortcut menu node, return null if permission is denied.
- Throws:
SystemException- throw if an error occurs
-
createShortcutMenuNode
public MenuNode createShortcutMenuNode(MenuBean menuBean, java.lang.String name, boolean nameLocalized, java.lang.Integer icon, java.lang.String module, java.lang.Class entityType, java.lang.String command, java.lang.String contextDataId, java.lang.String contextTypeName, boolean checkPermission, ModuleScopedName permissionRequired) throws SystemException
Create shortcut menuNode.- Parameters:
menuBean- menuBeanname- menuNode name (not localized). name is use as id and must be unique within the menuBean.nameLocalized- whether menu node name is localizedicon- menuNode icon for commandLink/Buttonmodule- the module to which the targeted menuNode belongsentityType- the targeted menuNode entity type, can be nullcommand- the command of targeted menu node, can not be null.contextDataId- the menuNodeFactoryContext.contextDataId of the targeted menuNode, can be nullcontextTypeName- typeName in TypedMenuNodeFactoryContext if anycheckPermission- whether to check permissionpermissionRequired- permission required, null if permission is not required- Returns:
- shortcut menu node. return null if current authenticated user does not have the permission.
- Throws:
SystemException- throw if an error occurs
-
-