05-02-2016 09:27 AM
I am programming using the REST API and NXQL. I ran into some problems and found it easier to test queries first using Nuxeo Shell : Nuxeo Shell in batch mode My goal is to have a listing of items found in a workspace or folder. I tried the following queries:
query "SELECT * FROM Document WHERE ecm:path = '/default-domain/workspaces/Trial workspace'"
query "SELECT * FROM Document WHERE ecm:path = '/default-domain/workspaces/Trial workspace/'"
query "SELECT * FROM Document WHERE ecm:path = '/default-domain/workspaces/Trial workspace/*'"
query "SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/workspaces/Trial workspace'"
These result in either no listing, a single item being the name of the path itself or the entire contents of the workspace including all items in subfolders, workspaces, etc which is way too much.
I also experimented a bit based on Existing Document Types (Dublin Core) and of course NXQL specification, but never got the result I wanted.
Basically I would like to have the same thing as you would have when using the Nuxeo GUI: a view of items in a folder, workspace, collection or section and not something residing in parent or child branches/items.
Q: How do I get what I want please?
05-02-2016 09:44 AM
It might be easier to use either the children adapter : "/path/{docPath}/@children" or the Document.GetChild operation
Using NXQL, you should take a look at "ecm:parentId"
05-02-2016 09:46 AM
In NXQL also look at the `ecm
05-02-2016 09:53 AM
I think Olaf is looking for children not descendants (he mentionned the ecm
05-02-2016 09:57 AM
Indeed, sorry I misread. `ecm
05-02-2016 10:01 AM
https
05-02-2016 10:12 AM
Thank you both for your prompt replies. Actually I am looking the exact contents and not a parent or child/descendant. So NXP-19605 seems to offer exactly what I want/need(ed) except that I was looking at the item itself and not the parent. But as it works it works regardless of the name
05-12-2016 12:01 PM
In Nuxeo shell I get a huge resultset when executing the query:
query "SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/workspaces/Trial workspace'"
However when I execute the same query using the PHP lib/client I get an exception 0 : File not found. And as a side effect an empty resultset. Is this a bug?
My goals was to get the first item of the resultset and then get the parentID so I can follow up the suggestions of Florent Guillaume in this thread, I assume this is the way to go as there is no LIMIT function or a way to query a workspace's properties directly?
05-23-2016 11:51 AM
Recently I noted something which does not sound logical to me:
query "SELECT * FROM Workspace WHERE ecm:path = '/default-domain/workspaces/Trial workspace'"
produces an exception and an empty resultset. Whereas:
query "SELECT * FROM Section WHERE ecm:path = '/default-domain/sections/just another section
'"
produces a single item resultset. In other words: properties of a section can be easily queried and therefor the ID can be retrieved. The ID can then be used to get the contents of the section. But the same can not be said for a workspace. Is this intentional?
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.