Package org.ametys.cms.tag
Class GroupTagProvider<T extends CMSTag>
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.tag.AbstractTagProvider<CMSTag>
-
- org.ametys.cms.tag.GroupTagProvider<T>
-
- Type Parameters:
T
- the tag class
- All Implemented Interfaces:
TagProvider<CMSTag>
,PluginAware
,Configurable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
GroupTagProvider
public class GroupTagProvider<T extends CMSTag> extends AbstractTagProvider<CMSTag> implements Serviceable
Class representing a group tag provider.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
_GROUP_ID_SEPERATOR
private static String
_GROUP_TAG_PREFIX
protected GroupDirectoryContextHelper
_groupDirectoryContextHelper
The group directory context helperprotected GroupDirectoryDAO
_groupDirectoryDAO
The group directory DAOprotected GroupManager
_groupManager
The group managerprotected TagTargetTypeExtensionPoint
_targetTypeEP
The tag target type extension pointstatic String
ROLE
The Avalon role-
Fields inherited from class org.ametys.cms.tag.AbstractTagProvider
_description, _featureName, _id, _label, _pluginName
-
-
Constructor Summary
Constructors Constructor Description GroupTagProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private CMSTag
_getCMSTag(String groupDirectoryId, Group group)
private CMSTag
_getCMSTag(CMSTag parentTag, Group group)
private CMSTag
_getCMSTag(GroupDirectory groupDirectory)
protected Set<String>
_getContexts()
Get the set of context to get group directoriesString
getGroupDirectoryTagId(String groupDirectoryTagId)
Get tag id if from group directoryString
getGroupTagId(String groupDirectoryTagId, GroupIdentity groupIdentity)
Get tag id if from the group and its group directoryCMSTag
getTag(String tagName, Map<String,Object> contextualParameters)
Returns the provider's tag.Collection<CMSTag>
getTags(String tagName, Map<String,Object> contextualParameters)
Returns the direct children of the provider's tag.Map<String,CMSTag>
getTags(Map<String,Object> contextualParameters)
Returns the provider's tags.boolean
hasTag(String tagName, Map<String,Object> contextualParameters)
Determines if the tag exists.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.cms.tag.AbstractTagProvider
configure, configureDescription, configureLabel, getDescription, getId, getLabel, getPluginName, setPluginInfo
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_GROUP_TAG_PREFIX
private static final String _GROUP_TAG_PREFIX
- See Also:
- Constant Field Values
-
_GROUP_ID_SEPERATOR
private static final String _GROUP_ID_SEPERATOR
- See Also:
- Constant Field Values
-
_groupManager
protected GroupManager _groupManager
The group manager
-
_groupDirectoryDAO
protected GroupDirectoryDAO _groupDirectoryDAO
The group directory DAO
-
_targetTypeEP
protected TagTargetTypeExtensionPoint _targetTypeEP
The tag target type extension point
-
_groupDirectoryContextHelper
protected GroupDirectoryContextHelper _groupDirectoryContextHelper
The group directory context helper
-
-
Constructor Detail
-
GroupTagProvider
public GroupTagProvider()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getTags
public Map<String,CMSTag> getTags(Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the provider's tags.- Specified by:
getTags
in interfaceTagProvider<T extends CMSTag>
- Parameters:
contextualParameters
- contextual parameters- Returns:
- the provider's tags.
-
getTag
public CMSTag getTag(String tagName, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the provider's tag.- Specified by:
getTag
in interfaceTagProvider<T extends CMSTag>
- Parameters:
tagName
- The tag namecontextualParameters
- contextual parameters- Returns:
- the provider's tag.
-
getTags
public Collection<CMSTag> getTags(String tagName, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the direct children of the provider's tag.- Specified by:
getTags
in interfaceTagProvider<T extends CMSTag>
- Parameters:
tagName
- The tag namecontextualParameters
- contextual parameters- Returns:
- the provider's tag.
-
hasTag
public boolean hasTag(String tagName, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Determines if the tag exists.- Specified by:
hasTag
in interfaceTagProvider<T extends CMSTag>
- Parameters:
tagName
- The tag unique namecontextualParameters
- contextual parameters- Returns:
- true if the tag exists.
-
_getCMSTag
private CMSTag _getCMSTag(GroupDirectory groupDirectory)
-
_getCMSTag
private CMSTag _getCMSTag(String groupDirectoryId, Group group)
-
_getCMSTag
private CMSTag _getCMSTag(CMSTag parentTag, Group group)
-
_getContexts
protected Set<String> _getContexts()
Get the set of context to get group directories- Returns:
- the set of context
-
getGroupDirectoryTagId
public String getGroupDirectoryTagId(String groupDirectoryTagId)
Get tag id if from group directory- Parameters:
groupDirectoryTagId
- the group directory id- Returns:
- the tag id
-
getGroupTagId
public String getGroupTagId(String groupDirectoryTagId, GroupIdentity groupIdentity)
Get tag id if from the group and its group directory- Parameters:
groupDirectoryTagId
- the group directory tag idgroupIdentity
- the group identity- Returns:
- the tag id
-
-