private boolean deal(SysSite site, CmsCategory entity, Integer pageIndex, Integer totalPage) { if (null != entity) { return templateComponent.createCategoryFile(site, entity, pageIndex, totalPage); } return false; }
@Override public void clear() { deleteCachedFile(getCachedFilePath(CommonConstants.BLANK)); }
@Override public void clear() { adminConfiguration.clearTemplateCache(); clearTemplateCache(); clearTaskTemplateCache(); }
private void publish(SysSite site, String path) throws IOException, TemplateException { if (CommonUtils.notEmpty(path)) { CmsPageMetadata metadata = metadataComponent.getTemplateMetadata(siteComponent.getWebTemplateFilePath(site, path)); if (site.isUseStatic() && CommonUtils.notEmpty(metadata.getPublishPath())) { String templatePath = SiteComponent.getFullTemplatePath(site, path); CmsPageData data = metadataComponent.getTemplateData(siteComponent.getCurrentSiteWebTemplateFilePath(site, path)); templateComponent.createStaticFile(site, templatePath, metadata.getPublishPath(), null, metadata.getAsMap(data), null); } } } }
/** * 删除推荐位元数据 * * @param filePath * @return whether the delete is successful */ public boolean deletePlaceMetadata(String filePath) { File file = new File(filePath); String dirPath = file.getParent(); Map<String, CmsPlaceMetadata> metadataMap = getPlaceMetadataMap(dirPath); metadataMap.remove(file.getName()); try { savePlaceMetadata(dirPath, metadataMap); return true; } catch (IOException e) { return false; } }
private ObjectWrapper getObjectWrapper() { if (null == objectWrapper) { objectWrapper = templateComponent.getWebConfiguration().getObjectWrapper(); } return objectWrapper; }
/** * 输出页面片段 * * @param site * @param templatePath * @param metadata * @return place content * @throws IOException * @throws TemplateException */ public String printPlace(SysSite site, String templatePath, CmsPlaceMetadata metadata) throws IOException, TemplateException { StringWriter writer = new StringWriter(); printPlace(writer, site, templatePath, metadata); return writer.toString(); }
/** * 删除缓存文件 * * @param path */ public void deleteCachedFile(String path) { FileUtils.deleteQuietly(new File(getCachedFilePath(path))); }
@Override public void execute(RenderHandler handler) throws IOException, Exception { PageHandler page = new PageHandler(null, null, 0, null); page.setList(modelComponent.getList(getSite(handler), handler.getString("parentId"), handler.getBoolean("hasChild"), handler.getBoolean("onlyUrl"), handler.getBoolean("hasImages"), handler.getBoolean("hasFiles"))); handler.put("page", page).render(); }
private void publish(SysSite site, String path) throws IOException, TemplateException { if (CommonUtils.notEmpty(path)) { CmsPageMetadata metadata = metadataComponent.getTemplateMetadata(siteComponent.getWebTemplateFilePath(site, path)); if (site.isUseStatic() && CommonUtils.notEmpty(metadata.getPublishPath())) { String templatePath = SiteComponent.getFullTemplatePath(site, path); CmsPageData data = metadataComponent.getTemplateData(siteComponent.getCurrentSiteWebTemplateFilePath(site, path)); templateComponent.createStaticFile(site, templatePath, metadata.getPublishPath(), null, metadata.getAsMap(data), null); } } } }
@Override public void clear() { deleteCachedFile(getCachedFilePath(CommonConstants.BLANK)); }
@Override public void clear() { adminConfiguration.clearTemplateCache(); clearTemplateCache(); clearTaskTemplateCache(); }
/** * 删除推荐位元数据 * * @param filePath * @return whether the delete is successful */ public boolean deletePlaceMetadata(String filePath) { File file = new File(filePath); String dirPath = file.getParent(); Map<String, CmsPlaceMetadata> metadataMap = getPlaceMetadataMap(dirPath); metadataMap.remove(file.getName()); try { savePlaceMetadata(dirPath, metadataMap); return true; } catch (IOException e) { return false; } }
private boolean deal(SysSite site, CmsCategory entity, Integer pageIndex, Integer totalPage) { if (null != entity) { return templateComponent.createCategoryFile(site, entity, pageIndex, totalPage); } return false; }
private ObjectWrapper getObjectWrapper() { if (null == objectWrapper) { objectWrapper = templateComponent.getWebConfiguration().getObjectWrapper(); } return objectWrapper; }
/** * 输出页面片段 * * @param site * @param templatePath * @param metadata * @return place content * @throws IOException * @throws TemplateException */ public String printPlace(SysSite site, String templatePath, CmsPlaceMetadata metadata) throws IOException, TemplateException { StringWriter writer = new StringWriter(); printPlace(writer, site, templatePath, metadata); return writer.toString(); }
/** * 删除缓存文件 * * @param path */ public void deleteCachedFile(String path) { FileUtils.deleteQuietly(new File(getCachedFilePath(path))); }
@Override public void execute(RenderHandler handler) throws IOException, Exception { PageHandler page = new PageHandler(null, null, 0, null); page.setList(modelComponent.getList(getSite(handler), handler.getString("parentId"), handler.getBoolean("hasChild"), handler.getBoolean("onlyUrl"), handler.getBoolean("hasImages"), handler.getBoolean("hasFiles"))); handler.put("page", page).render(); }
/** * @param siteId * @param id * @param max * @throws IOException * @throws TemplateException */ private void publish(SysSite site, Integer id, Integer max) throws IOException, TemplateException { CmsCategory entity = service.getEntity(id); if (null != site && null != entity && site.getId() == entity.getSiteId()) { templateComponent.createCategoryFile(site, entity, null, max); } }
/** * @param siteId * @param id * @param max * @throws IOException * @throws TemplateException */ private void publish(SysSite site, Integer id, Integer max) throws IOException, TemplateException { CmsCategory entity = service.getEntity(id); if (null != site && null != entity && site.getId() == entity.getSiteId()) { templateComponent.createCategoryFile(site, entity, null, max); } }