Package org.ametys.web.source
Class TemplateSourceFactory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.source.SkinSourceFactory
-
- org.ametys.web.source.TemplateSourceFactory
-
- All Implemented Interfaces:
LogEnabled
,Component
,Configurable
,Contextualizable
,Serviceable
,SourceFactory
public class TemplateSourceFactory extends SkinSourceFactory implements Contextualizable
Resolve the template:// protocol seeking file in skins/{siteConf:skin}/templates/{currentTemplate}/ or template:forcedvalue#defaultvalue://- See Also:
SkinSourceFactory
-
-
Field Summary
Fields Modifier and Type Field Description protected Context
_context
Avalon context-
Fields inherited from class org.ametys.web.source.SkinSourceFactory
__SKIN_SCHEME, __SOURCE_PATTERN, _cocoonContext, _siteManager, _skinsManager
-
Fields inherited from interface org.apache.excalibur.source.SourceFactory
ROLE
-
-
Constructor Summary
Constructors Constructor Description TemplateSourceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contextualize(Context context)
Source
getSource(String location, Map parameters)
protected SkinTemplate
getTemplate(String name, String defaultValue)
Return the current template-
Methods inherited from class org.ametys.web.source.SkinSourceFactory
configure, getSkin, initializeComponents, release, service
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Constructor Detail
-
TemplateSourceFactory
public TemplateSourceFactory()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getSource
public Source getSource(String location, Map parameters) throws IOException, SourceNotFoundException
- Specified by:
getSource
in interfaceSourceFactory
- Overrides:
getSource
in classSkinSourceFactory
- Throws:
IOException
SourceNotFoundException
-
getTemplate
protected SkinTemplate getTemplate(String name, String defaultValue) throws SourceNotFoundException
Return the current template- Parameters:
name
- the skin name. Can be null or emptydefaultValue
- switch to this value if skin cannot be determined, or if the determined skin does not exist. Can be null- Returns:
- the template. Cannot be null.
- Throws:
SourceNotFoundException
- If the template cannot be determiner or the template do not exist
-
-