JahiaOne - Jahia7 New REST API

33 %
67 %
Information about JahiaOne - Jahia7 New REST API
Technology

Published on February 18, 2014

Author: Jahia

Source: slideshare.net

Description

This session will look at the philosophy and implementation of the new REST API. In particular, we will address why we felt a new implementation was interesting, what is and how to use a RESTful API and will look at how the new API makes integrating and extending Jahia an even simpler task than before.

Jahia Digital Factory New RESTful API Christophe Laprun / @metacosm Jahia Solutions Group SA

REST?     REpresentational State Transfer Architectural style defined by R. Fielding Underlies the modern web Resources identified via URIs are manipulated via representations using a unified interface  Stateless  HATEOAS (Hypermedia As The Engine Of Application State)

RESTful API?  A (web service) API conforming to the REST architecture principles  Manipulation of entities via URIs  Mapping of operations on data over a simple vocabulary of HTTP methods:  GET => read  PUT => create or update  POST => create or complex operations  DELETE => delete

What about the existing RESTful API?     Hybrid approach not completely RESTful Complex Organically grown Implementation intertwined with rendering pipeline

Goals       CRUD (Create Read Update Delete) interface to JCR nodes Module JSON only Optimize for access from JS Decouple from rendering pipeline Implement best practices  Respect HTTP methods semantics  HATEOAS

Resources and URIs  JCR nodes are natural matches for resources  Sub-resources for properties, children, mixins and versions  URIs should be opaque, only interesting URI is entry point  But:  : => __  [] => - -

Opaque URIs?  How do we navigate the API?  Links!  Subset of HAL (JSON Hypertext Application Language)  _links object recording links used to navigate / operate / learn about resources  _links / <rel> / href

Examples  Let’s look at node representations  Updating a node using cURL

Node representation “name" : <the node's unescaped name>, "type" : <the node's node unescaped type name>, "properties" : <properties representation>, "mixins" : <mixins representation>, "children" : <children representation>, "versions" : <versions representation>, "_links" : { "self" : { "href" : “<this node’s URI>" }, "type" : { "href" : "<this node's nodetype URI>" }, "properties" : { "href" : “<URI for this node’s properties>" }, "mixins" : { "href" : "<URI for this node’s mixins>" }, "children" : { "href" : "<URI for this node’s children>" },

Property representation “name" : <the property's unescaped name>, "type" : <the property's JCR property type name>, "multiple" : <whether this property is multivalued>, "value" : <object or array representing the property’s value>, "_links" : { "self" : { "href" : “<this node’s URI>" }, "type" : { "href" : "<this node's nodetype URI>" }, (“target" : { "href" : “<URI of the node being pointed at>" })* } *: if the property is of type PATH, REFERENCE or WEAKREFERENCE

AngularJS demo application  List sessions  Vote for sessions and display current rating  Reset votes  Show node details

Status  Almost there  Scheduled for Digital Factory (April 1st)  Interested in your feedback  What scenarios would you like to see made even easier?  Missing links?  Versioning scheme?  Code currently lives at: https://github.com/metacosm/jcrestapi

References  REST: http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arc h_style.htm  HATEOAS:  Theory: http://roy.gbiv.com/untangled/2008/rest-apismust-be-hypertext-driven  Simpler: http://www.slideshare.net/josdirksen/restfrom-get-to-hateoas  HAL: http://tools.ietf.org/html/draft-kelly-json-hal-06  AngularJS: http://angularjs.org/

Questions?

Add a comment

Related presentations

Related pages

Presentations and videos - Jahia - jahiaone.com

JahiaOne 2014; Presentations and videos; Sessions; ... Query and search API under the hood; Slide : Extending Jahia7 with NoSQL. ... Slide : New REST API ...
Read more

JahiaOne 2014

JahiaOne 2014 JahiaOne 2014 war ... Extending Jahia7 with NoSQL. ... Slide : New REST API by Christophe Laprun: Slide : MVC in Jahia 7 using Spring Web ...
Read more

Jahia 7 Developer Quick Start part 2 - YouTube

Jahia 7 - Developer Quick Start part 1 ... JahiaOne - Jahia 7, enter the Studio, new development ... Création de contenu via l'API REST ...
Read more

Sessions - JahiaOne

JahiaOne 2014. JahiaOne 2014; Presentations and videos; Sessions; Speakers; Developer Contest; ... Sessions Sessions Opening Keynote Presented by Elie ...
Read more

Jahia Experience 2016 Paris

Formerly known as JahiaOne, our user conference gathers enthusiastic crowds! For you to get a hint of what to expect when you attend Jahia Experience ...
Read more

New Rest | LinkedIn

serveuse at NEW REST CAMROUN Past seveuse a NEW REST CAMEROUN at GUININNESS CAMEROUN Education LYCEE DAWAE UNIVERSITE DE YDE1, LYCEE DAWAE See less.
Read more

7 - Développeur Quick Start - Création de contenu via l ...

Cette video explique comment il est possible de créer aisément du contenu dans Jahia sans même utiliser les interfaces du logiciel. Dans le ...
Read more