1

I have a *.get.js webscript which executes a cmis query and result is displayed in *.html.ftl.

So far it works great with String/Date properties, such as cmis:name, or cmis:creationDate. But I'm not able to display title (cm:title) nor description (cm:description). I guess the problem is because the type of these properties is mltext and ftl wants to treat it some special way. Please note that I joined with cm:titled aspect, so it should be in the result. Also filtering by cm:title or cm:description works (by adding and cm:title like '%test%' to the end of the query).

The exception I have is

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>
streetturtle
  • 5,472
  • 2
  • 25
  • 43
  • The workaround is to use lucene instead of CMIS, then access to properties is slightly easier, like `${node.properties.description!""}` – streetturtle Aug 09 '16 at 17:27

0 Answers0