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
Resolve the template:// protocol seeking file in skins/{siteConf:skin}/templates/{currentTemplate}/
or template:forcedvalue#defaultvalue://
- See Also:
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) protected SkinTemplate
getTemplate
(String name, String defaultValue) Return the current templateMethods 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
-
Field Details
-
_context
Avalon context
-
-
Constructor Details
-
TemplateSourceFactory
public TemplateSourceFactory()
-
-
Method Details
-
contextualize
- 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
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
-