Nicolas Pastorino - REST + recommendation, consume the right content, anywhere - IPC11

1,820 views

Published on

This talk was given at IPC, Mainz, Oct. 10th. 2011. Please rate at : http://joind.in/3852

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Nicolas Pastorino - REST + recommendation, consume the right content, anywhere - IPC11

  1. 1. REST +Recommendation: consume the right content, anywhere
  2. 2. REST +Recommendation: consume the right content, anywhere Nicolas Pastorino - nfrp@ez.no Director Community - eZ Systems @jeanvoye - http://share.ez.no
  3. 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
  4. 4. Our agenda :
  5. 5. Our agenda :Multichannel emotion
  6. 6. Our agenda :Multichannel emotion REST
  7. 7. Our agenda :Multichannel emotion RESTExtensible REST API
  8. 8. Our agenda :Multichannel emotion RESTExtensible REST APIContent recommendation
  9. 9. Multichannel : emotion 3
  10. 10. Online content touchesyou,
  11. 11. Online content touchesyou, it spurs emotionsanywhere, on anydevice
  12. 12. Online content touchesyou, it spurs emotionsanywhere, on anydevice
  13. 13. Online content touchesyou, it spurs emotionsanywhere, on anydevice
  14. 14. Online content touchesyou, it spurs emotionsanywhere, on anydevice
  15. 15. You are consumingcontent, all the time
  16. 16. You are consumingcontent, all the time
  17. 17. You are consumingcontent, all the time
  18. 18. You are consumingcontent, all the time
  19. 19. Multichannelcontentdistribution is“emotionsanywhere”
  20. 20. Pre-requisites to multichannel distributionNicolas Pastorino - IPCse11 30/05/2011 8
  21. 21. Pre-requisites to multichannel distributionSeparation of layoutand content at the 1content source level Nicolas Pastorino - IPCse11 30/05/2011 8
  22. 22. Pre-requisites to multichannel distributionSeparation of layoutand content at the 1content source level Nicolas Pastorino - IPCse11 30/05/2011 8
  23. 23. Pre-requisites to multichannel distributionSeparation of layoutand content at the 1content source levelDo not compromise onuser experience 2 Nicolas Pastorino - IPCse11 30/05/2011 8
  24. 24. Pre-requisites to multichannel distributionSeparation of layoutand content at the 1content source level “The Superman Effect” Aral Balkan, DPC11Do not compromise onuser experience 2 Nicolas Pastorino - IPCse11 30/05/2011 8
  25. 25. Pre-requisites to multichannel distributionSeparation of layoutand content at the 1content source level “The Superman Effect” Aral Balkan, DPC11Do not compromise onuser 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
  26. 26. Pre-requisites to multichannel distributionSeparation of layoutand content at the 1content source level “The Superman Effect” Aral Balkan, DPC11Do not compromise onuser experience 2 “There is a lot of effort going into improving customer experience. It is key to get consistency across different channels so theirHave a single source experience does not vary” Jim Daviesniof content 3 Nicolas Pastorino - IPCse11 30/05/2011 8
  27. 27. Pre-requisites to multichannel distributionSeparation of layoutand content at the 1content source level “The Superman Effect” Aral Balkan, DPC11Do not compromise onuser experience 2 “There is a lot of effort going into improving customer experience. It is key to get consistency across different channels so theirHave a single source experience does not vary” Jim Daviesniof content 3 “Publishers usually cant afford a dedicated editorial team per channel” Nicolas Pastorino - IPCse11 30/05/2011 8
  28. 28. Are 3rules of thumbenough ?
  29. 29. Are 3rules of thumbenough We’re ? hardly off the ground. Let’s dig further...
  30. 30. SingleContentSource / CMS
  31. 31. SingleContentSource / CMS
  32. 32. Monetized Content StreamsSingleContentSource / CMS
  33. 33. Monetized Content Streams Mobile ApplicationsSingle / Smartphones, TabletsContentSource CMS
  34. 34. Monetized Content Streams Mobile ApplicationsSingle / Smartphones, TabletsContentSource CMS Push 3rd party CRM, ERP Content Newsletters
  35. 35. Monetized Content Streams Mobile ApplicationsSingle / Smartphones, TabletsContentSource CMS Push 3rd party CRM, ERP Content Newsletters Print Legacy publication chains
  36. 36. Monetized Content Streams Mobile ApplicationsSingle / Smartphones, TabletsContentSource CMS Push 3rd party CRM, ERP Content Newsletters Print Legacy publication chains Social Media
  37. 37. "Multichannel media consumers have higher levelsof engagement than those present in only onechannel.The more one watches TV, listens to the radio,spends time online, etc., the more advertising theyconsume.This shows that multichannel contentdistribution will also have an important impacton the publishers revenue structure. It willevolve to become a competitive, critical, enablingtechnology for marketing communications."
  38. 38. Having a REST ? :)
  39. 39. Having a REST ? :) We are not there yet, let’s dig further
  40. 40. “Media companies as well as consumer brands mustrecognize that adding mobile to the multichannel mixdoes not mean creating a mini-channel. Thosebuilding 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.”
  41. 41. Least CommonDenominator :
  42. 42. Least CommonDenominator :a REST API
  43. 43. Those were the functional basics to increase your REACH through multiple channels
  44. 44. Those were the functional basics to increase your REACH Now through come the multiple technical channels bits
  45. 45. REST 16
  46. 46. REpresentationalStateTransfer
  47. 47. REpresentationalStateTransferREST is a set of principles that define how Web standards, such asHTTP 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
  48. 48. REpresentationalStateTransferREST is a set of principles that define how Web standards, such asHTTP 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
  49. 49. REpresentationalStateTransfer h"p://www.infoq.com/ar4cles/rest-­‐introduc4on h"p://en.wikipedia.org/wiki/Representa4onal_State_Transfer
  50. 50. REpresentationalStateTransferKey goals of REST include:• Scalability of component interactions• Generality of interfaces• Independent deployment of components• Intermediary components to reduce latency, enforce security andencapsulate legacy systems h"p://www.infoq.com/ar4cles/rest-­‐introduc4on h"p://en.wikipedia.org/wiki/Representa4onal_State_Transfer
  51. 51. Extensible REST APIat the core of the eZ Publish CMS 19
  52. 52. At the core of the eZ Publish CMSExtensible REST API REST as a core featureNicolas Pastorino - IPCse11 30/05/2011 20
  53. 53. At the core of the eZ Publish CMSExtensible REST APIDedicated front-controllerNicolas Pastorino - IPCse11 30/05/2011 21
  54. 54. At the core of the eZ Publish CMSExtensible REST API REST setup REST eZP REST  request FC eZ  Publish web-­‐requestNicolas Pastorino - IPCse11 30/05/2011 22
  55. 55. At the core of the eZ Publish CMSExtensible REST API REST setup REST eZP REST  request FC eZ  Publish web-­‐requestNicolas Pastorino - IPCse11 30/05/2011 22
  56. 56. At the core of the eZ Publish CMSExtensible REST API Mapping content into resourcesNicolas Pastorino - IPCse11 30/05/2011 23
  57. 57. At the core of the eZ Publish CMSExtensible REST API Makes data availableNicolas Pastorino - IPCse11 30/05/2011 24
  58. 58. At the core of the eZ Publish CMSExtensible REST API Makes data reusableNicolas Pastorino - IPCse11 30/05/2011 24
  59. 59. At the core of the eZ Publish CMSExtensible REST API Content is essentially liberatedNicolas Pastorino - IPCse11 30/05/2011 25
  60. 60. At the core of the eZ Publish CMSExtensible REST API URI patternNicolas Pastorino - IPCse11 30/05/2011 26
  61. 61. At the core of the eZ Publish CMSExtensible REST API Just a token to trigger your rewrite rule Call + GET Host / Prefix / Provider / Version / params ezpRestPrefixFilterInterfaceNicolas Pastorino - IPCse11 30/05/2011 27
  62. 62. At the core of the eZ Publish CMSExtensible REST API Prefix Just a token to trigger your rewrite ruleProvider ezpRestPrefixFilterInterfaceVersionNicolas Pastorino - IPCse11 30/05/2011 27
  63. 63. At the core of the eZ Publish CMSExtensible REST API Prefix Just a token to trigger your rewrite ruleProvider ezpRestPrefixFilterInterfaceVersionNicolas Pastorino - IPCse11 30/05/2011 27
  64. 64. At the core of the eZ Publish CMSExtensible REST API Prefix Just a token to trigger your rewrite ruleProvider ezpRestPrefixFilterInterfaceVersionNicolas Pastorino - IPCse11 30/05/2011 27
  65. 65. Prefix filterezpRestPrefixFilterInterfaceCurrent providerCurrent parsed version valueNicolas Pastorino - IPCse11 30/05/2011 28
  66. 66. Versioned APIclass 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 ); }} Nicolas Pastorino - IPCse11 30/05/2011 29
  67. 67. Versioned APIezpRestVersionedRoute Version makes the notion version a part of the routing decisionNicolas Pastorino - IPCse11 30/05/2011 30
  68. 68. At the core of the eZ Publish CMSExtensible REST API Build your own flavor, extend the interface(s)Nicolas Pastorino - IPCse11 30/05/2011 31
  69. 69. Extending the interface REST providersNicolas Pastorino - IPCse11 30/05/2011 32
  70. 70. Extending the interfaceezpRestProviderInterfaceNicolas Pastorino - IPCse11 30/05/2011 33
  71. 71. Overview of hooksthe places where you can go wild.
  72. 72. Nicolas Pastorino - IPCse11 30/05/2011 35
  73. 73. Route setup - Exampleclass 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
  74. 74. Extensible REST APIKey features 37
  75. 75. Key featuresExtensible REST API Content resourcesNicolas Pastorino - IPCse11 30/05/2011 38
  76. 76. Key featuresGET /[api]/v1/content/object/ <objectId>/fields HTTP/1.1Nicolas Pastorino - IPCse11 30/05/2011 39
  77. 77. Key featuresfields/<fieldname> type (datatype string) identifier (attribute identifier) value (string representation of data) id (object attribute numerical ID) classattribute_id (class attribute numerical ID)Nicolas Pastorino - IPCse11 30/05/2011 40
  78. 78. Key features GET /[api]/v1/content/object/ <objectId>/field/ <FieldIdentifier> HTTP/1.1Nicolas Pastorino - IPCse11 30/05/2011 41
  79. 79. Content RecommendationYooChoose, eZ Recommender Engine 42
  80. 80. A tough selection needs tobe made amongst the infiniteamount of content published
  81. 81. A tough selection needs tobe made amongst the infiniteamount of content publishedWhichone is myslope ?
  82. 82. A tough selection needs tobe made amongst the infiniteamount of content published
  83. 83. A tough selection needs tobe made amongst the infiniteamount of content publishedI only have 30minutes a day,which postsshould i read ?
  84. 84. A tough selection needs tobe made amongst the infiniteamount of content publishedDoesn’t itfeel like thissometimes :
  85. 85. One sometimes needs ahelping hand to choose theright slope to ride, the right content to consume
  86. 86. One sometimes needs ahelping hand to choose theright slope to ride, the right content to consume
  87. 87. One sometimes needs ahelping hand to choose theright slope to ride, the right content to consume
  88. 88. One sometimes needs a helping hand to choose the right slope to ride, the right content to consumeContentrecommendation
  89. 89. Content recommendationNicolas Pastorino - IPCse11 30/05/2011 47
  90. 90. Content recommendationNicolas Pastorino - IPCse11 30/05/2011 47
  91. 91. Content recommendationTrack contentconsumptionNicolas Pastorino - IPCse11 30/05/2011 47
  92. 92. Content recommendationTrack contentconsumption + Learn content metadataNicolas Pastorino - IPCse11 30/05/2011 47
  93. 93. Content recommendationTrack contentconsumption + Learn content metadata = Content RecommendationNicolas Pastorino - IPCse11 30/05/2011 47
  94. 94. 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
  95. 95. Content recommendationNicolas Pastorino - IPCse11 30/05/2011 49
  96. 96. Content recommendation Hybrid filtering Increasing recommendation quality by combining methods for qualifying behaviorsNicolas Pastorino - IPCse11 30/05/2011 49
  97. 97. 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
  98. 98. 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
  99. 99. 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&BNicolas Pastorino - IPCse11 30/05/2011 49
  100. 100. 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 recommendationsNicolas Pastorino - IPCse11 30/05/2011 49
  101. 101. Content recommendationNicolas Pastorino - IPCse11 30/05/2011 50
  102. 102. Content recommendationI/O through RESTNative connection with any HTTP-enabled client( simple with PHP, native extension for eZPublish CMS )Cloud-based : scalesDifferent methods for event tracking : JS, built-inthe CMS, Nicolas Pastorino - IPCse11 30/05/2011 50
  103. 103. Famous Last Slides 51
  104. 104. RECAP
  105. 105. RECAPMultichannel emotion
  106. 106. RECAPMultichannel emotion REST
  107. 107. RECAPMultichannel emotion RESTExtensible REST API
  108. 108. RECAPMultichannel emotion RESTExtensible REST APIContent recommendation
  109. 109. Find me on Twitter : @jeanvoyeRate this talk : http://joind.in/3852Slides available soon at http://slideshare.net/jeanvoyeeZ Communityhttp://share.ez.noeZ Publish Community Projecthttps://github.com/ezsystems/ezpublishhttp://share.ez.no/downloadhttp://share.ez.no/get-involved Thank you !YooChoose, recommendation enginehttp://www.yoochoose.comeZ Systems & eZ Publish Enterprise Editionhttp://ez.no

×