Menu Management
From OpenI Wiki
Relevant when rolling out new admin features, need an easier way to configure the menu
| Table of contents |
[edit]
Requirements
- list of available features
- add to admin menu
- specify a display name, radio button to specify the feature (i.e. "Download Project" -> project_download.zip)
- application configures entire list of available features, and the permissions for each feature
- each project can configure which features are visible
- each project can configure the sort order of items in the left nav
- configurable menu filter so that user can hide menu items based on filter criteria
- Virtual Menu's:
- change admin menu items to be configurable instead of hard coded appAdmin/projectAdmin/projectUser
- different from the file based report menu.
- Configuration
- projects can configure any menu name, which can contain any feature
- project can configure sort order of features as well as menu's
- menu's should always be after the report menu's
- end users
- system creates menu for each user
- per user, menu they see is determined by role (defined in application.xml)
- only options that are authorized for their role, are visible
- authorization is configured in application.xml
[edit]
Menu Config Implementation [Updated]
- Controller - org.openi.web.controller.menu.MenuConfigFormController
- Test class - org.openi.web.controller.menu.MenuConfigFormControllerTest
- Test methods :
- testControllerConfig()
- testGet()
- view :
- menuConfigFormView (menu_config.jsp) - main view shows menu as a tree
- menuEntryTypeSelectionView (new_menu_type_selection.jsp) - new menu type selection ui
- menuEntryEditView (edit_menuentry.jsp]) - allows editing of selected menu item as well as new menu item entry
- Menu is configurable for each project
- project contains projectMenu property, which is the list of Menu or MenuItems and persisted as follows:
<project >
..........
<projectMenu>
<org.openi.menu.Menu>
<displayName>Main Group</displayName>
<childNodes class="linked-list">
<org.openi.menu.MenuItem>
<url>manageapplication.htm</url>
<displayName>Manage Application</displayName>
</org.openi.menu.MenuItem>
<<org.openi.menu.MenuItem>
<url>datasource.htm</url>
<displayName>Manage Datasource</displayName>
</org.openi.menu.MenuItem>
</childNodes>
</org.openi.menu.Menu>
<org.openi.menu.Menu>
<displayName>Another Group</displayName>
<childNodes class="linked-list">
<org.openi.menu.MenuItem>
<url>newanalysis.htm</url>
<displayName>New analysis</displayName>
</org.openi.menu.MenuItem>
<<org.openi.menu.MenuItem>
<url>menuconfig.htm</url>
<displayName>Menu Configuration</displayName>
</org.openi.menu.MenuItem>
</childNodes>
</org.openi.menu.Menu>
</projectMenu>
</project>
- If projectMenu is empty(in the case of old project), it is initialized from the existing menuConfig map. The appAdminList menu items is listed under 'Administrator' menu, projectAdminList under 'Project Administrator' and projectUserList under 'Project User' respectively.
- projectMenu is configurable from menuconfig.htm ui.
- It shows menu as similar way as manage files shows the foler and files
- You can add any number of menu/sub menu/menuitems
- You can rename/delete existing menu/sub-menu/menu item
- You can manage the order of menu/menuitem
- Menu items are filtered based on security configuration. A menu item is visible only, if its url is allowed for current user.
[edit]
Menu Filter Implementation
- Menu Filter is list of wild card pattern to hide the item(s) from menu.
- Menu filter pattern is persisted into Application.xml as:
<wildCardFilters class="linked-list"> <string>*_sub.jrxml</string> </wildCardFilters>
- Menu filter is editable from Manage Application Page. You can add wild card filter patterns as comma separated string.
- file path, that matches the specified wild card pattern(one or more), is filtered and not visible in menu
- Wild card format is simple OS shell like pattern containg "*" and "?" character
[edit]
Feedback
- move the menu url list from spring to application.xml, call it available features (instead of url) -- [June 06 2006 - dipendra] should we need to show the default menu list in the case, if menu list is empty - happens when users use old format application.xml?
- UI combines permissions with menu. Seems like we need to separate the two.
- This project menu management UI should configure only the menu content, and display name -- [June 06 2006 - dipendra] where we persist this - project.xml?
- The application configuration should configure:
- available features (move from spring)
- appliation configuration should allow add/edit/delete of available features
- role-based permission for each feature (which you've already done) -- [June 06 2006 - dipendra] Does it also include permissions need to be persisted for each feature or do I just need to use 'applicationAdminPermissions','projectAdminPermissions' and' projectUserPermissions' ?
- adding a new permission needs to be done manually
- granular authorization configuration - ??? not sure what to do with this, please suggest, and work on this last
- sort order
- should be configurable as well, yes this will add complexity, but a good feature
- per project
- menu filter - yes, make this configurable in application.xml -- [June 06 2006 - dipendra] done
- And finally - a new requirement - virtual menu's. As opposed to the file system based menu's, and as opposed to the hard coded appAdmin/projectAdmin/projectUser menu's. See new requirement above in the requirements section.
