public class CategoryItem extends Item
CategoryItemCollection
Modifier and Type | Method and Description |
---|---|
boolean |
canBeChildOf(CategoryItem potentialParentCategoryItem)
Return whether this category item could be made a sub-category of the given category item.
|
CategoryItem |
createCategoryItem(java.lang.String name)
Create a sub-category for this category item with a given name.
|
CategoryItem |
createCategoryItems(java.lang.String categoryTreePath)
Create category items along the given path and return the bottom-most category item.
|
CategoryItem |
createDirectoryCategoryItem(int volID,
int dirID,
java.lang.String name)
Create a new category item that represents a Mac OS directory on disk.
|
CategoryItem |
createPathDirectoryCategoryItem(java.lang.String path,
java.lang.String name)
Create a new category item that represents a Windows directory on disk.
|
CategoryItem |
createRelatedCategoryItem(CategoryItem original,
java.lang.String name)
Create a related category item for the given original category.
|
CategoryItem |
createURLDirectoryCategoryItem(java.lang.String URL,
java.lang.String name)
Create a new category item that represents a URL or Unix directory on disk.
|
void |
deleteItem()
delete this category item from the catalog.
|
CategoryItemCollection |
getCategoryItemCollection()
Return the collection object that this category item comes from.
|
java.lang.String |
getCategoryTreePath()
Return the path to this category item in the hierarchy.
|
java.lang.String |
getCategoryTreePath(java.util.Locale locale)
Return the path to this category item in the hierarchy using the localized category names.
|
java.util.List<java.lang.Integer> |
getCategoryTreePathIDs()
Returns the category tree hierarchy as list of IDs with the top most parent first.
|
java.lang.String |
getDisplayString()
Return a string representation of this category item using the current locale.
|
java.lang.String |
getDisplayString(int languageID)
Returns a string representation of this category item for the given language.
|
java.lang.String |
getDisplayString(java.util.Locale locale)
Returns a string representation of this category item for the given locale.
|
CategoryItem |
getFirstChildCategoryItem()
Get the first sub-category item for this category.
|
boolean |
getHasSubCategories()
Return whether this category item has sub-categories.
|
int |
getLevel()
Return the level of this category item in the category tree hierarchy.
|
CategoryItem |
getNextSiblingCategoryItem()
Get the next sibling category of this category item.
|
int |
getNumberOfAssignedRecords()
Get the number of records assigned to this category item.
|
int |
getNumberOfAssignedRecords(java.util.EnumSet<FindFlag> flags)
Get the number of records assigned to this category item according to the flags specified.
|
CategoryItem |
getOriginalCategory()
Return the category item representing the original category for this related category.
|
CategoryItem |
getParentCategoryItem()
Get the category item that contains this category as a sub-category making it a parent category for this category.
|
java.util.List<java.lang.Integer> |
getRelatedCategoryIDs()
Get a list of IDs of all categories that are related categories to this category.
|
java.util.List<java.lang.Integer> |
getSubCategoryIDs()
Get a list of the IDs of all sub-categories of this category item.
|
java.util.Set<java.lang.Integer> |
getSubCategoryIDs(boolean recursive)
Get a list of the IDs of all sub-categories of this category item.
|
CategoryType |
getType()
Get the type of this category item.
|
boolean |
isDisabled()
Return whether this category is disabled.
|
java.lang.String |
toString()
Return a string representation of this category item.
|
applyPermissionTemplate, checkin, checkin, checkout, clearModifiedValue, clearValue, convertAsset, copyAsset, deleteItem, deleteItem, doAssetAction, doAssetAction, doAssetAction, equals, getAssetReferenceValue, getAssetXRefValue, getBinaryValue, getBooleanValue, getCatalogID, getCumulusSession, getDataSizeValue, getDateOnlyValue, getDateValue, getDoubleValue, getID, getIntValue, getItemCollection, getItemIdentifier, getLabelValue, getLengthInInchValue, getLongValue, getPictureValue, getRatingValue, getResolutionValue, getStringEnumValue, getStringValue, getStringValue, getTableValue, getTimeOnlyValue, getUserUIDValue, getVocabularyValue, hashCode, hasValue, isCheckedOut, logUsage, matchesQuery, moveAsset, renameAsset, rollback, save, save, setAssetReferenceValue, setAssetXRefValue, setBinaryValue, setBooleanValue, setDataSizeValue, setDateOnlyValue, setDateValue, setDoubleValue, setIntValue, setLabelValue, setLengthInInchValue, setLongValue, setPictureValue, setRatingValue, setResolutionValue, setStringEnumValue, setStringValue, setTimeOnlyValue, setVocabularyValue, undoCheckout, update, update, updateAsset, updateAssetReference, updateAssetReference, updateFormulaFields, validate
public CategoryItemCollection getCategoryItemCollection()
public void deleteItem() throws PermissionDeniedException, CumulusException
deleteItem
in class Item
PermissionDeniedException
- if you do not have the necessary permission for this operationCumulusException
- on other errorsItem.deleteItem(boolean)
public boolean getHasSubCategories()
true
if this category item has any sub-categories in the hierarchy. false
otherwise.getSubCategoryIDs()
public java.util.List<java.lang.Integer> getSubCategoryIDs()
CategoryItemCollection
.getHasSubCategories()
public java.util.Set<java.lang.Integer> getSubCategoryIDs(boolean recursive)
getHasSubCategories()
public CategoryItem getOriginalCategory() throws CumulusException
CumulusException
- if this category item is not a related categorypublic java.util.List<java.lang.Integer> getRelatedCategoryIDs()
public CategoryItem getParentCategoryItem()
null
.public CategoryItem getNextSiblingCategoryItem()
getFirstChildCategoryItem()
and getNextSiblingCategoryItem()
you can traverse the whole tree of category items very efficiently. Both methods
return null
if there is no further category item.getFirstChildCategoryItem()
public CategoryItem getFirstChildCategoryItem()
getFirstChildCategoryItem()
and getNextSiblingCategoryItem()
you can traverse
the whole tree of category items very efficiently. Both methods return null
if there is no further category item.null
if this category does not have any sub-categories.getNextSiblingCategoryItem()
public boolean canBeChildOf(CategoryItem potentialParentCategoryItem)
potentialParentCategoryItem
- The category item to checktrue
if this category item can be made a sub-category of the given potential parent.public CategoryType getType()
public boolean isDisabled()
true
if this category is disabled, false
otherwise.public int getLevel()
public java.lang.String getCategoryTreePath()
CategoryItemCollection.getCategoryTreePath(java.util.List)
public java.lang.String getCategoryTreePath(java.util.Locale locale)
locale
- locale you want to get names forgetCategoryTreePath()
,
getCategoryTreePathIDs()
,
CategoryItemCollection.getCategoryTreePath(java.util.List)
,
CategoryItemCollection.getCategoryTreeItemIDs(int, int, java.util.Set, boolean)
public java.util.List<java.lang.Integer> getCategoryTreePathIDs()
public int getNumberOfAssignedRecords()
CategoryItemCollection.getNumberOfAssignedRecords(java.util.Set, java.util.EnumSet)
public int getNumberOfAssignedRecords(java.util.EnumSet<FindFlag> flags)
flags
- The flags that control how the assignments are calculated.CategoryItemCollection.getNumberOfAssignedRecords(java.util.Set, java.util.EnumSet)
public java.lang.String toString()
public java.lang.String getDisplayString()
getDisplayString
in class Item
getDisplayString(java.util.Locale)
public java.lang.String getDisplayString(java.util.Locale locale)
getDisplayString
in class Item
locale
- the locale to use for the category name. If that language is not available the field value for the field "Category Name" is used instead.public java.lang.String getDisplayString(int languageID)
getDisplayString
in class Item
languageID
- the language to use for the category name. If that language is not available the field value for the field "Category Name" is used
instead.public CategoryItem createCategoryItem(java.lang.String name) throws PermissionDeniedException, CumulusException
Item.save()
to save additional changes to this category item. ItemCollection.createItem()
and set the hierarchy fields like GUID.UID_CAT_PARENT_ID
manually.name
- The name of the newly created category item.PermissionDeniedException
- if you do not have the permissions necessary for this operation.CumulusException
- on other errors.public CategoryItem createCategoryItems(java.lang.String categoryTreePath) throws PermissionDeniedException, CumulusException
categoryTreePath
- The path that describes the categories to be created.PermissionDeniedException
- if you do not have the permissions necessary for this operation.CumulusException
- on other errors.public CategoryItem createRelatedCategoryItem(CategoryItem original, java.lang.String name) throws PermissionDeniedException, CumulusException
Item.save()
to save additional changes to this category item.original
- The original category item that the newly created related category item should refer to.name
- The name of the newly created category item.PermissionDeniedException
- if you do not have the permissions necessary for this operation.CumulusException
- on other errors.public CategoryItem createDirectoryCategoryItem(int volID, int dirID, java.lang.String name) throws PermissionDeniedException, CumulusException
Item.save()
to save additional changes to this category item.volID
- The ID of the volume that this category item represents.dirID
- The ID of the directory that this category item represents.name
- The name of the newly created category item.PermissionDeniedException
- if you do not have the permissions necessary for this operation.CumulusException
- on other errors.public CategoryItem createPathDirectoryCategoryItem(java.lang.String path, java.lang.String name) throws PermissionDeniedException, CumulusException
Item.save()
to save additional changes to this category item.path
- The path of the directory that this category item represents.name
- The name of the newly created category item.PermissionDeniedException
- if you do not have the permissions necessary for this operation.CumulusException
- on other errors.public CategoryItem createURLDirectoryCategoryItem(java.lang.String URL, java.lang.String name) throws PermissionDeniedException, CumulusException
Item.save()
to save additional changes to this category item.URL
- The URL or Unix path of the directory that this category item represents.name
- The name of the newly created category item.PermissionDeniedException
- if you do not have the permissions necessary for this operation.CumulusException
- on other errors.www.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.