|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.categorization.CategorizedObject
A wrapper for a categorized ACSObject
, such as the Jaws
object in this diagram.
The reason this class exists is because the ACSObject
class does
not know about the categorization service. Therefore, if you have a
categorized ACSObject
, it does not provides methods for
answering questions like: What are you parents? What is your default
category?, and so on. This class serves as a wrapper that provides these and
other methods.
Constructor Summary | |
CategorizedObject(ACSObject data)
Initializes with the specified ACS object. |
|
CategorizedObject(DataObject dataObject)
Creates the appropriate type of ACS object from the passed in data object. |
Method Summary | |
boolean |
equals(Object o)
Determines whether the contained objects are equal. |
Iterator |
getDefaultAncestors()
Returns the default ancestor categories up to the root, with the root as the first item in the iterator. |
Category |
getDefaultParentCategory()
Gets the default parent category. |
ACSObject |
getObject()
Gets the contained object. |
Collection |
getParentCategories()
Deprecated. use getParents() |
Collection |
getParentCategories(String purposeKey)
Deprecated. the notion of "category purposes" has been deprecated. Use the use-context-based API, as explained in Category . |
long |
getParentCategoryCount()
Gets the count of parent categories for this object. |
CategoryCollection |
getParents()
|
int |
hashCode()
Delegates hashCode generation to the contained ACS object. |
void |
save()
This saves all of the changes that have been made to this object as well as saving the underlying ACSObject. |
void |
setDefaultParentCategory(Category parent)
Sets the passed in category as the default parent category for this category. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CategorizedObject(ACSObject data)
data
- the ACS objectpublic CategorizedObject(DataObject dataObject)
IllegalArgumentException
- if the data object is not an ACS object.Method Detail |
public ACSObject getObject()
public Collection getParentCategories()
getParents()
DataObjectNotFoundException
public CategoryCollection getParents()
public Collection getParentCategories(String purposeKey)
Category
.
For a category to correspond to a CategoryPurpose, the ancestor category which is a direct child of the category root must be associated with a CategoryPurpose whose key equals that passed into this method.
purposeKey
- the Integer key for the desired CategoryPurpose
DataObjectNotFoundException
public Category getDefaultParentCategory()
DataObjectNotFoundException
CategoryNotFoundException
public long getParentCategoryCount()
public Iterator getDefaultAncestors()
DataObjectNotFoundException
CategorizationException
public void setDefaultParentCategory(Category parent)
Sets the passed in category as the default parent category for this category. If the passed on object is not already a parent then this add the passed in object as a new parent.
Note: This clears the previous default mapping. The results are saved for the user when the transaction is committed.
parent
- the new default category.
DataObjectNotFoundException
public void save()
public boolean equals(Object o)
true
if the two contained objects match;
false
otherwise.public int hashCode()
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |