nicolas pastorino - launching content in mobility with rest and ez publish

Post on 01-Nov-2014

1.821 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Talk given at the Dutch PHP Conference 2011. Pure-web is not an option anymore when publishing content: addressing the broader internet and its multiple channels is key to a great diffusion. As a Content Management Platform, eZ Publish now exposes an extensible REST API for mobile devices to consume and create content. This session will show how content & functionalities are made available to mobile applications on such platforms as Android phones, iPhones, iPads and tablets.

TRANSCRIPT

Launching content in mobility withREST & eZ Publish

Launching content in mobility withREST & eZ Publish

Nicolas Pastorino - nfrp@ez.noDirector Community - eZ Systems@jeanvoye - http://share.ez.no

Mobile

Launching content in mobility withREST & eZ Publish

Nicolas Pastorino - nfrp@ez.noDirector Community - eZ Systems@jeanvoye - http://share.ez.no

Dutch PHP Conference 2011 - Amsterdam - May 21st

#dpc11

Mobile

Launching content in mobility withREST & eZ Publish

Nicolas Pastorino - nfrp@ez.noDirector Community - eZ Systems@jeanvoye - http://share.ez.no

Dutch PHP Conference 2011 - Amsterdam - May 21st

#dpc11

Our agenda :

Multichannel : why ?Our agenda :

Multichannel : why ?REST

Our agenda :

Multichannel : why ?REST

Extensible REST API

Our agenda :

Multichannel : why ?REST

Extensible REST APIDemo

Our agenda :

Multichannel : why ?

3

How would you feel playing Pacman on a single, straight line of dots ?

How would you feel playing Pacman on a single, straight line of dots ?

How would you feel playing Pacman on a single, straight line of dots ?

Boring,right ?

Multichannel content distribution is the real Pacman

Multichannel content distribution is the real Pacman

21/05/2011Nicolas Pastorino - DPC11

Pre-requisites to multichannel distribution

7

21/05/2011Nicolas Pastorino - DPC11

Pre-requisites to multichannel distribution

7

Separation of layout and content at the content source level

1

21/05/2011Nicolas Pastorino - DPC11

Pre-requisites to multichannel distribution

7

Separation of layout and content at the content source level

1

21/05/2011Nicolas Pastorino - DPC11

Pre-requisites to multichannel distribution

7

Separation of layout and content at the content source level

1

Do not compromise on user experience 2

21/05/2011Nicolas Pastorino - DPC11

Pre-requisites to multichannel distribution

7

“The Superman Effect” Aral Balkan, DPC11

Separation of layout and content at the content source level

1

Do not compromise on user experience 2

21/05/2011Nicolas Pastorino - DPC11

Pre-requisites to multichannel distribution

7

“The Superman Effect” Aral Balkan, DPC11

“There is a lot of effort going into improving customer experience. It is key to get consistency across different channels so their experience does not vary” Jim Daviesni

Separation of layout and content at the content source level

1

Do not compromise on user experience 2

21/05/2011Nicolas Pastorino - DPC11

Pre-requisites to multichannel distribution

7

“The Superman Effect” Aral Balkan, DPC11

“There is a lot of effort going into improving customer experience. It is key to get consistency across different channels so their experience does not vary” Jim Daviesni

Separation of layout and content at the content source level

1

Do not compromise on user experience 2

Have a single source of content 3

21/05/2011Nicolas Pastorino - DPC11

Pre-requisites to multichannel distribution

7

“The Superman Effect” Aral Balkan, DPC11

“There is a lot of effort going into improving customer experience. It is key to get consistency across different channels so their experience does not vary” Jim Daviesni

Separation of layout and content at the content source level

1

Do not compromise on user experience 2

Have a single source of content 3

“Publishers usually can't afford a dedicated editorial team per channel”

Ready to tackle

your channels

yet ?

Ready to tackle

your channels

yet ?

We’re hardly off the ground. Let’s dig further...

CMSSingle Content Source /

CMSSingle Content Source /

CMSSingle Content Source /

Monetized Content Streams

CMSSingle Content Source /

Monetized Content Streams

Mobile ApplicationsSmartphones, Tablets

CMSSingle Content Source /

Monetized Content Streams

Mobile ApplicationsSmartphones, Tablets

Push ContentNewsletters

3rd partyCRM, ERP

CMSSingle Content Source /

Monetized Content Streams

Mobile ApplicationsSmartphones, Tablets

Push ContentNewsletters

PrintLegacy publication chains

3rd partyCRM, ERP

CMSSingle Content Source /

Monetized Content Streams

Mobile ApplicationsSmartphones, Tablets

Push ContentNewsletters

PrintLegacy publication chains

Social Media

3rd partyCRM, ERP

"Multichannel media consumers have higher levels of engagement than those present in only one channel.

The more one watches TV, listens to the radio, spends time online, etc., the more advertising they consume.

This shows that multichannel content distribution will also have an important impact on the publishers revenue structure. It will evolve to become a competitive, critical, enabling technology for marketing communications."

Having a REST ?

:)

Having a REST ?

:)

A touch more of

insight will help...

“Media companies as well as consumer brands must recognize that adding mobile to the multichannel mix does not mean creating a mini-channel. Those building mobile strategies should recognize that:

• Mobile is not just about shrinking the desktop experience,

• The user environment is an element of the mobile experience,

• Mobile users are not simply a subset of online users – some are new.”

Least Common

Denominator :

Least Common

Denominator :

a REST API

Those were the basics to increase

your REACHthrough multiple

channels

Those were the basics to increase

your REACHthrough multiple

channels Right Chris ?

REST

15

REpresentational State Transfer

REpresentational State Transfer

REST is a 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• Use standard methods• Resources with multiple representations• Communicate statelessly

REpresentational State Transfer

REST is a 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• Use standard methods• Resources with multiple representations• Communicate statelessly

h"p://en.wikipedia.org/wiki/Representa4onal_State_Transferh"p://www.infoq.com/ar4cles/rest-­‐introduc4on

REpresentational State Transfer

h"p://en.wikipedia.org/wiki/Representa4onal_State_Transferh"p://www.infoq.com/ar4cles/rest-­‐introduc4on

Extensible REST API

18

at the core of the eZ Publish CMS

21.05.2011Nicolas Pastorino - DPC11

At the core of the eZ Publish CMS

REST as a core feature

19

Extensible REST API

21.05.2011Nicolas Pastorino - DPC11

Dedicated front-controller

20

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 21

REST setup

REST

FC

eZPREST  request

eZ  Publishweb-­‐request

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 21

REST setup

REST

FC

eZPREST  request

eZ  Publishweb-­‐request

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 22

Mapping content into resources

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 23

Makes data availableMakes data available

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 23

Makes data reusableMakes data reusable

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 24

Content is essentially liberated

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11

URI pattern

25

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 26

Prefix Provider VersionGET Host / / / / Call + params

Just a token to trigger your rewrite rule

ezpRestPrefixFilterInterface

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 26

Prefix Provider Version

Just a token to trigger your rewrite rule

ezpRestPrefixFilterInterface

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 26

Prefix

Provider Version

Just a token to trigger your rewrite rule

ezpRestPrefixFilterInterface

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 26

Prefix

Provider Version

Just a token to trigger your rewrite rule

ezpRestPrefixFilterInterface

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 26

Prefix

Provider

Version

Just a token to trigger your rewrite rule

ezpRestPrefixFilterInterface

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 26

Prefix

Provider

Version

Just a token to trigger your rewrite rule

ezpRestPrefixFilterInterface

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11 26

Prefix

Provider

Version

Just a token to trigger your rewrite rule

ezpRestPrefixFilterInterface

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11

Prefix filter

27

Current provider

Current parsed version value

ezpRestPrefixFilterInterface

21.05.2011Nicolas Pastorino - DPC11

Versioned API

28

class ezpRestRouter extends ezcMvcRouter{ public function createRoutes() { // ezpRestApiProvider $routes = array( new ezcMvcRailsRoute( '/content/node/:nodeId/listAtom', 'ezpRestAtomController', 'collection' ), new ezcMvcRailsRoute( '/content/node/:nodeId/list', 'ezpRestContentController', 'list' ), new ezcMvcRailsRoute( '/content/node/:nodeId', 'ezpRestContentController', 'viewContent' ), new ezcMvcRailsRoute( '/content/node/:nodeId/fields', 'ezpRestContentController', 'viewFields' ), new ezcMvcRailsRoute( '/content/node/:nodeId/field/:fieldIdentifier', 'ezpRestContentController', 'viewField' ), new ezcMvcRailsRoute( '/content/object/:objectId', 'ezpRestContentController', 'viewContent' ), new ezcMvcRailsRoute( '/content/object/:objectId/fields', 'ezpRestContentController', 'viewFields' ), new ezcMvcRailsRoute( '/content/object/:objectId/field/:fieldIdentifier', 'ezpRestContentController', 'viewField' ),

new ezpRestVersionedRoute( new ezcMvcRailsRoute( '/foo', 'myController', 'myActionOne' ), 1 ), new ezpRestVersionedRoute( new ezcMvcRailsRoute( 'e/foo', 'myController2 or myControlerWhichExtendsmyController', 'myBetterAndScalingAction' ), 2 ), ); return ezcMvcRouter::prefix( '/api', $routes ); }}

21.05.2011Nicolas Pastorino - DPC11

Versioned API

makes the notion version a part of the routing decision

29

Version

ezpRestVersionedRoute

21.05.2011Nicolas Pastorino - DPC11

Extending the interface

30

At the core of the eZ Publish CMS Extensible REST API

21.05.2011Nicolas Pastorino - DPC11

Extending the interface

31

REST providers

21.05.2011Nicolas Pastorino - DPC11

Extending the interface

ezpRestProviderInterface

32

21.05.2011Nicolas Pastorino - DPC11

Overview of hooks

33

21.05.2011Nicolas Pastorino - DPC11 34

21.05.2011Nicolas Pastorino - DPC11

Route setup - Example

35

class ezpRestRouter extends ezcMvcRouter{ public function createRoutes() { $providerRoutes = ezpRestProvider::getProvider( ezpRestPrefixFilterInterface::getApiProviderName() )->getRoutes();

$routes = array( new ezpMvcRailsRoute( '/fatal', 'ezpRestErrorController', 'show' ), new ezpMvcRailsRoute( '/http-basic-auth', 'ezpRestAuthController', 'basicAuth' ), new ezpMvcRailsRoute( '/login/oauth', 'ezpRestAuthController', 'oauthRequired' ), new ezpMvcRailsRoute( '/oauth/token', 'ezpRestOauthTokenController', 'handleRequest'),

// ezpRestVersionedRoute( $route, $version ) // $version == 1 should be the same as if the only the $route had been present new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/foo', 'myController', 'myActionOne' ), 1 ), new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/foo', 'myController', 'myActionOneBetter' ), 2 ),

);

return ezcMvcRouter::prefix( '/api', array_merge( $providerRoutes, $routes ) ); }}

Extensible REST API

36

Key features

21.05.2011Nicolas Pastorino - DPC11

Content resources

37

Key featuresExtensible REST API

21.05.2011Nicolas Pastorino - DPC11

Key features

GET /[api]/v1/content/object/<objectId>/fields HTTP/1.1

38

21.05.2011Nicolas Pastorino - DPC11

Key features

fields/<fieldname>

type (datatype string)

identifier (attribute identifier)

value (string representation of data)

id (object attribute numerical ID)

classattribute_id (class attribute numerical ID)

39

21.05.2011Nicolas Pastorino - DPC11

Key features

GET /[api]/v1/content/object/<objectId>/field/

<FieldIdentifier> HTTP/1.1

40

Demo

41

Web + Android, eZ Publish powered

Famous Last Slides

42

Multichannel : why ?REST

Extensible REST APIDemo

RECAP

You won’t ever play Pacman the same way again :)

You won’t ever play Pacman the same way again :)

You won’t ever play Pacman the same way again :)

eZ Communityhttp://share.ez.no

eZ Publish Community Projecthttp://share.ez.no/download & http://share.ez.no/get-involved

eZ Systems & eZ Publish Enterprise Editionhttp://ez.no

Find me on Twitter : @jeanvoye

Rate this talk : http://joind.in/talk/view/3255, Slides available soon at http://slideshare.net/jeanvoye

eZ Conference, June 16th&17th, London : Rasmus Lerdorf, Derick Rethans, Tobias Schlitt Get a 20% off coupon at the eZ Booth in the hall, and register : http://london2011.ez.no

Thank you !

top related