Wednesday, April 10, 2013

CMIS: What are Secondary object types?

The main advantage of ECM servers over file servers is the ability to have metadata about the documents, and the ability to define what metadata should exist, on what kind of document.

For instance, an ECM administrator might decide that pictures should have a height and a width metadata, while bills should have a price metadata. In CMIS parlance, pictures and bills are called "primary types".

Most ECM servers also have a "secondary type" concept. Secondary types are more transverse, and can be applied to documents of any primary type. For instance, "Confidentiality" can be applied to images as well as bills. A document can only have one primary type, but can have several secondary types.
A few examples: Versionability, effectivity, geographic details, audio details, ...

Forgotten in CMIS 1.0, secondary types are now part of the CMIS 1.1 standard, which should be official soon.

Example with Alfresco

In Alfresco, a secondary type is called an "aspect". You can easily add aspects to any document. There are predefined aspects, but you can also define custom aspects.

For instance, let's say we manage field observation reports, and each observation report has a latitude and longitude. So, let's add the predefined "Geographic" secondary type to a document. In the document's details page, click on "Manage Aspects":


 Then add the "Geographic" aspect:


The latitude and longitude are now part of the document's metadata properties:


Looks nice in the Alfresco client, but how is it via CMIS?

The CMIS 1.1 standard is not official yet, so unfortunately in Alfresco 4.2.0, secondary type properties can not yet be seen in the CMIS properties:


Instead, you have to get them via the CMIS extensions, which is a mechanism for vendor-specific tricks:


Actually, there is an open source Java library that makes it easy to retrieve them from there. But I would suggest waiting for CMIS 1.1, you will then be able to use secondary type properties easily, in a way that will work on all ECM servers.

Nicolas Raoul

No comments: