<?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 Re: REST API/NXQL Children of a Collection in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322353#M9354</link>
    <description>&lt;P&gt;After extensive testing I came to the following conclusions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;grenard's solution did not work for me as I got an error on the query used. This might have to do that we use different versions of Nuxeo (v7.10 vs v8) ?&lt;/LI&gt;
&lt;LI&gt;pibou Bouvret's solution worked fine, but results in some weird behavior:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The collection I used contains 4 documents:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;document #1 version 0.1 Project (resides in a personal workspace)&lt;/LI&gt;
&lt;LI&gt;document #2 version 0.1 Project (resides in a section)&lt;/LI&gt;
&lt;LI&gt;document #3 version 0.2 Project (resides in a workspace)&lt;/LI&gt;
&lt;LI&gt;document #4 version 0.1 Approved (resides in a section)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Documents #3 and #4 have the same title/name.&lt;/P&gt;
&lt;P&gt;When I query Nuxeo to get the collection:documentIds I get:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;document #1 , but it is the last item in the array&lt;/LI&gt;
&lt;LI&gt;a document which is not listed above. It is a deleted document&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Are document residing in a section not listed by default? Why?&lt;/P&gt;
&lt;P&gt;Why do I only get a single document, or does that has to do with versioning/approving?
If so, the fact that the document resides in a different location is irrelevant?&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2016 12:49:12 GMT</pubDate>
    <dc:creator>olaf_</dc:creator>
    <dc:date>2016-06-15T12:49:12Z</dc:date>
    <item>
      <title>REST API/NXQL Children of a Collection</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322350#M9351</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Normally one follows the recipe of querying a folder, get the UID and next issue a startswith on the ecm:path to get the contents of a folder (Workspace, Section).&lt;/P&gt;
&lt;P&gt;With Collections it is a different cookie:
&lt;CODE&gt; &lt;/CODE&gt;$query = "SELECT * FROM Document WHERE ecm:path = '/default-domain/workspaces/" . $workspace . "/" . $collection . "'" ;
$filter = "ecm:currentLifeCycleState != 'deleted'";
`&lt;/P&gt;
&lt;P&gt;follwed by:
&lt;CODE&gt;getDocumentUiD&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;and somthing like:
&lt;CODE&gt; &lt;/CODE&gt;$query = "SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/workspaces/" . $workspace . "/" . $collection . "' AND ecm:parentId='".$parid."'" ;
$query .= " AND " . $filter;`&lt;/P&gt;
&lt;P&gt;This does not work as a Collection is not a folder with Documents in it, but is a thing with links to Documents. So when using the above query you get an empty resultset. ("file not found"). This makes sense as the UID of the parent of an item in the collection is not the Collection itself, but the folder in which the Document resides (the location being linked to from the collection).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;So this leaves the question: how to get the items in a collection using NXQL as @children is not an option?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 13:13:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322350#M9351</guid>
      <dc:creator>olaf_</dc:creator>
      <dc:date>2016-06-13T13:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: REST API/NXQL Children of a Collection</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322351#M9352</link>
      <description>&lt;P&gt;The Ids of documents belonging to a collection can be accessed as a multi-valued property of the collection :
collection:documentIds / documentId
The Ids of the collections a document belongs to can be accessed as a multi-valued property of the document :
collectionMember:collectionIds&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 14:21:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322351#M9352</guid>
      <dc:creator>pibou_Bouvret</dc:creator>
      <dc:date>2016-06-13T14:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: REST API/NXQL Children of a Collection</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322352#M9353</link>
      <description>&lt;P&gt;Have a look to the &lt;A href="http://explorer.nuxeo.com/nuxeo/site/distribution/Nuxeo%20DM-8.2/viewContribution/org.nuxeo.ecm.collections.pageprovider--providers"&gt;default_content_collection&lt;/A&gt; page provider. You can then use it with the query endpoint.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 14:25:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322352#M9353</guid>
      <dc:creator>Guillaume_Renar</dc:creator>
      <dc:date>2016-06-13T14:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: REST API/NXQL Children of a Collection</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322353#M9354</link>
      <description>&lt;P&gt;After extensive testing I came to the following conclusions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;grenard's solution did not work for me as I got an error on the query used. This might have to do that we use different versions of Nuxeo (v7.10 vs v8) ?&lt;/LI&gt;
&lt;LI&gt;pibou Bouvret's solution worked fine, but results in some weird behavior:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The collection I used contains 4 documents:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;document #1 version 0.1 Project (resides in a personal workspace)&lt;/LI&gt;
&lt;LI&gt;document #2 version 0.1 Project (resides in a section)&lt;/LI&gt;
&lt;LI&gt;document #3 version 0.2 Project (resides in a workspace)&lt;/LI&gt;
&lt;LI&gt;document #4 version 0.1 Approved (resides in a section)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Documents #3 and #4 have the same title/name.&lt;/P&gt;
&lt;P&gt;When I query Nuxeo to get the collection:documentIds I get:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;document #1 , but it is the last item in the array&lt;/LI&gt;
&lt;LI&gt;a document which is not listed above. It is a deleted document&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Are document residing in a section not listed by default? Why?&lt;/P&gt;
&lt;P&gt;Why do I only get a single document, or does that has to do with versioning/approving?
If so, the fact that the document resides in a different location is irrelevant?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 12:49:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322353#M9354</guid>
      <dc:creator>olaf_</dc:creator>
      <dc:date>2016-06-15T12:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: REST API/NXQL Children of a Collection</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322354#M9355</link>
      <description>&lt;P&gt;This seemed to work ok, but results in some oddities. Please see above.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 12:50:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/rest-api-nxql-children-of-a-collection/m-p/322354#M9355</guid>
      <dc:creator>olaf_</dc:creator>
      <dc:date>2016-06-15T12:50:29Z</dc:date>
    </item>
  </channel>
</rss>

