Re: [Evolution-hackers] Address book merging



On Wed, 2015-02-18 at 16:30 -0300, Renato Araujo wrote:
Could you guys help me with that? 

        Hi,
I wasn't sure what kind of merge you have on mind. I can think of a 
real contact merge, like when adding a new contact to an address book 
and searching for a similar contact (like based on e-mail) and 
eventually ask a user to merge the newly added contact with an already 
existing. Or, the other merge kind, is to gather contacts from 
multiple books and show them all in one long list (I have configured 
really many books, and some contains thousands of contacts, thus your 
application should count with it; there are also company books with 
hundreds of thousands of contacts).

I then realized, after reading your email, that you most likely need 
to do the second kind of the merge, provide contacts from multiple 
books in once source.

Is this idea too crazy?

No, it isn't.

Do you have any other idea to have contact from different address-
book merged in EDS? 

It's what the ENameSelector from evolution does. It's used for auto-
completion and it picks all books configured to be part of the auto-
completion and searches for available contacts in all these books at 
once. Check the ENameSelectorEntry [1] and EContactStore [2], the 
later is that what gathers contacts from the books.

Is possible to use client API inside of the backend implementation?  
(How?)

Yes, it is. Check the Birthdays & Anniversaries calendar code [3], it 
also uses books. It can be a little issue to ask for clients in the 
server side which provides those clients (you ask to open a book in a 
book backend, which wants to talk to the book factory, thus to 
itself). You might be also careful which thread you block with your 
client open. If you block the main thread of the factory, then any 
attempt to contact it, by any client, will cause timeouts.

Which is the best solution to get access to others addressbook from 
my backend implemation?


See the answer for the previous question.

        Hope it helps,
        Milan

[1] https://git.gnome.org/browse/evolution/tree/e-util/e-name-selector-entry.c
[2] https://git.gnome.org/browse/evolution/tree/e-util/e-contact-store.c
[3] 
https://git.gnome.org/browse/evolution-data-server/tree/calendar/backends/contacts/e-cal-backend-contacts.c


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]