
Upgrade Your Drupal Skills
We trained 1,000+ Drupal Developers over the last decade.
See Advanced Courses NAH, I know EnoughHands on CMIS with Alfresco
Hands on CMIS with Alfresco
Posted on: Thursday, March 22nd 2012 by Victor
Canopy Solution
In our Canopy solution, one of the core features is the ability to synchronize the content and its metadata change upon request between Drupal and Alfresco. A typical use case is called R-R (Repository to Repository): publishing content from one repository to another. A common scenario is publishing content from Alfresco directly to Drupal systems for publication to the Intra/Internet. In case of performance of document retrieval is a requirement, a solution needs to provide two essential functions:
- Be able to provide bidirectional document/metatadata synchronization between Drupal and Alfresco. It is vital to support custom content type from Drupal, as well as Alfresco custom content model.
- Be able to receive change notification between Drupal and Alfresco so that each document can be made aware of what changes (document, metadata upload, update and deletion) have happened in other repositories.
CMIS
In order for support bidirectional data synchronization, one option is to employ CMIS Alfresco, as I love learning by hands on, my intuition is: why not try it to see what it can accomplish first. cmislib is developed by Jeff Potts (Chief Community Officer at Alfresco) and comes in handy. The beauty of cmislib is a developer can try all sorts of things from command line or favorite IDE and Python is just that elegant to read and write. Even you program in other languages such as PHP/Ruby/Java, the CMIS concepts such as Repository,Document,Folder,Query etc are about the same. Open Chemistry has listed CMIS client for Java, PHP, Python and .NET.
Demo code
I have written some demo code based on an Alfresco out of the box installation.The source code is located at github. "git clone git@github.com:victordude/alfresco.git" will get the source code cmis.py.
Alfresco Version: 4.0 Enterprise
Python: 2.7+
Python CMIS libs: cmislib, cmislibalf
The code above will use the out of box demo data is installed as part of : /Sites/swsdp/documentLibrary/Agency Files/Contracts/
As you can play with the above source code, you can learn the following:
To install cmislib is pretty easy with "pip install cmislib". If you don't have pip installed, "sudo apt-get install pip" will install it on debian/ubuntu linux, otherwise please consult PIP install
References
About Drupal Sun
Drupal Sun is an Evolving Web project. It allows you to:
- Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
- Facet based on tags, author, or feed
- Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
- View the entire article text inline, or in the context of the site where it was created
See the blog post at Evolving Web
