cancel
Showing results for 
Search instead for 
Did you mean: 

apply processTemplate to a collection

leonardo_celati
Champ in-the-making
Champ in-the-making
In a script I am trying to apply the processTemplate to a collection of article.


var template = ….
var nodeRef = 'workspoace://…..';
var collection = search.findNode(nodeRef);
var args = {};
var rendering = collection.processTemplate(template,args);


This is the .ftl


<#assign collection = document.assocs['ws:webassets']>

<#list collection as article>
-${article.properties['cm:name']}
</#list>


However I am getting:

<cite>Expression document is undefined on line 1, column 23 in string://fixed.</cite>

I suppose that Alfresco is obviously right, because a collection is not meant to fit in the document root object.
If this is the case, are there any alternative for rendering a collection by means of freemarker ?
1 REPLY 1

leonardo_celati
Champ in-the-making
Champ in-the-making
I found out that using 'space' root object instead of the document  one it solves the problem.