Liferay 7.0-ce-b4

com.liferay.portal.theme
Class NavItem

java.lang.Object
  extended by com.liferay.portal.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.

See Also:
Serialized Form

Constructor Summary
NavItem(javax.servlet.http.HttpServletRequest request, Layout layout, Map<String,Object> contextObjects)
           
 
Method Summary
 boolean equals(Object obj)
           
static List<NavItem> fromLayouts(javax.servlet.http.HttpServletRequest request, List<Layout> layouts, Map<String,Object> contextObjects)
          Creates a single level of navigation items from the layouts.
 List<NavItem> getBrowsableChildren()
          Returns all of the browsable child layouts that the current user has permission to access from this navigation item's layout.
 List<NavItem> getChildren()
          Returns all of child layouts that the current user has permission to access from this navigation item's layout.
 Layout getLayout()
          Returns the navigation item's layout.
 long getLayoutId()
          Returns the ID of the navigation item's layout.
 String getName()
          Returns the HTML-escaped name of the navigation item's layout.
 String getRegularFullURL()
          Returns the full, absolute URL (including the portal's URL) of the navigation item's layout.
 String getRegularURL()
          Returns the regular URL of the navigation item's layout.
 String getResetLayoutURL()
           
 String getResetMaxStateURL()
           
 String getTarget()
          Returns the target of the navigation item's layout.
 String getTitle()
          Returns the title of the navigation item's layout in the current request's locale.
 String getUnescapedName()
          Returns the unescaped name of the navigation item's layout in the current request's locale.
 String getURL()
          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
 boolean hasBrowsableChildren()
          Returns true if the navigation item's layout has browsable child layouts.
 boolean hasChildren()
          Returns true if the navigation item's layout has child layouts.
 int hashCode()
           
 String iconURL()
           
 boolean isBrowsable()
           
 boolean isChildSelected()
           
 boolean isInNavigation(List<NavItem> navItems)
           
 boolean isSelected()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavItem

public NavItem(javax.servlet.http.HttpServletRequest request,
               Layout layout,
               Map<String,Object> contextObjects)
Method Detail

fromLayouts

public static List<NavItem> fromLayouts(javax.servlet.http.HttpServletRequest request,
                                        List<Layout> layouts,
                                        Map<String,Object> contextObjects)
Creates a single level of navigation items from the layouts. Navigation items for nested layouts are only created when they are accessed.

No permission checks are performed in this method. Permissions of child layouts are honored when accessing them via getChildren().

Parameters:
request - the currently served HttpServletRequest
layouts - the layouts from which to create the navigation items
Returns:
a single level of navigation items from the layouts, or null if the collection of layouts was null.

equals

public boolean equals(Object obj)
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

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

Liferay 7.0-ce-b4