SlideShare uma empresa Scribd logo
1 de 60
Baixar para ler 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

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

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