Class CategoryHelper
- java.lang.Object
-
- org.ametys.plugins.workspaces.categories.CategoryHelper
-
- All Implemented Interfaces:
Component
,Serviceable
public class CategoryHelper extends Object implements Serviceable, Component
Helper for project's categories
-
-
Constructor Summary
Constructors Constructor Description CategoryHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getCategoryColor(Category category)
Get the colors of a category.Collection<Category>
getChildCategories(Category category)
Get the (flattened) child categories recursivelyCollection<Category>
getLeafCategories()
Get the leaf categoriesCollection<Category>
getLeafCategories(Category category)
Get the leaf categories of a given categoryCollection<Category>
getRootCategories()
Get the root categoriesvoid
service(ServiceManager smanager)
-
-
-
Constructor Detail
-
CategoryHelper
public CategoryHelper()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getRootCategories
public Collection<Category> getRootCategories()
Get the root categories- Returns:
- the root categories
-
getLeafCategories
public Collection<Category> getLeafCategories()
Get the leaf categories- Returns:
- the leaf categories
-
getLeafCategories
public Collection<Category> getLeafCategories(Category category)
Get the leaf categories of a given category- Parameters:
category
- the category- Returns:
- the leaf categories or the category it self if it has no child
-
getChildCategories
public Collection<Category> getChildCategories(Category category)
Get the (flattened) child categories recursively- Parameters:
category
- the category- Returns:
- the child categories
-
getCategoryColor
public Map<String,String> getCategoryColor(Category category)
Get the colors of a category.- Parameters:
category
- the category. Can be null to get default color.- Returns:
- the colors associated to this category or the default color if there is no category or if the category has no color
-
-