RE: ACTION-19 contact api review / feedback

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