Class SubMenuItem

  • All Implemented Interfaces:
    com.novomind.ecom.common.api.attribute.DisplayNamed, com.novomind.ecom.common.api.attribute.Named

    public final class SubMenuItem
    extends java.lang.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 Detail

      • SubMenuItem

        public SubMenuItem​(java.lang.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​(java.lang.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 Detail

      • getUrl

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

        public java.util.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​(java.lang.String url)
        Parameters:
        url - the outcome to set
        Returns:
        this
        Since:
        10.0.34
      • getName

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

        public java.util.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