Simple query

Query: Select all cmis:document.

SELECT * FROM cmis:document


You need to enable query support by following CMIS Add-on configuration section.

That simple query can be executed by curl as follows:

  1. Upload a text file test.txt to the drive Collaboration in Sites Explorer.

  2. Send the GET request to query service by curl:

    curl -o result.xml -uroot:gtn http://localhost:8080/rest/private/cmisatom/Collaboration/query?q=SELECT%20*%20FROM%20cmis:document

The output file (result.xml) contains an entry of test.txt:

		<title type="text">test.txt</title>

If you want to use POST request, write your query in an xml file (cmis:statement is required):

<?xml version='1.0' encoding='utf-8'?>
<cmis:query xmlns='http://www.w3.org/2005/Atom' xmlns:cmis='http://docs.oasis-open.org/ns/cmis/core/200908/'>
    <cmis:statement>SELECT * FROM cmis:document</cmis:statement>

Then send it by the following command (for example you saved the file as query.xml):

curl -o result.xml -X POST -uroot:gtn http://localhost:8080/rest/private/cmisatom/Collaboration/query -H "Content-Type: text/xml; charset=UTF-8" -d @query.xml
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus