我有一个* .get.js webscript执行cmis查询,结果显示在*.html.ftl
中。
到目前为止,它适用于字符串/日期属性,例如cmis:name
或cmis:creationDate
。但是我无法显示标题(cm:title
)和描述(cm:description
)。我想问题是因为这些属性的类型是mltext
而ftl想以某种特殊的方式对待它。请注意,我加入cm:titled
方面,因此它应该在结果中。同时按cm:title
或cm:description
进行过滤(通过添加and cm:title like '%test%' to the end of the query
)。
我的例外是
freemarker.core.InvalidReferenceException - Expression res.getPropertyValueByQueryName('t.cm:title') is undefined
myScript.get.js :
var query = "select d.*, t.* " +
"from cmis:document as d join cm:titled as t on d.cmis:objectId = t.cmis:objectId " +
"where IN_FOLDER(d, 'workspace://SpacesStore/72525f23-5273-11dd-9321-e32454ebec2e') ";
var cmisConnection = cmis.getConnection();
var cmisSession = cmisConnection.getSession();
var results = cmisSession.query(query, false);
model.results = results.iterator();
myScript.get.html.ftl :
<ul>
<#list results as res>
<#assign title = res.getPropertyValueByQueryName('t.cm:title')>
<td>${title}</td>
</#list>
</ul>