Changes

Jump to: navigation, search

CloudServices/Sync/FxSync/Developer/ClientAPI

959 bytes added, 09:31, 30 January 2009
createRecord
=== createRecord ===
 
The <tt>createRecord( guid )</tt> method gets called by the engine to request a new record for an item with a given GUID.
 
It's your Store's responsibility to instantiate a Record object (of the class you defined earlier), assign the given GUID to it, and return it.
 
It's also strongly recommended that your Store cache the record object. The base class provides the cache, so you can store a record in it like so:
 
this.cache.put( guid, record );
 
And you can retrieve a record from it like so:
 
this.cache.get( guid );
 
Thus, if createRecord is called requesting a GUID for which you've already instantiated a Record, you can just return the cached Record.
 
Otherwise, createRecord should set all the required data on the Record object to reflect the state of the underlying application data identified by the GUID. It must also store the GUID in the id property of the record before returning it, like so:
 
// ...
record.id = guid;
return record;
=== itemExists / changeItemId / getAllIds / wipe ===
1,007
edits

Navigation menu