Class MenuCallable
java.lang.Object
de.uplanet.lucy.server.auxiliaries.MenuCallable
@VelocityVariable("Menu")
@VelocityCallable("singleton")
public final class MenuCallable
extends Object
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
canAccessMenuNode
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) Check if the current user can access the given menu item.findMenuItems
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, IRtMenuFilter p_filter) Starting with the root menu node, find all menu items that are accepted by the given filter.findMenuItems
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId, IRtMenuFilter p_filter) Find all menu items that are accepted by the given filter, starting with the given menu node.static IRtMenuFilter
static IRtMenuFilter
static IRtMenuFilter
getApplicationMenuFilter
(String p_strAppGuid) getApplicationMenus
(String p_strKey) Get all application menus for the current user.getMenu
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx) Get the menu starting with the root menu node.getMenu
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, IRtMenuFilter p_filter) Get the menu starting with the root menu node.getMenuTitleComparator
(String p_strLang) getMenuTitleWithFallback
(IMenuItem p_item, String p_strPreferredLang) Get a menu title in the given preferred language.static IRtMenuFilter
getNamePatternMenuFilter
(String p_strLang, String p_strPattern, boolean p_bAcceptPattern) getOpenNewWindowMenuItemAppGuids
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) Get the application GUIDs of all applications or links of the given submenu that have the open-new-window-flag set.getSubmenu
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) Get the submenu with the specified unique identifier.getSubmenu
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId, IRtMenuFilter p_filter) Get the submenu with the specified unique identifier.getSubmenu
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId, IRtMenuFilter p_filter, boolean p_bFilterCmsMenuItems) Get the submenu with the specified unique identifier.getSubmenuDefinition
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) Get the submenu with the specified unique identifier.getTopLevelGroupMenuFromChild
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) boolean
boolean
isExistingMenuNode
(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) Check if a menu node with the given GUID exists in the portal.boolean
isMenuCookieValid
(String p_strCookie) toJSONString
(IMenuItem p_menuItem) Convert the given menu tree to JSON.void
Convert the given menu tree to JSON and write the output to the given character stream.
-
Constructor Details
-
MenuCallable
public MenuCallable(org.springframework.context.ApplicationContext p_appCtx)
-
-
Method Details
-
alwaysCheckForNewMenu
public boolean alwaysCheckForNewMenu() -
isMenuCookieValid
-
getMenuCookie
-
isExistingMenuNode
public boolean isExistingMenuNode(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) throws de.uplanet.lucy.menu.MenuException Check if a menu node with the given GUID exists in the portal.- Parameters:
p_ctx
- The processing context.p_strId
- The unique identifier of the submenu.- Returns:
true
if a menu node with the given id exists in the portal, orfalse
otherwise.- Throws:
de.uplanet.lucy.menu.MenuException
-
canAccessMenuNode
public boolean canAccessMenuNode(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) Check if the current user can access the given menu item.- Parameters:
p_ctx
- The processing context.p_strId
- The unique identifier of the menu item.- Returns:
true
if the current user can access the given menu item, orfalse
otherwise.
-
getMenu
Get the menu starting with the root menu node.- Parameters:
p_ctx
- The processing context.- Returns:
- The complete menu, or
null
if an error occurred.
-
getTopLevelGroupMenuFromChild
public TopLevelGroupMenuItem getTopLevelGroupMenuFromChild(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) -
getApplicationMenus
public Map<String,de.uplanet.lucy.server.auxiliaries.menu.ApplicationMenu> getApplicationMenus(String p_strKey) Get all application menus for the current user.- Parameters:
p_strKey
- A grouping key, e.g.desktop
, ormobile
.- Returns:
- The application menus per application GUID.
-
getOpenNewWindowMenuItemAppGuids
public Set<String> getOpenNewWindowMenuItemAppGuids(de.uplanet.lucy.server.ISimpleProcessingContext p_ctx, String p_strId) Get the application GUIDs of all applications or links of the given submenu that have the open-new-window-flag set.- Parameters:
p_ctx
- The processing context.p_strId
- The unique identifier of the submenu.- Returns:
- A possibly empty set of application GUIDs.
-
getMenuTitleComparator
-
getAcceptingMenuFilter
- Returns:
- A menu filter that accepts all menu items.
-
getNamePatternMenuFilter
@Customization("feature request #4470") public static IRtMenuFilter getNamePatternMenuFilter(String p_strLang, String p_strPattern, boolean p_bAcceptPattern) - Parameters:
p_strLang
- The language to be used.p_strPattern
- A name pattern.p_bAcceptPattern
-true
if menu items that match the given pattern should be accepted, orfalse
if they should be rejected by this filter.- Returns:
- A menu filter that accepts menu items that match the given criteria.
-
getAbstractContainerMenuFilter
- Returns:
- A menu filter that accepts all menu items that are
instanceof de.uplanet.lucy.server.menu.rt.AbstractContainerMenuItem
.
-
getApplicationMenuFilter
- Returns:
- A menu filter that accepts all application menu items with the given GUID.
-
isCmsPage
-