java.lang.Object
com.novomind.ecom.api.imail.routing.frontend.menu.SubMenuItem
All Implemented Interfaces:
com.novomind.ecom.common.api.attribute.DisplayNamed, com.novomind.ecom.common.api.attribute.Named

public final class SubMenuItem extends Object implements com.novomind.ecom.common.api.attribute.DisplayNamed

This class represents a sub menu item for the entry points in the Supervisor menu.

The menu can store several sub menu items with addSubMenuItem(SubMenuItem). If so the isOpened() option defines whether this sub menu is opened per default or not.

The menu is generated at view scope, meaning every time the user go to another site. For this reason it is very important to cache the custom menu object as much as possible.

The xhtml files have to be in the directory META-INF/includes.

Since:
10.0.34
  • Constructor Details

    • SubMenuItem

      public SubMenuItem(String name)
      Creates a new sub menu item with a given default display text.
      Parameters:
      name - the name
      Since:
      10.0.34
    • SubMenuItem

      public SubMenuItem(String name, Privilege privilege)
      Creates a new sub menu item with a given default display text and privilege.
      Parameters:
      name - the name
      privilege - the Privilege for this SubMenuItem
      Since:
      11.5
  • Method Details

    • getUrl

      public String getUrl()
      Returns:
      the outcome
      Since:
      10.0.34
    • getSubMenuItems

      public List<SubMenuItem> getSubMenuItems()
      Returns:
      the subMenuItems
      Since:
      10.0.34
    • isOpened

      public boolean isOpened()
      Returns:
      the isOpened
      Since:
      10.0.34
    • setOpened

      public SubMenuItem setOpened(boolean isOpened)
      Parameters:
      isOpened - the isOpened to set
      Returns:
      this
      Since:
      10.0.34
    • addSubMenuItem

      public SubMenuItem addSubMenuItem(SubMenuItem subMenuItem)
      Adds a new sub menu item to the menu item.
      Parameters:
      subMenuItem - the sub menu item to add
      Returns:
      this
      Since:
      10.0.34
    • setUrl

      public SubMenuItem setUrl(String url)
      Parameters:
      url - the outcome to set
      Returns:
      this
      Since:
      10.0.34
    • getName

      public String getName()
      Specified by:
      getName in interface com.novomind.ecom.common.api.attribute.Named
      Since:
      10.0.34
    • getPrivilege

      public Optional<Privilege> getPrivilege()
      Returns the Privilege of this SubMenuItem, if present
      Returns:
      the Privilege or empty if no Privilege was set during creation of this SubMenuItem
      Since:
      11.5