public class ModuleUIAutoNav extends Object implements IMenuAutoNav
ModuleUI
's into MenuItem
& AuthorizableMenuItem
s and
adds them to the main adminMenu (Menu DataStructure) & adminPageMenuMap (Which page Item refers to which menu Item to determine current focused page/item) into the context.
Module
info, we can automatically generate all this via this class.
sortMenuItems(MenuItem)
Modifier and Type | Field and Description |
---|---|
protected static String |
RELATED_MODULE |
Constructor and Description |
---|
ModuleUIAutoNav() |
Modifier and Type | Method and Description |
---|---|
protected List<Module> |
constructMenuHierarchy(Map<Module,List<ModuleUI>> moduleUiMap,
Map<Module,MenuItem> moduleMenuMap)
|
protected Map<Module,MenuItem> |
constructModuleMenuMap(Map<Module,List<ModuleUI>> moduleUiMap) |
protected Map<Module,List<ModuleUI>> |
constructModuleUiMap(Map<String,ModuleUI> moduleUisMap) |
protected MenuItem |
createMenuItem(Module module)
Allow to overrride to create any custom type of
MenuItem if required. |
protected MenuItem |
createSubMenuForModule(Module module,
Map<Module,List<ModuleUI>> moduleUiMap)
|
protected MenuItem |
getAdminNavigation(Map<Module,List<ModuleUI>> moduleUiMap,
Map<Module,MenuItem> moduleMenuMap,
List<Module> topLevelModules) |
MenuItem |
getGeneratedMenuItem(Object... params)
Generate a Menu based on context, logic and some optional/additional params
|
Map<String,MenuItem> |
getGeneratedPageMenuMap(Object... params)
TODO: This method is common with
HierarchyTypeAutoNav |
Map<String,String[]> |
getReferenceToPathMapping(Object... params)
A
MenuItem.getRefId() points to the raw resource that the menu points to (like classpath name). |
protected void |
sortMenuItems(MenuItem rootItem)
Will sort the entries in the
MenuItem . |
protected static final String RELATED_MODULE
public MenuItem getGeneratedMenuItem(Object... params)
IMenuGenerator
getGeneratedMenuItem
in interface IMenuGenerator
params
- optionalMenuItem
protected Map<Module,List<ModuleUI>> constructModuleUiMap(Map<String,ModuleUI> moduleUisMap)
protected Map<Module,MenuItem> constructModuleMenuMap(Map<Module,List<ModuleUI>> moduleUiMap)
protected MenuItem createMenuItem(Module module)
MenuItem
if required.module
- MenuItem
protected MenuItem createSubMenuForModule(Module module, Map<Module,List<ModuleUI>> moduleUiMap)
ModuleUI
(see this#moduleUiMap
), create atomic MenuItem
instances.module
- protected List<Module> constructMenuHierarchy(Map<Module,List<ModuleUI>> moduleUiMap, Map<Module,MenuItem> moduleMenuMap)
Module
and MenuItem
s. Module.getModule()
as parent relation.protected void sortMenuItems(MenuItem rootItem)
rootItem
- protected MenuItem getAdminNavigation(Map<Module,List<ModuleUI>> moduleUiMap, Map<Module,MenuItem> moduleMenuMap, List<Module> topLevelModules)
public Map<String,MenuItem> getGeneratedPageMenuMap(Object... params)
HierarchyTypeAutoNav
getGeneratedPageMenuMap
in interface IMenuPathMapper
params
- as any paramsMap
of String to MenuItem
public Map<String,String[]> getReferenceToPathMapping(Object... params)
IMenuPathMapper
MenuItem.getRefId()
points to the raw resource that the menu points to (like classpath name).
To generate the Page Menu Map when the refId is not same as app path we require the additional mapping(s).
Note, a reference can have multiple path aliases.getReferenceToPathMapping
in interface IMenuPathMapper
Map
of String to String arrayCopyright © 2018. All rights reserved.