CMIS - CMIS SQL Search Tutorial - ENG

95
Today, let’s talk about CMIS-SQL

Transcript of CMIS - CMIS SQL Search Tutorial - ENG

Page 1: CMIS - CMIS SQL Search Tutorial - ENG

Today, let’s talk about CMIS-SQL

Page 2: CMIS - CMIS SQL Search Tutorial - ENG

Eh Mister!! Before starting.. Who is CMIS ?

Page 3: CMIS - CMIS SQL Search Tutorial - ENG

That’s right, let’s share the story of CMIS

Page 4: CMIS - CMIS SQL Search Tutorial - ENG

Everyone was living Everyone was living in their own world…in their own world…

Page 5: CMIS - CMIS SQL Search Tutorial - ENG

Until the day when the Until the day when the encounter became encounter became

unescapable…unescapable…

$$

Page 6: CMIS - CMIS SQL Search Tutorial - ENG

Because Because each of them each of them wanted to wanted to go higher go higher than the than the others.others.

Page 7: CMIS - CMIS SQL Search Tutorial - ENG

A few deaths later…A few deaths later…

Page 8: CMIS - CMIS SQL Search Tutorial - ENG

They realized they couldn’t They realized they couldn’t go in so many different go in so many different

directions anymoredirections anymore

Page 9: CMIS - CMIS SQL Search Tutorial - ENG

They shared aThey shared asimilar objectivesimilar objective

InteroperabilityInteroperability

ContentContent

Page 10: CMIS - CMIS SQL Search Tutorial - ENG

So instead of fighting, So instead of fighting, They gathered their They gathered their

strengths…strengths…

Page 11: CMIS - CMIS SQL Search Tutorial - ENG

To keep going To keep going further on…further on…

Page 12: CMIS - CMIS SQL Search Tutorial - ENG

And to shareAnd to shareinformation!information!

Page 13: CMIS - CMIS SQL Search Tutorial - ENG

To resume …

Page 14: CMIS - CMIS SQL Search Tutorial - ENG

CMIS stands for Content Management Interoperability Services (CMIS).

Page 15: CMIS - CMIS SQL Search Tutorial - ENG

Actually it’s a draft specification submitted by leading ECM vendors to OASIS (the Organization for the Advancement of Structured Information Standards) with the aim of becoming an ECM industry standard.

Page 16: CMIS - CMIS SQL Search Tutorial - ENG

Officially…

Page 17: CMIS - CMIS SQL Search Tutorial - ENG

CMIS defines a domain model and set of bindings, such as Web Service and REST/Atom that can be used by applications to work with one or more Content Management repositories.

Page 18: CMIS - CMIS SQL Search Tutorial - ENG

Visually, it looks like that…

Page 19: CMIS - CMIS SQL Search Tutorial - ENG
Page 20: CMIS - CMIS SQL Search Tutorial - ENG

Ok ! Could you explain the different part of CMIS ?

Page 21: CMIS - CMIS SQL Search Tutorial - ENG

Ok… Let’s try a comparison…

Page 22: CMIS - CMIS SQL Search Tutorial - ENG

Do you know how goods travel ?

Page 23: CMIS - CMIS SQL Search Tutorial - ENG

http://www.flickr.com/photos/anniemole/313981428/

Indeed, goods enjoy great trip !

Page 24: CMIS - CMIS SQL Search Tutorial - ENG

Most of them, travel by…

http://www.flickr.com/photos/mescon/3714341746/

Page 25: CMIS - CMIS SQL Search Tutorial - ENG

Trucks…

http://www.flickr.com/photos/87913776@N00/422603859/

Page 26: CMIS - CMIS SQL Search Tutorial - ENG

Ships…

http://www.flickr.com/photos/danramarch/2875308394/

Page 27: CMIS - CMIS SQL Search Tutorial - ENG

Or Trains…

http://www.flickr.com/photos/pfly/199823544/

Page 28: CMIS - CMIS SQL Search Tutorial - ENG

What’s the common point ?

Page 29: CMIS - CMIS SQL Search Tutorial - ENG

CONTAINERS !

http://www.flickr.com/photos/nelsoncruz/431244400/

Page 30: CMIS - CMIS SQL Search Tutorial - ENG

It’s standardized…

http://www.flickr.com/photos/ppdigital/2327889692/

Page 31: CMIS - CMIS SQL Search Tutorial - ENG

It’s interoperable…

http://www.flickr.com/photos/marelles/852012838/

Page 32: CMIS - CMIS SQL Search Tutorial - ENG

That’s why, it increase exchange !

http://www.flickr.com/photos/bcnbits/2859509269/

Page 33: CMIS - CMIS SQL Search Tutorial - ENG

And CMIS ?

Page 34: CMIS - CMIS SQL Search Tutorial - ENG

1. CMIS is THE container for document management

Page 35: CMIS - CMIS SQL Search Tutorial - ENG

It standardizes a unique

domain/data model http://www.flickr.com/photos/circulating/2533948028/

Page 36: CMIS - CMIS SQL Search Tutorial - ENG

2. CMIS is a means of transport

http://www.flickr.com/photos/grumbler/448401254/

Page 37: CMIS - CMIS SQL Search Tutorial - ENG

By WebServices

http://www.flickr.com/photos/adam_knight/356512207/

Page 38: CMIS - CMIS SQL Search Tutorial - ENG

By REST/ATOM http://www.flickr.com/photos/theolaphoto/2325540194/

Page 39: CMIS - CMIS SQL Search Tutorial - ENG

3. CMIS provides services

http://www.flickr.com/photos/ejouvenaux/2886232980/

Page 40: CMIS - CMIS SQL Search Tutorial - ENG

Document Management

http://www.flickr.com/photos/misterdna/49841409/

Page 41: CMIS - CMIS SQL Search Tutorial - ENG

CMIS SQL search

http://www.flickr.com/photos/chrisjohnbeckett/514914659/

Page 42: CMIS - CMIS SQL Search Tutorial - ENG

That’s why, CMIS increase exchange !

http://www.flickr.com/photos/bcnbits/2859509269/

Page 43: CMIS - CMIS SQL Search Tutorial - ENG

All right folks ? Can we go back to CMIS-SQL ?

Page 44: CMIS - CMIS SQL Search Tutorial - ENG

Ok! Let’s explain CMIS-SQL !

Page 45: CMIS - CMIS SQL Search Tutorial - ENG

So what’s CMIS-SQL…

Page 46: CMIS - CMIS SQL Search Tutorial - ENG

CMIS-SQL ?• CMIS provides a type-based query service for

discovering objects that match specified criteria, by defining a read-only projection of the CMIS data model into a Relational View.

• Through this relational view, queries may be performed via a simplified SQL SELECT statement. This query language, called CMIS SQL, is based on a subset of the SQL-92 grammar, with a few extensions to enhance its filtering capability for the CMIS data model, such as existential quantification for multi-valued property, full-text search, and folder membership. Other statements of the SQL language are not adopted by CMIS.

• The semantics of CMIS SQL is defined by the SQL-92 standard, plus the extensions, in conjunction with the model mapping defined by CMIS’s relational view

• Source: Oasis CMIS Part 1 – Domain Model v0.61c

Page 47: CMIS - CMIS SQL Search Tutorial - ENG
Page 48: CMIS - CMIS SQL Search Tutorial - ENG

OK… Demo time!

Page 49: CMIS - CMIS SQL Search Tutorial - ENG

A bit of theory

Page 50: CMIS - CMIS SQL Search Tutorial - ENG

CMIS enables to query on…

Page 51: CMIS - CMIS SQL Search Tutorial - ENG

CMIS enables to query on…

CMIS DOMAIN CMIS DOMAIN MODELMODEL

Page 52: CMIS - CMIS SQL Search Tutorial - ENG
Page 53: CMIS - CMIS SQL Search Tutorial - ENG

Syntax

Page 54: CMIS - CMIS SQL Search Tutorial - ENG

Simple query

• SELECT [columns]

• FROM [Virtual Table Names]

• WHERE [conditions]

• ORDER BY [sort specification]

Page 55: CMIS - CMIS SQL Search Tutorial - ENG

SELECT [columns]• This clause identifies

the set of columns that will be included in the query results for each row.

Page 56: CMIS - CMIS SQL Search Tutorial - ENG

FROM [Virtual Table Names]• This clause identifies

which Virtual Table(s) the query will run against.

Page 57: CMIS - CMIS SQL Search Tutorial - ENG

WHERE [conditions]• This clause identifies

the constraints that rows SHALL satisfy to be considered a result for the query.

Page 58: CMIS - CMIS SQL Search Tutorial - ENG

ORDER BY [sort specification]• This clause identifies

the order in which the result rows SHALL be sorted in the result row set.

Page 59: CMIS - CMIS SQL Search Tutorial - ENG

PredicateFunctions

Page 60: CMIS - CMIS SQL Search Tutorial - ENG

CONTAINS() • This is a predicate function

that encapsulates the full-text search capability that MAY be provided by a Repository

• The predicate returns a Boolean value.

Page 61: CMIS - CMIS SQL Search Tutorial - ENG

SCORE() • This is a predicate function

that encapsulates the full-text search capability that MAY be provided by a Repository

• The SCORE() predicate function returns a decimal value in the interval [0,1]

Page 62: CMIS - CMIS SQL Search Tutorial - ENG

IN_FOLDER() • This is a predicate function

that tests whether or not a candidate object is a child-object of the folder object identified by the given <folder id>.

• The predicate returns a Boolean value.

Page 63: CMIS - CMIS SQL Search Tutorial - ENG

IN_TREE() • This is a predicate function

that tests whether or not a candidate object is a descendant-object of the folder object identified by the given <folder id>.

• The predicate returns a Boolean value.

Page 64: CMIS - CMIS SQL Search Tutorial - ENG

Operator

Page 65: CMIS - CMIS SQL Search Tutorial - ENG

AND To add a criteria

OR To add a choice between several

criterias

NOT To exclude a criteria

Logical operators

Page 66: CMIS - CMIS SQL Search Tutorial - ENG

LIKE allows you to use wildcards in a WHERE clause

IS [NOT] NULL Check if an expression is NULL.

[NOT] IN allows you to specify multiple values in a WHERE clause.

Predicate

Page 67: CMIS - CMIS SQL Search Tutorial - ENG

Now how to make simple queries with CMIS-SQL ?

Page 68: CMIS - CMIS SQL Search Tutorial - ENG

CMIS-SQL : My Recipe

Page 69: CMIS - CMIS SQL Search Tutorial - ENG

Install a content Repository

http://www.flickr.com/photos/piston9/2497672447/

http://www.flickr.com/photos/piston9/2497672447/

Page 70: CMIS - CMIS SQL Search Tutorial - ENG

Alfresco 3.x Community (for me)

I’m always here !

Page 71: CMIS - CMIS SQL Search Tutorial - ENG

Add an independent CMIS client like Shane Johnson's

Flex/AIR CMIS Browser

Page 72: CMIS - CMIS SQL Search Tutorial - ENG

Bind them…

http://www.flickr.com/photos/intherough/3253349104/

Page 73: CMIS - CMIS SQL Search Tutorial - ENG

Then create your queries

http://www.flickr.com/photos/sgw/2329607771/

Page 74: CMIS - CMIS SQL Search Tutorial - ENG

And watch results.

http://www.flickr.com/photos/fozzeee/3756133976/

Page 75: CMIS - CMIS SQL Search Tutorial - ENG

Let’s try some samples..

Page 76: CMIS - CMIS SQL Search Tutorial - ENG

I want all informations of all folders

SELECT * FROM FOLDER

Page 77: CMIS - CMIS SQL Search Tutorial - ENG

I just want the name of all folders

SELECT F.Name FROM FOLDER AS F

Page 78: CMIS - CMIS SQL Search Tutorial - ENG

I want all informations of « MyFolder »

SELECT F.* FROM FOLDER AS FWHERE F.Name='MyFolder'

Page 79: CMIS - CMIS SQL Search Tutorial - ENG

I want all information of all documents in « MyFolder »

SELECT * FROM DOCUMENT AS D WHERE IN_FOLDER('workspace://SpacesStore/b7008f8b-5352-4e9b-97e7-4374479ee984')

Page 80: CMIS - CMIS SQL Search Tutorial - ENG

I want all information of folders in « MyFolder »

SELECT * FROM FOLDER AS F WHERE IN_FOLDER('workspace://SpacesStore/b7008f8b-5352-4e9b-97e7-4374479ee984')

Page 81: CMIS - CMIS SQL Search Tutorial - ENG

I want ObjectType and Name of « MyDocument.doc »

SELECT D.ObjectTypeId, D.Name FROM document AS D WHERE D.Name=‘MyDocument.doc'

Page 82: CMIS - CMIS SQL Search Tutorial - ENG

I want ObjectType and Name of all document that contains the

word ‘CMIS’SELECT D.ObjectTypeId, D.Name FROM document AS D WHERE CONTAINS(‘CMIS‘)

Page 83: CMIS - CMIS SQL Search Tutorial - ENG

I want the name of all document that contains the word ‘CMIS’ and objectType

is ‘cmis_doc’

SELECT D.ObjectTypeId, D.Name FROM document AS D WHERE CONTAINS(‘CMIS‘)AND D.ObjectTypeId='D/cmis_doc'

Page 84: CMIS - CMIS SQL Search Tutorial - ENG

Voilà! Enough for today!

Page 85: CMIS - CMIS SQL Search Tutorial - ENG

Now it’s your turn!

Page 86: CMIS - CMIS SQL Search Tutorial - ENG

Don’t hesitate to create or use..

CMIS ToolkitsCMIS ClientCMIS Repository

Page 87: CMIS - CMIS SQL Search Tutorial - ENG

Test your combination

Page 88: CMIS - CMIS SQL Search Tutorial - ENG

And make your own !

Page 89: CMIS - CMIS SQL Search Tutorial - ENG

Be the first to enjoy content interoperability!

Page 90: CMIS - CMIS SQL Search Tutorial - ENG

And finally…

Page 91: CMIS - CMIS SQL Search Tutorial - ENG

To discover…

Page 92: CMIS - CMIS SQL Search Tutorial - ENG

To go further on…

Page 93: CMIS - CMIS SQL Search Tutorial - ENG

And to reach our goals…

Page 94: CMIS - CMIS SQL Search Tutorial - ENG

Choose ECM Open Source

Page 95: CMIS - CMIS SQL Search Tutorial - ENG

CMIS-SQL

By JM.PASCAL

www.opensourceecm.fr&

www.open-source-ecm.com