23 Nov 2009
New Tutorial: Getting Started with CMIS
I’ve written a new tutorial on the proposed Content Management Interoperability Services (CMIS) standard called, “Getting Started with CMIS“. The tutorial first takes you through an overview of the specification. Then, I do several examples. The examples start out using curl to make GET, PUT, POST, and DELETE calls against Alfresco to perform CRUD functions on folders, documents, and relationships in the repository. If you’ve been dabbling with CMIS and you’ve struggled to find examples, particularly of POSTs, here you go.
I used Alfresco Community built from head, but yesterday, Alfresco pushed a new Community release that supports CMIS 1.0 Committee Draft 04 so you can download that, use the hosted Alfresco CMIS repository, or spin up an EC2 image (once Luis gets it updated with the new Community release). If you don’t want to use Alfresco you should be able to use any CMIS repository that supports 1.0cd04. I tried some, but not all, of the command-line examples against the Apache Chemistry test server.
Once you’ve felt both the joy and the pain of talking directly to the CMIS AtomPub Binding, I take you through some very short examples using JavaScript and Java. For Java I show Apache Abdera, Apache Chemistry, and the Apache Chemistry TCK.
For the Chemistry TCK stuff, I’m using Alfresco’s CMIS Maven Toolkit which Gabriele Columbro and Richard McKnight put together. That inspired me to do my examples with Maven as well (plus, it’s practical–the Abdera and Chemistry clients have a lot of dependencies, and using Maven meant I didn’t have to chase any of those down).
So take a look at the tutorial, try out the examples with your favorite CMIS 1.0 repo, and let me know what you think. If you like it, pass it along to a friend. As with past tutorials, I’ve released it under Creative Commons Attribution-Share Alike.
[Updated to correct typo with Gabriele's name. Sorry, Gab!]

Couple of things I forgot to mention:
Check out http://cmisdev.org for useful CMIS-related links
Richard and Gab are doing a free, interactive CMIS training session tomorrow, 24 November. See http://www.alfresco.com/about/events/2009/11/cmis_training/ for more details.
Jeff
jpotts
November 23rd, 2009 at 5:58 pmpermalink
[...] mentioned in the New York Times. Yes, the New York Times. Secondly, Jeff Potts released his “Getting Started with CMIS” tutorial. And, finally, I had the chance to drink beer and talk shit with the great David [...]
CMIS, JCR and OSGi for Idiots | Jon On Tech
November 26th, 2009 at 10:42 ampermalink
[...] Getting Started with CMIS (Jeff Potts) [...]
CMIS resources « CMIS Blog
December 3rd, 2009 at 3:28 ampermalink
[...] Getting Started with CMIS (Jeff Potts) [...]
Two new tutorials about CMIS « CMIS Blog
December 3rd, 2009 at 3:29 ampermalink
Thanks for the tutorial. I’m in the process of going through the CMIS spec and it’s nice to see it in practice.
Marty Gagnon
December 3rd, 2009 at 11:56 ampermalink
Nice tutorial but are there any known examples or at least clients using the web service binding?
AndreasM
December 4th, 2009 at 5:54 ampermalink
I haven’t seen any clients choose to use the web services binding yet, but it is still early. I’m sure there will be cases where it makes sense.
Jeff
jpotts
December 4th, 2009 at 9:36 ampermalink
[...] around the time I was putting together the Getting Started with CMIS tutorial, it struck me that there needed to be an API that didn’t have a lot of dependencies [...]
cmislib: A CMIS client library for Python | ecmarchitect.com
December 18th, 2009 at 12:41 pmpermalink
I was trying to get into CMIS and I noticed that there are only XML bindings – is that right? Or is there the option (at least for Alfresco) to get the response in a different format (e.g. JSON)?
Martin Wildam
January 26th, 2010 at 9:54 ampermalink
Martin,
CMIS compliant servers must implement two bindings. One is the Restful AtomPub Binding. The other is the Web Services binding. The current spec doesn’t provide for any other bindings (such as JSON).
Jeff
jpotts
January 26th, 2010 at 10:26 ampermalink
Thanks for the Tutorial Jeff. One aspect i am struggling to get working is querying against categories. How do I do this?
Noel Sharpe
January 27th, 2010 at 6:40 pmpermalink
From page 475 of the Alfresco Developer Guide…
A handy little hack to get the Lucene full-text search query syntax is to use the web client to build your search, then save the search, then use the Node Browser to go look at the search string Alfresco saved.
[UPDATE: I just realized you posted this comment regarding the CMIS tutorial so this answer isn't going to help you at all. CMIS queries don't support categories, so, unfortunately, if you're using CMIS, you're out-of-luck for now].
Hope that helps,
Jeff
jpotts
February 2nd, 2010 at 3:32 pmpermalink
Hi Jeff,
I have created Axis2 client and able to access different CMIS services (Alfresco).
I want execute different features like createDocument, createFolder etc.
Can you guide me how to set properties using web service client?
I have generated stub classes using Axis2 ADB option.
Nikesh
March 2nd, 2010 at 12:18 ampermalink
Jeff, thanks very much for (another) great tutorial.
Please correct the namespace errata in page 25. CMIS namespace is missing and ending /. I lost 2 days until I did find the error.
Definitively copy&paste is the worst enemy of the programmer.
Igor Blanco
March 24th, 2010 at 9:58 ampermalink
Totally agree on the copy and paste comment. Yes, screwing up those namespaces can really foul things up. The snippet on page 25 is missing a trailing slash. Instead of:
"http://docs.oasis-open.org/ns/cmis/core/200908"It should read:
"http://docs.oasis-open.org/ns/cmis/core/200908/"The actual downloadable source code does not have this problem.
Jeff
jpotts
March 25th, 2010 at 3:00 pmpermalink
This CMIS has been good stuff to have found. Is there a trick to passing the Drupal user name to Alfresco to limit access to spaces?
chrisw
April 4th, 2010 at 3:29 ampermalink
In a nutshell, you need to do single sign-on between Drupal and Alfresco to make this happen. So, instead of configuring CMIS to use a “system” ID to connect (like “admin” for Alfresco) you can configure it to get a session using the creds already in the Drupal header. Unfortunately, this isn’t a simple checkbox config. We may show this working at DrupalCon (no promises). Maybe we can post more details on it for those that can’t attend.
jpotts
April 9th, 2010 at 8:46 ampermalink
I’m trying to follow our tutorial but, when trying to create a document, with testCreateSampleA.atom.xml I get an error
Invalid typeId D:sc:whitepaper.
However, if I use cmis:document
then it works.
Can you explain that?
SAlvador
August 17th, 2010 at 5:40 ampermalink
That type, D:sc:whitepaper, is a custom type that does not come with Alfresco out-of-the-box. You have to deploy it as part of a custom content model. You can use your own custom types instead or use the “SomeCo” examples from my blog and/or book. Does your custom content model include a custom content type called sc:whitepaper?
Jeff
jpotts
August 17th, 2010 at 8:52 ampermalink
No, I don’t have that type. I’ll get your blog code and give it a try. Thanks
SAlvador
August 18th, 2010 at 3:05 ampermalink