public class RenderComponentDirective extends Object implements freemarker.template.TemplateDirectiveModel
Modifier and Type | Field and Description |
---|---|
static String |
ADDITIONAL_MODEL_PARAM_NAME |
static String |
COMPONENT_PARAM_NAME |
static String |
COMPONENT_PATH_PARAM_NAME |
protected String |
includeElementName |
static String |
KEY_CONTENT_MODEL |
static String |
KEY_MODEL
Deprecated.
|
protected org.springframework.beans.factory.ObjectFactory<freemarker.template.SimpleHash> |
modelFactory |
protected SiteItemScriptResolver |
scriptResolver |
protected javax.servlet.ServletContext |
servletContext |
protected SiteItemService |
siteItemService |
protected String |
templateNamePrefix |
protected String |
templateNameSuffix |
protected String |
templateXPathQuery |
Constructor and Description |
---|
RenderComponentDirective() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
createScriptVariables(SiteItem component,
Map<String,Object> templateModel,
Map<String,Object> additionalModel) |
void |
execute(freemarker.core.Environment env,
Map params,
freemarker.template.TemplateModel[] loopVars,
freemarker.template.TemplateDirectiveBody body) |
protected void |
executeScript(Script script,
Map<String,Object> scriptVariables,
freemarker.core.Environment env) |
protected Map<String,Object> |
executeScripts(SiteItem component,
Map<String,Object> additionalModel,
freemarker.core.Environment env) |
protected SiteItem |
getComponent(String componentPath,
freemarker.core.Environment env) |
protected SiteItem |
getComponentFromNode(freemarker.template.TemplateModel componentParam,
freemarker.core.Environment env) |
protected SiteItem |
getComponentFromPath(freemarker.template.TemplateModel componentPathParam,
freemarker.core.Environment env) |
protected String |
getComponentTemplateName(SiteItem component,
freemarker.core.Environment env) |
protected freemarker.template.SimpleHash |
getFullModel(SiteItem component,
Map<String,Object> templateModel,
Map<String,Object> additionalModel) |
protected freemarker.template.Template |
getTemplate(SiteItem component,
freemarker.core.Environment env) |
protected void |
processComponentTemplate(freemarker.template.Template template,
freemarker.template.SimpleHash model,
Writer output,
freemarker.core.Environment env) |
void |
setIncludeElementName(String includeElementName) |
void |
setModelFactory(org.springframework.beans.factory.ObjectFactory<freemarker.template.SimpleHash> modelFactory) |
void |
setScriptResolver(SiteItemScriptResolver scriptResolver) |
void |
setServletContext(javax.servlet.ServletContext servletContext) |
void |
setSiteItemService(SiteItemService siteItemService) |
void |
setTemplateNamePrefix(String templateNamePrefix) |
void |
setTemplateNameSuffix(String templateNameSuffix) |
void |
setTemplateXPathQuery(String templateXPathQuery) |
protected <T> T |
unwrap(String name,
freemarker.template.TemplateModel value,
Class<T> expectedClass,
freemarker.core.Environment env) |
@Deprecated public static final String KEY_MODEL
public static final String KEY_CONTENT_MODEL
public static final String COMPONENT_PARAM_NAME
public static final String COMPONENT_PATH_PARAM_NAME
public static final String ADDITIONAL_MODEL_PARAM_NAME
protected javax.servlet.ServletContext servletContext
protected SiteItemService siteItemService
protected org.springframework.beans.factory.ObjectFactory<freemarker.template.SimpleHash> modelFactory
protected String templateXPathQuery
protected String templateNamePrefix
protected String templateNameSuffix
protected String includeElementName
protected SiteItemScriptResolver scriptResolver
public void setServletContext(javax.servlet.ServletContext servletContext)
public void setSiteItemService(SiteItemService siteItemService)
public void setModelFactory(org.springframework.beans.factory.ObjectFactory<freemarker.template.SimpleHash> modelFactory)
public void setTemplateXPathQuery(String templateXPathQuery)
public void setTemplateNamePrefix(String templateNamePrefix)
public void setTemplateNameSuffix(String templateNameSuffix)
public void setIncludeElementName(String includeElementName)
public void setScriptResolver(SiteItemScriptResolver scriptResolver)
public void execute(freemarker.core.Environment env, Map params, freemarker.template.TemplateModel[] loopVars, freemarker.template.TemplateDirectiveBody body) throws freemarker.template.TemplateException
execute
in interface freemarker.template.TemplateDirectiveModel
freemarker.template.TemplateException
protected SiteItem getComponentFromNode(freemarker.template.TemplateModel componentParam, freemarker.core.Environment env) throws freemarker.template.TemplateException
freemarker.template.TemplateException
protected SiteItem getComponentFromPath(freemarker.template.TemplateModel componentPathParam, freemarker.core.Environment env) throws freemarker.template.TemplateException
freemarker.template.TemplateException
protected SiteItem getComponent(String componentPath, freemarker.core.Environment env) throws freemarker.template.TemplateException
freemarker.template.TemplateException
protected Map<String,Object> executeScripts(SiteItem component, Map<String,Object> additionalModel, freemarker.core.Environment env) throws freemarker.template.TemplateException
freemarker.template.TemplateException
protected Map<String,Object> createScriptVariables(SiteItem component, Map<String,Object> templateModel, Map<String,Object> additionalModel)
protected void executeScript(Script script, Map<String,Object> scriptVariables, freemarker.core.Environment env) throws freemarker.template.TemplateException
freemarker.template.TemplateException
protected freemarker.template.Template getTemplate(SiteItem component, freemarker.core.Environment env) throws freemarker.template.TemplateException
freemarker.template.TemplateException
protected String getComponentTemplateName(SiteItem component, freemarker.core.Environment env) throws freemarker.template.TemplateException
freemarker.template.TemplateException
protected freemarker.template.SimpleHash getFullModel(SiteItem component, Map<String,Object> templateModel, Map<String,Object> additionalModel) throws freemarker.template.TemplateException
freemarker.template.TemplateException
protected void processComponentTemplate(freemarker.template.Template template, freemarker.template.SimpleHash model, Writer output, freemarker.core.Environment env) throws freemarker.template.TemplateException
freemarker.template.TemplateException
Copyright © 2019 CrafterCMS. All rights reserved.