CMIS is cool indeed, and especially working on it with Open Source tools like Alfresco, Maven and Chemistry can result in quite a bit of fun.
I’ve been working quite a lot lately on producing some sample and training material for the coming Alfresco meetups (tomorrow I’ll be presenting the CMIS Master class live from Madrid), and so I decided to mix and match the two things I can do best:
- Using my beloved Apache Maven
- Using the Chemistry AtomPub TCK (former Alfresco CMIS TCK) that we contributed to ASF to provide high level access to the CMIS ReST API
This effort, which I’ll probably heavily use in the next days Master Classes and training session, turned out to be quite productive as in a couple of days of work I was able to:
- develop a Labs framework which wraps Chemistry TCK embedded CMISClient
- provide an easy CMIS 0.62 application(s) scaffolding platform using a Maven multimodule project
- produce and release a Maven archetype which is now hosted our partner Sourcesense repositories ( big thanks go to this folks for being always supportive with their Maven maven infrastructure) and can be used as CMIS launchpad / labs / toolkit
Trying it is very easy, due to Maven archetypes power, and you can have the full Labs toolkit downloaded and installed on your by just selecting ‘cmis-master-labs-archetype‘ in the options of the command below:
mvn archetype:generate -DarchetypeRepository=http://repository.sourcesense.com/nexus/content/repositories/alfresco.public.snapshots -DarchetypeGroupId=org.alfresco.enablement.codecamps.cmis -DarchetypeArtifactId=cmis-master-labs-archetype -DarchetypeVersion=1.0
This will create a multiproject structure ready for use. You’ll just need to configure (in a single sourced fashion for the whole suite) the CMIS endpoint properties in the main POM, by editing the following properties:
<!-- SINGLE POINT OF CONFIGURATION FOR CMIS ENDPOINT -->
<!-- Configure here the CMIS endopoint For the whole suite -->
All the nice tracing and validation features of the Chemistry TCK are exposed, once that you configured the POM to point to a proper CMIS 0.62 compliant server (e.g. Alfresco, and an Ubuntu Alfresco VM is available here for this purpose). Specifically the toolkit offers 3 Maven submodules
- cmis-support –> Support JAR which wraps Chemistry TCK CMISClient
- cmis-query-webapp –> Very basic SpringMVC webapp querying a CMIS repository and showing results/entries
- cmis-lab-atompub-binding –> Learning lab on how to import data in Alfresco (complete class in the solution folders)
and a lab-solutions folder.
Using it is pretty straighforward. A simple
will test the support against the provided configuration, while entering the cmis-query-webapp folder and running
will result in the (quite ugly) but functional CMIS Query interface you can see below:
using a simple three tiered architecture like the one that follows:
Lastly entering the lab-atompub-binding folder and running
will run the sample JUnit empty test for the data import lab. Solution (real Test class) is to be found in the labs-solutions folder.
It’s a beginning but I believe it’s a very nice tool to overcome the somehow still steep learning curve around CMIS, so I warmly suggest you start installing the VM and the archetype and play around with it, and even use it as start for your integration/contribution projects. Especially if you are going to attend Alfresco meetups this month. I’ll surely post the Labs slides later this month, so stay posted!
The CMIS 1.0 Public Review compliant toolkit (working against Chemistry AtomPub TCK Trunk 1.0) is available on the Sourcesense repository and it’s added to the remote catalo mentioned in the previous command.
As a side note, at the moment this toolkit provide support for CMIS 0.62 while http://cmis.alfresco.com is Alfresco supporting CMIS 0.70: I’m planning to update the archetype (just a mere Maven dependency 🙂 ) to use the HEAD version of Chemistry TCK that is supporting 0.70.
Feedback welcome as usual!
Hope this really helps 🙂