类 TemplateComponent

java.lang.Object
com.publiccms.logic.component.template.TemplateComponent
所有已实现的接口:
AdminContextPath, Cache

@Component public class TemplateComponent extends Object implements Cache, AdminContextPath
模板处理组件 Template Component
  • 字段详细资料

  • 构造器详细资料

    • 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
      抛出:
      IOException
      freemarker.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
      抛出:
      IOException
      freemarker.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.TemplateException
      IOException
    • 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
      抛出:
      IOException
      freemarker.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 -
      返回:
      抛出:
      IOException
      freemarker.template.TemplateException
    • staticPlace

      public void staticPlace(SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data) throws IOException, freemarker.template.TemplateException
      静态化页面片段
      参数:
      site -
      templatePath -
      metadata -
      data -
      抛出:
      IOException
      freemarker.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
      抛出:
      IOException
      freemarker.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 -
      抛出:
      IOException
      freemarker.template.TemplateException
    • createStaticFile

      public String createStaticFile(SysSite site, String fullTemplatePath, String filepath, Integer pageIndex, Map<String,Object> metadataMap, Map<String,Object> model, Consumer<String> urlConsumer) throws IOException, freemarker.template.TemplateException
      创建静态化页面
      参数:
      site -
      fullTemplatePath -
      filepath -
      pageIndex -
      metadataMap -
      model -
      urlConsumer -
      返回:
      static file path
      抛出:
      IOException
      freemarker.template.TemplateException
    • exposePlace

      private void exposePlace(SysSite site, String templatePath, CmsPlaceMetadata metadata, CmsPageData data, Map<String,Object> model)
    • setAdminContextPath

      public void setAdminContextPath(String adminContextPath)
      指定者:
      setAdminContextPath 在接口中 AdminContextPath
    • clear

      public void clear()
      指定者:
      clear 在接口中 Cache
    • 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