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
,Initializable
,Component
,Configurable
,Serviceable
public class LinkDirectoryColorsComponent
extends AbstractLogEnabled
implements Component, Serviceable, Configurable, Initializable
Component listing the available colors for a link
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Class representing a colors configurationstatic class
Class representing a link directory reloader -
Field Summary
Modifier and TypeFieldDescriptionThe colors configurationprotected FileReloaderUtils
The file reloader utilsprotected SiteManager
The site managerprotected static final String
The color skin cache idstatic final String
The component role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_getColorsFromSkin
(String siteName) Get colors configuration from skin_parseColors
(Configuration configuration) Parse colors from configurationvoid
configure
(Configuration configuration) Get colors from site namegetDefaultKey
(String siteName) Get the default color keyvoid
void
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role -
COLOR_SKIN_CACHE
The color skin cache id -
_siteManager
The site manager -
_fileReloaderUtils
The file reloader utils -
_colorsConfiguration
The colors configuration
-
-
Constructor Details
-
LinkDirectoryColorsComponent
public LinkDirectoryColorsComponent()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getColors
Get colors from site name- Parameters:
siteName
- the site name- Returns:
- the map of colors
-
getDefaultKey
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
Get colors configuration from skin- Parameters:
siteName
- the site name- Returns:
- the colors configuration
-