Package org.opencms.jsp.util
Class CmsJspNavigationBean
java.lang.Object
org.opencms.jsp.util.CmsJspNavigationBean
Allows access to the OpenCms navigation information in combination with the
<cms:navigation> tag.- Since:
- 8.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassProvides a Map with Booleans that indicate if the given URI is the currently active element in the navigation.classProvides a Map with Booleans that indicate if the given navigation URI is a parent element of the current URI. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CmsJspNavBuilderThe navigation builder.protected CmsObjectThe OpenCms user context.protected CmsJspNavElementThe navigation element of the currently requested uri.protected intThe optional end level for the navigation.Indicates if a given navigation uri is currently active.Indicates if the given navigation URI is a parent element of the current URI.protected List<CmsJspNavElement> The result items from the navigation.protected StringThe optional parameter for the navigation.protected StringThe optional resource for the navigation.protected intThe optional start level for the navigation.protected CmsJspTagNavigation.TypeThe selected navigation type. -
Constructor Summary
ConstructorsConstructorDescriptionCmsJspNavigationBean(CmsObject cms, CmsJspTagNavigation.Type type, int startLevel, int endLevel, String resource, String param) Base constructor.CmsJspNavigationBean(CmsObject cms, CmsJspTagNavigation.Type type, int startLevel, int endLevel, String resource, String param, Locale locale) Base constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the navigation element of the currently requested uri.Returns a lazy initialized Map that provides Booleans that indicate if a given navigation uri is currently active.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.
-
Field Details
-
m_builder
The navigation builder. -
m_cms
The OpenCms user context. -
m_current
The navigation element of the currently requested uri. -
m_endLevel
The optional end level for the navigation. -
m_isActive
Indicates if a given navigation uri is currently active. -
m_isParent
Indicates if the given navigation URI is a parent element of the current URI. -
m_items
The result items from the navigation. -
m_param
The optional parameter for the navigation. -
m_resource
The optional resource for the navigation. -
m_startLevel
The optional start level for the navigation. -
m_type
The selected navigation type.
-
-
Constructor Details
-
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
-