Package org.opencms.relations
Class CmsCategory
java.lang.Object
org.opencms.relations.CmsCategory
- All Implemented Interfaces:
Serializable
,Comparable<CmsCategory>
Represents a category, that is just a folder.
The category can be centralized under /system/categories/
,
or decentralized in every folder.
For instance, you can have a category folder under /sites/default/
so, any file under /sites/default/
could be assigned to any
category defined under /system/categories/
or
/sites/default/categories
.
But a file under /sites/othersite/
will only be assignable to
categories defined in /system/categories/
.
- Since:
- 6.9.2
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Empty default constructor which is only used for serialization.CmsCategory
(CmsCategory other, String title, String description) Creates a new category based on another one, keeping everything except title and description, which are passed in separately.CmsCategory
(CmsUUID structureId, String rootPath, String title, String description, String baseFolder) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(CmsCategory cat) boolean
Returns the category's base path.static String
getCategoryPath
(String rootPath, String baseFolder) Returns the category path for the given root path.Returns the description.getId()
Returns the id.getName()
Returns the mere category name without it's complete path and without the trailing folder - slash.getPath()
Returns the path.Returns the category's root path.getTitle()
Returns the title.int
hashCode()
toString()
-
Constructor Details
-
CmsCategory
Creates a new category based on another one, keeping everything except title and description, which are passed in separately.- Parameters:
other
- the other category to copy fields fromtitle
- the new titledescription
- the new description
-
CmsCategory
public CmsCategory(CmsUUID structureId, String rootPath, String title, String description, String baseFolder) throws CmsException Default constructor.- Parameters:
structureId
- the structure id of the resource that this category representsrootPath
- the root path of the category foldertitle
- the title of the categorydescription
- the description of the categorybaseFolder
- the base categories folder- Throws:
CmsException
- if the root path does not match the given base folder
-
CmsCategory
protected CmsCategory()Empty default constructor which is only used for serialization.
-
-
Method Details
-
getCategoryPath
Returns the category path for the given root path.- Parameters:
rootPath
- the root pathbaseFolder
- the categories base folder name- Returns:
- the category path
- Throws:
CmsException
- if the root path does not match the given base folder
-
compareTo
- Specified by:
compareTo
in interfaceComparable<CmsCategory>
- See Also:
-
equals
-
getBasePath
Returns the category's base path.- Returns:
- the category's base path
-
getDescription
Returns the description.- Returns:
- the description
-
getId
Returns the id.- Returns:
- the id
-
getName
Returns the mere category name without it's complete path and without the trailing folder - slash.- Returns:
- the mere category name without it's complete path and without the trailing folder - slash
-
getPath
Returns the path.- Returns:
- the path
-
getRootPath
Returns the category's root path.- Returns:
- the category's root path
-
getTitle
Returns the title.- Returns:
- the title
-
hashCode
-
toString
-