Class CMSTag

java.lang.Object
org.ametys.cms.tag.CMSTag
All Implemented Interfaces:
Tag
Direct Known Subclasses:
CategoryCMSTag, KeywordCMSTag, ProjectCMSTag

public class CMSTag extends Object implements Tag
This class represent a CMS Tag
  • Constructor Details

    • CMSTag

      public CMSTag(String id, String name, CMSTag parent, I18nizableText title, I18nizableText description, TagTargetType target)
      Constructor
      Parameters:
      id - The id of the tag. The id must be unique.
      name - The name of the tag. The name must be unique. The name is the same as the id except for JCR tag.
      parent - The parent tag (can be null if the tag has no parent)
      title - the tag title
      description - the tag description
      target - the type of target
    • CMSTag

      public CMSTag(String id, String name, CMSTag parent, I18nizableText title, I18nizableText description, CMSTag.TagVisibility visibility, TagTargetType target)
      Constructor
      Parameters:
      id - The id of the tag. The id must be unique.
      name - The name of the tag. The name must be unique. The name is the same as the id except for JCR tag.
      parent - The parent tag (can be null if the tag has no parent)
      title - the tag title
      description - the tag description
      visibility - the tag visibility.
      target - The type of target
  • Method Details

    • getId

      public String getId()
      Description copied from interface: Tag
      Get the tag unique id.
      Specified by:
      getId in interface Tag
      Returns:
      The unique id
    • getName

      public String getName()
      Description copied from interface: Tag
      Get the tag name.
      Specified by:
      getName in interface Tag
      Returns:
      The tag name
    • getTitle

      Description copied from interface: Tag
      Retrieves the title.
      Specified by:
      getTitle in interface Tag
      Returns:
      the title.
    • getDescription

      Description copied from interface: Tag
      Retrieves the description.
      Specified by:
      getDescription in interface Tag
      Returns:
      the description.
    • getParentName

      Description copied from interface: Tag
      Get the parent name.
      Specified by:
      getParentName in interface Tag
      Returns:
      The parent name.
    • getParent

      public CMSTag getParent()
      Description copied from interface: Tag
      Get the parent tag
      Specified by:
      getParent in interface Tag
      Returns:
      The parent tag or null if the tag has no parent.
    • addTag

      public void addTag(Tag tag)
      Description copied from interface: Tag
      Add a new child tag.
      Specified by:
      addTag in interface Tag
      Parameters:
      tag - The tag to add
    • getTags

      public Map<String,CMSTag> getTags()
      Description copied from interface: Tag
      Retrieves the Set of child tags
      Specified by:
      getTags in interface Tag
      Returns:
      The child tags in a Map
    • getTag

      public CMSTag getTag(String tagId)
      Description copied from interface: Tag
      Try to get a child tag by its id
      Specified by:
      getTag in interface Tag
      Parameters:
      tagId - The id of the child tag
      Returns:
      The child tag or null if not existing
    • hasTag

      public boolean hasTag(String tagId)
      Description copied from interface: Tag
      Determines if a tag exists
      Specified by:
      hasTag in interface Tag
      Parameters:
      tagId - The tag id
      Returns:
      true if the tag exists
    • getVisibility

      Retrieves the visibility type.
      Returns:
      the visibility type.
    • setVisibility

      public void setVisibility(CMSTag.TagVisibility visibility)
      Set the visibility type.
      Parameters:
      visibility - the visibility to set.
    • getTarget

      Retrieves the target type.
      Returns:
      the target type.
    • setTarget

      public void setTarget(TagTargetType target)
      Set the target type.
      Parameters:
      target - the target to set.
    • setTags

      public void setTags(Map<String,? extends Tag> tags)
      Description copied from interface: Tag
      Set the child tags
      Specified by:
      setTags in interface Tag
      Parameters:
      tags - The Map of Tag to set