06-13-2016 09:13 AM
Hi
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).
With Collections it is a different cookie:
$query = "SELECT * FROM Document WHERE ecm:path = '/default-domain/workspaces/" . $workspace . "/" . $collection . "'" ;
$filter = "ecm:currentLifeCycleState != 'deleted'";
`
follwed by:
getDocumentUiD
and somthing like:
$query = "SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/workspaces/" . $workspace . "/" . $collection . "' AND ecm:parentId='".$parid."'" ;
$query .= " AND " . $filter;`
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).
So this leaves the question: how to get the items in a collection using NXQL as @children is not an option?
06-13-2016 10:21 AM
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
06-15-2016 08:50 AM
This seemed to work ok, but results in some oddities. Please see above.
06-13-2016 10:25 AM
Have a look to the default_content_collection page provider. You can then use it with the query endpoint.
06-15-2016 08:49 AM
After extensive testing I came to the following conclusions:
The collection I used contains 4 documents:
Documents #3 and #4 have the same title/name.
When I query Nuxeo to get the collection:documentIds I get:
Are document residing in a section not listed by default? Why?
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?
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.