2. REST +
Recommendation:
consume the
right content,
anywhere
Nicolas Pastorino - nfrp@ez.no
Director Community - eZ Systems
@jeanvoye - http://share.ez.no
3. REST +
Recommendation:
consume the
right content,
anywhere
International PHP Conference 2011 - Mainz - October 10th
Nicolas Pastorino - nfrp@ez.no
#ipc11 Director Community - eZ Systems
@jeanvoye - http://share.ez.no
25. Pre-requisites to multichannel distribution
Separation of layout
and content at the 1
content source level
Nicolas Pastorino - IPCse11 30/05/2011 8
26. Pre-requisites to multichannel distribution
Separation of layout
and content at the 1
content source level
Nicolas Pastorino - IPCse11 30/05/2011 8
27. Pre-requisites to multichannel distribution
Separation of layout
and content at the 1
content source level
Do not compromise on
user experience 2
Nicolas Pastorino - IPCse11 30/05/2011 8
28. Pre-requisites to multichannel distribution
Separation of layout
and content at the 1
content source level
“The Superman Effect” Aral Balkan, DPC11
Do not compromise on
user experience 2
Nicolas Pastorino - IPCse11 30/05/2011 8
29. Pre-requisites to multichannel distribution
Separation of layout
and content at the 1
content source level
“The Superman Effect” Aral Balkan, DPC11
Do not compromise on
user experience 2
“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
Nicolas Pastorino - IPCse11 30/05/2011 8
30. Pre-requisites to multichannel distribution
Separation of layout
and content at the 1
content source level
“The Superman Effect” Aral Balkan, DPC11
Do not compromise on
user experience 2
“There is a lot of effort going into improving
customer experience. It is key to get
consistency across different channels so their
Have a single source experience does not vary” Jim Daviesni
of content 3
Nicolas Pastorino - IPCse11 30/05/2011 8
31. Pre-requisites to multichannel distribution
Separation of layout
and content at the 1
content source level
“The Superman Effect” Aral Balkan, DPC11
Do not compromise on
user experience 2
“There is a lot of effort going into improving
customer experience. It is key to get
consistency across different channels so their
Have a single source experience does not vary” Jim Daviesni
of content 3
“Publishers usually can't afford a dedicated
editorial team per channel”
Nicolas Pastorino - IPCse11 30/05/2011 8
37. Monetized
Content
Streams
Single
Content
Source / CMS
38. Monetized
Content
Streams
Mobile
Applications
Single
/
Smartphones, Tablets
Content
Source
CMS
39. Monetized
Content
Streams
Mobile
Applications
Single
/
Smartphones, Tablets
Content
Source
CMS Push 3rd party
CRM, ERP
Content
Newsletters
40. Monetized
Content
Streams
Mobile
Applications
Single
/
Smartphones, Tablets
Content
Source
CMS Push 3rd party
CRM, ERP
Content
Newsletters
Print
Legacy publication chains
41. Monetized
Content
Streams
Mobile
Applications
Single
/
Smartphones, Tablets
Content
Source
CMS Push 3rd party
CRM, ERP
Content
Newsletters
Print
Legacy publication chains
Social Media
42.
43. "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."
46. Having a
REST ?
:)
We are
not there
yet, let’s
dig further
47.
48. “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.”
57. 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 (“HATEOAS”) (cf David Zuelke’s keynote)
• Use standard methods
• Resources with multiple representations
• Communicate statelessly
58. 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 (“HATEOAS”) (cf David Zuelke’s keynote)
• 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
59. REpresentational
State
Transfer
h"p://www.infoq.com/ar4cles/rest-‐introduc4on
h"p://en.wikipedia.org/wiki/Representa4onal_State_Transfer
60. REpresentational
State
Transfer
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
62. At the core of the eZ Publish CMS
Extensible REST API
REST as a core feature
Nicolas Pastorino - IPCse11 30/05/2011 20
63. At the core of the eZ Publish CMS
Extensible REST API
Dedicated front-controller
Nicolas Pastorino - IPCse11 30/05/2011 21
64. At the core of the eZ Publish CMS
Extensible REST API
REST setup
REST
eZP
REST
request
FC
eZ
Publish
web-‐request
Nicolas Pastorino - IPCse11 30/05/2011 22
65. At the core of the eZ Publish CMS
Extensible REST API
REST setup
REST
eZP
REST
request
FC
eZ
Publish
web-‐request
Nicolas Pastorino - IPCse11 30/05/2011 22
66. At the core of the eZ Publish CMS
Extensible REST API
Mapping content into
resources
Nicolas Pastorino - IPCse11 30/05/2011 23
67. At the core of the eZ Publish CMS
Extensible REST API
Makes data available
Nicolas Pastorino - IPCse11 30/05/2011 24
68. At the core of the eZ Publish CMS
Extensible REST API
Makes data reusable
Nicolas Pastorino - IPCse11 30/05/2011 24
69. At the core of the eZ Publish CMS
Extensible REST API
Content is essentially
liberated
Nicolas Pastorino - IPCse11 30/05/2011 25
70. At the core of the eZ Publish CMS
Extensible REST API
URI pattern
Nicolas Pastorino - IPCse11 30/05/2011 26
71. At the core of the eZ Publish CMS
Extensible REST API
Just a token to trigger your rewrite rule
Call +
GET Host / Prefix / Provider / Version / params
ezpRestPrefixFilterInterface
Nicolas Pastorino - IPCse11 30/05/2011 27
72. At the core of the eZ Publish CMS
Extensible REST API
Prefix Just a token to trigger your rewrite rule
Provider
ezpRestPrefixFilterInterface
Version
Nicolas Pastorino - IPCse11 30/05/2011 27
73. At the core of the eZ Publish CMS
Extensible REST API
Prefix Just a token to trigger your rewrite rule
Provider
ezpRestPrefixFilterInterface
Version
Nicolas Pastorino - IPCse11 30/05/2011 27
74. At the core of the eZ Publish CMS
Extensible REST API
Prefix Just a token to trigger your rewrite rule
Provider
ezpRestPrefixFilterInterface
Version
Nicolas Pastorino - IPCse11 30/05/2011 27
83. Route setup - Example
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 ) );
}
}
Nicolas Pastorino - IPCse11 30/05/2011 36
107. Cloud-based learning of behaviors using
• Events
“Viewing, Purchasing, Rating, Sharing”
• Models
Users who viewed A also viewed B
• Stereotypes
Affinity calculated against larger sets of
content
109. Content recommendation
Hybrid filtering
Increasing recommendation quality by combining
methods for qualifying behaviors
Nicolas Pastorino - IPCse11 30/05/2011 49
110. Content recommendation
Hybrid filtering
Increasing recommendation quality by combining
methods for qualifying behaviors
Content-based
filtering
“Content like this”
~
Nicolas Pastorino - IPCse11 30/05/2011 49
111. Content recommendation
Hybrid filtering
Increasing recommendation quality by combining
methods for qualifying behaviors
Content-based Collaborative
filtering filtering
“Content like this” “Customers who
were interested in
this product also
bought …”
~
Nicolas Pastorino - IPCse11 30/05/2011 49
112. Content recommendation
Hybrid filtering
Increasing recommendation quality by combining
methods for qualifying behaviors
Content-based Collaborative Community- Stereotype- Context-based
filtering filtering based filtering based filtering filtering
“Content like this” “Customers who “Customers like you Recommendation Recommendation
were interested in also bought …” combines content depends on
this product also cluster with affinity location, time,
bought …” vectors mood, environment
…
Rock
~ ~ Pop
R&B
Nicolas Pastorino - IPCse11 30/05/2011 49
113. Content recommendation
Hybrid filtering
Increasing recommendation quality by combining
methods for qualifying behaviors
Content-based Collaborative Community- Stereotype- Context-based
filtering filtering based filtering based filtering filtering
“Content like this” “Customers who “Customers like you Recommendation Recommendation
were interested in also bought …” combines content depends on
this product also cluster with affinity location, time,
bought …” vectors mood, environment
…
Rock
~ ~ Pop
R&B
+ A/B testing + near cold-start recommendations
Nicolas Pastorino - IPCse11 30/05/2011 49
115. Content recommendation
I/O through REST
Native connection with any HTTP-enabled client
( simple with PHP, native extension for eZ
Publish CMS )
Cloud-based : scales
Different methods for event tracking : JS, built-in
the CMS,
Nicolas Pastorino - IPCse11 30/05/2011 50
122. Find me on Twitter : @jeanvoye
Rate this talk : http://joind.in/3852
Slides available soon at http://slideshare.net/jeanvoye
eZ Community
http://share.ez.no
eZ Publish Community Project
https://github.com/ezsystems/ezpublish
http://share.ez.no/download
http://share.ez.no/get-involved
Thank you !
YooChoose, recommendation engine
http://www.yoochoose.com
eZ Systems & eZ Publish Enterprise Edition
http://ez.no