• JSON data export

last modified April 7, 2013 by gpieretti

UPDATE: Done. :) All my code has been reviewed and merged with collective.jsonify .Thank you all for making it happend! :) 

UPDATE: Also Mikko suggest to get a full list {"path","uid"} of live objects and let the client APP to make the dirty work. Two evidences make a prove :)

 

UPDATE: Massimiliano De Ruosi has been recruited in this sprint and gives his "two-cents" to the open discussion on DELETED objects. Thank very much for that, Massimiliano!

He suggested to give the number of existing objects as a first response, and then a list of {"path","uid"} of existing objects, letting the client APP do the right query  for checking if and what object has been deleted.
I think it's a very clean solution on the Plone side, but more work should be done on the client APP side (some queries....)

By now, I think it is the best solution we have.

Everybody out there... any suggestions? 

 

The goal: 

More than a sprint, JSON export is an open talk to valuable solution for an easy and fast management of JSON exports of Plone contents.

The goal is not about a raw export of JSON format data (or better, this is a side effect), but to give a "standardized" answer to questions like:

- Are there any changes from THIS date (from specific path, portal type, etc...)? : YES or NO

- If YES, return the JSON format of changed objects 

- Are there any DELETE objects from THIS date? If so, tell me... (TBD)

Also, as a result of discussions with Mikko, it should be nice if other functions are implemented.

This is what he suggest (as based on BackboneJS calls):

Login

- How to identify the user (HTTP cookies - do not opinionate for vanilla Plone)

Query and list folder objects HTTP GET - special

- Map Plone content items to JSON. Preferably with minimal transform for Backbone collection and other consumption

- Accept filtering parameters

Get object HTTP GET

- Check permission

- Get object by folder item id

- Get object by UUID

Add object HTTP PUT

- Check permission

- Reindex

- Return CREATE response which a URL the created object

Update object HTTP POST

- Check permission

- Read JSON

- Delegate to setXXX(), etc.

- Reindex

Update object partially HTTP PATCH

- Check permission

- Read JSON

- Delegate to setXXX(), etc.

- Reindex

Delete object HTTP DELETE

- Check permission

- Reindex 

 

Thank you Mikko for your interest! :)