[Sugar-devel] Datastore API for html activities (Daniel Narvaez)

Daniel Narvaez dwnarvaez at gmail.com
Thu May 30 13:54:22 EDT 2013


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()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130530/a66e269d/attachment.html>


More information about the Sugar-devel mailing list