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.
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
OpenCms Days 2012 - OpenCms 8.5: Accessing the VFS repository using CMIS
1. Workshop track
Accessing the VFS repository
using CMIS
Georg Westenberger and Michael Emmerich,
25.09.2012
Alkacon Software
2. Agenda
2
● 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
3. 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
4. Previous standards
4
● WebDAV
● Already supported by OpenCms
● JCR (Content Repository API for Java)
● Complex
● Java-centric
5. Purpose of CMIS
5
● 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
7. CMIS Data Model
7
● 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.
8. Service bindings
8
● Protocols for accessing CMIS repositories:
● SOAP
● AtomPub
In principle accessible using any programming
language
9. OpenCms CMIS implementation
9
● 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
10. OpenCms CMIS implementation
10
● 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
11. OpenCms CMIS implementation
11
● 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
12. OpenCms CMIS implementation
12
● 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
13. OpenCms CMIS implementation
13
● 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
14. Live Demo: Fetching resources from OpenCms
14
Demo Demo
● Live Demo
デモ
Demo
Demo
15. Fetching resources from OpenCms
15
● 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);
}
}
16. Limitations
16
● 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
17. Limitations
17
● 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
18. Search
18
● 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 “