Package org.ametys.web.skin
Class SkinModel
- java.lang.Object
 - 
- org.ametys.web.skin.SkinModel
 
 
- 
public class SkinModel extends Object
A skin Do not mistake withSkinParametersModel 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSkinModel.CssMenuItemAbstract representation of a menu itemclassSkinModel.CssStyleItemBean representing a item of css styleclassSkinModel.SeparatorItem representing a separatorclassSkinModel.ThemeBean representing a theme 
- 
Field Summary
Fields Modifier and Type Field Description private List<String>_colorsprivate Map<String,List<SkinModel.CssMenuItem>>_cssStylesprivate String_defaultColorThemeprivate Map<String,String>_defaultValuesprotected I18nizableText_descriptionThe skin descriptionprotected Path_fileThe skin directoryprotected String_idThe skin id (e.g.protected I18nizableText_labelThe skin nameprotected String_largeImageThe skin thumbnail 48x48private long_lastColorsUpdateprotected long_lastConfUpdateThe last time the file was loadedprivate long_lastCssStylesUpdateprivate long_lastDefaultValuesUpdateprivate static org.slf4j.Logger_loggerprotected String_mediumImageThe skin thumbnail 32x32protected boolean_modifiableIs the skin modifiableprotected String_smallImageThe skin thumbnail 16x16private Map<String,SkinModel.Theme>_themes 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private I18nizableText_configureI18nizableText(Configuration configuration, I18nizableText defaultValue)private String_configureIcon(Configuration iconConf)private List<SkinModel.CssMenuItem>_configureStyleItems(Configuration styleConfig)private String_configureThumbnail(String value, String defaultImage)protected void_defaultValues()The configuration default values (if configuration file does not exist or is unreadable)private void_refreshColorsValues()private void_refreshCssStyles()private void_refreshDefaultValues()List<String>getColors(String themeId)Get the default colors of this themeList<String>getDefaultColors()Get the default colors of this modelStringgetDefaultColorTheme()Get the default color themeMap<String,String>getDefaultValues()Get model default valuesI18nizableTextgetDescription()The skin descriptionStringgetId()The skin idI18nizableTextgetLabel()The skin labelStringgetLargeImage()The large image file uriStringgetMediumImage()The medium image file uriPathgetPath()Get the skin's file directoryStringgetSmallImage()The small image file uriMap<String,List<SkinModel.CssMenuItem>>getStyleItems()Get all style items of this modelList<SkinModel.CssMenuItem>getStyleItems(String styleId)Get the items of this css styleSkinModel.ThemegetTheme(String themeId)Get a theme of this modelMap<String,SkinModel.Theme>getThemes()Get color themes of this modelbooleanisModifiable()Is the model modifiable?voidrefreshValues()Refresh the conf values 
 - 
 
- 
- 
Field Detail
- 
_logger
private static org.slf4j.Logger _logger
 
- 
_label
protected I18nizableText _label
The skin name 
- 
_description
protected I18nizableText _description
The skin description 
- 
_smallImage
protected String _smallImage
The skin thumbnail 16x16 
- 
_mediumImage
protected String _mediumImage
The skin thumbnail 32x32 
- 
_largeImage
protected String _largeImage
The skin thumbnail 48x48 
- 
_lastConfUpdate
protected long _lastConfUpdate
The last time the file was loaded 
- 
_modifiable
protected boolean _modifiable
Is the skin modifiable 
- 
_lastDefaultValuesUpdate
private long _lastDefaultValuesUpdate
 
- 
_defaultValues
private Map<String,String> _defaultValues
 
- 
_defaultColorTheme
private String _defaultColorTheme
 
- 
_lastColorsUpdate
private long _lastColorsUpdate
 
- 
_themes
private Map<String,SkinModel.Theme> _themes
 
- 
_lastCssStylesUpdate
private long _lastCssStylesUpdate
 
- 
_cssStyles
private Map<String,List<SkinModel.CssMenuItem>> _cssStyles
 
 - 
 
- 
Method Detail
- 
_defaultValues
protected void _defaultValues()
The configuration default values (if configuration file does not exist or is unreadable) 
- 
isModifiable
public boolean isModifiable()
Is the model modifiable?- Returns:
 - true if modifiable
 
 
- 
refreshValues
public void refreshValues()
Refresh the conf values 
- 
getDefaultColorTheme
public String getDefaultColorTheme()
Get the default color theme- Returns:
 - The default color theme or 
null 
 
- 
getThemes
public Map<String,SkinModel.Theme> getThemes()
Get color themes of this model- Returns:
 - color themes of this model
 
 
- 
getTheme
public SkinModel.Theme getTheme(String themeId)
Get a theme of this model- Parameters:
 themeId- the theme id- Returns:
 - the theme
 
 
- 
getDefaultColors
public List<String> getDefaultColors()
Get the default colors of this model- Returns:
 - The default colors of this model
 
 
- 
getColors
public List<String> getColors(String themeId)
Get the default colors of this theme- Parameters:
 themeId- The theme id- Returns:
 - the default colors of this theme
 
 
- 
getStyleItems
public Map<String,List<SkinModel.CssMenuItem>> getStyleItems()
Get all style items of this model- Returns:
 - the list of items of css style
 
 
- 
getStyleItems
public List<SkinModel.CssMenuItem> getStyleItems(String styleId)
Get the items of this css style- Parameters:
 styleId- The css style id- Returns:
 - the list of items of css style
 
 
- 
getDefaultValues
public Map<String,String> getDefaultValues()
Get model default values- Returns:
 - The default values
 
 
- 
_refreshColorsValues
private void _refreshColorsValues()
 
- 
_refreshCssStyles
private void _refreshCssStyles()
 
- 
_configureStyleItems
private List<SkinModel.CssMenuItem> _configureStyleItems(Configuration styleConfig) throws ConfigurationException
- Throws:
 ConfigurationException
 
- 
_refreshDefaultValues
private void _refreshDefaultValues()
 
- 
_configureThumbnail
private String _configureThumbnail(String value, String defaultImage)
 
- 
_configureI18nizableText
private I18nizableText _configureI18nizableText(Configuration configuration, I18nizableText defaultValue) throws ConfigurationException
- Throws:
 ConfigurationException
 
- 
_configureIcon
private String _configureIcon(Configuration iconConf) throws ConfigurationException
- Throws:
 ConfigurationException
 
- 
getLabel
public I18nizableText getLabel()
The skin label- Returns:
 - The label
 
 
- 
getDescription
public I18nizableText getDescription()
The skin description- Returns:
 - The description. Can not be null but can be empty
 
 
- 
getSmallImage
public String getSmallImage()
The small image file uri- Returns:
 - The small image file uri
 
 
- 
getMediumImage
public String getMediumImage()
The medium image file uri- Returns:
 - The medium image file uri
 
 
- 
getLargeImage
public String getLargeImage()
The large image file uri- Returns:
 - The large image file uri
 
 
 - 
 
 -