Service/Sync/FxSync/Developer/BrowserObjects: Difference between revisions

blank page since content on docs.services.m.c
(blank page since content on docs.services.m.c)
 
Line 1: Line 1:
Once an [[Labs/Weave/Developer/StorageFormat#Payload:_Encrypted_Data_Object|Encrypted Data Object]]'s payload is decrypted using [[Labs/Weave/Crypto|Weave Crypto]], the result is a cleartext JSON string. Each collection can have its own object structure to store data that it needs to reconstruct the item on the client.
{{Warning| This page is now located at http://docs.services.mozilla.com/sync/fxclient/storage.html}}
 
The object structure is versioned with the version metadata stored in the [[Labs/Weave/Developer/StorageFormat#Payload:_meta.2Fglobal|payload of meta/global]].
 
This document describes the format of the objects for each collection for each version. Typically, one record corresponds to one item, e.g., a bookmark, and the object formats have a fixed list of keys for simple key/value string pairs.
 
The following sections, named by the corresponding collection name, describes the various object formats and how they're used. Note that object structures may change in the future and may not be backwards compatible.
 
In addition to these custom collection object structures, the [[Labs/Weave/Developer/StorageFormat#Payload:_Encrypted_Data_Object|Encrypted Data Object]] adds fields like <tt>id</tt> and <tt>deleted</tt>. Also, remember that there is data at the [[Labs/Weave/Developer/StorageFormat#Weave_Basic_Object|Weave Basic Object]] level as well such as <tt>id</tt>, <tt>modified</tt>, <tt>sortindex</tt> and <tt>payload</tt>.
 
== bookmarks (engine version 1) ==
 
One bookmark record exists for each "bookmark item," where an item may actually be a folder or a separator. Each item will have a <tt>type</tt> that determines what other fields are available in the object. The following sections describe the object format for a given <tt>type</tt>.
 
Each bookmark item has a parentid and predecessorid to form a structure like a tree of linked-lists to provide a hierarchical ordered list of bookmarks, folders, etc.
 
==== bookmark ====
 
This describes a regular bookmark that users can click to view a page.
 
<b>title</b> <i>string</i>: name of the bookmark
<b>bmkUri</b> <i>string</i> uri of the page to load
<b>description</b> <i>string</i>: extra description if provided
<b>loadInSidebar</b> <i>boolean</i>: true if the bookmark should load in the sidebar
<b>tags</b> <i>array of strings</i>: tags for the bookmark
<b>keyword</b> <i>string</i>: alias to activate the bookmark from the location bar
<b>parentid</b> <i>string</i>: GUID of the containing folder
<b>parentName</b> <i>string</i>: name of the containing folder
<b>predecessorid</b> <i>string</i>: GUID of the item before this (empty if it's first)
<b>type</b> <i>string</i>: "bookmark"
 
==== microsummary ====
 
[https://developer.mozilla.org/en/Microsummary_topics Microsummaries] allow pages to be summarized for viewing from the toolbar. This extends <tt>bookmark</tt>, so the usual <tt>bookmark</tt> fields apply.
 
<b>generatorUri</b> <i>string</i>: uri that generates the summary
<b>staticTitle</b> <i>string</i>: title to show when no summaries are available
<b>title</b> <i>string</i>: name of the microsummary
<b>bmkUri</b> <i>string</i> uri of the page to load
<b>description</b> <i>string</i>: extra description if provided
<b>loadInSidebar</b> <i>boolean</i>: true if the bookmark should load in the sidebar
<b>tags</b> <i>array of strings</i>: tags for the bookmark
<b>keyword</b> <i>string</i>: alias to activate the bookmark from the location bar
<b>parentid</b> <i>string</i>: GUID of the containing folder
<b>parentName</b> <i>string</i>: name of the containing folder
<b>predecessorid</b> <i>string</i>: GUID of the item before this (empty if it's first)
<b>type</b> <i>string</i>: "microsummary"
 
==== query ====
 
Place queries are special bookmarks with a place: uri that links to an existing folder/tag. This extends <tt>bookmark</tt>, so the usual <tt>bookmark</tt> fields apply.
 
<b>folderName</b> <i>string</i>: name of the folder/tag to link to
<b>queryId</b> <i>string</i> (optional): identifier of the smart bookmark query
<b>title</b> <i>string</i>: name of the query
<b>bmkUri</b> <i>string</i> place: uri query
<b>description</b> <i>string</i>: extra description if provided
<b>loadInSidebar</b> <i>boolean</i>: true if the bookmark should load in the sidebar
<b>tags</b> <i>array of strings</i>: tags for the query
<b>keyword</b> <i>string</i>: alias to activate the bookmark from the location bar
<b>parentid</b> <i>string</i>: GUID of the containing folder
<b>parentName</b> <i>string</i>: name of the containing folder
<b>predecessorid</b> <i>string</i>: GUID of the item before this (empty if it's first)
<b>type</b> <i>string</i>: "query"
 
==== folder ====
 
Folders contain bookmark items like bookmarks and other folders.
 
<b>title</b> <i>string</i>: name of the folder
<b>parentid</b> <i>string</i>: GUID of the containing folder
<b>parentName</b> <i>string</i>: name of the containing folder
<b>predecessorid</b> <i>string</i>: GUID of the item before this (empty if it's first)
<b>type</b> <i>string</i>: "folder"
 
==== livemark ====
 
[https://developer.mozilla.org/en/Using_the_Places_livemark_service Livemarks] act like folders with a dynamic list bookmarks, e.g., a RSS feed. This extends <tt>folder</tt>, so the usual <tt>folder</tt> fields apply.
 
<b>siteUri</b> <i>string</i>: site associated with the livemark
<b>feedUri</b> <i>string</i>: feed to get items for the livemark
<b>title</b> <i>string</i>: name of the livemark
<b>parentid</b> <i>string</i>: GUID of the containing folder
<b>parentName</b> <i>string</i>: name of the containing folder
<b>predecessorid</b> <i>string</i>: GUID of the item before this (empty if it's first)
<b>type</b> <i>string</i>: "livemark"
 
==== separator ====
 
Separators help split sections of a folder.
 
<b>pos</b> <i>string</i>: position (index) of the separator
<b>parentid</b> <i>string</i>: GUID of the containing folder
<b>parentName</b> <i>string</i>: name of the containing folder
<b>predecessorid</b> <i>string</i>: GUID of the item before this (empty if it's first)
<b>type</b> <i>string</i>: "separator"
 
== bookmarks (engine version 2) ==
 
Same as engine version 1, except:
 
* the predecessorid is removed from all records,
* instead folder and livemark records have a children attribute which is an array of child GUIDs in order of their appearance in the folder:
 
<b>children</b> <i>array of strings</i>: ordered list of child GUIDs
 
* the special folders 'menu' and 'toolbar' now have records that are synced, purely to maintain order within them according to their '''children''' array.
 
== clients ==
 
Client records identify a user's one or multiple clients that are accessing the data. The existence of client records can change the behavior of the Firefox Weave Sync add-on -- multiple clients and/or mobile clients result in syncs to happen more frequently.
 
<b>name</b> <i>string</i>: name of the client connecting
<b>type</b> <i>string</i>: type of the client: "desktop" or "mobile"
<b>commands</b> <i>array</i>: commands to be executed upon next sync
 
== forms ==
 
Form data is used to give suggestions for autocomplete for a HTML text input form. One record is created for each form entry.
 
<b>name</b> <i>string</i>: name of the HTML input field
<b>value</b> <i>string</i>: value to suggest for the input
 
== history ==
 
Every page a user visits generates a history item/page. One history (page) per record.
 
<b>histUri</b> <i>string</i>: uri of the page
<b>title</b> <i>string</i>: title of the page
<b>visits</b> <i>array of objects</i>: a number of how and when the page was visited
  <b>date</b> <i>integer</i>: datetime of the visit
  <b>type</b> <i>integer</i>: [https://developer.mozilla.org/en/nsINavHistoryService#Constants transition type] of the visit
 
== passwords ==
 
Saved passwords help users get back into websites that require a login such as HTML input/password fields or HTTP auth.
 
<b>hostname</b> <i>string</i>: hostname that password is applicable at
<b>formSubmitURL</b> <i>string</i>: submission url (GET/POST url set by <form>)
<b>httpRealm</b> <i>string</i>: the HTTP Realm for which the login is valid. if not provided by the server, the value is the same as hostname
<b>username</b> <i>string</i>: username to log in as
<b>password</b> <i>string</i>: password for the username
<b>usernameField</b> <i>string</i>: HTML field name of the username
<b>passwordField</b> <i>string</i>: HTML field name of the password
 
== prefs (engine version 1) ==
 
Some preferences used by Firefox will be synced to other clients. There is only one record for preferences with a GUID "preferences". Custom preferences can be synced such as [[Labs/Weave/Developer/HowToSynchronizeAddOnPrefs|add-on preferences]].
 
<b>value</b> <i>array of objects</i>: each object describes a preference entry
  <b>name</b> <i>string</i>: full name of the preference
  <b>type</b> <i>string</i>: the type of preference (int, string, boolean)
  <b>value</b> <i>depends on type</i>: value of the preference
 
== prefs (engine version 2) ==
 
There is only one record for preferences, using nsIXULAppInfo.ID as the GUID. Custom preferences can be synced such as [[Labs/Weave/Developer/HowToSynchronizeAddOnPrefs|add-on preferences]].
 
<b>value</b> <i>object</i> containing name and value of the preferences.
 
Note: The preferences that determine which preferences are synced are now included as well.
 
== tabs ==
 
Tabs describe the opened tabs on a given client to provide functionality like get-up-n-go. Each client will provide one record.
 
<b>clientName</b> <i>string</i>: name of the client providing these tabs
<b>tabs</b> <i>array of objects</i>: each object describes a tab
  <b>title</b> <i>string</i>: title of the current page
  <b>urlHistory</b> <i>array of strings</i>: page urls in the tab's history
  <b>icon</b> <i>string</i>: favicon uri of the tab
  <b>lastUsed</b> <i>integer</i>: datetime in seconds the tab was last accessed
canmove, Confirmed users
409

edits