In many projects, the Nuxeo Platform is used as a central repository especially for Digital Assets, such as pictures and other media assets. It goes without saying that a central repository is more useful when you can use it with other systems. Let’s imagine you use Drupal, a well known open-source CMS, to publish articles to a wide audience via the Web. Doesn’t a page look better when there is an image in the article? Of course, that image should live in the Nuxeo Platform because it provides advanced management capabilities, such as asset rights management, validation, lifecycle management, automated rendition, and syndication management for media files. More importantly these assets will be stored in a central repository enabling you to share them between several external systems.

Now the next question is, how do you make that happen? The Nuxeo Platform is extensible and it has full APIs for, among other things, integration with outside systems. Drupal does as well, therefore it should be simple to integrate the two.

The goal is to get something like:


screenshot of the Drupal page displaying a picture from Nuxeo Screenshot of the Drupal page displaying a picture from the Nuxeo Platform

Image in the Nuxeo Platform Image in the Nuxeo Platform

There are many ways you can access the Nuxeo Platform from external systems. Two main constraints drive the choices for a solution here.

First aspect: permissions and authentication have to be simple. You do not want the article authors to choose images that wouldn’t be accessible to the viewers. Having the same permissions for all users accessing content from the Nuxeo Platform through Drupal is therefore a requirement. A simple solution is to create a dedicated Drupal user in the Nuxeo Platform with restricted read access.

And then we want to display images. The Nuxeo Platform creates extensible picture conversions that can be linked and accessed directly (http://doc.nuxeo.com/x/4Bs5AQ), it’s very convenient. However with that solution, the Drupal viewers will see direct links to content in the Nuxeo Platform, so authentication still has to be managed somehow. Let’s put a reverse proxy between Drupal and the Nuxeo Platform for that, it also fits well with the first requirement and will even give a caching solution if needed.

In the end the architecture looks like:


Nuxeo-Drupal Integration Architecture Nuxeo-Drupal Integration Architecture

To create Drupal modules, you implement “hooks” in PHP (https://www.drupal.org/developing/modules/7). There are many hooks available; in our case, several hooks have to be implemented, especially for edit and view mode of the image in the Nuxeo Platform. View mode is pretty straightforward. It’s a simple PHP function that recreates the picture rendition link from the asset Id. The edit mode is a bit trickier, we chose to create a simple JavaScript search screen in a WebEngine page (http://doc.nuxeo.com/x/CYAO) and to display it through an iframe in the edit mode of the Drupal (so that it can reused for another integration if needed).

Here is what it looks like:



You can check out the actual implementation at: https://github.com/fvadon/nuxeo-drupal

As we just saw, integrating content in the Nuxeo Platform into a Drupal module is incredibly easy. The other important point is that the way to implement integration between differents tools depends on the use case. Here we almost did not use Nuxeo REST APIs (http://doc.nuxeo.com/x/QYLQ) but it might be the most efficient solution for many other use cases. So, are you wondering about any kind of integration with the Nuxeo Platform? We can certainly help, just get in touch with us!