OpenCms Days 2012 - OpenCms 8.5: Accessing the VFS repository using CMIS
Upcoming SlideShare
Loading in...5

OpenCms Days 2012 - OpenCms 8.5: Accessing the VFS repository using CMIS



Content Management Interoperability Services (CMIS) is an open standard that defines an abstraction layer for controlling various document management systems and repositories using web protocols.

Content Management Interoperability Services (CMIS) is an open standard that defines an abstraction layer for controlling various document management systems and repositories using web protocols.

By integrating Apache Chemistry, OpenCms 8.5 has become a CMIS server. This means there is now a simple, web service oriented interface to read content from and write content to the OpenCms VFS "on the fly". Accessing the OpenCms repository was easy enough using the native API before, but with CMIS you can access the repository even from a remote server.

Georg will introduce the CMIS standard to you and show how it has been integrated in OpenCms 8.5. He will explain the most common use cases and point out the possibilities and limitations of this powerful new interface in OpenCms.



Total Views
Views on SlideShare
Embed Views



6 Embeds 389 214 165 3 3 3 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    OpenCms Days 2012 - OpenCms 8.5: Accessing the VFS repository using CMIS OpenCms Days 2012 - OpenCms 8.5: Accessing the VFS repository using CMIS Presentation Transcript

    • Workshop track Accessing the VFS repository using CMIS Georg Westenberger and Michael Emmerich,25.09.2012 Alkacon Software
    • Agenda2 ● Introduction to CMIS ● What is CMIS? ● Demo 1: Uploading files ● CMIS Data Model ● OpenCms implementation of CMIS ● CMIS concepts in OpenCms ● Demo 2: Fetching resources from OpenCms ● Limitations of the CMIS implementation ● Demo 3: Searching with CMIS
    • What is CMIS?3 ● Content Management Interoperability Services ● Standard for accessing content repositories through a web service interface ● Defined in 2010 by web standards consortium OASIS ● „Least common denominator“: not meant to support all possible content repository operations
    • Previous standards4 ● WebDAV ● Already supported by OpenCms ● JCR (Content Repository API for Java) ● Complex ● Java-centric
    • Purpose of CMIS5 ● Problem: Accessing different CMS repositories ● E.g. for content migration, aggregation ● Normally requires special programming effort for every CMS repository you want to access ● Using CMIS to access CMS repositories: Remote access to repositories Using the same client software for different CMS implementations
    • Live Demo: Uploading Files6 Demo Demo ● Live Demo デモ Demo Demo
    • CMIS Data Model7 ● A repository contain objects ● Objects may be: ● Folders and documents arranged in a hierarchy ● Typed relationships between folders/documents (directed „links“) ● Policies ● Objects have a type ● Objects have properties defined by their type ● CMIS standard defines possible operations for reading/writing/creating/deleting these objects, changing properties, etc.
    • Service bindings8 ● Protocols for accessing CMIS repositories: ● SOAP ● AtomPub In principle accessible using any programming language
    • OpenCms CMIS implementation9 ● Uses Apache Chemistry ● Libraries for implementing CMIS clients or servers ● Provides servlets for SOAP and AtomPub bindings ● Service methods are implemented as Java methods ● Servlets provide access to repositories configured in opencms-importexport.xml ● Offline repository: read/write access to the Offline project ● Online repository: read-only access to the Online project
    • OpenCms CMIS implementation10 ● All basic CMIS file operations (create, update, delete, etc.) are supported ● Folder navigation is supported ● The CMIS root folder always corresponds to the OpenCms root folder ● OpenCms user accounts are used for all CMIS operations All changes through CMIS are made in the context of the authenticated user
    • OpenCms CMIS implementation11 ● Files and folders have types cmis:document, cmis:folder ● Standard resource attributes (Last modification date, etc.) are represented as standard CMIS properties ● cmis:objectId cmis:name cmis:creationDate cmis:lastModificationDate cmis:lastModifiedBy cmis:createdBy cmis:path
    • OpenCms CMIS implementation12 ● For each OpenCms property, there are two CMIS properties, e.g. for the template property: ● opencms:template only contains the value directly set on the resource itself ● opencms-inherited:template contains the property value that is active for the resource, i.e. it may be inherited from a parent folder ● The resource type can be read from the property opencms-special:resource-type
    • OpenCms CMIS implementation13 ● Relations in OpenCms correspond directly to CMIS relationships ● One type for every OpenCms relation type, e.g. opencms:XML_WEAK ● Only relations not defined through XML content are modifiable
    • Live Demo: Fetching resources from OpenCms14 Demo Demo ● Live Demo デモ Demo Demo
    • Fetching resources from OpenCms15 ● Demo program implemented using Apache Chemistry ● The main part: Session session = getSession(); Folder origin = (Folder)session.getObjectByPath(cmisPath); for (CmisObject child : origin.getChildren()) { //… if (child instanceof Folder) { //… } else if (child instanceof Document) { Document document = (Document)child; InputStream input = document.getContentStream().getStream(); writeStreamToFile(input, rfsFile); } }
    • Limitations16 ● CMIS has no concept of locking Resources are implicitly locked/unlocked for each operation ● The CMIS permission concept does not translate well to the OpenCms permission concept ● No negative permissions (deny) ● CMIS defines „allowable actions“ for a document and the current user You have to read the „allowable actions“ if you want to check if you can perform an action
    • Limitations17 ● No support for multifiling (putting files in multiple folders) ● Almost like OpenCms siblings, but this doesn‘t work, since siblings can have different properties ● Versioning not supported ● Offline changes are not versioned, historic versions are only created on publishing ● No support for search using the CMIS query language
    • Search18 ● Solr queries can be used instead of the CMIS query language ● This requires a Solr Index to be configured for the repository ● Queries support all parameters supported by the OpenCms Solr integration ● E.g. „fq=type:v8flower “
    • Live Demo: Searching with CMIS19 Demo Demo ● Live Demo デモ Demo Demo
    • Searching through CMIS using Solr20 Session session = getSession(); for (QueryResult result : session.query(query, false)) { String idString = (String)(result.getPropertyValueById("cmis:objectId")); ObjectId id = new ObjectIdImpl(idString); CmisObject resultObject = session.getObject(id); if (resultObject instanceof Document) { Document resultDoc = (Document)resultObject; //… writeStreamToFile(resultDoc.getContentStream().getStream() , new File(filename)); } }
    • Any Questions?21 Questions ? ● Any Questions? Fragen? 質問 ¿Preguntas? Questiones?
    • 22 Thank you very much for your attention! Georg Westenberger Michael Emmerich Alkacon Software GmbH