How to Make a simple CMIS query with Alfresco
The following http://yourserver:8080/alfresco/service/api/cmis.html link lets you run the CMIS test queries.
http://yourserver:8080/alfresco/service/api/query is the webscript which receives a post query and the results
are an atom feed.
A custom webscript can be used to make a search and display the results
<blockquote>var connector = remote.connect(“alfresco”);
//make a xml query and append the query keyword string to it
var query = “<?xml version=’1.0′?>” +
“<query xmlns=’http://www.cmis.org/2008/05′>” +
“<statement><![CDATA[SELECT * FROM Document WHERE CONTAINS ('"+ argsQuery +"')]]></statement>” +
“<searchAllVersions>false</searchAllVersions>” +
“<pageSize>10</pageSize><maxItems>”+maxItems+”</maxItems>” +
“<skipCount>” + skipCount +”</skipCount>” +
“<returnAllowableActions>false</returnAllowableActions></query>”;
//make a post request
var feed = connector.post(“/api/query” , query.toString() ,”application/cmisquery+xml”);
var feedXml = new String(feed);
model.result = parseAtomFeed(feedXml)
</blockquote>
parseAtomFeed javascript method could be reused from the Slingshot project