cancel
Showing results for 
Search instead for 
Did you mean: 

cmis query with browser binding

markusr
Champ in-the-making
Champ in-the-making
Hello,

i apaologize for what looks like a rather simple qustion, but i have not been able to find a solution yet.
We are using Alfresco 4.2f and plan to use browser binding with javascript.
I just want to do somthing simple like, for example, "give me back the names of all a documents in a folder".
I know i can use "cmisselector=children&succinct=true", but this passes back too much information. I want to specify exactly, which information the api should deliver back.
So is there a way and how can i combine cmis query statements (select cmis:name from cmis:folder …) in a url with with browser binding?

Thank you in advance for your help.

Markus
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
This is the query you are looking for:
<blockquote>
select cmis:name from cmis:document where in_folder('a29f27d7-3bdc-41c6-81a7-559d1a8b2ec3')
</blockquote>

That id in the IN_FOLDER clause is the cmis object ID of the folder I am searching.

You can run that query from the OpenCMIS Workbench. You can also run it from a URL.

The way queries work with the browser binding is that you do a POST to the root URL, use a cmisaction of query, then pass the query in with the statement arg, so the POST would look like:


http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser?cmisaction=query&state... cmis:name from cmis:document where in_folder('a29f27d7-3bdc-41c6-81a7-559d1a8b2ec3')


Hope that helps,

Jeff