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.

0

Teilen

Herunterladen, um offline zu lesen

Using a Plone JSON API to interface modern Web Applications

Herunterladen, um offline zu lesen

The usage and the concept of the Plone add-on 'plone.jsonapi.routes' will be shown in the web browser to the audience.

This will encompass basic content retrieval, as well as create/update/delete operations.

Afterwards, a modern JavaScript web application that communicates with Plone over the JSON API will be demonstrated.

A small excursion to the JavaScript developer console provides some deeper insights into the asynchronous data retrieval.

Finally, ways to extend `plone.jsonapi.routes` will be discussed.

Ähnliche Bücher

Kostenlos mit einer 30-tägigen Testversion von Scribd

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

Using a Plone JSON API to interface modern Web Applications

  1. 1. Using a Plone JSON API to interface modern Web Applications Ramon Bartl RIDING BYTES
  2. 2. plone.jsonapi.core 2012
  3. 3. Browser View /@@API
  4. 4. Traverses Subpaths zope.publisher.interfaces.IPublishTraverse
  5. 5. http://localhost:2017/Plone/@@API/hello/world
 <Plone Base URL>/<API Browser View>/<Subpath>
  6. 6. Maps Subpaths to endpoints and vice versa werkzeug.routing for the win
  7. 7. from plone.jsonapi.core import router @router.add_route("/hello/<string:name>", "hello", methods=["GET"])
 def hello(context, request, name="world"):
 return {"hello": name}
  8. 8. Subpath to Endpoint Mapping >>> DefaultRouter.url_map
 
 Map([<Rule '/hello/<name>' (HEAD, GET) -> hello>])
 The Subpath maps to a named endpoint
  9. 9. Endpoint to Function Mapping >>> DefaultRouter.view_functions
 
 {'hello': <function hello at 0x10ae35de8>}
 The endpoint is the key for a view function
  10. 10. plone.jsonapi.routes 2014
  11. 11. Route Providers on top of plone.jsonapi.routes /@@API/plone/api/1.0/<resource>
  12. 12. CRUD Operations for Plone resources Create, Read, Update, Delete
  13. 13. As Fast as Possible Postpone expensive operations
  14. 14. Two-step Architecture Step 1: Return Catalog Schema Step 2: Return Object Schema
  15. 15. Step 1
 Catalog Search Results /@@API/plone/api/1.0/folder /@@API/plone/api/1.0/document /@@API/plone/api/1.0/event
 /@@API/plone/api/1.0/<custom type>
  16. 16. Step 2
 Fetch Resource …/folder/c35d00fec4eb44bfb6dd7bb39c4e2ad5 …/6febded044354c9d97c342a52f1bd23a …/event?complete=yes
 …/customtype?children=yes&complete=yes
  17. 17. Supports Catalog Indexes …/folder?sort_on=created …/document?SearchableText=Welcome* …/event?start.query:record:list:date=2017-10-16& start.range:record=min
 …/customtype?sort_on=created
  18. 18. Browser Demo
  19. 19. How to extend? A JSON API built to be extended
  20. 20. Data Provider Adapts a content object to extract the schema
 plone.jsonapi.routes.interfaces.IInfo
  21. 21. Data Manager Adapts a content object to get/set a named value
 plone.jsonapi.routes.interfaces.IDataManager
  22. 22. Field Manager Adapts a field to get/set a value
 plone.jsonapi.routes.interfaces.IFieldManager
  23. 23. Catalog Adapts the Portal object to get a catalog tool
 plone.jsonapi.routes.interfaces.ICatalog
  24. 24. Catalog Query Adapts the Catalog adapter to generate create query
 plone.jsonapi.routes.interfaces.ICatalogQuery
  25. 25. Building a Todo App with BACKBONE.JS
  26. 26. App Demo
  27. 27. Getting started
  28. 28. Todo Model
  29. 29. Todo Collection
  30. 30. JS Console Demo
  31. 31. More Apps
  32. 32. Thank You

The usage and the concept of the Plone add-on 'plone.jsonapi.routes' will be shown in the web browser to the audience. This will encompass basic content retrieval, as well as create/update/delete operations. Afterwards, a modern JavaScript web application that communicates with Plone over the JSON API will be demonstrated. A small excursion to the JavaScript developer console provides some deeper insights into the asynchronous data retrieval. Finally, ways to extend `plone.jsonapi.routes` will be discussed.

Aufrufe

Aufrufe insgesamt

509

Auf Slideshare

0

Aus Einbettungen

0

Anzahl der Einbettungen

88

Befehle

Downloads

2

Geteilt

0

Kommentare

0

Likes

0

×