Package org.ametys.cms.tag
Class CMSTag
java.lang.Object
org.ametys.cms.tag.CMSTag
- All Implemented Interfaces:
Tag
- Direct Known Subclasses:
CategoryCMSTag
,KeywordCMSTag
,ProjectCMSTag
This class represent a CMS Tag
-
Nested Class Summary
-
Field Summary
Fields inherited from interface org.ametys.cms.tag.Tag
NAME_PATTERN
-
Constructor Summary
ConstructorDescriptionCMSTag
(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
Modifier and TypeMethodDescriptionvoid
Add a new child tag.Retrieves the description.getId()
Get the tag unique id.getName()
Get the tag name.Get the parent tagGet the parent name.Try to get a child tag by its idgetTags()
Retrieves the Set of child tagsRetrieves the target type.getTitle()
Retrieves the title.Retrieves the visibility type.boolean
Determines if a tag existsvoid
Set the child tagsvoid
setTarget
(TagTargetType target) Set the target type.void
setVisibility
(CMSTag.TagVisibility visibility) Set the visibility type.
-
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 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 Details
-
getId
Description copied from interface:Tag
Get the tag unique id. -
getName
Description copied from interface:Tag
Get the tag name. -
getTitle
Description copied from interface:Tag
Retrieves the title. -
getDescription
Description copied from interface:Tag
Retrieves the description.- Specified by:
getDescription
in interfaceTag
- Returns:
- the description.
-
getParentName
Description copied from interface:Tag
Get the parent name.- Specified by:
getParentName
in interfaceTag
- Returns:
- The parent name.
-
getParent
Description copied from interface:Tag
Get the parent tag -
addTag
Description copied from interface:Tag
Add a new child tag. -
getTags
Description copied from interface:Tag
Retrieves the Set of child tags -
getTag
Description copied from interface:Tag
Try to get a child tag by its id -
hasTag
Description copied from interface:Tag
Determines if a tag exists -
getVisibility
Retrieves the visibility type.- Returns:
- the visibility type.
-
setVisibility
Set the visibility type.- Parameters:
visibility
- the visibility to set.
-
getTarget
Retrieves the target type.- Returns:
- the target type.
-
setTarget
Set the target type.- Parameters:
target
- the target to set.
-
setTags
Description copied from interface:Tag
Set the child tags
-