05-07-2009 11:27 AM
<#assign map = mapAsString?eval/><#if !map["keynotexist"]??><#assign mapAsString = "{"/>
<#assign first = true />
<#list person.assocs["cm:subscribedBy"] as subscriber>
<#if first = false>
<#assign mapAsString = mapAsString + ","/>
</#if>
<#assign mapAsString = mapAsString + "\"" + subscriber.properties["userName"] + "\":" + "\"" + subscriber.properties["userName"] + "\""/>
<#assign first = false/>
</#list>
<#assign mapAsString = mapAsString + "}"/>
<#assign map = mapAsString?eval/>
<p><i>map size: ${map?size}</i></p>
<#assign keys = map?keys>
<#list keys as key>
${key} = ${map[key]}
</#list>
<#if !map["keynotexist"]??>
<p><i>key not found</i></p>
<#else>
<p><i>key found</i></p>
</#if>05-07-2009 12:01 PM
05-09-2009 04:46 AM
PS : according to the freemarker doc reference order may be maintained in the map. So I'am quite suspicious that behind this is a real java map…So it means that Map and Sequence in Freemarker looks to be the same java underlying data structure : a List, because they maintained the order both.
05-09-2009 06:57 PM
05-10-2009 05:44 PM
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.