Changes

Jump to: navigation, search

CloudServices/Sync/FxSync/Developer/ClientAPI

377 bytes added, 10:13, 30 January 2009
Example Store class skeleton
__proto__: Store.prototype,
_logName: "foo",
itemExists: function(idguid) { // Return true if an item with given guid = id exists in the store.
},
createRecord: function(idguid) { // Return the cached one if we have it: let record = this has something to do with WBOs?.cache.get(guid); if (record) return record; // Otherwise, instantiate: record = new FooRecord(); // now sets Set the data and the guid on it: record.bar = 17; // or whatever record .id= guid; // use utils.makeGuid Add it to create the cache: this.cache.put(guid for something, record);
// return the record
}, createMetaRecords: function(guid, items) { // Return... what exactly?return record;
},
changeItemId: function(oldId, newId) {
},
getAllIds: function() {
// Return a dictionary-style object...list of the GUIDs of all items
},
wipe: function() {
},
create: function(record) {
// Create a new item based on the values in record
},
update: function(record) {
// look up the stored record with id = record.id, then set // its values to those of new record
},
remove: function(record) {
// look up the stored record with id = record.id, then delete it.
}
};
1,007
edits

Navigation menu