Labs/Sprints/People: Difference between revisions

Jump to navigation Jump to search
Line 27: Line 27:


== Structure ==
== Structure ==
There will be a single XPCOM component implemented in JavaScript, and an IDL file to go along with it.  The component can then be dropped into any extensions that need to use the interface, and eventually uplifted into Firefox.
The backend store is implemented as a JS module.


== API ==
== API ==
Line 56: Line 56:
Currently, the store uses transactions internally to add each person (because data is split up over multiple tables), so there is no public API for dealing with database transactions.  In the future, we may add this functionality.
Currently, the store uses transactions internally to add each person (because data is split up over multiple tables), so there is no public API for dealing with database transactions.  In the future, we may add this functionality.


The object to pass in to <tt>add</tt> and <tt>update</tt> and returned by <tt>find</tt> are [http://portablecontacts.net/draft-spec.html#schema Portable Contacts objects]. There are two additional optional singular fields: <tt>moz_guid</tt> and <tt>moz_schema</tt>.
The object to pass in to <tt>add</tt> and <tt>update</tt> and returned by <tt>find</tt> look like this:
 
<pre>
{
  guid: "af24d-fe488-ab748-b947f",
  schema: "http://mozilla.com/schemas/people/1",
 
  firstname: "foo"
  lastname: "bar"
 
  documents: [
    {
      moz_schema: "http://portablecontacts.net/draft-spec.html",
      firstname: "foo",
      lastname: "bar",
      emails: [
        {value: "foo@gmail.com"},
        {value: "foo@yahoo.com"},
        {value: "bar@yahoo.com"}
      ]
    }
  ]
}
</pre>
 
Currently, by default, we're storing a single [http://portablecontacts.net/draft-spec.html#schema Portable Contacts object], with the addition of a <tt>moz_schema</tt> field.


== Performance ==
== Performance ==
946

edits

Navigation menu