|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MCRCategoryDAO
Interface of the Data Access Object for Classifications.
| Method Summary | |
|---|---|
void |
addCategory(MCRCategoryID parentID,
MCRCategory category)
Adds a category as child of another category. |
void |
deleteCategory(MCRCategoryID id)
Deletes a category with all child categories. |
boolean |
exist(MCRCategoryID id)
Tells if a given category exists. |
List<MCRCategory> |
getCategoriesByLabel(MCRCategoryID baseID,
String lang,
String text)
Retrieve all Categories tagged by a specific label in a specific lang. |
MCRCategory |
getCategory(MCRCategoryID id,
int childLevel)
Returns MCRCategory with this id and childLevel levels of subcategories. |
List<MCRCategory> |
getChildren(MCRCategoryID id)
Returns the list of child categories for the specified category. |
long |
getLastModified()
allows to determine when the last change was made to the categories. |
List<MCRCategory> |
getParents(MCRCategoryID id)
Returns the parent of the given category and its parent and so on. |
List<MCRCategory> |
getRootCategories()
Returns all categories that do not have a parent category. |
MCRCategory |
getRootCategory(MCRCategoryID baseID,
int childLevel)
Returns the root Category with ancestor axis of the specified category and childLevel levels of subcategories. |
List<MCRCategoryID> |
getRootCategoryIDs()
Returns all category IDs that do not have a parent category. |
boolean |
hasChildren(MCRCategoryID id)
Tells if a given category contains subcategories. |
void |
moveCategory(MCRCategoryID id,
MCRCategoryID newParentID)
Moves a Category from one subtree in a classification to a new parent. |
void |
moveCategory(MCRCategoryID id,
MCRCategoryID newParentID,
int index)
Moves a Category from one subtree in a classification to a new parent as the indexth child. |
void |
removeLabel(MCRCategoryID id,
String lang)
Removes a label from a Category. |
void |
replaceCategory(MCRCategory newCategory)
Replaces a MCRCategory by a new version of the same
category. |
void |
setLabel(MCRCategoryID id,
MCRLabel label)
Sets or updates a label from a Category. |
| Method Detail |
|---|
void addCategory(MCRCategoryID parentID,
MCRCategory category)
parentID - ID of the parent categorycategory - Category (with children) to be addedvoid deleteCategory(MCRCategoryID id)
id - ID of Category to be removedboolean exist(MCRCategoryID id)
id - ID of Category
List<MCRCategory> getCategoriesByLabel(MCRCategoryID baseID,
String lang,
String text)
baseID - base Category which subtree is searched for the label.lang - language attribute of the labeltext - text of the label
MCRCategory getCategory(MCRCategoryID id,
int childLevel)
id - ID of categorychildLevel - how many levels of subcategories should be retrieved (-1 for
invinitive)
idList<MCRCategory> getChildren(MCRCategoryID id)
id - ID of category
List<MCRCategory> getParents(MCRCategoryID id)
id - ID of Category
List<MCRCategoryID> getRootCategoryIDs()
List<MCRCategory> getRootCategories()
MCRCategory getRootCategory(MCRCategoryID baseID,
int childLevel)
baseID - Category with relative level set to "0".childLevel - amount of subcategory levels rooted at baseID category
getParents(MCRCategoryID),
getCategory(MCRCategoryID, int)boolean hasChildren(MCRCategoryID id)
id - ID of Category
void moveCategory(MCRCategoryID id,
MCRCategoryID newParentID)
id - ID of the Category which should be movednewParentID - ID of the new parent
void moveCategory(MCRCategoryID id,
MCRCategoryID newParentID,
int index)
indexth child.
id - ID of the Category which should be movednewParentID - ID of the new parentindex - insert category at index in the list of children
void removeLabel(MCRCategoryID id,
String lang)
id - ID of the categorylang - which language should be removed?
void replaceCategory(MCRCategory newCategory)
throws IllegalArgumentException
MCRCategory by a new version of the same
category.
This replacment includes all subcategories and labels. So former
subcategories and labels not present in newCategory will
be removed while new ones will be inserted.
If you can use the other methods defined by this interface as they ought
to be more optimized.
newCategory - new version of MCRCategory
IllegalArgumentException - if old version of MCRCategory does not exist
void setLabel(MCRCategoryID id,
MCRLabel label)
id - ID of the categorylabel - to be set or updatedlong getLastModified()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||