AnsweredAssumed Answered

access property name with freemarker

Question asked by eldi on Feb 14, 2013
Latest reply on Feb 14, 2013 by eldi
Hello,

1) This works fine :

   <#– Get a list of all the property names for the document –> 
                      <#assign props = doc.properties?keys> 
                      <#list props as t>
                         <#– If the property exists –>
                         <#if doc.properties[t]?exists>
                               <#– If it is a date, format it accordingly–>
                               <#if doc.properties[t]?is_date>
                                     ${t} = ${doc.properties[t]?date}
                              
                               <#– If it is a boolean, format it accordingly–>
                               <#elseif doc.properties[t]?is_boolean>
                                     ${t} = ${doc.properties[t]?string("yes", "no")}
                              
                               <#– Otherwise treat it as a string –>
                               <#else>
                                     ${t} = ${doc.properties[t]}                                     
                               </#if>
                         </#if>
                      </#list>

OUTPUT is :

{http://www.alfresco.org/model/content/1.0}creator = admin   

{http://www.alfresco.org/model/content/1.0}author = eok

…etc


2) i want only print  :

creator = admin
author = eok
…etc

and not '{http://www.alfresco.org/model/content/1.0}…', if i write ]{t.name}, i get an error, why ?
What should i write to get the property name only ?


Thank you.

Outcomes