Class Category
- java.lang.Object
-
- org.ametys.plugins.workspaces.categories.Category
-
-
Field Summary
Fields Modifier and Type Field Description private String
_color
private I18nizableText
_description
private String
_id
private String
_name
private Category
_parent
private Map<String,Category>
_tags
private I18nizableText
_title
-
Fields inherited from interface org.ametys.cms.tag.Tag
NAME_PATTERN
-
-
Constructor Summary
Constructors Constructor Description Category(String id)
ConstructorCategory(String id, String name, String color, Category parent, I18nizableText title, I18nizableText description)
ConstructorCategory(String id, String name, Category parent, I18nizableText title, I18nizableText description)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTag(Tag tag)
Add a new child tag.String
getColor()
Get the color categoryI18nizableText
getDescription()
Retrieves the description.String
getId()
Get the tag unique id.String
getName()
Get the tag name.Category
getParent()
Get the parent tagString
getParentName()
Get the parent name.Category
getTag(String tagId)
Try to get a child tag by its idMap<String,Category>
getTags()
Retrieves the Set of child tagsI18nizableText
getTitle()
Retrieves the title.boolean
hasTag(String tagId)
Determines if a tag existsvoid
setTags(Map<String,? extends Tag> tags)
Set the child tags
-
-
-
Constructor Detail
-
Category
public Category(String id)
Constructor- Parameters:
id
- The id of the tag. The id must be unique.
-
Category
public Category(String id, String name, Category parent, I18nizableText title, I18nizableText description)
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 description
-
Category
public Category(String id, String name, String color, Category parent, I18nizableText title, I18nizableText description)
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.color
- the colorparent
- The parent tag (can be null if the tag has no parent)title
- the tag titledescription
- the tag description
-
-
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,Category> getTags()
Description copied from interface:Tag
Retrieves the Set of child tags
-
getTag
public Category 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
-
-