Package org.ametys.plugins.linkdirectory
Class LinkDirectoryColorsComponent
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.linkdirectory.LinkDirectoryColorsComponent
-
- All Implemented Interfaces:
LogEnabled
,Component
,Configurable
,Serviceable
public class LinkDirectoryColorsComponent extends AbstractLogEnabled implements Component, Serviceable, Configurable
Component listing the available colors for a link
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LinkDirectoryColorsComponent.ColorsConfiguration
Class representing a colors configurationstatic class
LinkDirectoryColorsComponent.LinkDirectoryReloader
Class representing a link directory reloader
-
Field Summary
Fields Modifier and Type Field Description protected LinkDirectoryColorsComponent.ColorsConfiguration
_colorsConfiguration
The colors configurationprotected Map<String,LinkDirectoryColorsComponent.ColorsConfiguration>
_colorsSkinCache
The cache of colors for each skinsprotected FileReloaderUtils
_fileReloaderUtils
The file reloader utilsprotected SiteManager
_siteManager
The site managerstatic String
ROLE
The component role
-
Constructor Summary
Constructors Constructor Description LinkDirectoryColorsComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LinkDirectoryColorsComponent.ColorsConfiguration
_getColorsFromSkin(String siteName)
Get colors configuration from skinprotected LinkDirectoryColorsComponent.ColorsConfiguration
_parseColors(Configuration configuration)
Parse colors from configurationvoid
configure(Configuration configuration)
Map<String,Map<String,String>>
getColors(String siteName)
Get colors from site nameString
getDefaultKey(String siteName)
Get the default color keyvoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_siteManager
protected SiteManager _siteManager
The site manager
-
_fileReloaderUtils
protected FileReloaderUtils _fileReloaderUtils
The file reloader utils
-
_colorsConfiguration
protected LinkDirectoryColorsComponent.ColorsConfiguration _colorsConfiguration
The colors configuration
-
_colorsSkinCache
protected Map<String,LinkDirectoryColorsComponent.ColorsConfiguration> _colorsSkinCache
The cache of colors for each skins
-
-
Constructor Detail
-
LinkDirectoryColorsComponent
public LinkDirectoryColorsComponent()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getColors
public Map<String,Map<String,String>> getColors(String siteName)
Get colors from site name- Parameters:
siteName
- the site name- Returns:
- the map of colors
-
getDefaultKey
public String getDefaultKey(String siteName)
Get the default color key- Parameters:
siteName
- the site name- Returns:
- the default key
-
_parseColors
protected LinkDirectoryColorsComponent.ColorsConfiguration _parseColors(Configuration configuration) throws ConfigurationException
Parse colors from configuration- Parameters:
configuration
- the configuration- Returns:
- the colors configuration
- Throws:
ConfigurationException
- if a configuration error occurred
-
_getColorsFromSkin
protected LinkDirectoryColorsComponent.ColorsConfiguration _getColorsFromSkin(String siteName)
Get colors configuration from skin- Parameters:
siteName
- the site name- Returns:
- the colors configuration
-
-