Class Keyword

java.lang.Object
com.tridion.taxonomies.Keyword
All Implemented Interfaces:
Serializable, Comparable

public class Keyword extends Object implements 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 Details

    • Keyword

      public Keyword(String taxonomyURI, String keywordURI, String keywordName, Keyword parentKeyword)
      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

      public Keyword(String taxonomyURI, String keywordURI, String keywordName)
      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 in
      keywordURI - The TCMURI of the element in the taxonomy
      keywordName - The name of the element in the taxonomy
    • Keyword

      public Keyword(String taxonomyURI, String keywordURI)
      This constructs a taxonomy keyword with the TCMURI and the Taxonomy it belongs to.
      Parameters:
      keywordURI - The TCMURI of the element in the taxonomy
      taxonomyURI - The URI of the Taxonomy the keyword is in
  • Method Details

    • getKeywordURI

      public String getKeywordURI()
      Returns the TCMURI of the keyword.
      Returns:
      The TCMURI of the TaxonomyKeyword as String
    • getParentKeywords

      public List<Keyword> getParentKeywords()
      Returns the full list of all the parent keywords of this Keyword.
      Returns:
      The list of all the parent keywords
    • getParentKeyword

      public Keyword getParentKeyword()
      Returns the parent TaxonomyKeyword.
      Returns:
      The parent TaxonomyKeyword
    • setParentKeyword

      public void setParentKeyword(Keyword parentKeyword, boolean thePrimaryParentKeyword)
      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 taxonomyKeyword
      thePrimaryParentKeyword - True if the parent is the primary parent
    • setParentKeyword

      public void setParentKeyword(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.
      Parameters:
      parentKeyword - The parent of this taxonomyKeyword
    • getKeywordChildren

      public List<Keyword> getKeywordChildren()
      Returns a List of all the children of this TaxonomyKeyword.
      Returns:
      The list of children for this taxonomyKeyword
    • getKeywordName

      public String getKeywordName()
      The name representing this TaxonomyKeyword.
      Returns:
      The name of this TaxonomyKeyword
    • getTaxonomyURI

      public String 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
    • isKeywordNavigable

      public boolean isKeywordNavigable()
      This returns if the TaxonomyKeyword should be navigable.
      Returns:
      this returns true if the Keyword should be navigable, false if not
    • setKeywordNavigable

      public void setKeywordNavigable(boolean keywordNavigable)
      This sets if the TaxonomyKeyword should be navigable.
      Parameters:
      keywordNavigable - Set to true if TaxonomyKeyword must be navigable, 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

      public String 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

      public void setKeywordKey(String keywordKey)
      Sets the key attribute of this Keyword.
    • getKeywordTitle

      public String 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

      public void setKeywordTitle(String keywordTitle)
      Sets the key attribute of this Keyword.
    • getKeywordMeta

      public CustomMeta getKeywordMeta()
      Returns the custom metadata for this taxonomyKeyword.
      Returns:
      the custom metadata for this taxonomyKeyword
    • setKeywordMeta

      public void setKeywordMeta(CustomMeta keywordMeta)
    • addRelatedKeywordURI

      public void addRelatedKeywordURI(String relatedKeywordURI)
      Add a related KeywordURI to the list of related KeywordURIS.
      Parameters:
      relatedKeywordURI - the related KeywordsURI to add to the related Keywords
    • getRelatedKeywordURIS

      public String[] getRelatedKeywordURIS()
      Returns an array of KeywordURIS related to the current Keyword.
      Returns:
      An array of related KeywordURIS
    • toString

      public String toString()
      This displays the actual value of the Taxonomy.
      Overrides:
      toString in class Object
    • 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

      public String getKeywordDescription()
      This returns the description field of the Keyword.
      Returns:
      The description field of the Keyword
    • setKeywordDescription

      public void setKeywordDescription(String keywordDescription)
      This sets the description field of the Keyword.
      Parameters:
      keywordDescription - The description field of the keyword
    • setKeywordName

      protected void setKeywordName(String keywordName)
      This sets the name field of the Keyword.
      Parameters:
      keywordName - The name field of the keyword
    • compareTo

      public int compareTo(Object o)
      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:
      compareTo in interface Comparable
    • clone

      public List<Keyword> clone(int left, Keyword parentKeyword)
      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 clone
      parentKeyword - The parent keyword of the keyword
      Returns:
      The flat list of cloned keywords and cloned children.