Official Documentation Available

This topic is now covered in CMIS module.

Implemented in 4.5

 

CMIS integration using Apache Chemistry.

Implementation tracked in MGNLCMIS@jira

Rationale

CMIS has been widely adopted and we've seen an increasing interest from customers.

Implementation

The CMIS module exposes the DMS workspace as a CMIS repository with two object types, folder and document.

  • Atompub binding is at /.magnolia/cmisatom/
  • WebService binding is at /.magnolia/cmisws/RepositoryService

Installation

Use maven, or drop the module's jar including its dependencies into your webapp. The dependencies are:

com.sun.xml.ws:jaxws-rt:2.1.7:compile
com.sun.xml.bind:jaxb-impl:2.1.11:compile
javax.xml.bind:jaxb-api:2.1:compile
com.sun.xml.stream.buffer:streambuffer:0.9:compile
javax.activation:activation:1.1:compile
org.codehaus.woodstox:wstx-asl:3.2.3:compile
org.jvnet.staxex:stax-ex:1.2:compile
com.sun.org.apache.xml.internal:resolver:20050927:compile
org.jvnet:mimepull:1.3:compile

org.apache.chemistry.opencmis:chemistry-opencmis-commons-api:0.6.0-SNAPSHOT:compile

org.apache.chemistry.opencmis:chemistry-opencmis-commons-impl:0.6.0-SNAPSHOT:compile

org.apache.chemistry.opencmis:chemistry-opencmis-server-bindings:classes:0.6.0-SNAPSHOT:compile
com.googlecode.json-simple:json-simple:1.1:compile

org.apache.chemistry.opencmis:chemistry-opencmis-server-support:0.6.0-SNAPSHOT:compile
org.antlr:antlr-runtime:3.2:compile
org.antlr:stringtemplate:3.2:compile
antlr:antlr:2.7.7:compile

org.apache.chemistry.opencmis:chemistry-opencmis-server-jcr:classes:0.6.0-SNAPSHOT:compile

CMIS model

CMIS is a set of services exposed both via SOAP web services and REST using the AtomPub protocol.

The model has a concept of repositories that contain a hierarchical model of objects.

An object has a type which defines its semantics and properties. Objects are strictly typed. There are four base object types folder and document which must be supported and relationship and policy that are optional. A repository can contain additional object types, these must inherit directly or indirectly from one of the four base types.

Concepts
  • versioning
  • querying, supports a query language based on SQL-92
  • renditions, alternative representations such as thumbnail
Folder semantics
  • folder objects are not versionable
  • folder objects do not have a content stream
  • folder objects have an implicit hierarchical property
  • folder objects have a collation of file-able objects
  • folder objects may have zero or more renditions
Document semantics
  • document objects are versionable
  • document objects have zero or one content stream
  • document objects cannot have children
  • document objects may have zero or more renditions

Mismatch with website content

Type strictness

The content model of Magnolia uses weakly typed nodes that allows for arbitrary properties and sub-nodes. A node of type page for instance can have any number of properties with names that are not strictly defined.

Workarounds
  1. We can return more properties that we include in the object type and accept properties being set that are not part of the object type definition.
  • (minus) Not spec compliant, might be a problem from client side tooling
  • (minus) Queries wont work if they are validated against object type declarations
  1. Use extensions mechanism to send additional properties
  • (minus) Client then need to know about this extension, all standard tooling will be useless
  • (minus) Queries wont work if they are validated against object type declarations
Hierarchy based on folders

Magnolia page nodes contains sub-pages and hence acts as both a document and a folder.

The spec has this wording "A non-folder object does not have any descendant object."

Its not obvious how we would map pages onto the CMIS concepts of folders and documents.

Workarounds
  1. Use relationships to represent the hierarchy. Browsing the repository in tooling would show only the pages directly under the root, after that you would need to navigate relationships.
  • (minus) Client side tooling might not be well suited for this
  • (minus) Paths don't make any sense in this setup
  • (minus) Adding requires two operations, one to add the orphan and one to create the relationship. Where in JCR is the node until the relationship is established?
  1. Use folder renditions: if web pages are read-only from the client's perspective, is to expose the page content as a
    folder's rendition (renditions for folders were designed to display icons but can be used in a generic manner).
  • (minus) Incompatible with versioning
  1. Expose a node's content as a magic document named like "index.html"
  • (plus) Path makes sense
  • (plus) Works with existing client side tooling

References

Connection with CMIS Workbench

Use the workbench to test/demo features. Get it from http://chemistry.apache.org/java/developing/tools/dev-tools-workbench.html
Start it with ./workbench.shUse the following options:

Connection with Sharepoint

  • Install Sharepoint Server (tested with 2010)
  • Install Sharepoint administration toolkit
  • Go to the SharePoint 2010 Management Shell
  • Run this command:

    Add-SPSolution -LiteralPath 'C:\Program Files\Microsoft\SharePoint 2010 Administration - Toolkit\Content Management Interoperability Services (CMIS) Connectors\spcmis.wsp'
    
  • Go to Central administration \ System Settings \ Manage Farm Solutions
  • Click spscmis.wsp, choose the appropriate deployment settings, and click Deploy Solutions
  • Configure secure store service
  • Activate the CMIS Consumer feature in site collection features
  • Add CMIS consumer web part to the page where you want it
  • Specify WSDL Address (webapp_path/.magnolia/cmisws/NavigationService?wsdl)
  • Check WS-Security required
  • Select repository and login
Found issues

All seems to be Sharepoint related. More should be done once dialogs are working.

  • renaming file on Sharepoint side is reflected in Magnolia DMS but not in Sharepoint itself (changes in DMS are reflected correctly)
  • folders cannot be downloaded (but that's also case for DMS)
  • on creation of folder correct username is shown in "modified by" field while "created by" field shows "system" (doesn't matter if created in Magnolia or Sharepoint), works correctly for files
  • No labels