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_resolverThe source resolverprivate SiteManager_siteManagerprivate SkinConfigurationHelper_skinConfigurationHelperprotected Map<String,List<String>>_skinLocalIdsThe tagsprivate SkinsManager_skinsManagerprotected Map<String,Map<String,DefaultTag>>_skinTagsThe 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 private DefaultTag_recursiveSearchTags(Map<String,DefaultTag> tags, String tagID)voidconfigure(Configuration configuration)protected Map<String,DefaultTag>configureTags(Configuration configuration, String skinName, DefaultTag parent, String defaultCatalogue)Configure themes from the passed configurationDefaultTaggetTag(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.booleanhasTag(String tagID, Map<String,Object> contextualParameters)Determines if the tag exists.protected voidinitializeTags(String skinName)Initialize a skin's themes from the themes file.voidservice(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
-
_siteManager
private SiteManager _siteManager
-
_skinsManager
private SkinsManager _skinsManager
-
_skinConfigurationHelper
private SkinConfigurationHelper _skinConfigurationHelper
-
-
Constructor Detail
-
SkinThemeProvider
public SkinThemeProvider()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classAbstractTagProvider<DefaultTag>- Throws:
ConfigurationException
-
hasTag
public boolean hasTag(String tagID, Map<String,Object> contextualParameters)
Description copied from interface:TagProviderDetermines if the tag exists.- Specified by:
hasTagin 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:TagProviderReturns the provider's tag.- Specified by:
getTagin 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:TagProviderReturns the direct children of the provider's tag.- Specified by:
getTagsin interfaceTagProvider<DefaultTag>- Parameters:
tagID- The tag namecontextualParameters- contextual parameters- Returns:
- the provider's tag.
-
_recursiveSearchTags
private DefaultTag _recursiveSearchTags(Map<String,DefaultTag> tags, String tagID)
-
getTags
public Map<String,DefaultTag> getTags(Map<String,Object> contextualParameters)
Description copied from interface:TagProviderReturns the provider's tags.- Specified by:
getTagsin 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
-
-