Entity view (Content)

osCaddie Module Update on Drupal.Org

By rmo
Oct. 9, 2014

Why osCaddie Drupal/Alfresco?

The osCaddie Drupal Alfresco module is designed to allow Drupal developers to take advantage of Alfresco development to provide a more sophisticated versioning and workflows mechanism. In order for Drupal to use this mechanism, content-types and content must be synched into Alfresco. Once inside Alfresco, versions will happen automatically and workflows can be triggered.

Since the data structure of a content-type in Drupal is completely different to a content-model in Alfresco, a ‘mapping’ must occur. This mapping translates the basic Entity object and any Fields attached to it into a set of properties of a Document type that Alfresco understands. Once the groundwork is established, content from Drupal can be synced into Alfresco easily.


Features and Benefits

  • Simplify the process of establishing the connection between Drupal and Alfresco through an admin UI. You can easily set up a connection in a few clicks, but also allows you to manage other aspects of the osCaddie Drupal Alfresco module.
  • Allow multiple Drupal sites to connect and use Alfresco as a centralized content repository that lets you trigger workflows and complete tasks on the synced content.
  • Access any content-type from any connected Drupal site. You can share content-types across all your different Drupal sites, making all content-types accessible to all sites
  • Use Alfresco as a secondary back-up solution to restore any content-types and content for Drupal. Since Alfresco has a 1-to-1 ‘clone’ of the information, so at any time if you lost a site, you can use osCaddie Drupal Alfresco to restore it.

How does it work?

Setting up the system – There are two components for osCaddie Alfresco, a Drupal module and an Alfresco webapp. The module will work on any Drupal 7 site, whether it is a fresh install or an existing setup, but the webapp will need to be compiled into Alfresco. You can have both Drupal and Alfresco installed in the same server or in different physical location, the Admin UI will allow you to specify where Alfresco is located. Please see the readme.txt included in the module for instructions on how to setup Alfresco.

Connecting and registering your Drupal site with Alfresco – Each Drupal site is represented as a ‘user’ in Alfresco with special privileges to make changes to the system, thus Drupal submits content on behalf of this ‘user’ into Alfresco. Before connecting Drupal with Alfresco, you will need to create this ‘user’ and assign him to the Canopy Manager group. You will also need to register the Drupal site before Alfresco can accept any content-types or content, which you can do in the Portal Configuration section.

Mapping content-types and sending content – Content-type Mapping section will let you select which content-type to be mapped, from Drupal into Alfresco or the other way around. It shows on the right all the content-types exists in Alfresco including the ones from other Drupal sites, and on the left the ones currently in Drupal. All you have to do is select one and press the create button. Once a content-type is mapped, any content of that type will be synced into Alfresco when you press Save on the edit form.


On the Technical Side

The osCaddie Drupal Alfresco module is, in fact, a package consisting of a base module and two other sub modules. The base module provides the foundation of the integration and global functions shared among all sub modules, the sub modules handles specific features.

osCaddie Alfresco - this is our base module, our JSON REST API, responsible for all communication with Alfresco. It contains a set of PHP functions representing the API implemented in the osCaddie Alfresco webapp, as well as osCaddie specific helper functions. Here is a list of osCaddie Alfresco API functions:

  • ticket_get() - Authorization method allowing Drupal to use the osCaddie Alfresco API.
  • site_register() - Site registration method to let Alfresco knows the existences of a Drupal site.
  • content_create() - Content creation method allowing Drupal to send content into Alfresco.
  • content_update() - Content update method allowing Drupal to send an update to an existing content in Alfresco.
  • types_get() - Content-types retrieval method that gets all content-types mapped into Alfresco including the data structure.
  • types_register() - Content-type creation method that takes a Drupal content-type data structure and create a Content Model in Alfresco.
  • types_map() - Content-type mapping method that takes the fields of a Drupal content-type and map to the properties of an Alfresco content model.
  • file_create() - Method to send a file into Alfresco.

*Note: Drupal API is still under development.

osCaddie Alfresco Model - this module provides the most critical piece of functionality in osCaddie Drupal Alfresco, the means to map Drupal content-types into Alfresco. It uses the Entity API and Fields API to deconstructs a Drupal content-type and extracts all essential information, which in turns, forms a definition (or a schema) that Alfresco understands. This definition becomes the blueprint to create a content model.

osCaddie Alfresco Model module will support a feature known as the Sync Model, which allows you to specify the direction the content is synced. 

  • Bi-directional Sync - this is the simple case, any changes from either side will be reflected in the other.
  • Uni-directional Sync - in the case for Drupal to Alfresco, changes made to Drupal will be synced into Alfresco, but if the content is altered in Alfresco the change will not be reflected in Drupal. The same logic applies to the converse, Alfresco to Drupal.

*Note: Sync Model is still under development.

osCaddie Alfresco Node -  this module is solely responsible for handling content (i.e. Node)  sending to or receiving from Alfresco. However, a content cannot be transported if the underlying content-type is not ‘mapped’ - the status of this is indicated on the content edit form. Nodes are keyed with a UUID given by Alfresco such that it order to tracked properly across the two systems. It is also used to associate files as ‘attachments’ to this piece of content.


...the Wrap Up

In essence, the key focus of the osCaddie Drupal Alfresco module is mapping and syncing content-types and content between the two systems. At the lowest level, it can also be seen as a SDK of a collection of helper functions and APIs that any developer can use to integrate Drupal and Alfresco together. And at the highest level, it simplifies the process of connecting Drupal and Alfresco, and allows Drupal site builders to take advantage of the Enterprise Content Management system that Alfresco offers.

If you are interested in contributing to the development of the module, please feel free to visit our project page on Drupal.org (https://www.drupal.org/project/oscaddie_alfresco

For a more in depth update and to ask us any questions live, register now for our technical update webinar taking place on Tuesday, October 21st.


Post Tags: