Package org.opencms.jsp.util
Class CmsJspCategoryAccessBean
- java.lang.Object
-
- org.opencms.jsp.util.CmsJspCategoryAccessBean
-
public class CmsJspCategoryAccessBean extends java.lang.Object
Bean for easy access to categories of a resource in JSPs.
-
-
Constructor Summary
Constructors Constructor Description CmsJspCategoryAccessBean(CmsObject cms, CmsResource resource)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CmsCategory>
getAllItems()
Returns all wrapped categories.boolean
getIsEmpty()
Returnstrue
if there is no category wrapped, otherwisefalse
.java.util.List<CmsCategory>
getLeafItems()
Returns only the leaf categories of the wrapped categories.java.util.Map<java.lang.String,CmsJspCategoryAccessBean>
getSubCategories()
Returns a map from a category path to the wrapper of all the sub-categories of the category with the path given as key.java.util.List<CmsCategory>
getTopItems()
Returns all categories that are direct children of the current main category.
-
-
-
Constructor Detail
-
CmsJspCategoryAccessBean
public CmsJspCategoryAccessBean(CmsObject cms, CmsResource resource)
Default constructor.- Parameters:
cms
- the currentCmsObject
.resource
- the resource for which the categories should be read.
-
-
Method Detail
-
getAllItems
public java.util.List<CmsCategory> getAllItems()
Returns all wrapped categories.- Returns:
- all wrapped categories.
-
getIsEmpty
public boolean getIsEmpty()
Returnstrue
if there is no category wrapped, otherwisefalse
.- Returns:
true
if there is no category wrapped, otherwisefalse
.
-
getLeafItems
public java.util.List<CmsCategory> getLeafItems()
Returns only the leaf categories of the wrapped categories. The method assumes that categories are ordered in the list, i.e., parents are directly followed by their children. NOTE: In the complete category tree a leaf of the wrapped tree part may not be a leaf.- Returns:
- only the leaf categories of the wrapped categories.
-
getSubCategories
public java.util.Map<java.lang.String,CmsJspCategoryAccessBean> getSubCategories()
Returns a map from a category path to the wrapper of all the sub-categories of the category with the path given as key.- Returns:
- a map from a category path to all sub-categories of the path's category.
-
getTopItems
public java.util.List<CmsCategory> getTopItems()
Returns all categories that are direct children of the current main category.- Returns:
- all categories that are direct children of the current main category.
-
-