874
edits
m (→Create your Store: style changes) |
m (→Create your Store: style fixes) |
||
| Line 27: | Line 27: | ||
* <tt>resetGUIDs()</tt>: is called in the case where the GUIDs of the local store have gotten out of sync with the GUIDs on the server, so that there's some kind of GUID conflict. See the implementation of <tt>BookmarkStore.resetGUIDs()</tt> in <tt>weave/modules/engines/bookmarks.js</tt> for an example of how this should work. May not be necessary for all types of engines. | * <tt>resetGUIDs()</tt>: is called in the case where the GUIDs of the local store have gotten out of sync with the GUIDs on the server, so that there's some kind of GUID conflict. See the implementation of <tt>BookmarkStore.resetGUIDs()</tt> in <tt>weave/modules/engines/bookmarks.js</tt> for an example of how this should work. May not be necessary for all types of engines. | ||
* <tt>_createCommand()</tt>, <tt>_removeCommand()</tt>, and <tt>_editCommand()</tt>: are called by the synchronization algorithm, in order to update the contents of your store. The argument passed to each one is | * <tt>_createCommand(command)</tt>, <tt>_removeCommand(command)</tt>, and <tt>_editCommand(command)</tt>: are called by the synchronization algorithm, in order to update the contents of your store. The <tt>command</tt> argument passed to each one is an object describing what user data should be created in the store, removed from the store, or updated within the store, respectively. It contains the following properties: | ||
:: | ::* <tt>GUID</tt>: this uniquely identifies which item in the store is to be affected. It will correspond to the GUID keys of the JSON dictionary that you return from <tt>wrap()</tt>. | ||
::* <tt>data</tt>: in the case of <tt>_createCommand()</tt> and <tt>_editCommand()</tt>, this contains the new data to be applied to the store. | |||
== Create your SyncCore == | == Create your SyncCore == | ||
edits