Wednesday, June 9, 2010

CMIS has been approved

CMIS has recently been accepted as a standard, so it is time to get some experience with it! Actually my company just delivered its first CMIS-based solution yesterday.

CMIS means "Content Management Interoperability Services". It is a protocol to access ECM (Enterprise Content Management) repositories. Why did I choose to use CMIS instead of JCR or WebDAV? Because CMIS better targets the needs of ECM projects, it is actually the first protocol designed for Document Management, with interoperability being one of the main goals. CMIS is a joint effort between IBM, Microsoft, Alfresco, EMC, Open Text, SAP, Oracle, Adobe, Nuxeo and others.

Some client implementations already exist in beta versions, but their documentation is still very scarce. I chose OpenCMIS as a client library. Other solutions could have been chemistry-abdera, which is not as active, or using CMIS as Web Service or REST directly, which would have taken a lot of time.

Like for other CMIS implementations, OpenCMIS documentation is still scarce (I actually contributed a good portion of it). So I will explain how to get started with CMIS in the small OpenCMIS tutorial below, hope this helps someone. For the example, I will explain how to access Alfresco from an OpenCMIS client.

Using OpenCMIS to access an Alfresco repository

OpenCMIS has not been released yet, so you will have to compile it from source. Install subversion and maven if you don't already have them. Then get the source:
svn checkout https://svn.apache.org/repos/asf/incubator/chemistry/opencmis/trunk

... and compile it (in the root directory):
mvn clean install

This will create a bunch of JAR libraries, in particular those we need:
  • chemistry-opencmis-client-api-0.1-incubating-SNAPSHOT.jar
  • chemistry-opencmis-client-impl-0.1-incubating-SNAPSHOT.jar
  • chemistry-opencmis-client-bindings-0.1-incubating-SNAPSHOT.jar
  • chemistry-opencmis-commons-api-0.1-incubating-SNAPSHOT.jar
  • chemistry-opencmis-commons-impl-0.1-incubating-SNAPSHOT.jar
If you don't have an Alfresco server ready, install Alfresco Community (version 3.3 or later) and start it.

Download my small Java demo file and edit the URL, user, password to match your environment.

Then compile with the libraries, run, and the content of your repository should appear :-)
That's it! To start doing actually useful things, check the OpenCMIS cookbook.

No comments:

Post a Comment