Class MenuFactory

Object
MenuFactory

public class MenuFactory extends Object
Author:
maartenl
  • Constructor Details

    • MenuFactory

      public MenuFactory()
  • Method Details

    • getRootMenu

      public static Menu getRootMenu()
    • getNotFoundMenu

      public static Menu getNotFoundMenu()
    • findVisibleMenu

      public static Optional<Menu> findVisibleMenu(String url)
      Returns the visible menu, based on the URL. Can return Null, in case the menu option is not visible in the navigation bar.
      Parameters:
      url - the url to check.
      Returns:
      a Menu or no menu.
    • getNavigationBarMenus

      public static List<Menu> getNavigationBarMenus()
      Returns the top level menus (and the appropriate sub menus) for displaying purposes.
      Returns:
      list of top level menus.
    • createBlogMenu

      public Menu createBlogMenu(String url)
    • createWikiMenu

      public Menu createWikiMenu(String url, boolean isDeputy)
    • createPersonMenu

      public Menu createPersonMenu()
      Creates the datamodel for the character sheet in the freemarker root.
      Returns:
      the appropriate menu
    • createCommandMenu

      public Menu createCommandMenu()
      Creates the datamodel for the command explanation in the freemarker root.
      Returns:
      the appropriate menu
    • setDatamodel

      public void setDatamodel(Menu menu, Map<String,Object> root, Map<String,String[]> parameterMap)
    • findMenu

      public static Optional<Menu> findMenu(String url)
      Looks in all menus that have been created.
      Parameters:
      url - the url to find, for example "/blogs/index.html".
      Returns:
      an optional indicating a found menu or nothing.