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
FieldsFields inherited from class org.ametys.web.source.SkinSourceFactory
__SKIN_SCHEME, __SOURCE_PATTERN, _cocoonContext, _siteManager, _skinsManagerFields inherited from interface org.apache.excalibur.source.SourceFactory
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextualize(Context context) protected SkinTemplategetTemplate(String name, String defaultValue) Return the current templateMethods inherited from class org.ametys.web.source.SkinSourceFactory
configure, getSkin, initializeComponents, release, serviceMethods 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:
contextualizein interfaceContextualizable- Throws:
ContextException
-
getSource
public Source getSource(String location, Map parameters) throws IOException, SourceNotFoundException - Specified by:
getSourcein interfaceSourceFactory- Overrides:
getSourcein classSkinSourceFactory- Throws:
IOExceptionSourceNotFoundException
-
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
-