SlideShare ist ein Scribd-Unternehmen logo
1 von 60
Downloaden Sie, um offline zu lesen
#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

Weitere ähnliche Inhalte

Ähnlich wie A REST Layer on Top of The World

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
 

Ähnlich wie A REST Layer on Top of The World (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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

A REST Layer on Top of The World

  • 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