Package org.opencms.ui.apps
Class CmsAppHierarchyBuilder
- java.lang.Object
-
- org.opencms.ui.apps.CmsAppHierarchyBuilder
-
public class CmsAppHierarchyBuilder extends java.lang.Object
Helper class for building a tree of categories/apps which should be displayed from the list of available apps and categories.
-
-
Constructor Summary
Constructors Constructor Description CmsAppHierarchyBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAppConfigToCategory(I_CmsWorkplaceAppConfiguration appConfig)
Adds an app configuration to the node belonging to its parent category id.void
addAppConfiguration(I_CmsWorkplaceAppConfiguration appConfig)
Adds an app configuration.void
addCategory(I_CmsAppCategory category)
Adds an app category.protected void
addNodeToItsParent(CmsAppCategoryNode node)
Adds a category node to the category node belonging to its parent id.CmsAppCategoryNode
buildHierarchy()
Builds the tree of categories and apps.CmsAppCategoryNode
getRootNode()
Gets the root node.
-
-
-
Constructor Detail
-
CmsAppHierarchyBuilder
public CmsAppHierarchyBuilder()
-
-
Method Detail
-
addAppConfiguration
public void addAppConfiguration(I_CmsWorkplaceAppConfiguration appConfig)
Adds an app configuration.- Parameters:
appConfig
- the app configuration to add
-
addCategory
public void addCategory(I_CmsAppCategory category)
Adds an app category.- Parameters:
category
- the app category to add
-
buildHierarchy
public CmsAppCategoryNode buildHierarchy()
Builds the tree of categories and apps.This tree will only include those categories which are reachable by following the parent chain of an available app configuration up to the root category (null).
- Returns:
- the root node of the tree
-
getRootNode
public CmsAppCategoryNode getRootNode()
Gets the root node.- Returns:
- the root node
-
addAppConfigToCategory
protected void addAppConfigToCategory(I_CmsWorkplaceAppConfiguration appConfig)
Adds an app configuration to the node belonging to its parent category id.- Parameters:
appConfig
- the app configuration to add to its parent node
-
addNodeToItsParent
protected void addNodeToItsParent(CmsAppCategoryNode node)
Adds a category node to the category node belonging to its parent id.- Parameters:
node
- the node which should be attached to its parent
-
-