Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
REST APIWeb ScriptsSocial ComputingOverview
Back to HTTP API.
NOTE:
This document presents ideas & thoughts for an Alfresco RESTful Web Services API for Content Management.
The content herein does not necessarily reflect current Alfresco product vision or development plan.
History:
27th March 07 - Initial thoughts & ideas
13th June 07 - Reformat and publish to Alfresco WIKI
This document presents ideas & thoughts for an Alfresco RESTful Web Services API for Content Management.
Objectives of this work are to:
We're hosting this document on the Alfresco Wiki to encourage feedback and collaborative development from anyone who may have an interest in Content Management, RESTful approaches in general, or a combination of both. As such, this document is 'living' and changing for the foreseeable future as ideas stabilize, discussion takes place etc. Please note: the content herein does not necessarily reflect current Alfresco product vision or development plan.
Initially, a limited scope of services have been investigated. This is to minimise up-front work to get the ball rolling.
A simple test case has been used to kick-start the research; a federated search & update application which allows a single search across multiple content repositories, with view and update of items returned in search results. Alfresco Web Scripts will be used to enable rapid prototyping of ideas.
The design goals of the HTTP API are:
Although the HTTP API may be used directly by clients, it is also envisioned that a client API will be provided for commonly used languages (e.g. Java/JCR, PHP, Javascript). The definition of the client API is deferred for now. However, it should be noted the same client API could be used for in-process Repository access too.
The API is focused on a set of Alfresco “Resources�?. Resources include repository data such as folders & files, as well as services such as a Search Engine.
Each resource is given a URL – an identifier.
Resource representations have been modeled on Atom & Atom Publishing Protocol (APP). In most cases, collections are represented as an Atom feed, and items are represented as Atom entries. The extension mechanism of Atom is used to support Alfresco specific meta-data.
Resources support methods – the primary ones being GET, PUT, POST & DELETE. Not all methods are supported by all resources. After much deliberation, custom methods outside of the HTTP specification are introduced for some Alfresco capabilities. This is an area we definitely want feedback on.
Interaction patterns for creating, updating and deleting resources have also been borrowed from Atom Publishing Protocol.
Atom may not be the only representation. Via Web Scripts we could also provide alternative representations such as JSON (both on request and response). A transformation could be provided for Atom, JSON and RSS switching.
The constructs described are not unknown – see Google Data API.
Alfresco Resources are represented as one the following entity types (primarily in Atom):
TODO: Mapping between Atom and JSON?
This is an interesting direction. Essentially, this provides a “visual�? api. The URIs remain the same, but the results are rendered in a form for human consumption. Navigation is a case of issuing further API URIs – links within HTML. Forms could be provided for creates and updates. Very useful for learning, testing and debugging the API. Could also become an generic Repository Browser, but with updates, and for all Repository services.
The following custom HTTP methods are provided for performing “advanced�? Resource operations. Actually, WebDAV has similar. Alternative approaches are listed below.
Why?
For those clients or environments which lock down HTTP methods, it is envisioned that they can be tunneled through POST by adding a header such as X-Method-Override. See Web Script Method Tunneling.
TBD
The API exposes the following Resources. An example URI is given to assist visualization of the API, although the syntax is not important (only for easing human understanding / consumption).
Some Resources may be provisioned by both Document Mgt. & WCM stores. The representation of such Resources is consistent across both. Where possible, the supported methods are also consistent, however, some may not be supported, but that should be kept to a minimum. The example URIs are driven by a Document Mgt store. Alternative syntax may be used for WCM.