@Component public class TemplateComponent extends java.lang.Object implements Cache, AdminContextPath
构造器和说明 |
---|
TemplateComponent() |
限定符和类型 | 方法和说明 |
---|---|
void |
clear() |
void |
clearTaskTemplateCache()
清理任务计划模板缓存
Clear Template Cache
|
void |
clearTemplateCache()
清理模板缓存
Clear Template Cache
|
boolean |
createCategoryFile(SysSite site,
CmsCategory entity,
java.lang.Integer pageIndex,
java.lang.Integer totalPage)
分类页面静态化
|
java.lang.String |
createCategoryFile(SysSite site,
CmsCategory entity,
java.lang.String templatePath,
java.lang.String filepath,
java.lang.Integer pageIndex,
java.lang.Integer totalPage)
分类页面静态化
|
java.lang.String |
createContentFile(SysSite site,
CmsContent entity,
CmsCategory category,
boolean createMultiContentPage,
java.lang.String templatePath,
java.lang.String filepath,
java.lang.Integer pageIndex)
内容页面静态化
|
boolean |
createContentFile(SysSite site,
CmsContent entity,
CmsCategory category,
CmsCategoryModel categoryModel)
内容页面静态化
|
void |
createContentFile(SysSite site,
java.util.List<java.io.Serializable> idList,
CmsCategory category,
CmsCategoryModel categoryModel)
内容页面静态化
|
java.lang.String |
createStaticFile(SysSite site,
java.lang.String fullTemplatePath,
java.lang.String filepath,
java.lang.Integer pageIndex,
java.util.Map<java.lang.String,java.lang.Object> metadataMap,
java.util.Map<java.lang.String,java.lang.Object> model,
java.util.function.Consumer<java.lang.String> urlConsumer)
创建静态化页面
|
void |
destroy() |
private void |
exposePlace(SysSite site,
java.lang.String templatePath,
CmsPlaceMetadata metadata,
CmsPageData data,
java.util.Map<java.lang.String,java.lang.Object> model) |
java.lang.String |
generatePlaceFilePath(java.lang.String filepath,
CmsCategory category,
java.util.Map<java.lang.String,java.lang.Object> model)
生成页面片段路径
|
freemarker.template.Configuration |
getAdminConfiguration()
获取FreeMarker管理后台配置
|
freemarker.template.Configuration |
getTaskConfiguration()
获取FreeMarker任务计划配置
|
freemarker.template.Configuration |
getWebConfiguration()
获取FreeMarker前台配置
|
java.lang.String |
printPlace(SysSite site,
java.lang.String templatePath,
CmsPlaceMetadata metadata,
CmsPageData data)
输出页面片段
|
void |
printPlace(java.io.Writer writer,
SysSite site,
java.lang.String templatePath,
CmsPlaceMetadata metadata,
CmsPageData data)
输出页面片段
|
void |
setAdminConfiguration(freemarker.template.Configuration adminConfiguration) |
void |
setAdminContextPath(java.lang.String adminContextPath) |
void |
setTaskConfiguration(freemarker.template.Configuration taskConfiguration) |
void |
setWebConfiguration(freemarker.template.Configuration webConfiguration) |
void |
staticPlace(SysSite site,
java.lang.String templatePath,
CmsPlaceMetadata metadata,
CmsPageData data)
静态化页面片段
|
protected final org.apache.commons.logging.Log log
public static final java.lang.String INCLUDE_DIRECTORY
public static final java.lang.String CONTEXT_ADMIN_CONTEXT_PATH
private freemarker.template.Configuration adminConfiguration
private freemarker.template.Configuration webConfiguration
private freemarker.template.Configuration taskConfiguration
private CmsContentAttributeService contentAttributeService
private CmsCategoryAttributeService categoryAttributeService
private CmsContentService contentService
private CmsCategoryModelService categoryModelService
private CmsCategoryService categoryService
private SiteComponent siteComponent
private MetadataComponent metadataComponent
private ModelComponent modelComponent
private CmsPlaceService placeService
private CmsPlaceAttributeService placeAttributeService
protected FileUploadComponent fileUploadComponent
protected ConfigDataComponent configDataComponent
protected ContentConfigComponent contentConfigComponent
private StatisticsComponent statisticsComponent
private static java.util.concurrent.ExecutorService pool
public java.lang.String createCategoryFile(SysSite site, CmsCategory entity, java.lang.String templatePath, java.lang.String filepath, java.lang.Integer pageIndex, java.lang.Integer totalPage) throws java.io.IOException, freemarker.template.TemplateException
site
- entity
- templatePath
- filepath
- pageIndex
- totalPage
- java.io.IOException
freemarker.template.TemplateException
public java.lang.String createContentFile(SysSite site, CmsContent entity, CmsCategory category, boolean createMultiContentPage, java.lang.String templatePath, java.lang.String filepath, java.lang.Integer pageIndex) throws java.io.IOException, freemarker.template.TemplateException
site
- entity
- category
- createMultiContentPage
- templatePath
- filepath
- pageIndex
- java.io.IOException
freemarker.template.TemplateException
public boolean createContentFile(SysSite site, CmsContent entity, CmsCategory category, CmsCategoryModel categoryModel) throws java.io.IOException, freemarker.template.TemplateException
site
- entity
- category
- categoryModel
- freemarker.template.TemplateException
java.io.IOException
public boolean createCategoryFile(SysSite site, CmsCategory entity, java.lang.Integer pageIndex, java.lang.Integer totalPage) throws java.io.IOException, freemarker.template.TemplateException
site
- entity
- pageIndex
- totalPage
- java.io.IOException
freemarker.template.TemplateException
public void createContentFile(SysSite site, java.util.List<java.io.Serializable> idList, CmsCategory category, CmsCategoryModel categoryModel)
site
- idList
- category
- categoryModel
- public java.lang.String generatePlaceFilePath(java.lang.String filepath, CmsCategory category, java.util.Map<java.lang.String,java.lang.Object> model) throws java.io.IOException, freemarker.template.TemplateException
filepath
- category
- model
- java.io.IOException
freemarker.template.TemplateException
public void staticPlace(SysSite site, java.lang.String templatePath, CmsPlaceMetadata metadata, CmsPageData data) throws java.io.IOException, freemarker.template.TemplateException
site
- templatePath
- metadata
- data
- java.io.IOException
freemarker.template.TemplateException
public java.lang.String printPlace(SysSite site, java.lang.String templatePath, CmsPlaceMetadata metadata, CmsPageData data) throws java.io.IOException, freemarker.template.TemplateException
site
- templatePath
- metadata
- data
- java.io.IOException
freemarker.template.TemplateException
public void printPlace(java.io.Writer writer, SysSite site, java.lang.String templatePath, CmsPlaceMetadata metadata, CmsPageData data) throws java.io.IOException, freemarker.template.TemplateException
writer
- site
- templatePath
- metadata
- data
- java.io.IOException
freemarker.template.TemplateException
public java.lang.String createStaticFile(SysSite site, java.lang.String fullTemplatePath, java.lang.String filepath, java.lang.Integer pageIndex, java.util.Map<java.lang.String,java.lang.Object> metadataMap, java.util.Map<java.lang.String,java.lang.Object> model, java.util.function.Consumer<java.lang.String> urlConsumer) throws java.io.IOException, freemarker.template.TemplateException
site
- fullTemplatePath
- filepath
- pageIndex
- metadataMap
- model
- urlConsumer
- java.io.IOException
freemarker.template.TemplateException
private void exposePlace(SysSite site, java.lang.String templatePath, CmsPlaceMetadata metadata, CmsPageData data, java.util.Map<java.lang.String,java.lang.Object> model)
public void setAdminContextPath(java.lang.String adminContextPath)
setAdminContextPath
在接口中 AdminContextPath
@PreDestroy public void destroy()
public void clearTemplateCache()
public void clearTaskTemplateCache()
public void setAdminConfiguration(freemarker.template.Configuration adminConfiguration)
adminConfiguration
- the adminConfiguration to setpublic void setWebConfiguration(freemarker.template.Configuration webConfiguration)
webConfiguration
- the webConfiguration to setpublic void setTaskConfiguration(freemarker.template.Configuration taskConfiguration)
taskConfiguration
- the taskConfiguration to setpublic freemarker.template.Configuration getAdminConfiguration()
public freemarker.template.Configuration getWebConfiguration()
public freemarker.template.Configuration getTaskConfiguration()