Mobile Channels in eZ Publish

2,367 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,367
On SlideShare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
29
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mobile Channels in eZ Publish

  1. 1. Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  2. 2. Łukasz Serwatka<br />Mobile Lead Engineer at eZ Systems<br />eZ Systems employee since March 2005<br /> Member of the Engineering Division<br /> 8 years experience with eZ Publish<br /> 2 years experience with native mobile applications development (iOS, Android)<br /> Author of many print and online publications about eZ Publish<br /> Creator of many eZ Publish extensions<br />Web: www.serwatka.net<br />Twitter: @lserwatka<br />11-06-20<br />Presenter: Łukasz Serwatka<br />2<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  3. 3. Mobile channels available in eZ Publish<br /> mobile web channel<br /> web technologies<br /> HTML5<br /> CSS3 & SASS<br /> JavaScript<br /> REST interface<br /> web service oriented<br /> lightweight client-server communication<br /> JSON as output format<br />11-06-20<br />Presenter: Łukasz Serwatka<br />3<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  4. 4. Content channels in eZ Publish<br />11-06-20<br />Presenter: Łukasz Serwatka<br />4<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  5. 5. Mobile channels in eZ Publish<br />11-06-20<br />Presenter: Łukasz Serwatka<br />5<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  6. 6. Environments: fragmentation<br /> Symbian (Nokia)<br />Andorid (Google)<br />Bada (Samsung)<br /> Windows Phone (Microsoft/Nokia)<br />iOS (Apple)<br /> BlackBerry (RIM)<br />webOS (Palm/HP)<br />MeeGo (Intel/Nokia/Maemo)<br />11-06-20<br />Presenter: Łukasz Serwatka<br />6<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  7. 7. The Web<br /> Cross-platform<br /> Familiar skills & tools<br /> Easily updated<br /> Decentralized<br /> Indexed<br /> Well-understood<br /> … but<br />11-06-20<br />Presenter: Łukasz Serwatka<br />7<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  8. 8. Caveats<br /> Performance: slower to execute, limited on CPU/GPU resource<br /> Browser support: some needs to be ignored<br /> Device access: limited access to hardware, not fully there yet<br /> Debug: more difficult on the client side<br /> Discoverability: no official app store, yet<br /> Monetization: more difficult<br /> App ‘experience’<br />11-06-20<br />Presenter: Łukasz Serwatka<br />8<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  9. 9. Mobile web: engines<br /> WebKit: ~57% market share<br /> iOS<br /> Bada<br /> BlackBerry 6.0+<br /> Symbian<br /> Andorid<br /> webOS<br /> MeeGo<br /> Presto: ~21% market share<br /> Opera Mini<br /> Opera Mobile<br /> Others: ~22% market share<br /> Gecko, Trident, Mango, UC, Obigo …<br />11-06-20<br />Presenter: Łukasz Serwatka<br />9<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  10. 10. Mobile HTML5<br />Presenter: Łukasz Serwatka<br />10<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />semantics<br />multimedia<br />offline & storage<br />3D, graphics & effects<br />device access<br />performance & integration<br />connectivity<br />CSS3<br />11-06-20<br />
  11. 11. Technologies<br /> accelerometer -webkit @page CSS Text localStorage @media<br /> manifest transform <video> WebSQL GeoLocation<br /> type=camera canvas keyframe gradient touch events<br /> <audio> Web Workers CSS3 SASS<br /> … and more <br />11-06-20<br />Presenter: Łukasz Serwatka<br />11<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  12. 12. Cross-browser<br /> mobile web frameworks<br /> JavaScript-based (programmatic approach)<br /> Sencha Touch<br /> SproutCore<br /> Markup-based (progressive enhancement approach)<br /> jQTouch<br /> jQuery Mobile<br />11-06-20<br />Presenter: Łukasz Serwatka<br />12<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  13. 13. Mobile web frameworks: why?<br /> Provide user interface components<br /> toolbars, buttons, navigation bars, etc.<br /> Smooth browser inconsistencies<br /> normalization is done under the hood, abstractions <br /> Mimic native or server paradigms<br /> UI elements, drop shadows, insets,<br /> Create consistent application architecture<br /> MVC framework<br />11-06-20<br />Presenter: Łukasz Serwatka<br />13<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  14. 14. jQTouch<br /> sponsored by Sencha Labs<br /> markup-based<br /> UI layer on top of jQuery<br /> library progressively enhances<br /> MIT license<br /> wide browser support<br />http://jqtouch.com<br />11-06-20<br />Presenter: Łukasz Serwatka<br />14<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  15. 15. jQuery Mobile<br /> still in alpha version<br /> markup-based<br /> UI layer on top of jQuery<br /> library progressively enhances<br /> MIT or GPL2 license<br /> wide browser support<br />http://jquerymobile.com<br />11-06-20<br />Presenter: Łukasz Serwatka<br />15<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  16. 16. Sencha Touch<br /> self-contained library<br /> built on ExtJS<br /> JavaScript-based approach<br /> standalone MVC applications<br /> commercial and open source licenses<br /> wide browser support<br />http://www.sencha.com/products/touch/<br />11-06-20<br />Presenter: Łukasz Serwatka<br />16<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  17. 17. Back to eZ Publish …<br />11-06-20<br />Presenter: Łukasz Serwatka<br />17<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  18. 18. Mobile web channel in eZ Publish<br /> accessible via eZ Publish “siteaccess” system;<br /> supports URI, HOST and PORT based access;<br /> permissions handling;<br /> can provide mobile optimized content and layout;<br /> template engine;<br /> content engine;<br />11-06-20<br />Presenter: Łukasz Serwatka<br />18<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  19. 19. Mobile web channel in eZ Publish: configuration<br /> Web server configuration<br /> Virtual-Host setup<br /> eZ Publish configuration<br /> Siteaccess settings<br /> Permissions setup<br /> Design extension<br />11-06-20<br />Presenter: Łukasz Serwatka<br />19<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  20. 20. Mobile web channel in eZ Publish: mobile detection<br /> Apache Mobile Filter<br />http://www.apachemobilefilter.org/<br /> No built-in solution<br />11-06-20<br />Presenter: Łukasz Serwatka<br />20<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  21. 21. Mobile web channel in eZ Publish: mobile detection<br /> Smart detection but let user choice.<br /> Place link to the desktop version of your site as well.<br />11-06-20<br />Presenter: Łukasz Serwatka<br />21<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  22. 22. Mobile web channel in eZ Publish: VH setup<br /> Possible scenarios<br /> Use a separate domain altogether (e.g www.mobile-example.com)<br /> Use a subdomain (e.g m.example.com)<br /> Probably the most popular option<br /> URI approach as alternative (e.g example.com/mobile)<br /> Use a .mobi top level domain<br /> Combine with smart detection<br />11-06-20<br />Presenter: Łukasz Serwatka<br />22<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  23. 23. Mobile web channel in eZ Publish: siteaccess<br /> /settings/override/site.ini.append.php<br /> ...<br /> [SiteAccessSettings]<br /> AvailableSiteAccessList[]<br /> AvailableSiteAccessList[]=example<br /> AvailableSiteAccessList[]=mobile<br /> MatchOrder=host<br /> HostMatchMapItems[]=www.example.com;example<br /> HostMatchMapItems[]=m.example.com;mobile<br /> ...<br />11-06-20<br />Presenter: Łukasz Serwatka<br />23<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  24. 24. Mobile web channel in eZ Publish: viewport<br /> Use the viewport meta tag to improve the presentation of your web content<br /> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=yes" /> <br />11-06-20<br />Presenter: Łukasz Serwatka<br />24<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  25. 25. DEMO<br />Presenter: Łukasz Serwatka<br />SLIDE 25<br />11-06-20<br />
  26. 26. Mobile web channel in eZ Publish: hybrid apps<br />Native shell for a mobile web<br /> Embedded WebView<br /> PhoneGap<br /> access to device APIs<br /> online build tool<br /> wide range of supported platforms<br /> Distributed via AppStore, Android Market, etc.<br /> Access to download statistics<br /> Access to the application via native shell (Icon on device screen)<br />11-06-20<br />Presenter: Łukasz Serwatka<br />26<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  27. 27. DEMO<br />Presenter: Łukasz Serwatka<br />SLIDE 27<br />11-06-20<br />
  28. 28. REST<br />
  29. 29. REST<br /> REpresentational<br /> State<br /> Transfer<br />11-06-20<br />Presenter: Łukasz Serwatka<br />29<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  30. 30. REST<br /> REpresentational<br /> State<br /> Transfer<br />REST is a set of principles that how Web standards, such as HTTP and URIs, are supposed to be used.<br /> Give every “thing” an ID<br /> Link things together<br /> Use standard methods<br /> Resource with multiple representations<br /> Communicate statelessly<br />11-06-20<br />Presenter: Łukasz Serwatka<br />30<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  31. 31. REST<br /> REpresentational<br /> State<br /> Transfer<br />Key goals of REST include:<br /> Scalability of component interactions<br /> Generality of interfaces<br /> Independent deployment of components<br /> Intermediary components to reduce latency, enforce security and encapsulate legacy systems <br />11-06-20<br />Presenter: Łukasz Serwatka<br />31<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  32. 32. Life before eZ Publish REST interface<br />custom siteaccess s and template based XML output<br /> custom web service implementations involving eZ Publish modules/view<br />ezjscore based web service implementations<br />11-06-20<br />Presenter: Łukasz Serwatka<br />32<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  33. 33. eZ Publish REST interface<br /> available as a core feature since version 4.5<br />11-06-20<br />Presenter: Łukasz Serwatka<br />33<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  34. 34. eZ Publish REST interface<br /> available as a core feature since version 4.5<br /> dedicated front-end controller (index_rest.php as REST endpoint)<br />11-06-20<br />Presenter: Łukasz Serwatka<br />34<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  35. 35. eZ Publish REST interface<br /> available as a core feature since version 4.5<br /> dedicated front-end controller (index_rest.php as REST endpoint)<br />11-06-20<br />Presenter: Łukasz Serwatka<br />35<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  36. 36. eZ Publish REST interface<br /> available as a core feature since version 4.5<br /> dedicated front-end controller (index_rest.php as REST endpoint)<br /> based on the Zeta Components: MVCTools component<br />11-06-20<br />Presenter: Łukasz Serwatka<br />36<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  37. 37. eZ Publish REST interface<br /> available as a core feature since version 4.5<br /> dedicated front-end controller (index_rest.php as REST endpoint)<br /> based on the Zeta Components: MVCTools component<br /> content retrieval only, with possibility to extend<br />11-06-20<br />Presenter: Łukasz Serwatka<br />37<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  38. 38. eZ Publish REST interface<br /> available as a core feature since version 4.5<br /> dedicated front-end controller (index_rest.php as REST endpoint)<br /> based on the Zeta Components: MVCTools component<br /> content retrieval only, with possibility to extend<br /> extensions mechanism<br />11-06-20<br />Presenter: Łukasz Serwatka<br />38<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  39. 39. eZ Publish REST interface<br /> available as a core feature since version 4.5<br /> dedicated front-end controller (index_rest.php as REST endpoint)<br /> based on the Zeta Components: MVCTools component<br /> content retrieval only, with possibility to extend<br /> extensions mechanism<br /> versioning<br />11-06-20<br />Presenter: Łukasz Serwatka<br />39<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  40. 40. eZ Publish REST interface<br /> available as a core feature since version 4.5<br /> dedicated front-controller (index_rest.php as REST endpoint)<br /> based on the Zeta Components: MVCTools component<br /> content retrieval only, with possibility to extend<br /> extensions mechanism<br /> versioning<br /> OAuth 2.0 authentication<br />11-06-20<br />Presenter: Łukasz Serwatka<br />40<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  41. 41. eZ Publish REST interface: other features<br /> built-in caching<br /> template based output for various resources<br /> returned fields configured per request: responseGroups<br />11-06-20<br />Presenter: Łukasz Serwatka<br />41<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  42. 42. eZ Publish REST interface: front-controller<br />11-06-20<br />Presenter: Łukasz Serwatka<br />42<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  43. 43. eZ Publish REST interface: OAuth 2.0<br /> web interface for applications management<br /> support for custom OAuth login pages: override oauthloginpagelayout.tpl<br /> configurable token expiry time in the rest.ini<br />11-06-20<br />Presenter: Łukasz Serwatka<br />43<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  44. 44. eZ Publish REST interface<br /> content is mapped into the resource<br /> node<br /> object<br /> lists<br /> fields<br /> resources provided by the ezprestapiprovider extension<br /> for better upgradability and easier maintenance<br /> new resources can be provided without eZ Publish upgrade<br />11-06-20<br />Presenter: Łukasz Serwatka<br />44<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  45. 45. eZ Publish REST interface<br /> content is mapped into the resource<br /> node<br /> object<br /> lists<br /> fields<br /> resources provided by the ezprestapiprovider extension<br /> for better upgradability and easier maintenance<br /> new resources can be provided without eZ Publish upgrade<br />11-06-20<br />Presenter: Łukasz Serwatka<br />45<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  46. 46. ezpRestProviderInterface<br /> every REST resource provider needs to implement ezpRestProviderInterface<br />interface ezpRestProviderInterface<br />{<br /> /**<br /> * Returns registered versioned routes for provider<br /> *<br /> * @abstract<br /> * @return array<br /> */<br /> public function getRoutes();<br /> /**<br /> * Returns associated with provider view controller<br /> *<br /> * @abstract<br /> * @return ezpRestViewController<br /> */<br /> public function getViewController();<br />}<br />11-06-20<br />Presenter: Łukasz Serwatka<br />46<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  47. 47. REST URI pattern explained<br />11-06-20<br />Presenter: Łukasz Serwatka<br />47<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  48. 48. REST URI pattern explained<br />11-06-20<br />Presenter: Łukasz Serwatka<br />48<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />globalprefixwhichcan be configured in the rest.ini<br />works as a token to triggeryour re-writerule;<br />/api/ as defaultprefix;<br />
  49. 49. REST URI pattern explained<br />ezpRestPrefixFilterInterface<br />responsible for handlingprovidersinformation<br />responsible for handling version token<br />ezpRestDefaultRegexpPrefixFilter<br /> /ezp/ as defaultprovidertoken<br /> v + integer (e.g v1) as a version token<br />11-06-20<br />Presenter: Łukasz Serwatka<br />49<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  50. 50. Versioning<br />versioning is supported<br />version token is part of the URI resource e.g. /api/ezp/v1/…<br /> use ezpRestVersionedRoute class to register your versioned resources<br />11-06-20<br />Presenter: Łukasz Serwatka<br />50<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  51. 51. Versioning: examples<br /> new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/content/node/:nodeId/fields', 'ezpRestContentController', 'viewFields' ), 1 )<br /> new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/content/node/:nodeId/field/:fieldIdentifier', 'ezpRestContentController', 'viewField' ), 1 )<br /> new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/content/node/:nodeId/childrenCount', 'ezpRestContentController', 'countChildren' ), 1 )<br /> new ezpRestVersionedRoute( new ezpMvcRailsRoute( '/content/object/:objectId', 'ezpRestContentController', 'viewContent' ), 1 )<br />11-06-20<br />Presenter: Łukasz Serwatka<br />51<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  52. 52. Extensibility<br />done via eZ Publish extension system<br />create new provider by implementing ezpRestProviderInterface<br /> register your new versioned resources<br /> see ezprestapiprovider extension as a source of your inspiration<br />11-06-20<br />Presenter: Łukasz Serwatka<br />52<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  53. 53. Resources<br />content consumption only<br /> full CRUD in the next versions<br /> needs to be inline with eZ Publish PHP API<br />11-06-20<br />Presenter: Łukasz Serwatka<br />53<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  54. 54. Resources: example<br />GET /[api]/v1/content/object/<objectId>/fields HTTP/1.1<br /> /content/node/:nodeId<br /> /content/node/:nodeId/fields<br /> /content/node/:nodeId/field/:fieldIdentifier<br /> /content/node/:nodeId/childrenCount<br /> /content/object/:objectId<br /> /content/object/:objectId/fields<br />11-06-20<br />Presenter: Łukasz Serwatka<br />54<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  55. 55. Resources: example<br />11-06-20<br />Presenter: Łukasz Serwatka<br />55<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  56. 56. DEMO<br />Presenter: Łukasz Serwatka<br />SLIDE 56<br />11-06-20<br />
  57. 57. Knowledge sharing<br /> guidelines for the developers<br /> mobile web<br /> hybrid applications<br /> native applications<br /> source code for sample apps available on GitHub<br />11-06-20<br />Presenter: Łukasz Serwatka<br />57<br />Mobile Channels in eZ Publish<br />eZ Conference 2011<br />
  58. 58. Presenter: Łukasz Serwatka<br />58<br />Guidelines for the usage<br />Color scheme<br />Orange eZ color (for Headlines, graphical elements)<br />RGB (243/108/44)<br />HEX (#f36f21)<br />Blue eZ color (for highlighting, graphical elements)<br />RGB (42/132/183)<br />HEX (#2a84b7)<br />Light gray eZ color (for graphical elements)<br />RGB (147/149/152)<br />HEX (#939598)<br />Dark gray eZ color (for text and sublines)<br />RGB (64/64/64)<br />11-06-20<br />

×