Package org.ametys.cms.tag
Class CMSTag
- java.lang.Object
-
- org.ametys.cms.tag.CMSTag
-
- All Implemented Interfaces:
Tag
- Direct Known Subclasses:
CategoryCMSTag
,KeywordCMSTag
public class CMSTag extends Object implements Tag
This class represent a CMS Tag
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CMSTag.TagVisibility
Tag visibility
-
Field Summary
Fields Modifier and Type Field Description private I18nizableText
_description
private String
_id
private String
_name
private CMSTag
_parent
private Map<String,CMSTag>
_tags
private TagTargetType
_targetType
private I18nizableText
_title
private CMSTag.TagVisibility
_visibility
-
Fields inherited from interface org.ametys.cms.tag.Tag
NAME_PATTERN
-
-
Constructor Summary
Constructors Constructor Description CMSTag(String id, String name, CMSTag parent, I18nizableText title, I18nizableText description, CMSTag.TagVisibility visibility, TagTargetType target)
ConstructorCMSTag(String id, String name, CMSTag parent, I18nizableText title, I18nizableText description, TagTargetType target)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTag(Tag tag)
Add a new child tag.I18nizableText
getDescription()
Retrieves the description.String
getId()
Get the tag unique id.String
getName()
Get the tag name.CMSTag
getParent()
Get the parent tagString
getParentName()
Get the parent name.CMSTag
getTag(String tagId)
Try to get a child tag by its idMap<String,CMSTag>
getTags()
Retrieves the Set of child tagsTagTargetType
getTarget()
Retrieves the target type.I18nizableText
getTitle()
Retrieves the title.CMSTag.TagVisibility
getVisibility()
Retrieves the visibility type.boolean
hasTag(String tagId)
Determines if a tag existsvoid
setTags(Map<String,? extends Tag> tags)
Set the child tagsvoid
setTarget(TagTargetType target)
Set the target type.void
setVisibility(CMSTag.TagVisibility visibility)
Set the visibility type.
-
-
-
Field Detail
-
_title
private I18nizableText _title
-
_description
private I18nizableText _description
-
_visibility
private CMSTag.TagVisibility _visibility
-
_targetType
private TagTargetType _targetType
-
-
Constructor Detail
-
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 titledescription
- the tag descriptiontarget
- 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 titledescription
- the tag descriptionvisibility
- the tag visibility.target
- The type of target
-
-
Method Detail
-
getTitle
public I18nizableText getTitle()
Description copied from interface:Tag
Retrieves the title.
-
getDescription
public I18nizableText getDescription()
Description copied from interface:Tag
Retrieves the description.- Specified by:
getDescription
in interfaceTag
- Returns:
- the description.
-
getParentName
public String getParentName()
Description copied from interface:Tag
Get the parent name.- Specified by:
getParentName
in interfaceTag
- Returns:
- The parent name.
-
getTags
public Map<String,CMSTag> getTags()
Description copied from interface:Tag
Retrieves the Set of child tags
-
getTag
public CMSTag getTag(String tagId)
Description copied from interface:Tag
Try to get a child tag by its id
-
hasTag
public boolean hasTag(String tagId)
Description copied from interface:Tag
Determines if a tag exists
-
getVisibility
public CMSTag.TagVisibility 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
public TagTargetType 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.
-
-