CloudServices/Sync/FxSync/Developer/ClientAPI: Difference between revisions

Jump to navigation Jump to search
delete createMetaRecord part
m (function name)
(delete createMetaRecord part)
Line 122: Line 122:


This is the method that the engine will call the first time it syncs, in order to get a complete inventory of what data there is that will need to be uploaded to the server.  Unless the items you're syncing have their own inherent GUIDs already defined, you'll need to invent GUIDs for all your items at this time.  When one of these GUIDs is later passed as an argument to <tt>createRecord()</tt>, you need to return a record based on the matching data.  Therefore, it's the responsibility of this method to define the guid -> item mapping, and to store it for later reference by other methods.
This is the method that the engine will call the first time it syncs, in order to get a complete inventory of what data there is that will need to be uploaded to the server.  Unless the items you're syncing have their own inherent GUIDs already defined, you'll need to invent GUIDs for all your items at this time.  When one of these GUIDs is later passed as an argument to <tt>createRecord()</tt>, you need to return a record based on the matching data.  Therefore, it's the responsibility of this method to define the guid -> item mapping, and to store it for later reference by other methods.
=== createMetaRecords(guid, items) ===
Unlike the other methods here, this one needs to be implemented only if your data store is a hierarchy (like bookmarks) as opposed to a simple list (like history or tabs).
If your data store is a hierarchy, you need to manually maintain the depth attribute on each one.  If depth and/or depthindex are used, then <tt>createMetaRecords()</tt> should return all objects potentially affected by change of guid, in short form (no full content, only id, depth, sortindex).
[TODO: explain this better!]


=== wipe() ===
=== wipe() ===
14

edits

Navigation menu