4

If I get it, Apache Sling acts a REST CRUD interface for a Jackrabbit JCR repository.

As there already exists a RESTful protocol (CMIS in its AtomPub implementation) to work with JCR repositories, apart from the view/templating layer, is there any advantage in using Apache Sling vs CMIS (ie. via Apache Chemistry) ?

Is there anything that can be done using JCR (Sling) that CMIS does not support ?

gpilotino
  • 13,055
  • 9
  • 48
  • 61

1 Answers1

6

A few characteristics of both protocols might help you choosing one to work with.

CMIS

Started as a mean to federate content across different (document) content repositories, its core business is letting diverse content repositories talk to each other over a web interface (REST / WS). While the latest edition of the protocol improved browser operations with content through the JSON based browser binding, CMIS often shows up as a bit of a chatty protocol, not always shining for content delivery.

PROS: standard, supported by a multitude of vendors, supports a slightly richer data model (Renditions, Policies)

CONS: chatty, lots of XML parsing if using the AtomPub or WS bindings, can't create custom service APIs

Sling

I am no expert on this, but as far as I gathered it's a lightweight, extensible HTTP layer on top of JCR. Data processing logic is tied to the content you request via HTTP as Components, giving you the ability to process and eventually optimize content before delivery.

PROS: adds a data processing layer on top of content retrieval, works on plain HTTP without complex payloads to describe each action

CONS: non standard, can't easily swap content repository

skuro
  • 13,414
  • 1
  • 48
  • 67
  • 1
    I agree with skuro, basically if you know you're going to have a JCR repository underneath the Sling HTTP API will give you a more powerful and more direct interface and the choice is easy. CMIS would be good for interoperability, but it doesn't map to JCR as closely as the Sling interface does. – Bertrand Delacretaz Mar 28 '13 at 08:16
  • may you please elaborate more on the differences in mapping ? maybe in an answer so i can upvote =) – gpilotino Mar 28 '13 at 13:29
  • in the meantime i've found this https://svn.apache.org/repos/asf/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/README.txt – gpilotino Mar 28 '13 at 13:34