Package com.almis.awe.service
Class MenuService
java.lang.Object
com.almis.awe.config.ServiceConfig
com.almis.awe.service.MenuService
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
Manage application Menus
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMenuService
(QueryService queryService, ScreenComponentGenerator screenComponentGenerator, InitialLoadDao initialLoadDao, BaseConfigProperties baseConfigProperties, SecurityConfigProperties securityConfigProperties, FavouriteService favouriteService, LauncherService launcherService) Autowired constructor -
Method Summary
Modifier and TypeMethodDescriptionallowMenuOption
(Integer user, Integer profile, String option) Allow menu option with restrictionsboolean
checkOptionAddress
(String address) Check if address is validgetAllScreenList
(String suggest) Retrieve a list of all screensgetAvailableOptionByName
(String optionId) Retrieve an option screen from the user menugetAvailableOptionScreen
(String optionId) Retrieve an option screen from the user menugetAvailableScreenList
(String suggest) Retrieve a list of available screensRetrieve the menu default screengetMenu()
Retrieve the menu for the userRetrieve a menuRetrieve the menu without restrictionsgetMenuOptionTreeByModule
(Integer user, Integer profile, String module) Retrieve the menu without restrictionsRetrieve the menu with all restrictions (included modules)Retrieve the menu with all restrictions (included modules)getMenuWithAllRestrictions
(String menuType) Retrieve the menu with all restrictions (included modules)Retrieve the menu for the usergetMenuWithRestrictions
(Menu menu) Retrieve the menu for the usergetMenuWithRestrictions
(String menuType) Retrieve the menu for the userRetrieve a list of available modulesgetNameOptionList
(String suggest) Retrieve a list of available optionsgetOptionByName
(String optionId) Retrieve an option screen from the user menugetOptionScreen
(String optionId) Retrieve an option screen from the user menuRetrieve an screenRetrieve an screengetScreenRestrictions
(String restriction) Retrieve a list of available screensboolean
isAvailableOption
(String optionId, String menuType) Retrieve if option is availableGenerates an array node with all options in the menuremoveRestriction
(Integer user, Integer profile, String option) Remove menu option restrictionrestrictMenuOption
(Integer user, Integer profile, String option) Restrict menu option with restrictionsupdateMenuRestrictionTree
(String option) Update menu restriction treeMethods inherited from class com.almis.awe.config.ServiceConfig
containsBean, getApplicationContext, getBean, getBean, getElements, getLocale, getLocale, getProperty, getProperty, getRequest, getSession, setApplicationContext
-
Field Details
-
OPTION
- See Also:
-
RESTRICTION
- See Also:
-
ACCESS
- See Also:
-
TEXT_SUCCESS
- See Also:
-
PROFILE
- See Also:
-
-
Constructor Details
-
MenuService
public MenuService(QueryService queryService, ScreenComponentGenerator screenComponentGenerator, InitialLoadDao initialLoadDao, BaseConfigProperties baseConfigProperties, SecurityConfigProperties securityConfigProperties, FavouriteService favouriteService, LauncherService launcherService) Autowired constructor- Parameters:
queryService
- Query servicescreenComponentGenerator
- Screen component generatorinitialLoadDao
- Initial load servicebaseConfigProperties
- Base configuration propertiessecurityConfigProperties
- Security configuration propertiesfavouriteService
- Favourites servicelauncherService
- Service launcher service
-
-
Method Details
-
getMenu
Retrieve the menu for the user- Returns:
- Retrieved menu
- Throws:
AWException
- Menu has not been found
-
getMenuWithRestrictions
Retrieve the menu for the user- Returns:
- Retrieved menu
- Throws:
AWException
- Menu has not been found
-
getMenuWithRestrictions
Retrieve the menu for the user- Parameters:
menuType
- Menu type- Returns:
- Retrieved menu
- Throws:
AWException
- Menu has not been found
-
getMenuWithAllRestrictions
Retrieve the menu with all restrictions (included modules)- Returns:
- Retrieved menu
- Throws:
AWException
- Menu has not been found
-
getMenuWithAllRestrictions
Retrieve the menu with all restrictions (included modules)- Parameters:
menuType
- Menu type- Returns:
- Retrieved menu
- Throws:
AWException
- Menu has not been found
-
getMenu
Retrieve a menu- Parameters:
menuId
- Menu identifier- Returns:
- Menu retrieved
- Throws:
AWException
- Menu has not been found
-
getDefaultScreen
Retrieve the menu default screen- Returns:
- Default screen
- Throws:
AWException
- Default screen has not been defined
-
getOptionScreen
Retrieve an option screen from the user menu- Parameters:
optionId
- Option identifier- Returns:
- Screen retrieved
- Throws:
AWException
- Screen has not been found
-
getAvailableOptionScreen
Retrieve an option screen from the user menu- Parameters:
optionId
- Option identifier- Returns:
- Screen retrieved
- Throws:
AWException
- Screen has not been found
-
getScreen
Retrieve an screen- Parameters:
screenId
- Screen identifier- Returns:
- Screen retrieved
- Throws:
AWException
- Screen has not been found
-
getScreen
Retrieve an screen- Parameters:
screenId
- Screen identifieroptionId
- Option identifier- Returns:
- Screen retrieved
- Throws:
AWException
- Screen has not been found
-
getOptionByName
Retrieve an option screen from the user menu- Parameters:
optionId
- Option identifier- Returns:
- Option retrieved
- Throws:
AWException
- Option has not been found
-
getAvailableOptionByName
Retrieve an option screen from the user menu- Parameters:
optionId
- Option identifier- Returns:
- Option retrieved
- Throws:
AWException
- Option has not been found
-
getAvailableScreenList
Retrieve a list of available screens- Parameters:
suggest
- Screen typed- Returns:
- Screen list retrieved
- Throws:
AWException
- Option has not been found
-
getAllScreenList
Retrieve a list of all screens- Parameters:
suggest
- Screen typed- Returns:
- Screen list retrieved
-
checkOptionAddress
Check if address is valid- Parameters:
address
- Option to check- Returns:
- Screen list retrieved
- Throws:
AWException
- Option has not been found
-
isAvailableOption
Retrieve if option is available- Parameters:
optionId
- Option to checkmenuType
- Menu type- Returns:
- Screen list retrieved
- Throws:
AWException
- Option has not been found
-
getModuleList
Retrieve a list of available modules- Returns:
- Module list retrieved
- Throws:
AWException
- Error retrieving module list
-
getNameOptionList
Retrieve a list of available options- Parameters:
suggest
- Option typed- Returns:
- Screen list retrieved
- Throws:
AWException
- Option has not been found
-
getScreenRestrictions
Retrieve a list of available screens- Parameters:
restriction
- Restriction profile- Returns:
- Screen restriction list
- Throws:
AWException
- Screen restriction retrieval failure
-
refreshMenu
Generates an array node with all options in the menu- Returns:
- Menu options
- Throws:
AWException
- Error generating menu
-
getMenuOptionTree
Retrieve the menu without restrictions- Returns:
- Full menu without restrictions
- Throws:
AWException
-
getMenuOptionTreeByModule
public ServiceData getMenuOptionTreeByModule(Integer user, Integer profile, String module) throws AWException Retrieve the menu without restrictions- Returns:
- Full menu without restrictions
- Throws:
AWException
-
updateMenuRestrictionTree
Update menu restriction tree- Parameters:
option
- Selected option- Returns:
- Service data
- Throws:
AWException
- Error retrieving data
-
allowMenuOption
Allow menu option with restrictions- Parameters:
user
- Selected userprofile
- Selected profileoption
- Selected option- Returns:
- Service data
- Throws:
AWException
- Error retrieving data
-
restrictMenuOption
public ServiceData restrictMenuOption(Integer user, Integer profile, String option) throws AWException Restrict menu option with restrictions- Parameters:
user
- Selected userprofile
- Selected profileoption
- Selected option- Returns:
- Service data
- Throws:
AWException
- Error retrieving data
-
removeRestriction
public ServiceData removeRestriction(Integer user, Integer profile, String option) throws AWException Remove menu option restriction- Parameters:
user
- Selected userprofile
- Selected profileoption
- Selected option- Returns:
- Service data
- Throws:
AWException
- Error retrieving data
-