Dear all, I have created a webscript that passes back json, example as follows...
I call that from within my springsurf file using the following...Code:{ "sitetree" : { "node" : { "name" : "test.html", "nodeRef" : "workspace://SpacesStore/a86f1bad-08cc-426c-a5ea-79d3f2e4ed8e", "description" : "Test file", "icon" : "/images/filetypes/html.gif" } , "node" : { "name" : "website1", "nodeRef" : "workspace://SpacesStore/f0e810d1-a405-4e14-a654-d116c25d581e", "description" : "", "icon" : "/images/icons/space-icon-default-16.gif" , "node" : { "name" : "website1.html", "nodeRef" : "workspace://SpacesStore/410d7d3b-109f-4dac-9164-df50891f3e9d", "description" : "", "icon" : "/images/filetypes/html.gif" } } } }
And then try to parse it as follows...Code:// get a connector to the Alfresco repository endpoint var connector = remote.connect("alfresco"); var result = connector.call("/alfrescocms/getsitetree"); model.sitetree = eval( '(' + result + ')' );
But I keep getting the errorCode:<#macro parseChild objectModel> <#list objectModel.node as child> <li><img src="${child.node.icon}"><a href="${child.node.nodeRef}">${child.node.name}</a></li> </#list> </#macro> <h3><a href="#">Site Tree</a></h3> <div> <ul> <@parseChild sitetree.sitetree /> </ul> </div>
Can anyone offer any insight into what I'm doing wrong. The JSON that is passed back seems to validate without any problem. Perhaps I'm misunderstanding what is possible with Freemarker?Code:freemarker.template.TemplateException - Expected collection or sequence. objectModel.node evaluated instead to freemarker.template.SimpleHash on line 3, column 16 in webscripts/getsitetree/getsitetree.get.html.ftl.


Reply With Quote
