Class SkinThemeProvider
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.tag.AbstractTagProvider<DefaultTag>
-
- org.ametys.plugins.linkdirectory.theme.SkinThemeProvider
-
- All Implemented Interfaces:
TagProvider<DefaultTag>
,PluginAware
,Configurable
,LogEnabled
,Serviceable
public class SkinThemeProvider extends AbstractTagProvider<DefaultTag> implements Serviceable
This class represents the themes provided by the skin
-
-
Field Summary
Fields Modifier and Type Field Description protected SourceResolver
_resolver
The source resolverprotected Map<String,List<String>>
_skinLocalIds
The tagsprotected Map<String,Map<String,DefaultTag>>
_skinTags
The tags-
Fields inherited from class org.ametys.cms.tag.AbstractTagProvider
_description, _featureName, _id, _label, _pluginName
-
-
Constructor Summary
Constructors Constructor Description SkinThemeProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Configuration configuration)
protected Map<String,DefaultTag>
configureTags(Configuration configuration, String skinName, DefaultTag parent, String defaultCatalogue)
Configure themes from the passed configurationDefaultTag
getTag(String tagID, Map<String,Object> contextualParameters)
Returns the provider's tag.Collection<DefaultTag>
getTags(String tagID, Map<String,Object> contextualParameters)
Returns the direct children of the provider's tag.Map<String,DefaultTag>
getTags(Map<String,Object> contextualParameters)
Returns the provider's tags.boolean
hasTag(String tagID, Map<String,Object> contextualParameters)
Determines if the tag exists.protected void
initializeTags(String skinName)
Initialize a skin's themes from the themes file.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
-
_resolver
protected SourceResolver _resolver
The source resolver
-
_skinLocalIds
protected Map<String,List<String>> _skinLocalIds
The tags
-
-
Constructor Detail
-
SkinThemeProvider
public SkinThemeProvider()
-
-
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<DefaultTag>
- Throws:
ConfigurationException
-
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<DefaultTag>
- Parameters:
tagID
- The tag unique namecontextualParameters
- contextual parameters- Returns:
- true if the tag exists.
-
getTag
public DefaultTag getTag(String tagID, Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the provider's tag.- Specified by:
getTag
in interfaceTagProvider<DefaultTag>
- Parameters:
tagID
- The tag namecontextualParameters
- contextual parameters- Returns:
- the provider's tag.
-
getTags
public Collection<DefaultTag> 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<DefaultTag>
- Parameters:
tagID
- The tag namecontextualParameters
- contextual parameters- Returns:
- the provider's tag.
-
getTags
public Map<String,DefaultTag> getTags(Map<String,Object> contextualParameters)
Description copied from interface:TagProvider
Returns the provider's tags.- Specified by:
getTags
in interfaceTagProvider<DefaultTag>
- Parameters:
contextualParameters
- contextual parameters- Returns:
- the provider's tags.
-
initializeTags
protected void initializeTags(String skinName) throws Exception
Initialize a skin's themes from the themes file.- Parameters:
skinName
- the name of the skin to initialize themes.- Throws:
Exception
- if an error occurs.
-
configureTags
protected Map<String,DefaultTag> configureTags(Configuration configuration, String skinName, DefaultTag parent, String defaultCatalogue) throws ConfigurationException
Configure themes from the passed configuration- Parameters:
configuration
- The configurationskinName
- the skin nameparent
- The parent theme if any (as recursion is disabled, should be null)defaultCatalogue
- The default catalog for i18n- Returns:
- a Set of
DefaultTag
- Throws:
ConfigurationException
- if configuration is invalid
-
-