Package org.ametys.cms.tag
Class StaticTagProvider
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.tag.AbstractTagProvider<CMSTag>
-
- org.ametys.cms.tag.StaticTagProvider
-
- All Implemented Interfaces:
TagProvider<CMSTag>
,PluginAware
,Configurable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
SkinTagProvider
public class StaticTagProvider extends AbstractTagProvider<CMSTag> implements Serviceable
Class representing a static tag provider.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
_localIds
List of statically defined idsprotected Map<String,CMSTag>
_tags
The tagsprotected TagTargetTypeExtensionPoint
_targetTypeEP
Target types-
Fields inherited from class org.ametys.cms.tag.AbstractTagProvider
_description, _featureName, _id, _label, _pluginName
-
-
Constructor Summary
Constructors Constructor Description StaticTagProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private CMSTag
_recursiveSearchTags(Map<String,CMSTag> tags, String tagID)
void
configure(Configuration configuration)
protected Map<String,CMSTag>
configureTags(Configuration configuration, CMSTag parent, String defaultCatalogue)
Configure tag from the passed configurationList<String>
getLocalIds()
Returns the list of statically defined idsCMSTag
getTag(String tagID, Map<String,Object> contextualParameters)
Returns the provider's tag.Collection<CMSTag>
getTags(String tagID, 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 tagID, Map<String,Object> contextualParameters)
Determines if the tag exists.void
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.cms.tag.AbstractTagProvider
configureDescription, configureLabel, getDescription, getId, getLabel, getPluginName, setPluginInfo
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_targetTypeEP
protected TagTargetTypeExtensionPoint _targetTypeEP
Target types
-
-
Constructor Detail
-
StaticTagProvider
public StaticTagProvider()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAbstractTagProvider<CMSTag>
- Throws:
ConfigurationException
-
getLocalIds
public List<String> getLocalIds()
Returns the list of statically defined ids- Returns:
- the list of statically defined ids
-
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<CMSTag>
- Parameters:
contextualParameters
- contextual parameters- Returns:
- the provider's tags.
-
hasTag
public boolean hasTag(String tagID, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Determines if the tag exists.- Specified by:
hasTag
in interfaceTagProvider<CMSTag>
- Parameters:
tagID
- The tag unique namecontextualParameters
- contextual parameters- Returns:
- true if the tag exists.
-
getTag
public CMSTag getTag(String tagID, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the provider's tag.- Specified by:
getTag
in interfaceTagProvider<CMSTag>
- Parameters:
tagID
- The tag namecontextualParameters
- contextual parameters- Returns:
- the provider's tag.
-
getTags
public Collection<CMSTag> getTags(String tagID, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the direct children of the provider's tag.- Specified by:
getTags
in interfaceTagProvider<CMSTag>
- Parameters:
tagID
- The tag namecontextualParameters
- contextual parameters- Returns:
- the provider's tag.
-
configureTags
protected Map<String,CMSTag> configureTags(Configuration configuration, CMSTag parent, String defaultCatalogue) throws ConfigurationException
Configure tag from the passed configuration- Parameters:
configuration
- The configurationparent
- The parent tag if anydefaultCatalogue
- The default catalogue for i18n- Returns:
- a Set of
Tag
- Throws:
ConfigurationException
- If an error occurred
-
-