Class NavItem

Object
com.liferay.portal.kernel.theme.NavItem
All Implemented Interfaces:
Serializable

public class NavItem extends Object implements Serializable
Represents a portal navigation item, providing access to layouts and metadata from templates, which can be found in a theme's portal-normal.vm.
Author:
Brian Wing Shun Chan, Shuyang Zhou
See Also:
  • Constructor Details

    • NavItem

      public NavItem(javax.servlet.http.HttpServletRequest httpServletRequest, Layout layout)
    • NavItem

      public NavItem(javax.servlet.http.HttpServletRequest httpServletRequest, ThemeDisplay themeDisplay, Layout layout)
  • Method Details

    • fromLayouts

      public static List<NavItem> fromLayouts(javax.servlet.http.HttpServletRequest httpServletRequest, List<Layout> parentLayouts, ThemeDisplay themeDisplay) throws PortalException
      Throws:
      PortalException
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • getBrowsableChildren

      public List<NavItem> getBrowsableChildren() throws Exception
      Returns all of the browsable child layouts that the current user has permission to access from this navigation item's layout.
      Returns:
      the list of all browsable child layouts that the current user has permission to access from this navigation item's layout
      Throws:
      Exception - if an exception occurred
    • getChildren

      public List<NavItem> getChildren() throws Exception
      Returns all of child layouts that the current user has permission to access from this navigation item's layout.
      Returns:
      the list of all child layouts that the current user has permission to access from this navigation item's layout
      Throws:
      Exception - if an exception occurred
    • getDisplayIcon

      public String getDisplayIcon() throws Exception
      Throws:
      Exception
    • getExpandoAttributes

      public Map<String,Serializable> getExpandoAttributes()
    • getLayout

      public Layout getLayout()
      Returns the navigation item's layout.
      Returns:
      the navigation item's layout
    • getLayoutId

      public long getLayoutId()
      Returns the ID of the navigation item's layout.
      Returns:
      the ID of the navigation item's layout
    • getName

      public String getName()
      Returns the HTML-escaped name of the navigation item's layout.
      Returns:
      the HTML-escaped name of the navigation item's layout
    • getRegularFullURL

      public String getRegularFullURL() throws Exception
      Returns the full, absolute URL (including the portal's URL) of the navigation item's layout.
      Returns:
      the full, absolute URL of the navigation item's layout
      Throws:
      Exception - if an exception occurred
    • getRegularURL

      public String getRegularURL() throws Exception
      Returns the regular URL of the navigation item's layout.
      Returns:
      the regular URL of the navigation item's layout
      Throws:
      Exception - if an exception occurred
    • getResetLayoutURL

      public String getResetLayoutURL() throws Exception
      Throws:
      Exception
    • getResetMaxStateURL

      public String getResetMaxStateURL() throws Exception
      Throws:
      Exception
    • getTarget

      public String getTarget()
      Returns the target of the navigation item's layout.
      Returns:
      the target of the navigation item's layout
    • getTitle

      public String getTitle()
      Returns the title of the navigation item's layout in the current request's locale.
      Returns:
      the title of the navigation item's layout in the current request's locale
    • getUnescapedName

      public String getUnescapedName()
      Returns the unescaped name of the navigation item's layout in the current request's locale.
      Returns:
      the unescaped name of the navigation item's layout in the current request's locale
    • getURL

      public String getURL() throws Exception
      Returns the URL of the navigation item's layout, in a format that makes it safe to use the URL as an HREF attribute value
      Returns:
      the URL of the navigation item's layout, in a format that makes it safe to use the URL as an HREF attribute value
      Throws:
      Exception - if an exception occurred
    • hasBrowsableChildren

      public boolean hasBrowsableChildren() throws Exception
      Returns true if the navigation item's layout has browsable child layouts.
      Returns:
      true if the navigation item's layout has browsable child layouts; false otherwise
      Throws:
      Exception - if an exception occurred
    • hasChildren

      public boolean hasChildren() throws Exception
      Returns true if the navigation item's layout has child layouts.
      Returns:
      true if the navigation item's layout has child layouts; false otherwise
      Throws:
      Exception - if an exception occurred
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • iconURL

      public String iconURL() throws Exception
      Throws:
      Exception
    • isBrowsable

      public boolean isBrowsable()
    • isChildSelected

      public boolean isChildSelected() throws PortalException
      Throws:
      PortalException
    • isInNavigation

      public boolean isInNavigation(List<NavItem> navItems)
    • isSelected

      public boolean isSelected() throws Exception
      Throws:
      Exception