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

public class MenuService extends ServiceConfig
Manage application Menus
  • Field Details

  • Constructor Details

    • MenuService

      public MenuService(QueryService queryService, ScreenComponentGenerator screenComponentGenerator, InitialLoadDao initialLoadDao, BaseConfigProperties baseConfigProperties, SecurityConfigProperties securityConfigProperties, FavouriteService favouriteService, LauncherService launcherService)
      Autowired constructor
      Parameters:
      queryService - Query service
      screenComponentGenerator - Screen component generator
      initialLoadDao - Initial load service
      baseConfigProperties - Base configuration properties
      securityConfigProperties - Security configuration properties
      favouriteService - Favourites service
      launcherService - Service launcher service
  • Method Details

    • getMenu

      public Menu getMenu() throws AWException
      Retrieve the menu for the user
      Returns:
      Retrieved menu
      Throws:
      AWException - Menu has not been found
    • getMenuWithRestrictions

      public Menu getMenuWithRestrictions() throws AWException
      Retrieve the menu for the user
      Returns:
      Retrieved menu
      Throws:
      AWException - Menu has not been found
    • getMenuWithRestrictions

      public Menu getMenuWithRestrictions(String menuType) throws AWException
      Retrieve the menu for the user
      Parameters:
      menuType - Menu type
      Returns:
      Retrieved menu
      Throws:
      AWException - Menu has not been found
    • getMenuWithRestrictions

      public Menu getMenuWithRestrictions(Menu menu) throws AWException
      Retrieve the menu for the user
      Parameters:
      menu - Menu
      Returns:
      Retrieved menu
      Throws:
      AWException - Menu has not been found
    • getMenuWithAllRestrictions

      public Menu getMenuWithAllRestrictions() throws AWException
      Retrieve the menu with all restrictions (included modules)
      Returns:
      Retrieved menu
      Throws:
      AWException - Menu has not been found
    • getMenuWithAllRestrictions

      public Menu getMenuWithAllRestrictions(String menuType) throws AWException
      Retrieve the menu with all restrictions (included modules)
      Parameters:
      menuType - Menu type
      Returns:
      Retrieved menu
      Throws:
      AWException - Menu has not been found
    • getMenuWithAllRestrictions

      public Menu getMenuWithAllRestrictions(Menu menu) throws AWException
      Retrieve the menu with all restrictions (included modules)
      Parameters:
      menu - Menu
      Returns:
      Retrieved menu
      Throws:
      AWException - Menu has not been found
    • getMenu

      public Menu getMenu(String menuId) throws AWException
      Retrieve a menu
      Parameters:
      menuId - Menu identifier
      Returns:
      Menu retrieved
      Throws:
      AWException - Menu has not been found
    • getDefaultScreen

      public Screen getDefaultScreen() throws AWException
      Retrieve the menu default screen
      Returns:
      Default screen
      Throws:
      AWException - Default screen has not been defined
    • getOptionScreen

      public Screen getOptionScreen(String optionId) throws AWException
      Retrieve an option screen from the user menu
      Parameters:
      optionId - Option identifier
      Returns:
      Screen retrieved
      Throws:
      AWException - Screen has not been found
    • getAvailableOptionScreen

      public Screen getAvailableOptionScreen(String optionId) throws AWException
      Retrieve an option screen from the user menu
      Parameters:
      optionId - Option identifier
      Returns:
      Screen retrieved
      Throws:
      AWException - Screen has not been found
    • getScreen

      public Screen getScreen(String screenId) throws AWException
      Retrieve an screen
      Parameters:
      screenId - Screen identifier
      Returns:
      Screen retrieved
      Throws:
      AWException - Screen has not been found
    • getScreen

      public Screen getScreen(String screenId, String optionId) throws AWException
      Retrieve an screen
      Parameters:
      screenId - Screen identifier
      optionId - Option identifier
      Returns:
      Screen retrieved
      Throws:
      AWException - Screen has not been found
    • getOptionByName

      public Option getOptionByName(String optionId) throws AWException
      Retrieve an option screen from the user menu
      Parameters:
      optionId - Option identifier
      Returns:
      Option retrieved
      Throws:
      AWException - Option has not been found
    • getAvailableOptionByName

      public Option getAvailableOptionByName(String optionId) throws AWException
      Retrieve an option screen from the user menu
      Parameters:
      optionId - Option identifier
      Returns:
      Option retrieved
      Throws:
      AWException - Option has not been found
    • getAvailableScreenList

      public ServiceData getAvailableScreenList(String suggest) throws AWException
      Retrieve a list of available screens
      Parameters:
      suggest - Screen typed
      Returns:
      Screen list retrieved
      Throws:
      AWException - Option has not been found
    • getAllScreenList

      public ServiceData getAllScreenList(String suggest)
      Retrieve a list of all screens
      Parameters:
      suggest - Screen typed
      Returns:
      Screen list retrieved
    • checkOptionAddress

      public boolean checkOptionAddress(String address) throws AWException
      Check if address is valid
      Parameters:
      address - Option to check
      Returns:
      Screen list retrieved
      Throws:
      AWException - Option has not been found
    • isAvailableOption

      public boolean isAvailableOption(String optionId, String menuType) throws AWException
      Retrieve if option is available
      Parameters:
      optionId - Option to check
      menuType - Menu type
      Returns:
      Screen list retrieved
      Throws:
      AWException - Option has not been found
    • getModuleList

      public ServiceData getModuleList() throws AWException
      Retrieve a list of available modules
      Returns:
      Module list retrieved
      Throws:
      AWException - Error retrieving module list
    • getNameOptionList

      public ServiceData getNameOptionList(String suggest) throws AWException
      Retrieve a list of available options
      Parameters:
      suggest - Option typed
      Returns:
      Screen list retrieved
      Throws:
      AWException - Option has not been found
    • getScreenRestrictions

      public ServiceData getScreenRestrictions(String restriction) throws AWException
      Retrieve a list of available screens
      Parameters:
      restriction - Restriction profile
      Returns:
      Screen restriction list
      Throws:
      AWException - Screen restriction retrieval failure
    • refreshMenu

      public ServiceData refreshMenu() throws AWException
      Generates an array node with all options in the menu
      Returns:
      Menu options
      Throws:
      AWException - Error generating menu
    • getMenuOptionTree

      public ServiceData getMenuOptionTree() throws AWException
      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

      public ServiceData updateMenuRestrictionTree(String option) throws AWException
      Update menu restriction tree
      Parameters:
      option - Selected option
      Returns:
      Service data
      Throws:
      AWException - Error retrieving data
    • allowMenuOption

      public ServiceData allowMenuOption(Integer user, Integer profile, String option) throws AWException
      Allow menu option with restrictions
      Parameters:
      user - Selected user
      profile - Selected profile
      option - 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 user
      profile - Selected profile
      option - 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 user
      profile - Selected profile
      option - Selected option
      Returns:
      Service data
      Throws:
      AWException - Error retrieving data