Package org.opencms.jsp.util
Class CmsJspNavigationBean
- java.lang.Object
-
- org.opencms.jsp.util.CmsJspNavigationBean
-
public class CmsJspNavigationBean extends java.lang.Object
Allows access to the OpenCms navigation information in combination with the<cms:navigation>
tag.- Since:
- 8.0
- See Also:
CmsJspTagContentAccess
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CmsJspNavigationBean.CmsIsActiveTransformer
Provides a Map with Booleans that indicate if the given URI is the currently active element in the navigation.class
CmsJspNavigationBean.CmsIsParentTransformer
Provides a Map with Booleans that indicate if the given navigation URI is a parent element of the current URI.
-
Field Summary
Fields Modifier and Type Field Description protected CmsJspNavBuilder
m_builder
The navigation builder.protected CmsObject
m_cms
The OpenCms user context.protected CmsJspNavElement
m_current
The navigation element of the currently requested uri.protected int
m_endLevel
The optional end level for the navigation.protected java.util.Map<java.lang.String,java.lang.Boolean>
m_isActive
Indicates if a given navigation uri is currently active.protected java.util.Map<java.lang.String,java.lang.Boolean>
m_isParent
Indicates if the given navigation URI is a parent element of the current URI.protected java.util.List<CmsJspNavElement>
m_items
The result items from the navigation.protected java.lang.String
m_param
The optional parameter for the navigation.protected java.lang.String
m_resource
The optional resource for the navigation.protected int
m_startLevel
The optional start level for the navigation.protected CmsJspTagNavigation.Type
m_type
The selected navigation type.
-
Constructor Summary
Constructors Constructor Description CmsJspNavigationBean(CmsObject cms, CmsJspTagNavigation.Type type, int startLevel, int endLevel, java.lang.String resource, java.lang.String param)
Base constructor.CmsJspNavigationBean(CmsObject cms, CmsJspTagNavigation.Type type, int startLevel, int endLevel, java.lang.String resource, java.lang.String param, java.util.Locale locale)
Base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsJspNavElement
getCurrent()
Returns the navigation element of the currently requested uri.java.util.Map<java.lang.String,java.lang.Boolean>
getIsActive()
Returns a lazy initialized Map that provides Booleans that indicate if a given navigation uri is currently active.java.util.Map<java.lang.String,java.lang.Boolean>
getIsParent()
Returns a lazy initialized Map that provides Booleans that indicate if the given navigation URI is a parent element of the current URI.java.util.List<CmsJspNavElement>
getItems()
Returns the list of selected navigation elements.
-
-
-
Field Detail
-
m_builder
protected CmsJspNavBuilder m_builder
The navigation builder.
-
m_current
protected CmsJspNavElement m_current
The navigation element of the currently requested uri.
-
m_endLevel
protected int m_endLevel
The optional end level for the navigation.
-
m_isActive
protected java.util.Map<java.lang.String,java.lang.Boolean> m_isActive
Indicates if a given navigation uri is currently active.
-
m_isParent
protected java.util.Map<java.lang.String,java.lang.Boolean> m_isParent
Indicates if the given navigation URI is a parent element of the current URI.
-
m_items
protected java.util.List<CmsJspNavElement> m_items
The result items from the navigation.
-
m_param
protected java.lang.String m_param
The optional parameter for the navigation.
-
m_resource
protected java.lang.String m_resource
The optional resource for the navigation.
-
m_startLevel
protected int m_startLevel
The optional start level for the navigation.
-
m_type
protected CmsJspTagNavigation.Type m_type
The selected navigation type.
-
-
Constructor Detail
-
CmsJspNavigationBean
public CmsJspNavigationBean(CmsObject cms, CmsJspTagNavigation.Type type, int startLevel, int endLevel, java.lang.String resource, java.lang.String param)
Base constructor.- Parameters:
cms
- the current users OpenCms context to build the navigation fortype
- the navigation type to generatestartLevel
- the optional start levelendLevel
- the optional end levelresource
- the optional resource for the navigationparam
- the optional parameter for the navigation
-
CmsJspNavigationBean
public CmsJspNavigationBean(CmsObject cms, CmsJspTagNavigation.Type type, int startLevel, int endLevel, java.lang.String resource, java.lang.String param, java.util.Locale locale)
Base constructor.- Parameters:
cms
- the current users OpenCms context to build the navigation fortype
- the navigation type to generatestartLevel
- the optional start levelendLevel
- the optional end levelresource
- the optional resource for the navigationparam
- the optional parameter for the navigationlocale
- the locale, for which Properties should be read.
-
-
Method Detail
-
getCurrent
public CmsJspNavElement getCurrent()
Returns the navigation element of the currently requested uri.- Returns:
- the navigation element of the currently requested uri
-
getIsActive
public java.util.Map<java.lang.String,java.lang.Boolean> 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
public java.util.Map<java.lang.String,java.lang.Boolean> 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
public java.util.List<CmsJspNavElement> getItems()
Returns the list of selected navigation elements.- Returns:
- the list of selected navigation elements
-
-