public class CmsCategory extends java.lang.Object implements java.lang.Comparable<CmsCategory>, java.io.Serializable
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/.
| Modifier | Constructor and Description |
|---|---|
protected |
CmsCategory()
Empty default constructor which is only used for serialization.
|
|
CmsCategory(CmsCategory other,
java.lang.String title,
java.lang.String description)
Creates a new category based on another one, keeping everything except title and description, which are passed in separately.
|
|
CmsCategory(CmsUUID structureId,
java.lang.String rootPath,
java.lang.String title,
java.lang.String description,
java.lang.String baseFolder)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(CmsCategory cat) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getBasePath()
Returns the category's base path.
|
static java.lang.String |
getCategoryPath(java.lang.String rootPath,
java.lang.String baseFolder)
Returns the category path for the given root path.
|
java.lang.String |
getDescription()
Returns the description.
|
CmsUUID |
getId()
Returns the id.
|
java.lang.String |
getName()
Returns the mere category name without it's complete path and without the trailing folder - slash.
|
java.lang.String |
getPath()
Returns the path.
|
java.lang.String |
getRootPath()
Returns the category's root path.
|
java.lang.String |
getTitle()
Returns the title.
|
int |
hashCode() |
java.lang.String |
toString() |
public CmsCategory(CmsCategory other, java.lang.String title, java.lang.String description)
other - the other category to copy fields fromtitle - the new titledescription - the new descriptionpublic CmsCategory(CmsUUID structureId, java.lang.String rootPath, java.lang.String title, java.lang.String description, java.lang.String baseFolder) throws CmsException
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 folderCmsException - if the root path does not match the given base folderprotected CmsCategory()
public static java.lang.String getCategoryPath(java.lang.String rootPath, java.lang.String baseFolder) throws CmsException
rootPath - the root pathbaseFolder - the categories base folder nameCmsException - if the root path does not match the given base folderpublic int compareTo(CmsCategory cat)
compareTo in interface java.lang.Comparable<CmsCategory>Comparable.compareTo(java.lang.Object)public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)public java.lang.String getBasePath()
public java.lang.String getDescription()
public java.lang.String getName()
public java.lang.String getPath()
public java.lang.String getRootPath()
public java.lang.String getTitle()
public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()