类 TemplateComponent
java.lang.Object
com.publiccms.logic.component.template.TemplateComponent
- 所有已实现的接口:
AdminContextPath,Cache
模板处理组件 Template Component
-
字段概要
字段修饰符和类型字段说明private freemarker.template.Configurationprivate CmsCategoryAttributeServiceprivate CmsCategoryLangServiceprivate CmsCategoryModelServiceprivate CmsCategoryServiceprotected ConfigDataComponentprivate CmsContentAttributeServiceprotected ContentConfigComponentprivate CmsContentLangServiceprivate CmsContentServicestatic final String管理后台上下文路径 Context Management Context Path Contextprotected FileUploadComponentstatic final String包含目录 include directoryprivate CmsLanguageServiceprotected final org.apache.commons.logging.Logprivate MetadataComponentprivate ModelComponentprivate CmsPlaceAttributeServiceprivate CmsPlaceServiceprivate static ExecutorServiceprotected SiteAttributeComponentprivate SiteComponentprivate StatisticsComponentprivate freemarker.template.Configurationprivate freemarker.template.Configuration -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidclear()void清理任务计划模板缓存 Clear Template Cachevoid清理模板缓存 Clear Template Cacheprivate booleancreateCategoryFile(SysSite site, CmsCategory entity, CmsCategoryLang lang, Integer pageIndex, Integer totalPage) 分类页面静态化createCategoryFile(SysSite site, CmsCategory entity, CmsCategoryLang langEntity, String templatePath, String filepathTemplate, Integer pageIndex, Integer totalPage) 分类页面静态化createContentFile(SysSite site, CmsContent entity, CmsContentLang langEntity, CmsCategory category, boolean createMultiContentPage, String templatePath, String filepathTemplate, Integer pageIndex) 内容页面静态化private booleancreateContentFile(SysSite site, CmsContent entity, CmsContentLang lang, String defaultLang, CmsCategory category, CmsCategoryModel categoryModel) 内容页面静态化voidcreateContentFile(SysSite site, List<Serializable> idList, CmsCategory category, CmsCategoryModel categoryModel) 内容页面静态化createStaticFile(SysSite site, String fullTemplatePath, String filepath, String lang, Integer pageIndex, CmsPageMetadata metadata, Map<String, Object> model, Consumer<String> urlConsumer) 创建静态化页面voiddeleteStaticFile(short siteId, CmsCategory entity) voiddeleteStaticFile(short siteId, CmsContent entity) voiddeleteStaticFile(short siteId, String url) voiddestroy()private voidexposePlace(SysSite site, String templatePath, String lang, String defaultLang, CmsPlaceMetadata metadata, 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前台配置voidinitPreviewContentModel(SysSite site, CmsContent entity, CmsContentAttribute attribute, CmsContentParameters contentParameters, org.springframework.ui.ModelMap model) voidpreviewContent(SysSite site, CmsContent entity, CmsContentAttribute attribute, Writer writer, org.springframework.ui.ModelMap model) printPlace(SysSite site, String templatePath, String lang, CmsPlaceMetadata metadata) 输出页面片段voidprintPlace(Writer writer, SysSite site, String templatePath, String lang, String defaultLang, CmsPlaceMetadata metadata) 输出页面片段booleanpublish(SysSite site, CmsCategory entity, Integer pageIndex, Integer totalPage) booleanpublish(SysSite site, CmsContent entity) booleanpublish(SysSite site, CmsContent entity, CmsCategory category) booleanpublish(SysSite site, CmsContent entity, CmsCategory category, CmsCategoryModel categoryModel) voidpublishPage(SysSite site, String templatePath) 创建静态化页面booleanpublishPage(SysSite site, String templatePath, String lang) 创建静态化页面voidpublishPlace(SysSite site, String templatePath, boolean checkExists) 静态化页面片段voidsetAdminConfiguration(freemarker.template.Configuration adminConfiguration) voidsetAdminContextPath(String adminContextPath) voidsetTaskConfiguration(freemarker.template.Configuration taskConfiguration) voidsetWebConfiguration(freemarker.template.Configuration webConfiguration) private voidstaticPlace(SysSite site, String templatePath, String lang, String defaultLang, CmsPlaceMetadata metadata) 静态化页面片段
-
字段详细资料
-
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
-
contentLangService
-
categoryLangService
-
contentService
-
categoryModelService
-
categoryService
-
siteComponent
-
metadataComponent
-
modelComponent
-
placeService
-
placeAttributeService
-
fileUploadComponent
-
configDataComponent
-
contentConfigComponent
-
statisticsComponent
-
languageService
-
siteAttributeComponent
-
pool
-
-
构造器详细资料
-
TemplateComponent
public TemplateComponent()
-
-
方法详细资料
-
createCategoryFile
public String createCategoryFile(SysSite site, CmsCategory entity, CmsCategoryLang langEntity, String templatePath, String filepathTemplate, Integer pageIndex, Integer totalPage) throws IOException, freemarker.template.TemplateException 分类页面静态化- 参数:
site-entity-langEntity-templatePath-filepathTemplate-pageIndex-totalPage-defaultLang-- 返回:
- category static file path
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
createContentFile
public String createContentFile(SysSite site, CmsContent entity, CmsContentLang langEntity, CmsCategory category, boolean createMultiContentPage, String templatePath, String filepathTemplate, Integer pageIndex) throws IOException, freemarker.template.TemplateException 内容页面静态化- 参数:
site-entity-langEntity-category-createMultiContentPage-templatePath-filepathTemplate-pageIndex-defaultLang-- 返回:
- content static file path
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
createContentFile
private boolean createContentFile(SysSite site, CmsContent entity, CmsContentLang lang, String defaultLang, CmsCategory category, CmsCategoryModel categoryModel) throws IOException, freemarker.template.TemplateException 内容页面静态化- 参数:
site-entity-lang-category-categoryModel-- 返回:
- whether the create is successful
- 抛出:
freemarker.template.TemplateExceptionIOException
-
publish
public boolean publish(SysSite site, CmsCategory entity, Integer pageIndex, Integer totalPage) throws IOException, freemarker.template.TemplateException - 参数:
site-entity-pageIndex-totalPage-- 返回:
- 抛出:
freemarker.template.TemplateExceptionIOException
-
publish
public boolean publish(SysSite site, CmsContent entity) throws IOException, freemarker.template.TemplateException - 参数:
site-entity-- 返回:
- 抛出:
freemarker.template.TemplateExceptionIOException
-
publish
public boolean publish(SysSite site, CmsContent entity, CmsCategory category) throws IOException, freemarker.template.TemplateException - 参数:
site-entity-category-- 返回:
- 抛出:
freemarker.template.TemplateExceptionIOException
-
publish
public boolean publish(SysSite site, CmsContent entity, CmsCategory category, CmsCategoryModel categoryModel) throws IOException, freemarker.template.TemplateException - 参数:
site-entity-category-categoryModel-- 返回:
- 抛出:
freemarker.template.TemplateExceptionIOException
-
deleteStaticFile
- 参数:
siteId-entity- 分类
-
deleteStaticFile
- 参数:
siteId-entity- 内容
-
deleteStaticFile
- 参数:
siteId-url-
-
createCategoryFile
private boolean createCategoryFile(SysSite site, CmsCategory entity, CmsCategoryLang lang, Integer pageIndex, Integer totalPage) throws IOException, freemarker.template.TemplateException 分类页面静态化- 参数:
site-entity-lang-pageIndex-totalPage-defaultLang-- 返回:
- 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-
-
initPreviewContentModel
public void initPreviewContentModel(SysSite site, CmsContent entity, CmsContentAttribute attribute, CmsContentParameters contentParameters, org.springframework.ui.ModelMap model) - 参数:
site-entity-attribute-contentParameters-model-writer-
-
previewContent
public void previewContent(SysSite site, CmsContent entity, CmsContentAttribute attribute, Writer writer, org.springframework.ui.ModelMap model) - 参数:
site-entity-attribute-writer-model-
-
generatePlaceFilePath
public String generatePlaceFilePath(String filepath, CmsCategory category, Map<String, Object> model) throws IOException, freemarker.template.TemplateException生成页面片段路径- 参数:
filepath-category-model-- 返回:
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
publishPlace
public void publishPlace(SysSite site, String templatePath, boolean checkExists) throws IOException, freemarker.template.TemplateException 静态化页面片段- 参数:
site- 站点templatePath- 模板路径 不含includecheckExists- 检查是否存在- 抛出:
IOExceptionfreemarker.template.TemplateException
-
staticPlace
private void staticPlace(SysSite site, String templatePath, String lang, String defaultLang, CmsPlaceMetadata metadata) throws IOException, freemarker.template.TemplateException 静态化页面片段- 参数:
site-templatePath-lang-metadata-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
printPlace
public String printPlace(SysSite site, String templatePath, String lang, CmsPlaceMetadata metadata) throws IOException, freemarker.template.TemplateException 输出页面片段- 参数:
site-templatePath-lang-metadata-- 返回:
- place content
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
printPlace
public void printPlace(Writer writer, SysSite site, String templatePath, String lang, String defaultLang, CmsPlaceMetadata metadata) throws IOException, freemarker.template.TemplateException 输出页面片段- 参数:
writer-site-templatePath-lang-defaultLang-metadata-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
publishPage
public boolean publishPage(SysSite site, String templatePath, String lang) throws IOException, freemarker.template.TemplateException 创建静态化页面- 参数:
site-templatePath-lang-- 返回:
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
publishPage
public void publishPage(SysSite site, String templatePath) throws IOException, freemarker.template.TemplateException 创建静态化页面- 参数:
site-templatePath-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
generateFilepath
public String generateFilepath(String filepathTemplate, SysSite site, Map<String, Object> model) throws IOException, freemarker.template.TemplateException- 抛出:
IOExceptionfreemarker.template.TemplateException
-
createStaticFile
public String createStaticFile(SysSite site, String fullTemplatePath, String filepath, String lang, Integer pageIndex, CmsPageMetadata metadata, Map<String, Object> model, Consumer<String> urlConsumer) throws IOException, freemarker.template.TemplateException创建静态化页面- 参数:
site-fullTemplatePath-filepath-lang-pageIndex-metadata-model-urlConsumer-- 返回:
- static file path
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
exposePlace
-
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
-