类 TemplateComponent
java.lang.Object
com.publiccms.logic.component.template.TemplateComponent
- 所有已实现的接口:
AdminContextPath,Cache
模板处理组件 Template Component
-
字段概要
字段修饰符和类型字段说明private freemarker.template.Configurationprivate CmsCategoryAttributeServiceprivate CmsCategoryModelServiceprivate CmsCategoryServiceprotected ConfigDataComponentprivate CmsContentAttributeServiceprotected ContentConfigComponentprivate CmsContentServicestatic final String管理后台上下文路径 Context Management Context Path Contextprotected FileUploadComponentstatic final String包含目录 include directoryprotected final org.apache.commons.logging.Logprivate MetadataComponentprivate ModelComponentprivate CmsPlaceAttributeServiceprivate CmsPlaceServiceprivate static ExecutorServiceprivate SiteComponentprivate StatisticsComponentprivate freemarker.template.Configurationprivate freemarker.template.Configuration -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidclear()void清理任务计划模板缓存 Clear Template Cachevoid清理模板缓存 Clear Template CachebooleancreateCategoryFile(SysSite site, CmsCategory entity, Integer pageIndex, Integer totalPage) 分类页面静态化createCategoryFile(SysSite site, CmsCategory entity, String templatePath, String filepath, Integer pageIndex, Integer totalPage) 分类页面静态化createContentFile(SysSite site, CmsContent entity, CmsCategory category, boolean createMultiContentPage, String templatePath, String filepath, Integer pageIndex) 内容页面静态化booleancreateContentFile(SysSite site, CmsContent entity, CmsCategory category, CmsCategoryModel categoryModel) 内容页面静态化voidcreateContentFile(SysSite site, List<Serializable> idList, CmsCategory category, CmsCategoryModel categoryModel) 内容页面静态化createStaticFile(SysSite site, String fullTemplatePath, String filepath, Integer pageIndex, Map<String, Object> metadataMap, Map<String, Object> model, Consumer<String> urlConsumer) 创建静态化页面voiddestroy()private voidexposePlace(SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data, Map<String, Object> model) generatePlaceFilePath(String filepath, CmsCategory category, Map<String, Object> model) 生成页面片段路径freemarker.template.Configuration获取FreeMarker管理后台配置freemarker.template.Configuration获取FreeMarker任务计划配置freemarker.template.Configuration获取FreeMarker前台配置printPlace(SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data) 输出页面片段voidprintPlace(Writer writer, SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data) 输出页面片段voidsetAdminConfiguration(freemarker.template.Configuration adminConfiguration) voidsetAdminContextPath(String adminContextPath) voidsetTaskConfiguration(freemarker.template.Configuration taskConfiguration) voidsetWebConfiguration(freemarker.template.Configuration webConfiguration) voidstaticPlace(SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data) 静态化页面片段
-
字段详细资料
-
log
protected final org.apache.commons.logging.Log log -
INCLUDE_DIRECTORY
包含目录 include directory- 另请参阅:
-
CONTEXT_ADMIN_CONTEXT_PATH
管理后台上下文路径 Context Management Context Path Context- 另请参阅:
-
adminConfiguration
private freemarker.template.Configuration adminConfiguration -
webConfiguration
private freemarker.template.Configuration webConfiguration -
taskConfiguration
private freemarker.template.Configuration taskConfiguration -
contentAttributeService
-
categoryAttributeService
-
contentService
-
categoryModelService
-
categoryService
-
siteComponent
-
metadataComponent
-
modelComponent
-
placeService
-
placeAttributeService
-
fileUploadComponent
-
configDataComponent
-
contentConfigComponent
-
statisticsComponent
-
pool
-
-
构造器详细资料
-
TemplateComponent
public TemplateComponent()
-
-
方法详细资料
-
createCategoryFile
public String createCategoryFile(SysSite site, CmsCategory entity, String templatePath, String filepath, Integer pageIndex, Integer totalPage) throws IOException, freemarker.template.TemplateException 分类页面静态化- 参数:
site-entity-templatePath-filepath-pageIndex-totalPage-- 返回:
- category static file path
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
createContentFile
public String createContentFile(SysSite site, CmsContent entity, CmsCategory category, boolean createMultiContentPage, String templatePath, String filepath, Integer pageIndex) throws IOException, freemarker.template.TemplateException 内容页面静态化- 参数:
site-entity-category-createMultiContentPage-templatePath-filepath-pageIndex-- 返回:
- content static file path
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
createContentFile
public boolean createContentFile(SysSite site, CmsContent entity, CmsCategory category, CmsCategoryModel categoryModel) throws IOException, freemarker.template.TemplateException 内容页面静态化- 参数:
site-entity-category-categoryModel-- 返回:
- whether the create is successful
- 抛出:
freemarker.template.TemplateExceptionIOException
-
createCategoryFile
public boolean createCategoryFile(SysSite site, CmsCategory entity, Integer pageIndex, Integer totalPage) throws IOException, freemarker.template.TemplateException 分类页面静态化- 参数:
site-entity-pageIndex-totalPage-- 返回:
- whether the create is successful
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
createContentFile
public void createContentFile(SysSite site, List<Serializable> idList, CmsCategory category, CmsCategoryModel categoryModel) 内容页面静态化- 参数:
site-idList-category-categoryModel-
-
generatePlaceFilePath
public String generatePlaceFilePath(String filepath, CmsCategory category, Map<String, Object> model) throws IOException, freemarker.template.TemplateException生成页面片段路径- 参数:
filepath-category-model-- 返回:
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
staticPlace
public void staticPlace(SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data) throws IOException, freemarker.template.TemplateException 静态化页面片段- 参数:
site-templatePath-metadata-data-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
printPlace
public String printPlace(SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data) throws IOException, freemarker.template.TemplateException 输出页面片段- 参数:
site-templatePath-metadata-data-- 返回:
- place content
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
printPlace
public void printPlace(Writer writer, SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data) throws IOException, freemarker.template.TemplateException 输出页面片段- 参数:
writer-site-templatePath-metadata-data-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
createStaticFile
public String createStaticFile(SysSite site, String fullTemplatePath, String filepath, Integer pageIndex, Map<String, Object> metadataMap, Map<String, throws IOException, freemarker.template.TemplateExceptionObject> model, Consumer<String> urlConsumer) 创建静态化页面- 参数:
site-fullTemplatePath-filepath-pageIndex-metadataMap-model-urlConsumer-- 返回:
- static file path
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
exposePlace
private void exposePlace(SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data, Map<String, Object> model) -
setAdminContextPath
- 指定者:
setAdminContextPath在接口中AdminContextPath
-
clear
public void clear() -
destroy
@PreDestroy public void destroy() -
clearTemplateCache
public void clearTemplateCache()清理模板缓存 Clear Template Cache -
clearTaskTemplateCache
public void clearTaskTemplateCache()清理任务计划模板缓存 Clear Template Cache -
setAdminConfiguration
public void setAdminConfiguration(freemarker.template.Configuration adminConfiguration) - 参数:
adminConfiguration- the adminConfiguration to set
-
setWebConfiguration
public void setWebConfiguration(freemarker.template.Configuration webConfiguration) - 参数:
webConfiguration- the webConfiguration to set
-
setTaskConfiguration
public void setTaskConfiguration(freemarker.template.Configuration taskConfiguration) - 参数:
taskConfiguration- the taskConfiguration to set
-
getAdminConfiguration
public freemarker.template.Configuration getAdminConfiguration()获取FreeMarker管理后台配置- 返回:
- FreeMarker admin config
-
getWebConfiguration
public freemarker.template.Configuration getWebConfiguration()获取FreeMarker前台配置- 返回:
- FreeMarker web config
-
getTaskConfiguration
public freemarker.template.Configuration getTaskConfiguration()获取FreeMarker任务计划配置- 返回:
- FreeMarker task config
-