SlideShare a Scribd company logo
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?

More Related Content

Similar to 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
 

Similar to JahiaOne - Jahia7 New REST API (20)

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
 
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 ...
 
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
 

More from Jahia Solutions Group

More from 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
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 

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/