OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

cmis-browser message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [cmis-browser] JSON Schema


Hi,

Here are a few more details about the OpenCMIS implementation and a topic we might want to discuss on the next call.

First of all, the browser binding code will now be build on the Apache build servers. An up-to-date, ready-to-use WAR can be downloaded from here:
https://hudson.apache.org/hudson/view/Chemistry/job/Chemistry%20-%20OpenCMIS%20-%20Browser%20Binding%20-%20install/lastSuccessfulBuild/org.apache.chemistry.opencmis$chemistry-opencmis-binding-browser/


In order to implement it, I had to make a few decision. One of them was how the URLs should work and look like.

We said that we want to identify an object either by path or by object id. Then we have to tell the repository what we want to do with it. The only available HTTP verbs are GET and POST.
There are a few ways to achieve that. After playing with a few ideas and running into several issues, I ended up with a Flickr style API:
The path or object id identifies the object and a "method" parameter tells the repository what to do with the object. If the "method" parameter is missing the default method for a document is getContentStream, the default method for a folder is getChildren, and the default method for a relationship or policy is getObject.

The URL pattern look like this:

Access by path:
http://<host>/<context>/<repositoryId>/<path>?method=<method>

Example:
http://myhost/cmis/myRepository/path/to/an/object?method=getObject


Access by object id:
http://<host>/<context>/<repositoryId>?objectId=<id>&method=<method>

Example:
http://myhost/cmis/myRepository?objectId=123&method=getObject 


It's not a RESTful way to do it, but it simple to use from JavaScript in a browser.
Any comments?



Regards,

Florian


On 07/10/2010 12:08, Florian Müller wrote:
> Hi,
> 
> When you look for "JSON Schema", you eventually end up here: http://json-schema.org/
> Unfortunately, it is very verbose, hard to read and lacks a few things we need for the browser binding (see below).
> 
> There is a more lightweight alternative called Orderly: http://orderly-json.org/
> Orderly is a subset of JSON Schema which is actually readable and (I think) usable for a specification.
> 
> Since it is a subset of JSON Schema, it also lacks a few things that we need for our purpose:
> - It only uses the JSON data types. That's not surprising since it is a general purpose description.
>    But I think we need the CMIS data types in the specification. We should be able to express if we mean a string, an id, a URI, or a HTML fragment, regardless of that they are all mapped to a JSON string on the wire.
> - There is no way to describe a map like structure. We need that at least for the properties.
> 
> 
> So I played with Orderly a bit, assumed that the CMIS data types were available and introduced the missing map concept (see below).
> I followed the CMIS XML schema and not the current browser binding draft. I'm not proposing that, it was just an exercise to learn Orderly.
> 
> 
> WDYT?
> 
> 
> Regards,
> 
> Florian
> 
> 
> 
> 
> Object: http://docs.oasis-open.org/ns/cmis/browser/200908/object
> 
> object {
>      ref "http://docs.oasis-open.org/ns/cmis/browser/200908/properties";          properties;
>      ref "http://docs.oasis-open.org/ns/cmis/browser/200908/allowableActions";    allowableActions?;
>      array { ref "http://docs.oasis-open.org/ns/cmis/browser/200908/object"; }    relationships?;
>      ref "http://docs.oasis-open.org/ns/cmis/browser/200908/changeEvent";         changeEvent?;
>      ref "http://docs.oasis-open.org/ns/cmis/browser/200908/acl";                 acl?;
>      array { ref "http://docs.oasis-open.org/ns/cmis/browser/200908/rendition"; } renditions?;
>      array { ref "http://docs.oasis-open.org/ns/cmis/browser/200908/policyId"; }  policyIds?;
> }*;
> 
> 
> 
> Properties: http://docs.oasis-open.org/ns/cmis/browser/200908/properties
> 
> map { id, union {
>                id;
>                string;
>                boolean;
>                decimal;
>                integer;
>                datetime;
>                uri;
>                html;
>                array { id };
>                array { string };
>                array { boolean };
>                array { decimal };
>                array { integer };
>                array { datetime };
>                array { uri };
>                array { html };
>                null;
>            }
> };
> 
> 
> 
> AllowableActions: http://docs.oasis-open.org/ns/cmis/browser/200908/allowableActions
> 
> object {
>      boolean canCreateDocument?;
>      ...todo...
> }*;
> 
> 
> 
> ChangeEvent: http://docs.oasis-open.org/ns/cmis/browser/200908/changeEvent
> 
> object {
>      ...todo...
> }*;
> 
> 
> 
> ACL: http://docs.oasis-open.org/ns/cmis/browser/200908/acl
> 
> object {
>      array { ref "http://docs.oasis-open.org/ns/cmis/browser/200908/ace"; } aces;
>      boolean isExact?;
> }*;
> 
> 
> 
> ACE: http://docs.oasis-open.org/ns/cmis/browser/200908/ace
> 
> object {
>      object {
>          string principalId;
>      }* principal;
>      array { string } permissions;
>      boolean isDirect;
> }*;
> 
> 
> 
> Renditions: http://docs.oasis-open.org/ns/cmis/browser/200908/rendition
> 
> object {
>      string streamId;
>      string mimeType;
>      integer length;
>      string kind;
>      string title;
>      integer height?;
>      integer width?;
>      string renditionDocumentId;
> }*;
> 
> 
> 
> Policy Ids: http://docs.oasis-open.org/ns/cmis/browser/200908/policyId
> 
> object {
>      array { string } ids;
> }*;
> 
> 
> 
> Object in folder: http://docs.oasis-open.org/ns/cmis/browser/200908/objectInFolder
> 
> object {
>      ref "http://docs.oasis-open.org/ns/cmis/browser/200908/object"; object;
>      string pathSegment;
> }*;
> 
> 
> 
> Folder list: http://docs.oasis-open.org/ns/cmis/browser/200908/objectInFolderList
> 
> object {
>      array { ref "http://docs.oasis-open.org/ns/cmis/browser/200908/objectInFolder"; } objects;
>      boolean hasMoreItems?;
>      integer numItems?;
> }*;
> 
> 
> 
> Type Definition: http://docs.oasis-open.org/ns/cmis/browser/200908/typeDefinition
> 
> object {
>      string id;
>      string localName;
>      string localNamespace;
>      string displayName;
>      string queryName;
>      string description;
>      string [ "cmis:document", "cmis:folder", "cmis:relationship", "cmis:policy" ] baseTypeId;
>      string parentTypeId?;
>      boolean creatable;
>      boolean fileable;
>      boolean queryable;
>      boolean fulltextIndexed;
>      boolean includedInSupertypeQuery;
>      boolean controllablePolicy;
>      boolean controllableAcl;
>      array { ref "http://docs.oasis-open.org/ns/cmis/browser/200908/propertyDefinition"; } propertyDefinitions;
> }*;
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this mail list, you must leave the OASIS TC that
> generates this mail.  Follow this link to all your TCs in OASIS at:
> https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
> 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]