SlideShare ist ein Scribd-Unternehmen logo
1 von 14
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?

Weitere ähnliche Inhalte

Ähnlich wie JahiaOne - Jahia7 New REST API

Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
kriszyp
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
Shreedhar Ganapathy
 

Ähnlich wie JahiaOne - Jahia7 New REST API (20)

David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
 
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationCdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
 
Spark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RSSpark IT 2011 - Developing RESTful Web services with JAX-RS
Spark IT 2011 - Developing RESTful Web services with JAX-RS
 
Consuming REST services with ActiveResource
Consuming REST services with ActiveResourceConsuming REST services with ActiveResource
Consuming REST services with ActiveResource
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restish
 
Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
 
Andrei shakirin rest_cxf
Andrei shakirin rest_cxfAndrei shakirin rest_cxf
Andrei shakirin rest_cxf
 
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, IntroductionArabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
 
APIs, Web Services, and Mashups: What they are and how they can be used
APIs, Web Services, and Mashups: What they are and how they can be usedAPIs, Web Services, and Mashups: What they are and how they can be used
APIs, Web Services, and Mashups: What they are and how they can be used
 
RESTful Web services using JAX-RS
RESTful Web services using JAX-RSRESTful Web services using JAX-RS
RESTful Web services using JAX-RS
 
Advanced Json
Advanced JsonAdvanced Json
Advanced Json
 
JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011JAX-RS JavaOne Hyderabad, India 2011
JAX-RS JavaOne Hyderabad, India 2011
 
The Glory of Rest
The Glory of RestThe Glory of Rest
The Glory of Rest
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
 
Services Stanford 2012
Services Stanford 2012Services Stanford 2012
Services Stanford 2012
 
Ams adapters
Ams adaptersAms adapters
Ams adapters
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with Java
 
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldEfficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
 
Naver_alternative_to_jpa
Naver_alternative_to_jpaNaver_alternative_to_jpa
Naver_alternative_to_jpa
 
Rest And Rails
Rest And RailsRest And Rails
Rest And Rails
 

Mehr von Jahia Solutions Group

Mehr von Jahia Solutions Group (20)

The Road ahead: What we see as the future of digital. By Elie Auvray
The Road ahead: What we see as the future of digital. By Elie AuvrayThe Road ahead: What we see as the future of digital. By Elie Auvray
The Road ahead: What we see as the future of digital. By Elie Auvray
 
Monitoring and Data-Driven Decision Making with Daniel Maher
Monitoring and Data-Driven Decision Making with Daniel MaherMonitoring and Data-Driven Decision Making with Daniel Maher
Monitoring and Data-Driven Decision Making with Daniel Maher
 
The ultimate search of the perfect customer experience By Brian Solis
The ultimate search of the perfect customer experience By Brian SolisThe ultimate search of the perfect customer experience By Brian Solis
The ultimate search of the perfect customer experience By Brian Solis
 
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
Docker, Kubernetes, Openshift: Jahia on steroids in production with Julian Ma...
 
Data for Dummies by Dan Katz, CDO at Safran
Data for Dummies by Dan Katz, CDO at SafranData for Dummies by Dan Katz, CDO at Safran
Data for Dummies by Dan Katz, CDO at Safran
 
Content and commerce: The perfect combo. By Catherine Barba
Content and commerce: The perfect combo. By Catherine BarbaContent and commerce: The perfect combo. By Catherine Barba
Content and commerce: The perfect combo. By Catherine Barba
 
The power of great customer experience in today’s world. Olivier Mourrieras &...
The power of great customer experience in today’s world. Olivier Mourrieras &...The power of great customer experience in today’s world. Olivier Mourrieras &...
The power of great customer experience in today’s world. Olivier Mourrieras &...
 
Making Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
Making Digital simpler. Occam’s Razor, Horses, Zebras, and EvolutionMaking Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
Making Digital simpler. Occam’s Razor, Horses, Zebras, and Evolution
 
Elasticsearch powered EDP by Cedric Mailleux
Elasticsearch powered EDP by Cedric MailleuxElasticsearch powered EDP by Cedric Mailleux
Elasticsearch powered EDP by Cedric Mailleux
 
Jahia Cloud Offerings by Julian Maurel & Abass Safoutou
Jahia Cloud Offerings by Julian Maurel & Abass SafoutouJahia Cloud Offerings by Julian Maurel & Abass Safoutou
Jahia Cloud Offerings by Julian Maurel & Abass Safoutou
 
Learn how to go headless with Jahia DX by Serge Huber
Learn how to go headless with Jahia DX by Serge HuberLearn how to go headless with Jahia DX by Serge Huber
Learn how to go headless with Jahia DX by Serge Huber
 
Making the life of patients easier in the healthcare sector thanks to digital...
Making the life of patients easier in the healthcare sector thanks to digital...Making the life of patients easier in the healthcare sector thanks to digital...
Making the life of patients easier in the healthcare sector thanks to digital...
 
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
Impletementing Analytics - Stop talking, Start doing! by Ben Salmon, We are C...
 
Strategy for content with local and global sites by Romain Gauthier
Strategy for content with local and global sites by Romain GauthierStrategy for content with local and global sites by Romain Gauthier
Strategy for content with local and global sites by Romain Gauthier
 
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO JahiaApache Unomi presentation and update. By Serge Huber, CTO Jahia
Apache Unomi presentation and update. By Serge Huber, CTO Jahia
 
Personalisation and Headless in a business context by Lars Petersen
Personalisation and Headless in a business context by Lars PetersenPersonalisation and Headless in a business context by Lars Petersen
Personalisation and Headless in a business context by Lars Petersen
 
Digital Revolution from Silo to Platform by Gilles Babinet
Digital Revolution from Silo to Platform by Gilles BabinetDigital Revolution from Silo to Platform by Gilles Babinet
Digital Revolution from Silo to Platform by Gilles Babinet
 
A customer journey with AI by Xavier Vaccari, Softeam Group
A customer journey with AI by Xavier Vaccari, Softeam GroupA customer journey with AI by Xavier Vaccari, Softeam Group
A customer journey with AI by Xavier Vaccari, Softeam Group
 
Using CX to unlock Total Experience by David Balko, Tribal
Using CX to unlock Total Experience by David Balko, TribalUsing CX to unlock Total Experience by David Balko, Tribal
Using CX to unlock Total Experience by David Balko, Tribal
 
AI-monitor & Marketing Factory, customer case study by Valerie Voci
AI-monitor & Marketing Factory, customer case study by Valerie VociAI-monitor & Marketing Factory, customer case study by Valerie Voci
AI-monitor & Marketing Factory, customer case study by Valerie Voci
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

JahiaOne - Jahia7 New REST API

  • 1. Jahia Digital Factory New RESTful API Christophe Laprun / @metacosm Jahia Solutions Group SA
  • 2. 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)
  • 3. 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
  • 4. What about the existing RESTful API?     Hybrid approach not completely RESTful Complex Organically grown Implementation intertwined with rendering pipeline
  • 5. 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
  • 6. 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:  : => __  [] => - -
  • 7. 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
  • 8. Examples  Let’s look at node representations  Updating a node using cURL
  • 9. 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>" },
  • 10. 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
  • 11. AngularJS demo application  List sessions  Vote for sessions and display current rating  Reset votes  Show node details
  • 12. 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
  • 13. 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/