So I'm looking to get a list of all checked out documents based on certain aspects, specifically cm:checkedOut. Basically, I want to search for all documents with the aspect cm:checkedOut and assume that that would be the list of all checked out documents.
I've been able to use cm:checkedOut and searched for checked out documents in the node browser, but I'm having a hard time finding a REST endpoint that will let me search for a certain aspect. The thing that I found so far is this CMIS endpoint:
GET /alfresco/service/cmis/query?q={q}&includeAllowableActions={includeAllowableActions?}&includeRelationships={includeRelationships?}&renditionFilter={renditionFilter?}&searchAllVersions={searchAllVersions?}&skipCount={skipCount?}&maxItems={maxItems?}
But I'm new to Alfresco and I honestly don't know if I can write a CMIS query to search for a particular aspect?
So my question is: is there a REST endpoint that will let me search for a specific aspect and do what I want to find? If it's relevant I'm using a .NET framework with C#.
first of all, since you are using Alfresco 4.2, you should be using the proper CMIS endpoints instead of the old /alfresco/service/cmis one which has been removed in Alfresco 5.0. See the <a href="http://docs.alfresco.com/4.2/pra/1/topics/cmis-welcome.html">documentation</a> for details.
In order to search for aspects, you need to either use CMIS 1.1 (only available via the proper CMIS endpoints, not the old alfresco/service/cmis) or an <a href="http://docs.alfresco.com/4.1/concepts/opencmis-ext-using.html">extension to the CMIS bindings specifically for Alfresco</a> (works only on alfresco/service/cmis). The recommended option would be CMIS 1.1. CMIS 1.1 provides a concept called "secondary object type" which translates to aspect in Alfresco vocabulary. This allows you to query documents based on aspects by including them in as JOIN clauses in the CMIS query or by selecting on a specific CMIS property (i.e. for multi-value / OR-conditions).
It is strongly recomended to use CMIS for generic folder/document access. The browser binding (CMIS 1.1) provides an API that is consumable by a ReST client. There are Alfresco-specific ReST endpoints that would allow you to perform similar searches, but they are primarily intended for internal use to support the Share user interface, and should not be used for application integration (unless you are willing to adapt on potentially every new version of Alfresco).
Also, so if I am understanding you correctly, I should be looking for a CMIS 1.1 endpoint that allows me to executes a CMIS query statement against the contents of the Repository, instead of the the CMIS 1.0 that I was using?
Then, since CMIS 1.1 includes secondary object types, I should be able to query for them by including them in as JOIN clauses in the CMIS query… are there any examples of this that I can find? I understand how to do a query like "SELECT * FROM cmis:document WHERE cmis:name='exampleName'", but how would this be different when I am querying for an aspect? Or for properties with OR-Conditions?
Also, you should not need to care about the specific URLs for an operation. Use a CMIS client library that will automatically look up the proper URLs to use for different operations, e.g. the OpenCMIS library is the de-facto king of handling CMIS both on client and server side.