Cmis Virtual Training Webinar 24 Nov09


Published on

Alfresco’s CMIS Virtual Training introduces the CMIS specification which is currently in public review stage at OASIS. The session is designed to help developers exploit the most complete and first open source CMIS 1.0 implementation.

The session will first provide a broad overview on the CMIS spec domain model, services and bindings, then offer a sample CMIS SQL query webapp built using SpringMVC and the Apache Chemistry Atompub TCK on the client side, while leveraging the Alfresco CMIS 1.0 compliant ReST binding as reference server implement

Published in: Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Cmis Virtual Training Webinar 24 Nov09

  1. 1. CMIS 1.0 Class Getting Started with CMIS Gabriele Columbro Solution Engineer, EMEA 1
  2. 2. Agenda ● Why CMIS? ● CMIS Data Model ● CMIS Intro Demo ● CMIS Services ● CMIS Queries ● CMIS Maven Toolkit ● CMIS Binding and tools ● Q&A
  3. 3. Agenda ● Why CMIS? ● CMIS Data Model ● CMIS Intro Demo ● CMIS Services ● CMIS Queries ● CMIS Maven Toolkit ● CMIS Binding and tools ● Q&A
  4. 4. The Tower of Babel
  5. 5. ECM Content Babel ● Most large organisations have multiple ECM solutions ● No standard across ECM systems ● Proprietary specific APIs ● Proprietary Query interfaces ● Language dependent Java vs .Net … ● One-off integrations ● No reuse ● Expensive to implement, maintain
  6. 6. ECM Trends ● Content centric applications are becoming more common in organizations ● Content Mashups with Internal/External services ● Content as a service ● Platform as a service (cloud) ● Vendors consolidation ● Oracle buys them all! ● Standardization...
  7. 7. What is CMIS? ● “The objective of the CMIS standard is to define a common content management web services interface that can be implemented by content repositories and enable interoperability across repositories.” ● A standard defining APIs to support interoperability with ECM systems ● CMIS defines: ● Model e.g. Types, Relationships ● Standardised Query Language ● Protocol Bindings e.g. REST, Web Services ● Services e.g. Check out/in, versioning CMIS is the SQL for Content Management!!!
  8. 8. Background / History ● Founding members ● Approach ● IBM, Microsoft, EMC ● Standardizing existing ECM implementations ● Contributing members ● Minimizing initial scope ● Alfresco, Open Text, SAP, Oracle (BEA) ● For broad acceptance ● Timeline ● Successful Vendor Interoperability ● Spec as been in development for approx 2 years Workshop ● Contributing Members invited Aug 07 ● All 7 vendors ● Draft Spec Submitted to OASIS 10th Sept ● CMIS Providers and Clients Tested 2008 ● REST and Web Services Protocol Bindings ● Public draft (1.0cd04) on October 23rd Ratified Standard 1.0 on early 2010 Time to learn!
  9. 9. CMIS Use Cases ● In Scope: ● Not In Scope for V1: ● Collaborative Content Creation ● Records Management & Compliance ● Authentication, Checkin/out, Version Control ● Retention schedules, classification, legal holds ● Portals ● Digital Asset Management ● Browsing, properties, indexing, search ● Renditions, streaming ● Mashups ● Web Content Management ● URL addressability, properties ● Templates, staging, preview, deployment . . . ● Content as a Service ● Subscription/Notification Services ● Repository agnostic interface for building ● Event triggers content centric business applications ● Archival Applications ● Properties, indexing and search ● Compound Documents ● Relationships ● Electronic Legal Discovery ● Versioning, properties, indexing, search CMIS is not meant to prescribe, define or expose ALL features provided by proprietary ECM systems
  10. 10. CMIS & Other Standards ● Why not using an existing standard? ● JCR-170/283 ● WebDAV ● Java Only ● No types and properties ● No Query ● Not backed by the majors ● No relationships ● Too prescriptive ● Tied to HTTP •Requires changes to core ECM capabilities to support specific ● Atom Publishing Protocol (APP) features and models ● HTTP and resource specific ● Not service oriented ● Note: CMIS builds on APP conventions •Requires persistent connections •Unsuited to Mashups
  11. 11. Alfresco CMIS Strategy ● Strategic investment on Open Standards ● Full CMIS 1.0cd04 support released ● Up and running at ● Get it at ● Apache Chemistry ● TCK Contribution ● 2 Committers (Dave Caruana, Chief Architect, and the speaker)
  12. 12. Alfresco CMIS Implementation AtomPub Alfresco TCK HEAD is contributed CMIS 0.70 to Apache compliant Chemistry
  13. 13. From a Client’s Perspective CMIS REST Client CMIS WS Client ● Access to the repository is via a URI that acts as an end point ● There will generally be a URI for SOAP Bindings and a different CMIS Web Services URI for REST Bindings CMIS REST Binding Binding ● The specifics around how the client obtains the URI or what the URI should look like is outside of the scope of CMIS Your Favorite CMIS Compliant Repository
  14. 14. CMIS Interoperability CMIS Content Application
  15. 15. CMIS Interoperability
  16. 16. Specification Overview ● Part I - Encapsulates ECM experience ● Defines Domain Model ● Defines Services i.e. interaction with Model ● Common to ECM repositories ● Part II – Map Part I to Protocol Bindings ● SOAP / WSDL •Leverage years of investment in infrastructure/tools •Service-oriented •Content Repository orchestration ● REST •“Web 2.0” stack •Resource-oriented •Content syndication / publishing
  17. 17. Agenda ● Why CMIS? ● CMIS Data Model ● CMIS Intro Demo ● CMIS Services ● CMIS Queries ● CMIS Maven Toolkit ● CMIS Binding and tools ● Q&A
  18. 18. CMIS Domain Model
  19. 19. CMIS Model details ACL Object Property -Type Id -Property Id ACE -Parent -Display Name * -Principal -Display Name -Type -Permissions -Abstract -Required -Direct -Queryable -Default Value -Controllable -… -Fileable Rendition Document Folder Relationship Policy -Kind * -Versionable -Source Types -Mime Type -Allow Content -Target Types Content Stream Custom Type Repository
  20. 20. Repository ● CMIS is defined around the interactions between a client application and a single repository ● A repository is a container of objects and has a set of capabilities that they may support. ● A repository allows clients to discover and navigate repository contents by ● Starting at the root directory and drilling down ● Issuing queries against the repository ● A repository provides ways for clients to manipulate contained objects by ● Offering CRUD functionality for the contained objects ● Offering versioning capabilities for the contained objects ● Allowing relationships between objects ● Allowing application of policies to objects. ● Controlling users access to content.
  21. 21. Repository Capabilities ● Navigation Capabilities ● Versioning Capabilities ● Get Descendants ● PWC Updateable ● Get Folder Tree ● PWC Searchable ● All versions searchable ● Object Capabilities ● Content Stream Update Capabilities ● Query Capabilities ● None ● Basic Query ● PwcOnly • None ● Anytime • Metadata only • Fulltext only ● Change Log • Both Separate ● None • Both Together ● Object ID only ● All ● Join Capabilities ● Renditions • None ● None • Inner Only • Inner and Outer ● Read ● Filing Capabilities ● ACL Capabilities • None ● Multi Filing • Discover ● Un-Filing • Manage ● Version Specific Filing
  22. 22. Objects ● Objects represent the entities in a repository and have a specific type ● All object types are sub classes of one of the following 4 base types ● Document Objects ● Folder Objects ● Policy Objects ● Relationship Objects ● An Object will have a set of Properties that is defined by its type ● Every Object should have an immutable Object ID ● The Object ID is assigned by the repository at its creation ● The Object ID should be permanent (unchanged for the lifespan of the object and never reused). ● An Object may have a URI allowing clients to access it as web resource ● ObjectID and URI syntax are opaque to CMIS
  23. 23. Object Types ● An object type definition identifies the properties in an object and the cardinality of those properties ● Objects are strongly typed ● If a property not specified in an object’s object-type definition is supplied by an application, an exception should be thrown. ● Subtypes inherit all properties of their parent types (if the property is not applicable it must show up as not set) ● No support for aspects or Mixins but it has been discussed ● Alfresco 1.0cd04 uses special Policy objects to map Alfresco aspects CMIS does NOT provide a means for an application to define new object types
  24. 24. More on Object types ● The Object Type Defines which operations can be performed on instances of that type Document Folder Relationship Policy Versionable maybe no no no Fileable maybe yes no maybe Queryable maybe maybe no no Controllable-Policy maybe maybe maybe no Controllable-ACL maybe maybe maybe no
  25. 25. Properties ● Properties are named but not explicitly ordered ● Properties can be single or multi valued ● Properties are strongly typed ● Properties are either set or not set ● There is no concept of a null value for a single value property ● There is no concept of an empty set for a multi valued property ● A repository should return properties in a consistent order ● Multi valued properties are represented as an ordered list of values ● The ordering of those values should be preserved by the repository ● The values in the list must be of the same type
  26. 26. Document Objects ● Documents represent the entities that are managed in a repository ● The object type definition defines whether they must, may or must not have a Content Stream ● A document may be associated with zero or more renditions ● Each version of a document is a separate object and will have a separate object ID ● ID is opaque to CMIS ● Documents can be filed in zero, one or more folder objects ● Unfiling ● Multifiling ● Content stream ● A content stream is a binary stream with a mimetype ● A content stream exists only as part of a containing document object.
  27. 27. Renditions ● A document object may have one or more renditions ● Renditions are alternate views of the Content Stream such as previews, PDF renditions and thumbnails ● It is also possible to have a thumbnail rendition object without content streams (i.e. folders) ● Renditions attributes include ● Stream ID ● MimeType ● Length – optional ● Title – optional ● Kind – optional (CMIS defines the thumbnail kind) ● Height and Width (should be set if kind == cmis:thumbnail) ● RenditionDocumentId – if present, allows the rendition to be queried as if it were a document
  28. 28. Folder Objects ● Folders are not Multi-filable ● Document object can still appear as multifiled ● The multi-filed folder would need to have an alternate identity for each location in which it was multifiled ● Deletes of a multifiled folder may have side effects ● Folder Objects do not have a content stream and are not versionable ● Key Folder properties: ● cmis:allowedChildObjectTypeIds limits regarding types of objects that can be filed in it ● cmis:path filesystem like starting from CMIS root
  29. 29. Relationship Objects ● Assigns a non-invasive two way relationship between two objects (source and target) ● Manipulating the relationships should not effect any changes to either the source or target objects. ● Not supported by all repositories ● Not queryable nor fileable ● Relationships are discovered by looking at the objects that they are related to ● Cannot have a content stream and not versionable
  30. 30. Policy Objects ● Administrative Policies are Repository Specific and optional ● Not controllable ● Not versionable ● May be fileable ● Has no content Stream ● The description of the policy is included in the base type and is opaque to CMIS (CMIS does not model the behavior of Policies) ● N-N object-policy relationship ● A single Policy Object can be applied to multiple “controllable” objects ● A single “controllable” object can have multiple policy objects applied to it ● In Alfresco CMIS a special policy is used for querying on aspects
  31. 31. Access Control ● Access control is used to specify who can do what with an object in the repository (additive rather than restrictive) ● An ACL (Access Control List) is a list of zero or more ACEs ● An ACE (Access Control Entry) contains the following ● Principle – (the who) a Group, User or Role ● List of Permissions (one or more) ● Flag indicating whether or not the permission is applied directly or derived. ● Basic CMIS Permissions include (custom permissions allowed): ● cmis:read ● cmis:write ● cmis:all ● A CMIS repository can have one of the following ACL Capabilities ● None, Discover, Manage
  32. 32. Allowable Actions and Permission Mapping ● Object instances in a CMIS repo have a set of allowable actions depending on ● Permissions that a user has on the object ● Lifecycle state of document ● CMIS repository must provide a mapping between each allowable action and the permissions implied by that allowable action
  33. 33. Agenda ● Why CMIS? ● CMIS Data Model ● CMIS Intro Demo ● CMIS Services ● CMIS Queries ● CMIS Maven Toolkit ● CMIS Binding and tools ● Q&A
  34. 34. CMIS Intro demo ● Quick tour of the Alfresco CMIS 1.0cd04 Repository
  35. 35. Agenda ● Why CMIS? ● CMIS Data Model ● CMIS Intro Demo ● CMIS Services ● CMIS Queries ● CMIS Maven Demo ● CMIS Binding and tools ● Q&A
  36. 36. CMIS Services ● CMIS services provide methods that allow a client to: ● Browse the repository ● Inspect Object within the repository ● Act upon the objects in the repository ● Methods provided are split up into 9 distinct services ● Repository - Browse ● Navigation - Browse ● Discovery - Browse ● Object - Inspect/Act ● Versioning - Inspect/Act ● Relationship - Inspect ● Multi-filing - Act ● Policy - Inspect/Act ● ACL - Inspect/Act
  37. 37. Common Service Elements ● Paging of Results Allows most methods that return a collection of objects to have those objects returned in pages. ● The paging allows for the specification of the max items to return and the number of items to skip. ● The results must include an whether or not there are more results and should indicate the total number of object in the result set. ● The repository may page results even if paging was not specified in the request. ● Change Tokens ● CMIS provides for the ability to use a Change Log Token for optimistic locking. If the repository populates this property then it must be provided as an input parameter for all update operations. ● An update conflict exception will be thrown if the values do not match. ● ACLs ● Any operations that involve ACLs may take an optional macro cmis:user
  38. 38. More on services ● Multi repository support ● Except for getRepositories repositoryId is always passed as an input parameter ● Optional property filters can be used to: ● specify the subset of properties that will be returned for each object ● return Object renditions (see CMIS spec) ● Optional input parameters can be used to return: ● Relationships an object is participating in [none, source, target, both] ● Policies that are applied to the object [Boolean flag] ● Objects ACLs [Boolean flag] ● Object Allowable Actions [Boolean flag]
  39. 39. Methods Used For Browsing The Repository ● Repository Services ● getRepositories – get a list of repositories that can be accessed from this service endpoint. ● getRepositoryInfo – get information about the specified repository ● getTypeChildren, getTypeDescendants – various ways to discover the object types in a repository ● getTypeDefinition – get the definition (list of properties) of the specified type. ● Navigation Services ● getFolderTree, getDescendants, getChildren – retrieve descendant objects (each one has slightly different nuances). ● getFolderParent, getObjectParents – retrieve parent folder(s). ● getCheckedoutDocs – retrieve list of checked out documents. ● Discovery Services ● query – execute a CMIS query ● getContentChanges – gets a list of changes to the repository uses change log token
  40. 40. Methods Used to Inspect Objects ● Object Services ● getObject, getObjectByPath – retrieve objects ● getProperties, getAllowableActions, getRenditions – get information about objects ● getContentStream– get content streams ● Versioning Services ● getPropertiesOfLatestVersion, getObjectOfLatestVersion – get information about latest version of object ● getAllVersions – retrieve version history. ● Relationship Services ● getObjectRelationships– get all of the relationships that an object is a part of ● Policy Services ● getAppliedPolicies– get all of the policies applied to an object ● ACL Services ● getACL– get the permissions associated with an object
  41. 41. Methods Used to Act Upon Objects ● Object Services ● createRelationship, createDocument, createDocumentFromSource, createPolicy, createFolder – create objects ● updateProperties, moveObject – update objects ● deleteObject, deleteTree – remove objects ● getContentStream, deleteContentStream – update content streams ● Versioning Services ● checkOut, checkIn, cancelCheckOut – control locking/unlocking of an object for the purpose of updating ● deleteAllVersions – remove version history. ● Milti-Filing Services ● addObjectToFolder, removeObjectFromFolder – file and unfile objects. ● Policy Services ● applyPolicy, removePolicy – apply and remove policies to/from an object ● ACL Services ● applyACL– set the permissions associated with an object
  42. 42. Agenda ● Why CMIS? ● CMIS Data Model ● CMIS Intro Demo ● CMIS Services ● CMIS Queries ● CMIS Maven Toolkit ● CMIS Binding and tools ● Q&A
  43. 43. CMIS Query
  44. 44. CMIS Query ● Spec allows client applications to issue SQL queries against the repository to search / retrieve objects ● The relational view of a repository exposes a virtual table for each queryable object type in a repository ● A virtual column is specified for each property defined in the object type definition and any property defined in any ancestor type but not defined in the object type definition ● The value for any property defined in an ancestor type but not in the object type must have the SQL NULL value ● An Object types queryName is the name of the associated virtual table ● A Property’s queryName is the name of the virtual column that represents that Property. CMIS Queries can’t be used to update the repository So no INSERT or UPDATE statements plz ☺
  45. 45. Anatomy of a CMIS Query SELECT ObjectId, SCORE() AS Relevance, Destination, DepartureDates /* The SELECT is required and specifies which Virtual Columns (or Properties) will be included in the results */ FROM TravelBrochure /* The FROM Clause is required and Specifies which Virtual Tables (Or Object Types) the query will run against */ WHERE CONTAINS(‘CARIBBEAN CENTRAL AMERICA CRUISE TOUR’) AND ‘2010-1-1’ < ANY DepartureDates /* The WHERE clause is optional and specifies which constraints the rows returned must satisfy */ ORDER BY Relevance DESC /* The ORDER BY clause is optional and specifies the order in which the rows must be returned
  46. 46. SELECT, FROM and JOIN Clauses ● A SELECT Clause must contain one of the following ● A comma separated list of one or more column names (the repository must include all specified columns in its results) ● A “*” token (the repository must include columns for all single valued properties and should return all multi-valued properties ● The FROM clause must only include queryNames of queryable Object Types ● CMIS Repositories must indicate their level of support using the capability-join attribute ● Allowed levels of support are [none, inneronly, innerandouter]
  47. 47. WHERE Clause Comparisons ● String Values [NOT] IN, =, <>, [NOT] LIKE ● Numeric Values (Decimal, Integer and DateTime) [NOT] IN, =, <>, <, >, >=, <= ● Booleans = ● ID [NOT] IN, =, <> ● URI [NOT] IN, =, <>, [NOT] LIKE
  48. 48. WHERE Clause Predicate and Predicate Functions ● ANY predicate ● WHERE “RED” = ANY COLOR ● WHERE ANY COLOR IN (“RED”,”WHITE”,”BLUE”) ● CONTAINS([Qualifier],<full text search>) Function Result of full text search (returns boolean). ● Can only be anded with other predicates in the WHERE clause. ● Can only occur once in the query. ● If more than one virtual table is included in the query, the qualifier must specify the table whose content is being searched. ● SCORE() Returns the relevance value of the search (0-1). ● Can only be used in conjunction with CONTAINS. ● Can only occur in the SELECT Clause ● Can be aliased in the SELECT Clause ● If not aliased a default alias of SEARCH_SCORE can be used ● Aliased name can be used in ORDER BY clause
  49. 49. Predicate Functions ● IN_FOLDER([qualifier],<folderID>) Checks to see if the target object is in the specified folder ● If more than one virtual table is included in the query, the qualifier must specify the table whose content is being searched. ● IN_TREE([qualifier],<folderID>) Checks to see if the target object is in the specified folder or one of its sub folders ● If more than one virtual table is included in the query, the qualifier must specify the table whose content is being searched.
  50. 50. Example Queries ● SELECT * FROM cmis:document ● SELECT cmis:Name FROM cmis:folder ● SELECT cmis:Name FROM cmis:document WHERE IN_TREE(‘rootNodeId’) ● SELECT cmis:ObjectId, cmis:ObjectTypeId, cmis:Name FROM cmis:folder ● Nothing special...It’s just the good old SQL!
  51. 51. Agenda ● Why CMIS? ● CMIS Data Model ● CMIS Intro Demo ● CMIS Services ● CMIS Queries ● CMIS Maven Toolkit ● CMIS Binding and tools ● Q&A
  52. 52. CMIS Query Demo CMIS Maven toolkit Available as ready to install Maven archetype Based on CMIS 1.0cd04 Working against More details at: 52
  53. 53. CMIS Query demo Alfresco CMIS instance Remote 80 HTTP / AtomPub Local 8081 cmis-query-webapp HTTP Browser 53
  54. 54. Agenda ● Why CMIS? ● CMIS Data Model ● CMIS Intro Demo ● CMIS Services ● CMIS Queries ● CMIS Maven Toolkit ● CMIS Binding and tools ● Q&A
  55. 55. CMIS Bindings ● CMIS Provides for REST and SOAP bindings ● Binding specifics: ● Each Binding has a URL entry point ● Authentication ● Service access and interaction ● Alfresco also provides a CMIS home page for human consumption ● CMIS HomePage: http://localhost:8080/alfresco/service/cmis ● REST: http://localhost:8080/alfresco/service/api/repository ● SOAP: http://localhost:8080/alfresco/cmis
  56. 56. CMIS Binding Comparison CMIS REST Client CMIS WS Client Binding specific logic CMIS REST API CMIS Web Services Common mapping layer Web Scripts CMIS to Repository Apache Abdera Model and Services CXF Apache CMIS Mapping Extension Alfresco Repository
  57. 57. CMIS SOAP Binding ● WSDL definition… ● XML schema for CMIS Domain Model ● XML schema for Service messages ● Direct exposure of CMIS (Part I) Services ● Generate client API for almost all languages ● WS-Security & Username Token Profile (MUST) ● WS-I Basic Profile & Basic Security Profile ● MTOM* content transfers *SOAP Message Transmission Optimization Mechanism
  58. 58. SOAP Binding WSDL
  59. 59. CMIS REST Binding ● ATOM Publishing Protocol ● ATOM syndication format for web feeds (GET) ● Create & update web resources (POST, PUT, DELETE) ● Extension mechanism supported ● CMIS APP extension ● XML Schema for CMIS Domain Model ● New Web Resources / Method mappings ● Errors are mapped to HTTP Error codes and body of the response should contain descriptive information ● Service URL is the starting point (as WSDL for WS) ● Single point of contact for starting a stateless conversation ● As per APP, together with a set of objects, it also returns a set of URLs usable by the client for the next interaction
  60. 60. Atom Publishing Protocol to CMIS Service Document AtomPub CMIS Atom Feed Atom Entry Additional Atom Feeds
  61. 61. AtomPub ServiceDocument
  62. 62. Alfresco CMIS bindings CMIS REST Client CMIS WS Client CMIS REST API CMIS Web Services Web Scripts Apache Abdera Apache CXF CMIS Extension Alfresco Repository
  63. 63. CMIS Client Tooling ● WebServices: ● Generate a client from the WSDL and you’re set! ● AtomPub: ● Apache Chemistry ● Maven AtomPub TCK contributed by Alfresco ● Client APIs still WIP ● CMIS FileshareBrowser (Integrated in Alfresco) ● CMIS Explorer ( ● Flex CMIS Client ( ● CMIS Maven Toolkit (
  64. 64. CMIS typical Use Cases ● R2R ● Repository to Repository ● A2R ● Application to Repository ● CEVA ● Content Enabled Vertical Applications ● Federated Repositories ● Commoditized access to the CLOUD!
  65. 65. CMIS based integrations
  66. 66. Now it’s your turn!
  67. 67. Next Steps ● Alfresco wiki page on CMIS ● ● Take part in the CMIS Survey ● ● Download specification ● ● Try out CMIS 1.0cd04 Implementation on Alfresco Labs 3.2r2 ● ● ECM Architect practical CMIS 1.0 Tutorial ● ● CMIS Sample Maven Toolkit ●
  68. 68. Any doubt? Questions... ...and answers ☺ 68
  69. 69. Thanks! ● OASIS CMIS standard ● ● CMIS Quick Reference Card blog posts ● ● Apache Chemistry ● ● CMIS on Wikipedia ● ● Discuss, propose, contribute! ● ●