@Component public class PublishContentDirective extends AbstractTaskDirective
参数列表
id
:内容id
ids
:多个内容id,id为空时有效
返回结果
map
map类型,键值内容id,值为生成结果
<@task.publishContent id=1><#list map as k,v>${k}:${v}<#sep>,</#list></@task.publishContent>
<script> $.getJSON('${site.dynamicPath}api/directive/task/publishContent?id=1&appToken=接口访问授权Token', function(data){ console.log(data); }); </script>
限定符和类型 | 字段和说明 |
---|---|
private CmsContentService |
service |
private TemplateComponent |
templateComponent |
siteComponent
log
构造器和说明 |
---|
PublishContentDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
execute, getApp, getSite
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
private TemplateComponent templateComponent
private CmsContentService service
public void execute(RenderHandler handler) throws java.io.IOException, freemarker.template.TemplateException
java.io.IOException
freemarker.template.TemplateException