org.opencms.relations
Class CmsCategory

java.lang.Object
  extended by org.opencms.relations.CmsCategory
All Implemented Interfaces:
java.lang.Comparable

public class CmsCategory
extends java.lang.Object
implements java.lang.Comparable

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
Version:
$Revision: 1.8 $
Author:
Michael Moossen

Constructor Summary
CmsCategory(CmsUUID structureId, java.lang.String rootPath, java.lang.String title, java.lang.String description, java.lang.String baseFolder)
          Default constructor.
 
Method Summary
 int compareTo(java.lang.Object that)
           
 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsCategory

public CmsCategory(CmsUUID structureId,
                   java.lang.String rootPath,
                   java.lang.String title,
                   java.lang.String description,
                   java.lang.String baseFolder)
            throws CmsException
Default constructor.

Parameters:
structureId - the structure id of the resource that this category represents
rootPath - the root path of the category folder
title - the title of the category
description - the description of the category
baseFolder - the base categories folder
Throws:
CmsException - if the root path does not match the given base folder
Method Detail

getCategoryPath

public static java.lang.String getCategoryPath(java.lang.String rootPath,
                                               java.lang.String baseFolder)
                                        throws CmsException
Returns the category path for the given root path.

Parameters:
rootPath - the root path
baseFolder - the categories base folder name
Returns:
the category path
Throws:
CmsException - if the root path does not match the given base folder

compareTo

public int compareTo(java.lang.Object that)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getBasePath

public java.lang.String getBasePath()
Returns the category's base path.

Returns:
the category's base path

getDescription

public java.lang.String getDescription()
Returns the description.

Returns:
the description

getId

public CmsUUID getId()
Returns the id.

Returns:
the id

getName

public java.lang.String 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

public java.lang.String getPath()
Returns the path.

Returns:
the path

getRootPath

public java.lang.String getRootPath()
Returns the category's root path.

Returns:
the category's root path

getTitle

public java.lang.String getTitle()
Returns the title.

Returns:
the title

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()