[Sugar-devel] Datastore API for html activities (Daniel Narvaez)
Manuel Quiñones
manuq at laptop.org
Thu May 30 14:14:51 EDT 2013
2013/5/30 Daniel Narvaez <dwnarvaez at gmail.com>:
> Updated proposal based on the feedback, limiting myself to loading/saving
> objects for now
>
> * Low level
>
> datastore.getMetadata(objectId, onGotMetadata)
> datastore.setMetadata(objectId, onMetadataSet)
> datastore.loadData(objectId, onStream, onLoaded)
> datastore.create(metadata, onStream, onCreated)
> datastore.update(objectId, metadata, onStream, onUpdated)
>
> * High level
>
> datastoreObject = datastore.DatastoreObject(objectId)
>
> datastoreObject.updateMetadata(metadata, onMetadataUpdated)
> datastoreObject.setDataAsText(text, onDataSet)
> datastoreObject.save(onSaved)
>
> datastoreObject.getMetadata(onGotMetadata)
> datastoreObject.load(onLoaded[metadata, data])
>
> activity.getDatastoreObject()
Looks very good to me.
--
.. manuq ..
More information about the Sugar-devel
mailing list