Class CategoryHelper
java.lang.Object
org.ametys.plugins.workspaces.categories.CategoryHelper
- All Implemented Interfaces:
Component
,Serviceable
Helper for project's categories
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCategoryColor
(Category category) Get the colors of a category.getChildCategories
(Category category) Get the (flattened) child categories recursivelyGet the leaf categoriesgetLeafCategories
(Category category) Get the leaf categories of a given categoryGet the root categoriesvoid
service
(ServiceManager smanager)
-
Field Details
-
ROLE
The avalon role
-
-
Constructor Details
-
CategoryHelper
public CategoryHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getRootCategories
Get the root categories- Returns:
- the root categories
-
getLeafCategories
Get the leaf categories- Returns:
- the leaf categories
-
getLeafCategories
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
Get the (flattened) child categories recursively- Parameters:
category
- the category- Returns:
- the child categories
-
getCategoryColor
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
-