Provides an API for creating and managing categories of nodes. Categories provide a system for organizing content. Unlike tags, which have no hierarchical structure, and which can be created and applied by anyone, categories are created by the Administrator, and are hierarchical in nature.
For example, You might have a Europe category, and then sub-categories such as France, Germany, Spain, and so on. The top Category in the hierarchical structure is known as the Root Category. The CategoryService API provides methods to perform actions such as the following:
- Create a Category
- Create a root Category
- Delete a Category
- Create a Classification (a grouping of Categories)
- Delete a Classification
- Get most popular Categories
// To create a root category: NodeRef newRootCat = serviceRegistry.getCategoryService().createRootCategory(spacesStore, ContentModel.ASPECT_GEN_CLASSIFIABLE, "newRootCat"); // To create a category NodeRef newCategory = serviceRegistry.getCategoryService().createCategory(newRootCat, "newCategory");
See also: