Package com.tridion.taxonomies
Class Keyword
java.lang.Object
com.tridion.taxonomies.Keyword
- All Implemented Interfaces:
Serializable,Comparable
This is a representation of a keyword inside a Taxonomy. This allows access to the properties which
can be set on keywords used inside a Taxonomy. The TaxonomyKeyword is different than normal categories/keywords
in the way it can contain relations to other keywords and can contain additional properties.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionThis constructs a taxonomy keyword with the TCMURI and the Taxonomy it belongs to.This constructs a taxonomy keyword with the TCMURI, it's name and the Taxonomy it belongs to.This constructs a taxonomy keyword with the TCMURI, it's name and it's parent. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRelatedKeywordURI(String relatedKeywordURI) Add a related KeywordURI to the list of related KeywordURIS.This clones this keyword and all of its children keywords in memory.intWhen this object is used in a collection it will make sure that the keyword is sorted by using it's natural order which is based on the tree pre-ordering mechanism.Returns a List of all the children of this TaxonomyKeyword.intThis returns the depth of this keyword in the whole taxonomy it belongs to.This returns the description field of the Keyword.This returns a key if one is set or an empty string if none.intThis gets the left value of this Keyword in the hierarchy.Returns the custom metadata for this taxonomyKeyword.The name representing this TaxonomyKeyword.intThis gets the right value of this Keyword in the hierarchy.This returns a title if one is set or an empty string if none.Returns the TCMURI of the keyword.Returns the parent TaxonomyKeyword.Returns the full list of all the parent keywords of this Keyword.intThis returns the reference count for a specific taxonomyKeyword.String[]Returns an array of KeywordURIS related to the current Keyword.This returns the URI of the taxonomy for this taxonomyKeyword.booleanThis returns if this TaxonomyKeyword has children.booleanThis returns if this TaxonomyKeyword is abstract.booleanThis returns if the TaxonomyKeyword should be navigable.booleanThis returns if this TaxonomyKeyword is used for identification.voidsetHasKeywordChildren(boolean hasKeywordChildren) This sets if this TaxonomyKeyword should act if it has children or not.voidsetKeywordAbstract(boolean keywordAbstract) This sets if the TaxonomyKeyword should behave like an abstract.voidsetKeywordDepth(int keywordDepth) This sets the depth of the keyword in the whole taxonomy it is belongs to.voidsetKeywordDescription(String keywordDescription) This sets the description field of the Keyword.voidsetKeywordKey(String keywordKey) Sets the key attribute of this Keyword.voidsetKeywordLeft(int keywordLeft) This sets the left value of this Keyword.voidsetKeywordMeta(CustomMeta keywordMeta) protected voidsetKeywordName(String keywordName) This sets the name field of the Keyword.voidsetKeywordNavigable(boolean keywordNavigable) This sets if the TaxonomyKeyword should be navigable.voidsetKeywordRight(int keywordRight) This sets the right value of this Keyword.voidsetKeywordTitle(String keywordTitle) Sets the key attribute of this Keyword.voidsetParentKeyword(Keyword parentKeyword) This sets the parent of this TaxonomyKeyword, this methods also sets the primary Parent Keyword of this Keyword in which this keyword will be present in its children.voidsetParentKeyword(Keyword parentKeyword, boolean thePrimaryParentKeyword) This sets the parent of this TaxonomyKeyword, this methods also puts it in the children list of the parentKeyword.voidsetReferencedContentCount(int referencedContentCount) This sets the number of referenced items for this taxonomyKeyword.voidsetUsedForIdentification(boolean usedForIdentification) This sets if the TaxonomyKeyword should be used for identification.toString()This displays the actual value of the Taxonomy.
-
Constructor Details
-
Keyword
This constructs a taxonomy keyword with the TCMURI, it's name and it's parent.- Parameters:
taxonomyURI- The Taxonomy URI of the taxonomy that contains the keyword.keywordURI- The URI of the keyword in the taxonomy.keywordName- The name of the keyword in the taxonomy.parentKeyword- The parent of this keyword in the taxonomy.
-
Keyword
This constructs a taxonomy keyword with the TCMURI, it's name and the Taxonomy it belongs to.- Parameters:
taxonomyURI- The URI of the Taxonomy the facet is inkeywordURI- The TCMURI of the element in the taxonomykeywordName- The name of the element in the taxonomy
-
Keyword
This constructs a taxonomy keyword with the TCMURI and the Taxonomy it belongs to.- Parameters:
keywordURI- The TCMURI of the element in the taxonomytaxonomyURI- The URI of the Taxonomy the keyword is in
-
-
Method Details
-
getKeywordURI
Returns the TCMURI of the keyword.- Returns:
- The TCMURI of the TaxonomyKeyword as String
-
getParentKeywords
Returns the full list of all the parent keywords of this Keyword.- Returns:
- The list of all the parent keywords
-
getParentKeyword
Returns the parent TaxonomyKeyword.- Returns:
- The parent TaxonomyKeyword
-
setParentKeyword
This sets the parent of this TaxonomyKeyword, this methods also puts it in the children list of the parentKeyword.- Parameters:
parentKeyword- The parent of this taxonomyKeywordthePrimaryParentKeyword- True if the parent is the primary parent
-
setParentKeyword
This sets the parent of this TaxonomyKeyword, this methods also sets the primary Parent Keyword of this Keyword in which this keyword will be present in its children.- Parameters:
parentKeyword- The parent of this taxonomyKeyword
-
getKeywordChildren
Returns a List of all the children of this TaxonomyKeyword.- Returns:
- The list of children for this taxonomyKeyword
-
getKeywordName
The name representing this TaxonomyKeyword.- Returns:
- The name of this TaxonomyKeyword
-
getTaxonomyURI
This returns the URI of the taxonomy for this taxonomyKeyword.- Returns:
- the TaxonomyURI this TaxonomyKeyword is part of
-
hasKeywordChildren
public boolean hasKeywordChildren()This returns if this TaxonomyKeyword has children.- Returns:
- this returns true if this Keyword has children, false if not
-
setHasKeywordChildren
public void setHasKeywordChildren(boolean hasKeywordChildren) This sets if this TaxonomyKeyword should act if it has children or not.- Parameters:
hasKeywordChildren- true if this Keyword has children, false if not
-
isKeywordAbstract
public boolean isKeywordAbstract()This returns if this TaxonomyKeyword is abstract.- Returns:
- True if this TaxonomyKeyword is abstract, false if not
-
setKeywordAbstract
public void setKeywordAbstract(boolean keywordAbstract) This sets if the TaxonomyKeyword should behave like an abstract.- Parameters:
keywordAbstract- true if it should behave like an abstract, false if not
-
isUsedForIdentification
public boolean isUsedForIdentification()This returns if this TaxonomyKeyword is used for identification.- Returns:
- True if this TaxonomyKeyword is used for identification, false if not
-
setUsedForIdentification
public void setUsedForIdentification(boolean usedForIdentification) This sets if the TaxonomyKeyword should be used for identification.- Parameters:
usedForIdentification- true if it should be used for identification, false if not
-
getReferencedContentCount
public int getReferencedContentCount()This returns the reference count for a specific taxonomyKeyword.- Returns:
- The number of referenced items for this taxonomyKeyword
-
setReferencedContentCount
public void setReferencedContentCount(int referencedContentCount) This sets the number of referenced items for this taxonomyKeyword.- Parameters:
referencedContentCount- The number of referenced items for this taxonomyKeyword
-
getKeywordKey
This returns a key if one is set or an empty string if none.- Returns:
- the key if set or an empty string if not set.
-
setKeywordKey
Sets the key attribute of this Keyword. -
getKeywordTitle
This returns a title if one is set or an empty string if none.- Returns:
- the title if set or an empty string if not set.
-
setKeywordTitle
Sets the key attribute of this Keyword. -
getKeywordMeta
Returns the custom metadata for this taxonomyKeyword.- Returns:
- the custom metadata for this taxonomyKeyword
-
setKeywordMeta
-
addRelatedKeywordURI
Add a related KeywordURI to the list of related KeywordURIS.- Parameters:
relatedKeywordURI- the related KeywordsURI to add to the related Keywords
-
getRelatedKeywordURIS
Returns an array of KeywordURIS related to the current Keyword.- Returns:
- An array of related KeywordURIS
-
toString
This displays the actual value of the Taxonomy. -
getKeywordLeft
public int getKeywordLeft()This gets the left value of this Keyword in the hierarchy.- Returns:
- The left Value of this Keyword in the hierarchy
-
setKeywordLeft
public void setKeywordLeft(int keywordLeft) This sets the left value of this Keyword.- Parameters:
keywordLeft- This sets the left value of this Keyword in the hierarchy
-
getKeywordRight
public int getKeywordRight()This gets the right value of this Keyword in the hierarchy.- Returns:
- The right Value of this Keyword in the hierarchy
-
setKeywordRight
public void setKeywordRight(int keywordRight) This sets the right value of this Keyword.- Parameters:
keywordRight- This sets the right value of this Keyword in the hierarchy
-
getKeywordDepth
public int getKeywordDepth()This returns the depth of this keyword in the whole taxonomy it belongs to.- Returns:
- The depth of the keyword in the taxonomy
-
setKeywordDepth
public void setKeywordDepth(int keywordDepth) This sets the depth of the keyword in the whole taxonomy it is belongs to.- Parameters:
keywordDepth- The depth of the keyword in the taxonomy
-
getKeywordDescription
This returns the description field of the Keyword.- Returns:
- The description field of the Keyword
-
setKeywordDescription
This sets the description field of the Keyword.- Parameters:
keywordDescription- The description field of the keyword
-
setKeywordName
This sets the name field of the Keyword.- Parameters:
keywordName- The name field of the keyword
-
compareTo
When this object is used in a collection it will make sure that the keyword is sorted by using it's natural order which is based on the tree pre-ordering mechanism.- Specified by:
compareToin interfaceComparable
-
clone
This clones this keyword and all of its children keywords in memory. It will clone them starting at the given left and the given depth.- Parameters:
left- The left start of the keyword to cloneparentKeyword- The parent keyword of the keyword- Returns:
- The flat list of cloned keywords and cloned children.
-