Package org.ametys.web.skin
Class SkinTemplate
java.lang.Object
org.ametys.web.skin.SkinTemplate
Represent a skin template.
-
Field Summary
Modifier and TypeFieldDescriptionprotected I18nizableText
Template descriptionprotected String
Template id (e.g.protected I18nizableText
Template labelprotected String
Template thumbnail 48pxprotected long
The last time the file was loadedprotected String
Template thumbnail 32pxprotected SkinConfigurationHelper
The skin configuration helperprotected String
The skin idprotected SkinsManager
The skins managerprotected String
Template thumbnail 16pxprotected Optional<ViewParametersModel>
The template view parametersprotected Map<String,
SkinTemplateZone> Template zones. -
Constructor Summary
ConstructorDescriptionSkinTemplate
(String skinId, String templateId, SkinsManager skinsManager, SkinConfigurationHelper skinConfigurationHelper) Creates a template -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<ViewParametersModel>
_configureTemplateViewParameters
(String skinId, String templateId, Configuration templateConfiguration) Parse template view parametersprotected Optional<ViewParametersModel>
_configureViewParameters
(Configuration paramConfiguration, String viewParametersId) Parse view parameters from configurationprotected Optional<ViewParametersModel>
_configureZoneItemViewParameters
(String skinId, String templateId, String zoneId, Configuration zoneConfiguration) Parse zone item view parametersprotected Optional<ViewParametersModel>
_configureZoneViewParameters
(String skinId, String templateId, String zoneId, Configuration zoneConfiguration) Parse zone view parametersprotected void
The configuration default values (if configuration file does not exist or is unreadable)void
dispose()
Dispose skin template componentGet the primary default zone.The template descriptiongetId()
The template idgetLabel()
The template labelThe large image file uriThe medium image file uriThe small image file uriGet the view parameters modelThe zone identifier by its idgetZones()
The zones defined in by the template defvoid
Refresh the configuration values
-
Field Details
-
_skinId
The skin id -
_id
Template id (e.g. the directory name) -
_label
Template label -
_description
Template description -
_smallImage
Template thumbnail 16px -
_mediumImage
Template thumbnail 32px -
_largeImage
Template thumbnail 48px -
_zones
Template zones. the key is the zone id -
_viewParameters
The template view parameters -
_lastConfUpdate
The last time the file was loaded -
_skinsManager
The skins manager -
_skinConfigurationHelper
The skin configuration helper
-
-
Constructor Details
-
SkinTemplate
public SkinTemplate(String skinId, String templateId, SkinsManager skinsManager, SkinConfigurationHelper skinConfigurationHelper) Creates a template- Parameters:
skinId
- The skin idtemplateId
- The template idskinsManager
- The skins managerskinConfigurationHelper
- The skin configuration helper
-
-
Method Details
-
_defaultValues
The configuration default values (if configuration file does not exist or is unreadable) -
refreshValues
Refresh the configuration values -
_configureTemplateViewParameters
protected Optional<ViewParametersModel> _configureTemplateViewParameters(String skinId, String templateId, Configuration templateConfiguration) throws ConfigurationException Parse template view parameters- Parameters:
skinId
- the skin idtemplateId
- the template idtemplateConfiguration
- the template configuration- Returns:
- the zone item view parameters
- Throws:
ConfigurationException
- if a configuration error occurred
-
_configureZoneViewParameters
protected Optional<ViewParametersModel> _configureZoneViewParameters(String skinId, String templateId, String zoneId, Configuration zoneConfiguration) throws ConfigurationException Parse zone view parameters- Parameters:
skinId
- the skin idtemplateId
- the template idzoneId
- the zone idzoneConfiguration
- the zone configuration- Returns:
- the zone view parameters
- Throws:
ConfigurationException
- if a configuration error occurred
-
_configureZoneItemViewParameters
protected Optional<ViewParametersModel> _configureZoneItemViewParameters(String skinId, String templateId, String zoneId, Configuration zoneConfiguration) throws ConfigurationException Parse zone item view parameters- Parameters:
skinId
- the skin idtemplateId
- the template idzoneId
- the zone idzoneConfiguration
- the zone configuration- Returns:
- the zone item view parameters
- Throws:
ConfigurationException
- if a configuration error occurred
-
_configureViewParameters
protected Optional<ViewParametersModel> _configureViewParameters(Configuration paramConfiguration, String viewParametersId) throws ConfigurationException Parse view parameters from configuration- Parameters:
paramConfiguration
- the configurationviewParametersId
- the view parameters id- Returns:
- the view parameters
- Throws:
ConfigurationException
- if a configuration error occurred
-
dispose
Dispose skin template component -
getId
The template id- Returns:
- the id
-
getLabel
The template label- Returns:
- The label
-
getDescription
The template description- Returns:
- The description. Can not be null but can be empty
-
getSmallImage
The small image file uri- Returns:
- The small image file uri
-
getMediumImage
The medium image file uri- Returns:
- The medium image file uri
-
getLargeImage
The large image file uri- Returns:
- The large image file uri
-
getZones
The zones defined in by the template def- Returns:
- The zones
-
getZone
The zone identifier by its id- Parameters:
zoneId
- The id of the zone definition to get- Returns:
- The zone or null if no zone has this name
-
getDefaultZoneId
Get the primary default zone. That is the first primary zone, or the 'default' zone if it exists and is primary- Returns:
- The default zone or null if there is no primary zone
-
getViewParameters
Get the view parameters model- Returns:
- the view parameters
-