Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 28ADCE0B1 for ; Tue, 22 Jan 2013 22:05:25 +0000 (UTC) Received: (qmail 25735 invoked by uid 500); 22 Jan 2013 22:05:25 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 25699 invoked by uid 500); 22 Jan 2013 22:05:24 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 25691 invoked by uid 99); 22 Jan 2013 22:05:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jan 2013 22:05:24 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of brian.leroux@gmail.com designates 209.85.220.169 as permitted sender) Received: from [209.85.220.169] (HELO mail-vc0-f169.google.com) (209.85.220.169) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jan 2013 22:05:17 +0000 Received: by mail-vc0-f169.google.com with SMTP id n10so646236vcn.14 for ; Tue, 22 Jan 2013 14:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Vz8k6Wag2HtG8ivLcZlHOeBQzovYgfhE1MHAPT1KLOM=; b=wIllAaLo6cyqvQjAXUyU+3fdvvfMT8x6rlU7x9E6MuJh2DNU9EsI8pY3RCgi1efpOK CbN/lBWbQj4KbgMs9/m5/WoPYy3acrSLm2HjU+rG3ovQhdtTnQHi98BDfGg7TEETVDki Q35TatrZ7gomJcCTeSn2mkA34B2o8jMGLnbNBDJfJYyazY3dBA3sGNLi78JlJmTPxhav NvjYkdx7Y2qJ0PhxLHPHkBqxoN+18Y/cOmFJBOKQXxJCGm27YSeh8LPHHlRtsxxkXzpV OxI3BI39g/1/3xMhxfdiMWxDCMScfAjBTg5snkiCGqs4eeB2robb/xQFiXqyzLa+OVCT yNsA== MIME-Version: 1.0 X-Received: by 10.52.76.170 with SMTP id l10mr22268404vdw.83.1358892296279; Tue, 22 Jan 2013 14:04:56 -0800 (PST) Sender: brian.leroux@gmail.com Received: by 10.58.38.230 with HTTP; Tue, 22 Jan 2013 14:04:56 -0800 (PST) In-Reply-To: References: Date: Tue, 22 Jan 2013 16:04:56 -0600 X-Google-Sender-Auth: 728KtW-MLquATOypoPkSAwEKfQg Message-ID: Subject: Re: Review of Contacts API against W3C From: Brian LeRoux To: dev@cordova.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Thx for this Becky. Agree we should maybe add this analysis to the wiki [1] (tho it too is in danger of getting dated) and hold out. [1] http://wiki.apache.org/cordova/Core%20API%20Audit On Tue, Jan 22, 2013 at 3:40 PM, Becky Gibson wrot= e: > I thought I would check the state of our Contacts API against the latest > W3C draft. At this point I don't think there are enough changes to warra= nt > modifying the Cordova APIs except maybe for search. We might consider > making search work better but I think at this point we are better off > waiting for the W3C to solidify the spec and decide what is happening wit= h > Web Intents. > > Here are the differences I noted in my review: > > Current W3C Document just provides a Pick Intent. We can ignore the Web > Intent based changes for now and focus on the Contact objects and > behaviors. The only option now is "pick" which is just find. There is = no > api for creating contacts but we can keep what we have implemented with > Contacts.create and Contacts.find. > > Most of the Contact objects are the same. However the input to the pick > operation has changed. Instead of two parameters of fields and > ContactFindOptions, there is now the ContactIntentExtras Dictionary ( > http://www.w3.org/TR/contacts-api/#idl-def-ContactIntentExtras) that > combines the previous options: > > ContactIntentExtras { > DomString search, > Unsigned long limit, // nullable > DomString[] fields > } > > Thus, what used to be the find string in ContactFindOptions is now the > loosely defined search string and the boolean multiple is once again a > numeric limit. The interesting change is the definition for search: > > "search of type DOMString, nullable > A string which provides a hint to the contact service to facilitate > contacts selection by the user. The exact manner in which this hint is > exploited is entirely up to the contact service." > > This gives us much more flexibility in implementing find. Previously, in > the December, 2010 draft, find was defined as the item to search for with= in > the specified fields (where fields were the field types that were returne= d > in the found contact(s)). We could add some rules to the search string t= o > allow people to search in specific fields rather than all of the returned > fields. We could use a simple format like: > > "searchTerm1, searchTerm2: searchField1, searchField2, =85 searchField#" > > This would allow limiting the search term(s) to one of more fields rather > than the entire fields array of items to be returned. Thus, to have all > name, address and phone number details returned for all contacts containi= ng > "Smith" in the familyName field you could provide the following > ContentIntentExtras: > > {search: "Smith: name.familyName", limit: NULL, fields: ["addresses", > "name", "phoneNumbers"]} > > Since the previous draft from June, 2011, does not spell out all the find > details, we could also implement something similar to this now using the > current ContactFindOptions.filter field. > > In addition, the ContactError object has been modified to just contain a > DomString with the error message rather than previously defined error cod= e.