getting started with cmis

28
Getting Started with CMIS January 2012 Jeff Potts Chief Community Officer Apache Chemistry cmislib lead

Upload: jeff-potts

Post on 08-May-2015

13.012 views

Category:

Technology


9 download

DESCRIPTION

A brief introduction to the CMIS spec and some tips and tricks for developers new to CMIS. Demos showed how to install and use cmislib, the Python API for CMIS, and OpenCMIS, the Java API. Both projects are part of Apache Chemistry. Originally given as part of an Alfresco webinar. Recording: http://blogs.alfresco.com/wp/webcasts/2012/01/getting-started-with-cmis-2/

TRANSCRIPT

Page 1: Getting Started with CMIS

Getting Started with CMISJanuary 2012

Jeff PottsChief Community OfficerApache Chemistry cmislib lead

Page 2: Getting Started with CMIS

Agenda

• What is CMIS?– Brief description– Quick overview of the domain model

• First steps using Apache Chemistry– Demos using cmislib (Python) and OpenCMIS

(Java)– Demo using OpenCMIS Workbench & the

Groovy Console

• Tips & Tricks for New CMIS Developers• Where to learn more

Page 3: Getting Started with CMIS
Page 4: Getting Started with CMIS

What is CMIS?

• Vendor independent API for working with content repositories

• Specification managed by OASIS– Domain model– Protocol bindings• Web Services Binding• ATOM Pub Binding• Browser (JSON) Binding (Coming in 1.1)

– CMIS Query Language

Page 5: Getting Started with CMIS

The Beauty of CMIS

?

Presentation Tier

Content Services Tier

?Enterprise Apps Tier

REST SOAP

Page 6: Getting Started with CMIS

Client

Content Repository

Services

Domain Model

read write

Con

sum

er

Pro

vid

er

Vendor Mapping

ContentManagementInteroperabilityServices

CMIS lets you read, search, write, update, delete, version, control, … content and metadata!

Meet CMIS

Page 7: Getting Started with CMIS

Implementations Already Available…

Pro

vid

ers

Consu

mers

Developed by 30+ ECM Vendors

Page 8: Getting Started with CMIS

Client

Content Repository

Content Repository

Content Repository

Client

Content RepositoryContent

RepositoryContent Repository

• Workflow & BPM• Archival• Virtual Documents• DAM / WCM

• Collaborative Content Creation• Portals• Client Application Integration• Mashup

Use Cases

Page 9: Getting Started with CMIS

Document• Content• Renditions• Version History

Folder• Container• Hierarchy• Filing

Relationship• Source Object• Target Object

Policy• Target Object

Described byType Definitions

Types

Page 10: Getting Started with CMIS

*

Custom Type

Object• Type Id• Parent• Display Name• Queryable• Controllable

Document• Versionable• Allow Content

Folder Relationship• Source Types• Target Types

Policy

Property• Property Id• Display Name• Type• Required• Default Value• …

Type Definitions

Page 11: Getting Started with CMIS
Page 12: Getting Started with CMIS

• Open Source implementations of CMIS

• Apache Chemistry is the umbrella project for all CMIS related projects within the ASF– OpenCMIS (Java, client and server)– cmislib (Python, client)– phpclient (PHP, client)– DotCMIS (.NET, client)

Page 13: Getting Started with CMIS

• Apache Chemistry started as an incubator project in May 2009– Graduated to a top level project in

February 2011.

• Backed by Adobe, Alfresco, Nuxeo, OpenText, and SAP

• OpenCMIS is a de-facto reference for CMIS and is also used by the CMIS TC to test new CMIS 1.1 features

Page 14: Getting Started with CMIS

FIRST STEPS WITH CMIS

Real-world coding examples

Page 15: Getting Started with CMIS

Notes on my setup

• Alfresco 4.0.c Community• SomeCo content model (See ecmarchitect.com

)• Mac OS X, Tomcat, MySQL, Eclipse• Java

– OpenCMIS 0.6*– Alfresco OpenCMIS extension 0.2*– JDK 1.6.0_29

• Python– cmislib 0.5– Python 2.6/2.7

* Distributed with Alfresco 4 SDK

Page 16: Getting Started with CMIS

DEMO

Installing and Using cmislibUse easy_install to install cmislib. Docs available here.

:10

Page 17: Getting Started with CMIS

DEMOUsing OpenCMIS to create, query, relate, & deleteThe code comes from the ecmarchitect.com custom content types tutorial, available here. Apache Chemistry OpenCMIS lives here.

:10

Page 18: Getting Started with CMIS

DEMO

Using the Groovy Console in the OpenCMIS Workbench

:05

Page 19: Getting Started with CMIS

TIPS & TRICKS

A few tidbits for the developer new to CMIS

Page 20: Getting Started with CMIS

Prefix cannot be null or empty• You may see this error when using

the Alfresco OpenCMIS extension• It is due to a dependency problem• If you are using Maven, see this issue

.• If you are setting an explicit

classpath, refer to the CMIS classpath set in the Ant build file in the content types tutorial

Page 21: Getting Started with CMIS

Using Alfresco CMIS extension with OpenCMIS Workbench

• You must do this if you want to set properties defined in an aspect

• Copy alfresco-opencmis-extension-0.2.jar to workbench/lib

• Set the following on “Expert” tab:org.apache.chemistry.opencmis.objectfactory.classname=org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl

• Click “Load Repositories” before leaving the expert tab

Page 22: Getting Started with CMIS

In Alfresco 4 the CMIS URLs have changed

• In Alfresco 4, OpenCMIS is now the CMIS implementation– Use

http://localhost:8080/alfresco/cmisatom instead of http://localhost:8080/alfresco/s/cmis

– Consider the CMIS web scripts to be deprecated

– You may see different results b/w the two URLs

Page 23: Getting Started with CMIS

CMIS in server-side JavaScript*var cmisConnection = cmis.getConnection();var cmisSession = cmisConnection.getSession();folder = cmisSession.getRootFolder();print("Children of: " + folder.name + "(" + folder.id + ")");

var iter = folder.getChildren().iterator();while (iter.hasNext()) { print(iter.next().name);}

*Broken in 4.0.c Community

Page 24: Getting Started with CMIS

Experimental JSON binding in Alfresco 4

• Alfresco 4 includes an experimental implementation of the new browser binding

• http://localhost:8080/alfresco/cmisbrowserhttp://localhost:8080/alfresco/cmisbrowser

http://localhost:8080/alfresco/cmisbrowser/{repo id}/roothttp://localhost:8080/alfresco/cmisbrowser/{repo id}/root?includeAllowableActions=true&skipCount=0&maxItemshttp://localhost:8080/alfresco/cmisbrowser/{repo id}/root/cmis-demohttp://localhost:8080/alfresco/cmisbrowser/{repo id}/root/cmis demo?selector=childrenhttp://localhost:8080/alfresco/cmisbrowser/{repo id}/root/cmis demo?selector=object

Page 25: Getting Started with CMIS

Working with permissions

• ACLs are lists of ACEs• In Alfresco, group identifiers start

with ”GROUP_”• You cannot break inheritance through

CMIS, but you can determine whether an ACE is inherited or “direct”

Page 26: Getting Started with CMIS

WHERE TO LEARN MORE

Page 27: Getting Started with CMIS

CMIS Resources

• cmis.alfresco.com includes a public CMIS server and links to CMIS resources

• Read the CMIS specification• Apache Chemistry site has clients, lightweight

server, documentation• Alfresco Extension for OpenCMIS allows you to

work with aspect-defined properties• “Getting Started with CMIS” tutorial shows how

to use cURL to hit ATOM Pub binding directly• Slideshare has some CMIS related presentations

from DevCon here and here

Page 28: Getting Started with CMIS

[email protected]@jeffpotts01 (Twitter & all chat services)http://ecmarchitect.com