<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic getFolderTree and recursion in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/getfoldertree-and-recursion/m-p/277847#M230977</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;(Alfresco community edition 4.0.0 b)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to get a complete tree listing of a folder, and it looks like the CMIS api getFolderTree (&lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/CMIS_Web_Scripts_Reference#Get_Folder_Hierarchy_.28getFolderTree.29" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/CMIS_Web_Scripts_Reference#Get_Folder_Hierarchy_.28getFolderTree.29&lt;/A&gt;&lt;SPAN&gt;) is the right way to go. However, this will only return one level of the tree, regardless of the setting of the depth parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Upon investigation, I found the webscript &lt;/SPAN&gt;&lt;STRONG&gt;atomentry.lib.atom.ftl&lt;/STRONG&gt;&lt;SPAN&gt;. On line 126 there is a comment saying "recurse for depth greater than 1", and below that there is "[#if maxdepth == -1 || depth &amp;amp;lt; maxdepth]". However, when I print maxdepth and depth, they are always equal to 1, so the condition is never satisfied, and the listing never recurses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems that the depth parameter is not passed on correctly, although this should happen in tree.get.atomfeed.ftl (line 25), if my understanding is correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I change the above condition so that it is always true, I run into another problem. Freemarker complains that "Expression feedLib is undefined" in "user-directive feedLib.feed".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can solve that by including [#import "/org/alfresco/cmis/lib/atomfeed.lib.atom.ftl" as feedLib/] in atomentry.lib.atom.ftl, but that does not feel like the right thing to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After making these changes, I do get a recursive tree listing, but it seems that, beeing an Alfresco newbie, I am missing something. Is there anyone who is willing to shed some light on this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Mar 2012 13:25:08 GMT</pubDate>
    <dc:creator>nverwer</dc:creator>
    <dc:date>2012-03-20T13:25:08Z</dc:date>
    <item>
      <title>getFolderTree and recursion</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/getfoldertree-and-recursion/m-p/277847#M230977</link>
      <description>(Alfresco community edition 4.0.0 b)I am trying to get a complete tree listing of a folder, and it looks like the CMIS api getFolderTree (http://wiki.alfresco.com/wiki/CMIS_Web_Scripts_Reference#Get_Folder_Hierarchy_.28getFolderTree.29) is the right way to go. However, this will only return one leve</description>
      <pubDate>Tue, 20 Mar 2012 13:25:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/getfoldertree-and-recursion/m-p/277847#M230977</guid>
      <dc:creator>nverwer</dc:creator>
      <dc:date>2012-03-20T13:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: getFolderTree and recursion</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/getfoldertree-and-recursion/m-p/277848#M230978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Starting with Alfresco 4, the old web script-based CMIS implementation which you will be using if you use the old CMIS ATOM service URL (&lt;/SPAN&gt;&lt;A href="http://localhost:8080/alfresco/s/api/cmis" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/s/api/cmis&lt;/A&gt;&lt;SPAN&gt;) is deprecated. Instead, you should use the OpenCMIS-based implementation, which you get to by using this URL: &lt;/SPAN&gt;&lt;A href="http://localhost:8080/alfresco/cmisatom" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/cmisatom&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just ran a quick test using cmislib against Alfresco 4.0.b Community and noticed that when I use the deprecated URL, I only get the first level on a getTree call. But when I use the new OpenCMIS-based URL, I get the full tree.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; client = CmisClient('&lt;A href="http://localhost:8080/alfresco/cmisatom" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/cmisatom&lt;/A&gt;', 'admin', 'admin')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; repo = client.defaultRepository&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; folder = repo.getObjectByPath('/test')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; tree = folder.getTree()&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; for res in tree:&lt;BR /&gt;…&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res.name&lt;BR /&gt;… &lt;BR /&gt;u'sub1'&lt;BR /&gt;u'sub11'&lt;BR /&gt;u'sub111'&lt;BR /&gt;u'sub112'&lt;BR /&gt;u'sub12'&lt;BR /&gt;u'sub2'&lt;BR /&gt;u'sub3'&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; client = CmisClient('&lt;A href="http://localhost:8080/alfresco/s/api/cmis" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/s/api/cmis&lt;/A&gt;', 'admin', 'admin')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; repo = client.defaultRepository&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; folder = repo.getObjectByPath('/test')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; tree = folder.getTree()&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; for res in tree:&lt;BR /&gt;…&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res.name&lt;BR /&gt;… &lt;BR /&gt;u'sub2'&lt;BR /&gt;u'sub3'&lt;BR /&gt;u'sub1'&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;There are other differences between the two implementation as well, so please do use the new one if possible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 16:39:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/getfoldertree-and-recursion/m-p/277848#M230978</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2012-03-20T16:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: getFolderTree and recursion</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/getfoldertree-and-recursion/m-p/277849#M230979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Jeff, this is very helpful information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I do wonder if I could have known this. The services listing from Alfresco …/alfresco/service/ happily lists the deprecated CMIS services.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards, Nico&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 09:58:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/getfoldertree-and-recursion/m-p/277849#M230979</guid>
      <dc:creator>nverwer</dc:creator>
      <dc:date>2012-03-22T09:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: getFolderTree and recursion</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/getfoldertree-and-recursion/m-p/277850#M230980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is a &lt;/SPAN&gt;&lt;A href="https://issues.alfresco.com/jira/browse/ALF-12667" rel="nofollow noopener noreferrer"&gt;Jira to get those marked as deprecated&lt;/A&gt;&lt;SPAN&gt;. Looks like it is fixed in 4.0.1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 14:44:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/getfoldertree-and-recursion/m-p/277850#M230980</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2012-03-22T14:44:43Z</dc:date>
    </item>
  </channel>
</rss>

