Package org.ametys.web.skin
Class StaticTemplatesAssignmentHandler
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.web.skin.StaticTemplatesAssignmentHandler
-
- All Implemented Interfaces:
TemplatesAssignmentHandler
,Initializable
,LogEnabled
,Serviceable
public class StaticTemplatesAssignmentHandler extends AbstractLogEnabled implements TemplatesAssignmentHandler, Serviceable, Initializable
This implementation of the templates handler is based uppon a configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StaticTemplatesAssignmentHandler.AssignmentCondition
Class representing the condition for a template assignmentprivate static class
StaticTemplatesAssignmentHandler.TemplateKey
-
Field Summary
Fields Modifier and Type Field Description private static String
__LAST_CONF_UPDATE
private static String
__TEMPLATE_CACHE
private AbstractCacheManager
_cacheManager
protected SkinsManager
_skinsManager
The skins managerprotected SourceResolver
_srcResolver
The source resolver-
Fields inherited from interface org.ametys.web.skin.TemplatesAssignmentHandler
ROLE
-
-
Constructor Summary
Constructors Constructor Description StaticTemplatesAssignmentHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_createCaches()
Creates the cachesprivate void
_getAllTemplatesWithoutCondition(Skin skin)
private Cache<String,Long>
_getLastConfUpdateCache()
private Pattern
_getPattern(String pattern)
private Cache<StaticTemplatesAssignmentHandler.TemplateKey,StaticTemplatesAssignmentHandler.AssignmentCondition>
_getTemplateCache()
private Set<String>
_getTemplatesForSkinNameFromCache(String skinName)
private void
_parseAvailableTemplates(Skin skin, Configuration configuration)
protected void
_refreshValues(Skin skin)
Get the available templates for assignmentSet<String>
getAvailablesTemplates(String skinName)
Returns the list of available templates for a skinSet<String>
getAvailablesTemplates(Page page)
Returns the list of available templates for a given Page.void
initialize()
void
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
__TEMPLATE_CACHE
private static final String __TEMPLATE_CACHE
-
__LAST_CONF_UPDATE
private static final String __LAST_CONF_UPDATE
-
_skinsManager
protected SkinsManager _skinsManager
The skins manager
-
_srcResolver
protected SourceResolver _srcResolver
The source resolver
-
_cacheManager
private AbstractCacheManager _cacheManager
-
-
Constructor Detail
-
StaticTemplatesAssignmentHandler
public StaticTemplatesAssignmentHandler()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
_createCaches
protected void _createCaches()
Creates the caches
-
getAvailablesTemplates
public Set<String> getAvailablesTemplates(String skinName)
Description copied from interface:TemplatesAssignmentHandler
Returns the list of available templates for a skin- Specified by:
getAvailablesTemplates
in interfaceTemplatesAssignmentHandler
- Parameters:
skinName
- the name of the skin to consider- Returns:
- the list of available templates for this skin
-
getAvailablesTemplates
public Set<String> getAvailablesTemplates(Page page)
Description copied from interface:TemplatesAssignmentHandler
Returns the list of available templates for a given Page.- Specified by:
getAvailablesTemplates
in interfaceTemplatesAssignmentHandler
- Parameters:
page
- the Page to consider- Returns:
- the list of available templates for a given Page
-
_refreshValues
protected void _refreshValues(Skin skin)
Get the available templates for assignment- Parameters:
skin
- The skin
-
_parseAvailableTemplates
private void _parseAvailableTemplates(Skin skin, Configuration configuration) throws ConfigurationException
- Throws:
ConfigurationException
-
_getAllTemplatesWithoutCondition
private void _getAllTemplatesWithoutCondition(Skin skin)
-
_getPattern
private Pattern _getPattern(String pattern)
-
_getTemplateCache
private Cache<StaticTemplatesAssignmentHandler.TemplateKey,StaticTemplatesAssignmentHandler.AssignmentCondition> _getTemplateCache()
-
_getLastConfUpdateCache
private Cache<String,Long> _getLastConfUpdateCache()
-
_getTemplatesForSkinNameFromCache
private Set<String> _getTemplatesForSkinNameFromCache(String skinName)
-
-