SlideShare a Scribd company logo
1 of 60
Download to read offline
#REST #ezpublish #symfony #IPC13 #CMS #SOA #UX

A REST Layer on Top
of The World
Nicolas Pastorino | eZ Systems
VP Community & Online Marketing
@jeanvoye | nicolas.pastorino@ez.no
Contents: Courtesy of Damien Pobel
about:eZ
about:eZ
Enterprise Open-source since 1999
Creators of eZ Publish Platform
Global
Business: http://ez.no | Community: http://share.ez.no
about:eZ
Enterprise Open-source since 1999
Creators of eZ Publish Platform
Global
Business: http://ez.no | Community: http://share.ez.no
@eZSystems
http://google.com/+ezsystems
http://linkedin.com/company/16738
https://github.com/ezsystems
about:me
about:me
eZ Publish Community since 2005
Lead Community + Marketing at eZ
Content Management, Open-source, Mountaineering
about:me
eZ Publish Community since 2005
Lead Community + Marketing at eZ
Content Management, Open-source, Mountaineering

@jeanvoye
http://bit.ly/nicolas-on-gplus
http://fr.linkedin.com/in/nicolaspastorino/
https://github.com/nfrp
T

O

D

A

Y
Y

REST

A

eZ Publish

D

REST in eZ Publish

O

DEMO

T

REST for UX
REST

5
REST?

h"p://www.infoq.com/ar4cles/rest-­‐introduc4on
h"p://en.wikipedia.org/wiki/Representa4onal_State_Transfer
REST?
Set of principles that define how Web standards,
such as HTTP and URIs, are supposed to be used.
Give every “thing” an ID
Link things together (“HATEOAS”)
Use standard methods
Resources with multiple representations
Communicate statelessly
h"p://www.infoq.com/ar4cles/rest-­‐introduc4on
h"p://en.wikipedia.org/wiki/Representa4onal_State_Transfer
REST? (ctd)

h"p://www.infoq.com/ar4cles/rest-­‐introduc4on
h"p://en.wikipedia.org/wiki/Representa4onal_State_Transfer
REST? (ctd)
Key goals of REST include:
Scalability of component interactions
Generality of interfaces
Independent deployment of components
Intermediary components to reduce latency,
enforce security and encapsulate legacy systems

h"p://www.infoq.com/ar4cles/rest-­‐introduc4on
h"p://en.wikipedia.org/wiki/Representa4onal_State_Transfer
HTTP 1.1 Request - Anatomy
HTTP 1.1 Request - Anatomy
• HTTP verb / method : GET,POST,PUT,DELETE,
TRACE,OPTIONS,HEAD, ...
HTTP 1.1 Request - Anatomy
• HTTP verb / method : GET,POST,PUT,DELETE,
TRACE,OPTIONS,HEAD, ...

• ... or a custom verb: PATCH,COPY, ...
HTTP 1.1 Request - Anatomy
• HTTP verb / method : GET,POST,PUT,DELETE,
TRACE,OPTIONS,HEAD, ...

• ... or a custom verb: PATCH,COPY, ...
• Set of headers
HTTP 1.1 Request - Anatomy
• HTTP verb / method : GET,POST,PUT,DELETE,
TRACE,OPTIONS,HEAD, ...

• ... or a custom verb: PATCH,COPY, ...
• Set of headers
• A body in POST,PUT or custom verb requests
HTTP 1.1 Response - Anatomy
HTTP 1.1 Response - Anatomy
• Status code (by @stevelosh)
HTTP 1.1 Response - Anatomy
• Status code (by @stevelosh)
• 1XX: hold on
HTTP 1.1 Response - Anatomy
• Status code (by @stevelosh)
• 1XX: hold on
• 2XX: here you go
HTTP 1.1 Response - Anatomy
• Status code (by @stevelosh)
• 1XX: hold on
• 2XX: here you go
• 3XX: go away
HTTP 1.1 Response - Anatomy
• Status code (by @stevelosh)
• 1XX: hold on
• 2XX: here you go
• 3XX: go away
• 4XX: you f * * * * d up
HTTP 1.1 Response - Anatomy
• Status code (by @stevelosh)
• 1XX: hold on
• 2XX: here you go
• 3XX: go away
• 4XX: you f * * * * d up
• 5XX: I f * * * * d up
HTTP 1.1 Response - Anatomy
• Status code (by @stevelosh)
• 1XX: hold on
• 2XX: here you go
• 3XX: go away
• 4XX: you f * * * * d up
• 5XX: I f * * * * d up
• Set of headers
HTTP 1.1 Response - Anatomy
• Status code (by @stevelosh)
• 1XX: hold on
• 2XX: here you go
• 3XX: go away
• 4XX: you f * * * * d up
• 5XX: I f * * * * d up
• Set of headers
• A body depending on the response
eZ Publish

10
Standard
Symfony2 App.
(=app)
Standard
Symfony2 App.
(=app)

+

eZ Publish
bundles
(PHP & REST APIs
+ Legacy)

vendor/
ezsystems/
ezpublish-kernel
Standard
Symfony2 App.
(=app)

+

eZ Publish
bundles
(PHP & REST APIs
+ Legacy)

vendor/
ezsystems/
ezpublish-kernel

+

Full-blown
Back-office
THIS is eZ Publish 5
Standard
Symfony2 App.
(=app)

+

eZ Publish
bundles
(PHP & REST APIs
+ Legacy)

vendor/
ezsystems/
ezpublish-kernel

+

Full-blown
Back-office
REST in eZ Publish

12
REST API in eZ Publish

4.x
REST API in eZ Publish

• eZ Publish 4.x has a REST API
• Prefix /ezp/api/v1/
• Read only
• Very limited scope / incomplete

4.x
REST API in eZ Publish

5.x
REST API in eZ Publish

5.x
REST API in eZ Publish
•
•
•

Read / Write

•
•
•
•

5.x

Support Basic Auth and Session Auth

Prefix /ezp/api/v2/
Allows to handle almost everything in the repository
(Content, Location, Types, ...)
XML or JSON support in input and output
Hypermedia as the Engine of Application State (HATEOAS)
Specifications: http://j.mp/ezpublish-rest-spec
A REST Layer on top of
a world of Content
A REST Layer on top of
a world of Content
A REST Layer on top of
a world of Content

o/
DEMO

16
Demo Synopsis
•
•
•

Navigate to http://cp2013.9.loc/ then to http://cp2013.9.loc/Blog
Add Blog post from http://cp2013.9.loc/ezdemo_site_admin/Blog (Content: http://phpconference.com/2013/en/sessions/rest-layer-top-world )
REST: Request REST Root:

•
•
•

Explain all parameters, then run.

REST: Show children of Content root

•
•

chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/1

chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/2

REST: Show Location/Content/ContentInfo for one child (“Blog”)

•
•
•
•

chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/3

chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/5

REST: Show children of one child (“Blog”)

•
•
•
•

chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/4
Edit Content, then reload.

Show children: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/8
Delete the previously created blog post: curl -u "admin:publish" -X DELETE http://cp2013.9.loc/api/ezp/v2/content/objects/<objectId>
Refresh children list: Show children: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/8

REST: Create an Image object

•
•

Show ContentType (ContentClass) in back-office: http://cp2013.9.loc/ezdemo_site_admin/class/view/27
Create image from command line

•
•

$> cdipc13

•
•

Publish object: curl -u "admin:publish" -X PUBLISH http://cp2013.9.loc/api/ezp/v2/content/objects/<object Id>/versions/1

$> curl -u "admin:publish" -i -H "Accept: application/json" -H "Content-Type: application/vnd.ez.api.ContentCreate+json" -X POST -d
@createimage.json http://cp2013.9.loc/api/ezp/v2/content/objects
Show image in the back-office: http://cp2013.9.loc/ezdemo_site_admin/eZ-Systems-logo-created-with-the-REST-API
REST for UX

18
REST API for more than
service-to-service: UX example
REST API for more than
service-to-service: UX example
• API REST as provider for ajax calls - data
• Initial page load (JS code, generating an
interface) - then Ajax+REST for navigation, data
retrieval,

• Total separation of functional UX and data
retrieval + back-end business logic.
REST API for more than
service-to-service: UX example
REST API for more than
service-to-service: UX example
• Tools
• JS lib, REST client: https://github.com/
ezsystems/ez-js-rest-client

• Reproduction of the public PHP API: exposing
services

• Relying on HATEOS, but simplifying usage of it
REST API for more than
service-to-service: UX example
REST API for more than
service-to-service: UX example
• Why?
• Easy to discover the REST API structure from a client
• BC support: no URL hard-coding, painless clientside, all existing projects relying on the API need not
be modified,

• Simplifies cache management (HTTP): easy to know
exactly which resource is to be expired after a
change in content repository.
Demo Synopsis
•
•
•
•

Navigate to http://cp2013.9.loc/summercamp/rest-test
Open Console > Network > Filter with “XHR” only
Reload page, and clear console
Click on “Details” for “Blog”

•

Inspect request in console:

•
•
•
•

show URL

In “Preview” subtab: show response, focus on “Content.Section”
--> Show next request (back to “Headers” subtab): Section

•
•
•
•

show”Accept” header value,

show”Accept” header value,
show URL
In “Preview” subtab: show response, focus on “Section.name”

--> Show next request (back to “Headers” subtab): Owner
Wrap-up

24
T

O

D

A

Y
Y

REST

A

eZ Publish

D

REST in eZ Publish

O

DEMO

T

REST for UX
Slides available soon at
http://slideshare.net/jeanvoye

@jeanvoye
http://bit.ly/nicolas-on-gplus
http://fr.linkedin.com/in/nicolaspastorino/
https://github.com/nfrp

eZ Publish Community http://share.ez.no
eZ Publish 5 Community Project
http://share.ez.no/download
https://github.com/ezsystems/ezpublish-community
eZ Systems & eZ Publish Platform Enterprise Edition
http://ez.no

More Related Content

Similar to A REST Layer on Top of the World - IPC13 Munich

JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPressTaylor Lovett
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainKen Collins
 
Using eZ Platform in an API Era
Using eZ Platform in an API EraUsing eZ Platform in an API Era
Using eZ Platform in an API EraeZ Systems
 
Atmosphere 2014: Let's build a solid base for a scale. - Krzysztof Debski
Atmosphere 2014: Let's build a solid base for a scale. - Krzysztof DebskiAtmosphere 2014: Let's build a solid base for a scale. - Krzysztof Debski
Atmosphere 2014: Let's build a solid base for a scale. - Krzysztof DebskiPROIDEA
 
Designing a beautiful REST json api
Designing a beautiful REST json apiDesigning a beautiful REST json api
Designing a beautiful REST json api0x07de
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swaggerTony Tam
 
Beyond 'Set it and Forget it': Proactively managing your EZproxy server
Beyond 'Set it and Forget it': Proactively managing your EZproxy serverBeyond 'Set it and Forget it': Proactively managing your EZproxy server
Beyond 'Set it and Forget it': Proactively managing your EZproxy serverNASIG
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariJoseph Scott
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPressTaylor Lovett
 
AtmosphereConf - Let's build a solid base for a scale
AtmosphereConf - Let's build a solid base for a scaleAtmosphereConf - Let's build a solid base for a scale
AtmosphereConf - Let's build a solid base for a scaleKrzysztof Debski
 
05 integrate redis
05 integrate redis05 integrate redis
05 integrate redisErhwen Kuo
 
Kubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherKubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherEdward Wilde
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformSébastien Morel
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side SwiftChad Moone
 
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0Martijn Dashorst
 
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)Balazs Bucsay
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsDerek Anderson
 

Similar to A REST Layer on Top of the World - IPC13 Munich (20)

JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
Using eZ Platform in an API Era
Using eZ Platform in an API EraUsing eZ Platform in an API Era
Using eZ Platform in an API Era
 
Atmosphere 2014: Let's build a solid base for a scale. - Krzysztof Debski
Atmosphere 2014: Let's build a solid base for a scale. - Krzysztof DebskiAtmosphere 2014: Let's build a solid base for a scale. - Krzysztof Debski
Atmosphere 2014: Let's build a solid base for a scale. - Krzysztof Debski
 
Designing a beautiful REST json api
Designing a beautiful REST json apiDesigning a beautiful REST json api
Designing a beautiful REST json api
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 
Beyond 'Set it and Forget it': Proactively managing your EZproxy server
Beyond 'Set it and Forget it': Proactively managing your EZproxy serverBeyond 'Set it and Forget it': Proactively managing your EZproxy server
Beyond 'Set it and Forget it': Proactively managing your EZproxy server
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
AtmosphereConf - Let's build a solid base for a scale
AtmosphereConf - Let's build a solid base for a scaleAtmosphereConf - Let's build a solid base for a scale
AtmosphereConf - Let's build a solid base for a scale
 
Mastering composer
Mastering composerMastering composer
Mastering composer
 
UCLA HACKU'11
UCLA HACKU'11UCLA HACKU'11
UCLA HACKU'11
 
05 integrate redis
05 integrate redis05 integrate redis
05 integrate redis
 
NullMQ @ PDX
NullMQ @ PDXNullMQ @ PDX
NullMQ @ PDX
 
Kubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherKubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely together
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ Platform
 
Server Side Swift
Server Side SwiftServer Side Swift
Server Side Swift
 
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
HTMX: Web 1.0 with the benefits of Web 2.0 without the grift of Web 3.0
 
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCats
 

More from Nicolas Pastorino

Symfony et eZ Publish: embarquement immédiat - talk at Symfony Live Paris
Symfony et eZ Publish: embarquement immédiat - talk at Symfony Live ParisSymfony et eZ Publish: embarquement immédiat - talk at Symfony Live Paris
Symfony et eZ Publish: embarquement immédiat - talk at Symfony Live ParisNicolas Pastorino
 
Nicolas Pastorino - Distribution de contenu scalable, le multicanal avec REST...
Nicolas Pastorino - Distribution de contenu scalable, le multicanal avec REST...Nicolas Pastorino - Distribution de contenu scalable, le multicanal avec REST...
Nicolas Pastorino - Distribution de contenu scalable, le multicanal avec REST...Nicolas Pastorino
 
Nicolas Pastorino - The Open-source roar in the eZ Community
Nicolas Pastorino - The Open-source roar in the eZ CommunityNicolas Pastorino - The Open-source roar in the eZ Community
Nicolas Pastorino - The Open-source roar in the eZ CommunityNicolas Pastorino
 
Nicolas Pastorino - REST + recommendation, consume the right content, anywher...
Nicolas Pastorino - REST + recommendation, consume the right content, anywher...Nicolas Pastorino - REST + recommendation, consume the right content, anywher...
Nicolas Pastorino - REST + recommendation, consume the right content, anywher...Nicolas Pastorino
 
Nicolas Pastorino - eZ Community - Innovation and Open-source inside
Nicolas Pastorino - eZ Community - Innovation and Open-source insideNicolas Pastorino - eZ Community - Innovation and Open-source inside
Nicolas Pastorino - eZ Community - Innovation and Open-source insideNicolas Pastorino
 
IPCse11 Nicolas Pastorino Launching content in mobility with REST and eZ Publish
IPCse11 Nicolas Pastorino Launching content in mobility with REST and eZ PublishIPCse11 Nicolas Pastorino Launching content in mobility with REST and eZ Publish
IPCse11 Nicolas Pastorino Launching content in mobility with REST and eZ PublishNicolas Pastorino
 
Nicolas Pastorino - Launching Content in mobility with REST and eZ Publish
Nicolas Pastorino - Launching Content in mobility with REST and eZ PublishNicolas Pastorino - Launching Content in mobility with REST and eZ Publish
Nicolas Pastorino - Launching Content in mobility with REST and eZ PublishNicolas Pastorino
 
Nicolas Pastorino - Launching content in mobility with REST & eZ Publish
Nicolas Pastorino - Launching content in mobility with REST & eZ PublishNicolas Pastorino - Launching content in mobility with REST & eZ Publish
Nicolas Pastorino - Launching content in mobility with REST & eZ PublishNicolas Pastorino
 

More from Nicolas Pastorino (8)

Symfony et eZ Publish: embarquement immédiat - talk at Symfony Live Paris
Symfony et eZ Publish: embarquement immédiat - talk at Symfony Live ParisSymfony et eZ Publish: embarquement immédiat - talk at Symfony Live Paris
Symfony et eZ Publish: embarquement immédiat - talk at Symfony Live Paris
 
Nicolas Pastorino - Distribution de contenu scalable, le multicanal avec REST...
Nicolas Pastorino - Distribution de contenu scalable, le multicanal avec REST...Nicolas Pastorino - Distribution de contenu scalable, le multicanal avec REST...
Nicolas Pastorino - Distribution de contenu scalable, le multicanal avec REST...
 
Nicolas Pastorino - The Open-source roar in the eZ Community
Nicolas Pastorino - The Open-source roar in the eZ CommunityNicolas Pastorino - The Open-source roar in the eZ Community
Nicolas Pastorino - The Open-source roar in the eZ Community
 
Nicolas Pastorino - REST + recommendation, consume the right content, anywher...
Nicolas Pastorino - REST + recommendation, consume the right content, anywher...Nicolas Pastorino - REST + recommendation, consume the right content, anywher...
Nicolas Pastorino - REST + recommendation, consume the right content, anywher...
 
Nicolas Pastorino - eZ Community - Innovation and Open-source inside
Nicolas Pastorino - eZ Community - Innovation and Open-source insideNicolas Pastorino - eZ Community - Innovation and Open-source inside
Nicolas Pastorino - eZ Community - Innovation and Open-source inside
 
IPCse11 Nicolas Pastorino Launching content in mobility with REST and eZ Publish
IPCse11 Nicolas Pastorino Launching content in mobility with REST and eZ PublishIPCse11 Nicolas Pastorino Launching content in mobility with REST and eZ Publish
IPCse11 Nicolas Pastorino Launching content in mobility with REST and eZ Publish
 
Nicolas Pastorino - Launching Content in mobility with REST and eZ Publish
Nicolas Pastorino - Launching Content in mobility with REST and eZ PublishNicolas Pastorino - Launching Content in mobility with REST and eZ Publish
Nicolas Pastorino - Launching Content in mobility with REST and eZ Publish
 
Nicolas Pastorino - Launching content in mobility with REST & eZ Publish
Nicolas Pastorino - Launching content in mobility with REST & eZ PublishNicolas Pastorino - Launching content in mobility with REST & eZ Publish
Nicolas Pastorino - Launching content in mobility with REST & eZ Publish
 

Recently uploaded

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 Nanonetsnaman860154
 
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.pdfUK Journal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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 WorkerThousandEyes
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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 MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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 organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Recently uploaded (20)

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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

A REST Layer on Top of the World - IPC13 Munich

  • 1. #REST #ezpublish #symfony #IPC13 #CMS #SOA #UX A REST Layer on Top of The World Nicolas Pastorino | eZ Systems VP Community & Online Marketing @jeanvoye | nicolas.pastorino@ez.no Contents: Courtesy of Damien Pobel
  • 3. about:eZ Enterprise Open-source since 1999 Creators of eZ Publish Platform Global Business: http://ez.no | Community: http://share.ez.no
  • 4. about:eZ Enterprise Open-source since 1999 Creators of eZ Publish Platform Global Business: http://ez.no | Community: http://share.ez.no @eZSystems http://google.com/+ezsystems http://linkedin.com/company/16738 https://github.com/ezsystems
  • 6. about:me eZ Publish Community since 2005 Lead Community + Marketing at eZ Content Management, Open-source, Mountaineering
  • 7. about:me eZ Publish Community since 2005 Lead Community + Marketing at eZ Content Management, Open-source, Mountaineering @jeanvoye http://bit.ly/nicolas-on-gplus http://fr.linkedin.com/in/nicolaspastorino/ https://github.com/nfrp
  • 9. Y REST A eZ Publish D REST in eZ Publish O DEMO T REST for UX
  • 12. REST? Set of principles that define how Web standards, such as HTTP and URIs, are supposed to be used. Give every “thing” an ID Link things together (“HATEOAS”) Use standard methods Resources with multiple representations Communicate statelessly h"p://www.infoq.com/ar4cles/rest-­‐introduc4on h"p://en.wikipedia.org/wiki/Representa4onal_State_Transfer
  • 14. REST? (ctd) Key goals of REST include: Scalability of component interactions Generality of interfaces Independent deployment of components Intermediary components to reduce latency, enforce security and encapsulate legacy systems h"p://www.infoq.com/ar4cles/rest-­‐introduc4on h"p://en.wikipedia.org/wiki/Representa4onal_State_Transfer
  • 15. HTTP 1.1 Request - Anatomy
  • 16. HTTP 1.1 Request - Anatomy • HTTP verb / method : GET,POST,PUT,DELETE, TRACE,OPTIONS,HEAD, ...
  • 17. HTTP 1.1 Request - Anatomy • HTTP verb / method : GET,POST,PUT,DELETE, TRACE,OPTIONS,HEAD, ... • ... or a custom verb: PATCH,COPY, ...
  • 18. HTTP 1.1 Request - Anatomy • HTTP verb / method : GET,POST,PUT,DELETE, TRACE,OPTIONS,HEAD, ... • ... or a custom verb: PATCH,COPY, ... • Set of headers
  • 19. HTTP 1.1 Request - Anatomy • HTTP verb / method : GET,POST,PUT,DELETE, TRACE,OPTIONS,HEAD, ... • ... or a custom verb: PATCH,COPY, ... • Set of headers • A body in POST,PUT or custom verb requests
  • 20. HTTP 1.1 Response - Anatomy
  • 21. HTTP 1.1 Response - Anatomy • Status code (by @stevelosh)
  • 22. HTTP 1.1 Response - Anatomy • Status code (by @stevelosh) • 1XX: hold on
  • 23. HTTP 1.1 Response - Anatomy • Status code (by @stevelosh) • 1XX: hold on • 2XX: here you go
  • 24. HTTP 1.1 Response - Anatomy • Status code (by @stevelosh) • 1XX: hold on • 2XX: here you go • 3XX: go away
  • 25. HTTP 1.1 Response - Anatomy • Status code (by @stevelosh) • 1XX: hold on • 2XX: here you go • 3XX: go away • 4XX: you f * * * * d up
  • 26. HTTP 1.1 Response - Anatomy • Status code (by @stevelosh) • 1XX: hold on • 2XX: here you go • 3XX: go away • 4XX: you f * * * * d up • 5XX: I f * * * * d up
  • 27. HTTP 1.1 Response - Anatomy • Status code (by @stevelosh) • 1XX: hold on • 2XX: here you go • 3XX: go away • 4XX: you f * * * * d up • 5XX: I f * * * * d up • Set of headers
  • 28. HTTP 1.1 Response - Anatomy • Status code (by @stevelosh) • 1XX: hold on • 2XX: here you go • 3XX: go away • 4XX: you f * * * * d up • 5XX: I f * * * * d up • Set of headers • A body depending on the response
  • 31. Standard Symfony2 App. (=app) + eZ Publish bundles (PHP & REST APIs + Legacy) vendor/ ezsystems/ ezpublish-kernel
  • 32. Standard Symfony2 App. (=app) + eZ Publish bundles (PHP & REST APIs + Legacy) vendor/ ezsystems/ ezpublish-kernel + Full-blown Back-office
  • 33. THIS is eZ Publish 5 Standard Symfony2 App. (=app) + eZ Publish bundles (PHP & REST APIs + Legacy) vendor/ ezsystems/ ezpublish-kernel + Full-blown Back-office
  • 34. REST in eZ Publish 12
  • 35. REST API in eZ Publish 4.x
  • 36. REST API in eZ Publish • eZ Publish 4.x has a REST API • Prefix /ezp/api/v1/ • Read only • Very limited scope / incomplete 4.x
  • 37. REST API in eZ Publish 5.x
  • 38. REST API in eZ Publish 5.x
  • 39. REST API in eZ Publish • • • Read / Write • • • • 5.x Support Basic Auth and Session Auth Prefix /ezp/api/v2/ Allows to handle almost everything in the repository (Content, Location, Types, ...) XML or JSON support in input and output Hypermedia as the Engine of Application State (HATEOAS) Specifications: http://j.mp/ezpublish-rest-spec
  • 40. A REST Layer on top of a world of Content
  • 41. A REST Layer on top of a world of Content
  • 42. A REST Layer on top of a world of Content o/
  • 44. Demo Synopsis • • • Navigate to http://cp2013.9.loc/ then to http://cp2013.9.loc/Blog Add Blog post from http://cp2013.9.loc/ezdemo_site_admin/Blog (Content: http://phpconference.com/2013/en/sessions/rest-layer-top-world ) REST: Request REST Root: • • • Explain all parameters, then run. REST: Show children of Content root • • chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/1 chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/2 REST: Show Location/Content/ContentInfo for one child (“Blog”) • • • • chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/3 chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/5 REST: Show children of one child (“Blog”) • • • • chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/4 Edit Content, then reload. Show children: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/8 Delete the previously created blog post: curl -u "admin:publish" -X DELETE http://cp2013.9.loc/api/ezp/v2/content/objects/<objectId> Refresh children list: Show children: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html#RequestPlace:projectEndpoint/8 REST: Create an Image object • • Show ContentType (ContentClass) in back-office: http://cp2013.9.loc/ezdemo_site_admin/class/view/27 Create image from command line • • $> cdipc13 • • Publish object: curl -u "admin:publish" -X PUBLISH http://cp2013.9.loc/api/ezp/v2/content/objects/<object Id>/versions/1 $> curl -u "admin:publish" -i -H "Accept: application/json" -H "Content-Type: application/vnd.ez.api.ContentCreate+json" -X POST -d @createimage.json http://cp2013.9.loc/api/ezp/v2/content/objects Show image in the back-office: http://cp2013.9.loc/ezdemo_site_admin/eZ-Systems-logo-created-with-the-REST-API
  • 46. REST API for more than service-to-service: UX example
  • 47. REST API for more than service-to-service: UX example • API REST as provider for ajax calls - data • Initial page load (JS code, generating an interface) - then Ajax+REST for navigation, data retrieval, • Total separation of functional UX and data retrieval + back-end business logic.
  • 48. REST API for more than service-to-service: UX example
  • 49. REST API for more than service-to-service: UX example • Tools • JS lib, REST client: https://github.com/ ezsystems/ez-js-rest-client • Reproduction of the public PHP API: exposing services • Relying on HATEOS, but simplifying usage of it
  • 50. REST API for more than service-to-service: UX example
  • 51. REST API for more than service-to-service: UX example • Why? • Easy to discover the REST API structure from a client • BC support: no URL hard-coding, painless clientside, all existing projects relying on the API need not be modified, • Simplifies cache management (HTTP): easy to know exactly which resource is to be expired after a change in content repository.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56. Demo Synopsis • • • • Navigate to http://cp2013.9.loc/summercamp/rest-test Open Console > Network > Filter with “XHR” only Reload page, and clear console Click on “Details” for “Blog” • Inspect request in console: • • • • show URL In “Preview” subtab: show response, focus on “Content.Section” --> Show next request (back to “Headers” subtab): Section • • • • show”Accept” header value, show”Accept” header value, show URL In “Preview” subtab: show response, focus on “Section.name” --> Show next request (back to “Headers” subtab): Owner
  • 59. Y REST A eZ Publish D REST in eZ Publish O DEMO T REST for UX
  • 60. Slides available soon at http://slideshare.net/jeanvoye @jeanvoye http://bit.ly/nicolas-on-gplus http://fr.linkedin.com/in/nicolaspastorino/ https://github.com/nfrp eZ Publish Community http://share.ez.no eZ Publish 5 Community Project http://share.ez.no/download https://github.com/ezsystems/ezpublish-community eZ Systems & eZ Publish Platform Enterprise Edition http://ez.no