AnsweredAssumed Answered

freemarker detecting types

Question asked by savic.prvoslav on Apr 10, 2012
<table>
<#– Get a list of all the property names for the document –>
<#assign props = document.properties?keys>
<#list props as t>
    <#– If the property exists –>
    <#if document.properties[t]?exists>
       <#– If it is a date, format it accordingly–>
       <#if document.properties[t]?is_date>
       <tr><td>${t} = ${document.properties[t]?date}</td></tr>
      
       <#– If it is a boolean, format it accordingly–>
       <#elseif document.properties[t]?is_boolean>
       <tr><td>${t} = ${document.properties[t]?string("yes", "no")}</td></tr>
      
       <#– Otherwise treat it as a string –>
       <#else>
       <tr><td>${t} = ${document.properties[t]}</td></tr>
       </#if>
    </#if>
</#list>
</table>

This here is a great example but it has a problem:
if you are listing users and home folder property:
because this is a nodref it shows as
Node Type: {http://www.alfresco.org/model/content/1.0}folder   Node Ref: workspace://SpacesStore/09389cb0-8494-4887-87ea-d22df47c58f8
My question is how to detect node ref so rendering could be done in a defferent way ?

Outcomes