W3C home > Mailing lists > Public > public-device-apis@w3.org > October 2009

RE: ACTION-19 contact api review / feedback

From: <richard.tibbett@orange-ftgroup.com>
Date: Fri, 9 Oct 2009 16:12:57 +0200
Message-ID: <355A518BC0575547B2A3D6773AAF8EEF4DF125@ftrdmel1>
To: <brian@westcoastlogic.com>
Cc: <anssi.kostiainen@nokia.com>, <public-device-apis@w3.org>
On 7th Oct, 2009 10:41am, anssi.kostiainen@nokia.com wrote:
> I'd also add:
> 
> MAY provide an interface to search through contacts.
>
> On 7th Oct, 2009 12:44pm, richard.tibbett@orange-ftgroup.com wrote:
>
> > I would rather make the existing ContactFilter interface 
> more flexible 
> > to allow AND/OR pattern matching across the available contact 
> > attributes (thereby creating a more flexible universal 
> search feature possible).
> > Currently ContactFilter is rigid in it's search but it 
> could be made 
> > to allow for more flexible search use cases:
> 
> > On 7th Oct, 2009 8:15pm, ext Brian LeRoux <brian@westcoastlogic.com>
wrote:
> > >
> > > Feels like a slippery slope!
> > >

Taking the use cases from my previous email and with the assumption that
'within each Contact object the fields are ANDed' and 'between Contact
objects the fields are ORed' then this could be accomplished using
sequences of ContactFilter objects as follows:

1. Filter contacts that are in my ('friends' OR 'collegues') group AND
are based in the 'UK'.

var search = { 
                 { category: 'friends', country: 'uk' },
                 { category: 'colleagues', country: 'uk' } 
             };

/*...*/device.contacts.addressbook.find(search);

2. Search for the entered query string 'london' over any of the
following contact attributes: 'firstname', 'lastname', 'address', 'job'
and return all matching results.

var search = {  
                 { firstname: 'london' },
                 { lastname: 'london' },
                 { address: 'london' },
                 { job: 'london' }
             };

/*...*/device.contacts.addressbook.find(search);


Does that provide the search feature required? This would denote only
the following minimal change to the existing Contacts API WebIDL (plus
some descriptive text):

[NoInterfaceObject]
interface AddressBook {
    ...
    sequence<Contact> find (in Object filter);
};


Best Regards,

Richard
Received on Friday, 9 October 2009 14:13:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:39 UTC