Class CmsJspNavigationBean

java.lang.Object
org.opencms.jsp.util.CmsJspNavigationBean

public class CmsJspNavigationBean extends Object
Allows access to the OpenCms navigation information in combination with the <cms:navigation> tag.

Since:
8.0
See Also:
  • Field Details

  • Constructor Details

    • CmsJspNavigationBean

      public CmsJspNavigationBean(CmsObject cms, CmsJspTagNavigation.Type type, int startLevel, int endLevel, String resource, String param)
      Base constructor.

      Parameters:
      cms - the current users OpenCms context to build the navigation for
      type - the navigation type to generate
      startLevel - the optional start level
      endLevel - the optional end level
      resource - the optional resource for the navigation
      param - the optional parameter for the navigation
    • CmsJspNavigationBean

      public CmsJspNavigationBean(CmsObject cms, CmsJspTagNavigation.Type type, int startLevel, int endLevel, String resource, String param, Locale locale)
      Base constructor.

      Parameters:
      cms - the current users OpenCms context to build the navigation for
      type - the navigation type to generate
      startLevel - the optional start level
      endLevel - the optional end level
      resource - the optional resource for the navigation
      param - the optional parameter for the navigation
      locale - the locale, for which Properties should be read.
  • Method Details

    • getCurrent

      Returns the navigation element of the currently requested uri.

      Returns:
      the navigation element of the currently requested uri
    • getIsActive

      Returns a lazy initialized Map that provides Booleans that indicate if a given navigation uri is currently active.

      The provided Map key is assumed to be a String that represents an absolute VFS path.

      Usage example on a JSP with the JSTL:

       <cms:navigation  type="treeForFolder" startLevel="1" endLevel="3" var="nav" />
           <c:forEach var="entry" items="${nav.items}" ... >
           ...
           <c:if test="${nav.isActive[entry.resourceName]}" >
               This is the currently active navigation entry
           </c:if>
       </c:forEach>
      Returns:
      a lazy initialized Map that provides Booleans that indicate if a given navigation uri is currently active
    • getIsParent

      Returns a lazy initialized Map that provides Booleans that indicate if the given navigation URI is a parent element of the current URI.

      The provided Map key is assumed to be a String that represents an absolute VFS path.

      Usage example on a JSP with the JSTL:

       <cms:navigation  type="treeForFolder" startLevel="1" endLevel="3" var="nav" />
           <c:forEach var="entry" items="${nav.items}" ... >
           ...
           <c:if test="${nav.isParent[entry.resourceName]}" >
               The currently active navigation entry is a parent of the currently requested URI
           </c:if>
       </c:forEach>
      Returns:
      a lazy initialized Map that provides Booleans that indicate if the given navigation URI is a parent element of the current URI
    • getItems

      Returns the list of selected navigation elements.

      Returns:
      the list of selected navigation elements