AnsweredAssumed Answered

Children of a link

Question asked by ehelfrich on Feb 6, 2014
Latest reply on Feb 7, 2014 by jpotts
I am trying to return an xml structure for a folder hierarchy via a freemarker template.  The hierarchy contains linked containers and nodes and I would like those nodes to be returned as well.  I can return everything but the content of a linked container. I am on Alfresco 4.0.2. and can't tell what I am doing incorrectly.  Here is my code:

<?xml version="1.0"?>
<#macro recurse_macro node>
   <#if (node.isContainer || node.isLinkToContainer)>
           <folder name="${node.name}">
              <#list node.children as child>
                      <#if (child.isContainer || child.isLinkToContainer) && node.children?size != 0 >
                         <@recurse_macro node=child />
                       </#if>
            <#if (child.isDocument || child.isLinkToDocument) >
            <file name="${child.name?html}"
                         
                              mimetype="${child.properties.content.mimetype}"
                              size="${child.properties.content.size}"
                      
                      />
            </#if>
                    </#list>
                 </folder>
   </#if>
</#macro>

<rootFolder displayPath="${folder.displayPath}" name="${folder.name}">
<#list folder.children as child>
<@recurse_macro node=child/>
</#list>
</rootFolder>

Outcomes