Changes

Jump to: navigation, search

CloudServices/Sync/FxSync/Developer/ClientAPI

821 bytes added, 03:30, 30 January 2009
Writing a Record class
== Writing a Record class ==
A Record object is a wrapper around a single instance of whatever data it is that you are syncing -- a single bookmark in the case of the bookmark engine, a single browser tab in the case of the tab engine, and so on.
There's a class called <tt>CryptoWrapper</tt> defined in <tt>weave/modules/base_records/crypto.js</tt>, which handles all the encryption and decryption of your record for you. All you have to do is write a class that extends <tt>CryptoWrapper</tt> and maintains a property called <tt>cleartext</tt>. <tt>cleartext</tt> must be a JSON-dictionary-style object; put into it all values that you want to have encrypted, stored on the server, decrypted, and synced up.
 
You may find it useful to write getters and setters for various properties of your Record class.
 
The skeleton of a sample Record class:
<pre>
1,007
edits

Navigation menu