10-09-2012 01:38 PM
<type>d:date</type>
"startdate": "<#if site.node.hasAspect("my:customAspect")>${siteNode.properties["my:customAspectDate"]?string("yyyy-MM-dd")}</#if>",
<#macro siteJSONManagers site siteNode roles>
so I can call it from site.get.json.ftl as well as person.sites.get.json.ftl:<@siteLib.siteJSON site=site siteNode=siteNode />
model.siteNode = site.node; // or the same with site.getNode;
<@siteLib.siteJSONManagers site=site siteNode=site.node roles=roles/>
"09090011 Wrapped Exception (with status template): 09090096 Error during processing of the template 'Expected method. siteNode.properties[\"my:customAspectDate\"]?string evaluated instead to freemarker.template.SimpleScalar on line 59, column 71 in org\/alfresco\/repository\/site\/site.lib.ftl.'. Please contact your system administrator."
If I just display this scallar (${siteNode.properties["my:customAspectDate"]}), I get org.mozilla.javascript.NativeDate as a string in my resulting JSON:"startdate": "org.mozilla.javascript.NativeDate@7a6e5e2e",
10-09-2012 01:56 PM
<#assign nodeR=companyhome.childByNamePath["Sites/" + site.shortName] />
"startdate": "<#if nodeR.hasAspect("my:customAspect")>${nodeR.properties["my:customAspectDate"]?string("yyyy-MM-dd")}</#if>",
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.