canmove, Confirmed users
725
edits
Line 6: | Line 6: | ||
== Overview == | == Overview == | ||
This page describes how to the client-side Sync API for sync engines (and their helper objects). The focus is on using this API to create a new sync engine to synchronize a new data type. | This page describes how to the client-side Sync API for sync engines (and their helper objects). The focus is on using this API to create a new sync engine to synchronize a new data type. To do this, you'll need to write an engine object that extends the base <tt>SyncEngine</tt> object. You'll also need to extend three helper objects. Here are the base implementations you need to extend, and the files in which they're defined: | ||
# <tt>CryptoWrapper</tt>, in <tt>services/sync/modules/record.js</tt> | # <tt>CryptoWrapper</tt>, in <tt>services/sync/modules/record.js</tt> | ||
# <tt>SyncEngine</tt>, <tt>Store</tt>, <tt>Tracker</tt> in <tt>services/sync/modules/engines.js</tt> | # <tt>SyncEngine</tt>, <tt>Store</tt>, <tt>Tracker</tt> in <tt>services/sync/modules/engines.js</tt> | ||
It will be very helpful to look at the existing sync engines -- such as the one for bookmarks and the one for history, and their helpers, for guidance. You can find these files at: | |||
It will be very helpful to look at the existing sync engines -- such as the one for bookmarks and the one for history | |||
* <tt>services/sync/modules/engines/bookmarks.js</tt> -- the Record implementations for the various subtypes of bookmarks and the <tt>BookmarkEngine</tt>, <tt>BookmarkStore</tt>, and <tt>BookmarkTracker</tt>. | * <tt>services/sync/modules/engines/bookmarks.js</tt> -- the Record implementations for the various subtypes of bookmarks and the <tt>BookmarkEngine</tt>, <tt>BookmarkStore</tt>, and <tt>BookmarkTracker</tt>. |