Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

eZ goes mobile - the RESTful way

2.101 Aufrufe

Veröffentlicht am

Veröffentlicht in: Technologie
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

eZ goes mobile - the RESTful way

  1. 1. eZ goes mobile <ul>...the RESTful way </ul>
  2. 2. About me <ul><li>Markus Birth
  3. 3. Software-Developer at silver.solutions GmbH
  4. 4. Berlin, Germany
  5. 5. silver.solutions offers great experience in connecting eZ Publish to ERP systems (Navision, Axapta, SAP R/3). We also do mobile apps.
  6. 6. I do mostly backend programming for eZ Publish sites where I'm specialized in interfaces. My second field of activity is mobile apps. </li></ul>
  7. 7. REST <ul>-> Re presentational S tate T ransfer (Google it! Or try Wikipedia: http://en.wikipedia.org/wiki/REST ) </ul>
  8. 8. Things you might need <ul>What you need: <li>eZ 4.5 with ezpRestApiProvider
  9. 9. configured OAuth2 consumer credentials
  10. 10. user login with appropriate access rights
  11. 11. doc.ez.no
  12. 12. some client (e.g. a mobile app) </li></ul>
  13. 13. I am who I am (or: OAuth 2.0) <ul><li>to communicate via REST, a valid access_token is required
  14. 14. can be retrieved via OAuth2 workflow
  15. 15. tricky for non-browser applications </li><ul><li>2 ways for apps on mobile devices: </li><ul><li>a) show login window in an own WebView and watch the currently shown URL for the endpoint URI
  16. 16. b) register a new protocol handler, set the endpoint_uri and react on that (works from any mobile browser) </li><ul><li>e.g. mycrapp:// </li></ul></ul></ul></ul>
  17. 17. OAuth 2.0 login
  18. 18. eZ REST URL Scheme <ul><li>Methods: GET , POST, PUT, DELETE
  19. 19. Base URL: http://myezsite.com/api/ezp/v1 </li><ul><li>/content/ object / [objectID]
  20. 20. /content/ node / [nodeID]
  21. 21. /content/ ( node | object ) / [ID] / fields
  22. 22. /content/ ( node | object ) / [ID] / field / [fieldID]
  23. 23. /content/node/ [nodeID] / list /offset/…/limit/…/sort/…/…
  24. 24. /content/node/ [nodeID] / childrenCount </li></ul><li>non-default language: http://… ?translation= xxx-YY </li></ul>
  25. 25. The first request GET /api/ezp/v1/content/node/ 2 / list Authorization: OAuth 0123456789abcdef… Accept: application/json &quot;childrenNodes&quot;: [ { &quot;objectName&quot;: &quot;Awards&quot; , &quot;classIdentifier&quot;: &quot;subcategory&quot;, &quot;datePublished&quot;: 1302091069, &quot;dateModified&quot;: 1307614988, &quot;objectRemoteId&quot;: &quot;d003…3e94&quot;, &quot;objectId&quot;: 1203, &quot;nodeId&quot;: 1257, &quot;nodeRemoteId&quot;: &quot;f4ef…47f2&quot;, &quot;fullUrl&quot;: &quot;http://…/Awards&quot;, &quot;link&quot;: &quot;http://…/content/node/1257&quot; }, { … } ],
  26. 26. Thank you for listening http://lanyrd.com/sfhtw

×