Re: [Evolution] Evolution Corba Interfaces



First of all, if you're going to be using C/C++, it might be easier just
to use the addressbook/backend/ebook stuff.  That's the C api for the
client side of the corba interface (the server end is in
addressbook/backend/pas).

The corba interface is designed to be asynchronous so the result for
most operations that you perform on an object come to a listener
object... For instance, all Book operations result in you being notified
at some point in the future by a call to your BookListener.  BookView
has an analogous BookViewListener interface.  In your particular case
you'd do something like:

     1. create a BookListener
     2. call BookFactory.openBook with the uri to the addressbook and
        the listener from step 1.
     3. (wait while the wombat does its thing)
     4. your BookListener's notifyBookOpened method will be called with
        the Book object that you'll use for other operations.
     5. call Book.getCursor with a query string.[*]
     6. your BookListener's notifyCursorRequested method will be called
        with the CardCursor object.
     7. you can use the methods on the CardCursor to interrogate it
        (it'll be a list of cards that match your query.)  The
        CardCursor interface is synchronous.

the ebook stuff makes all of this much easier, though.  it's callback
based, and hides the Listener stuff.

[*] the query string format isn't documented anywhere, unfortunately.. 
it's an sexp (just like filters and the query strings that are used in
other parts of evolution).  Your particular query string could be
something like:

(is "phone" "111-111111")

along with 'is', you can also use 'contains', 'beginswith', or
'endswith'.  You can also join multiple predicates with 'and' and 'or'..
there's also a 'not'.

so you can do things like:

(and (is "phone" "111-111111") (not (is "email" "toshok ximian com")))

for lack of a better place (and since we have no documentation on it), a
guideline for the fields that are allowed (in place of "phone" and
"email") can be found in backend/pas/pas-backend-card-sexp.c.  look for
"prop_info" to find the table..  you want the query_prop field (the
second string in the prop_info table entries).

Chris

On Mon, 2003-04-21 at 10:20, Iñigo Illán wrote:
Basically, I need to get the name of the person who's telephone number
is 111-111111. For this I think I must retrieve all VCards on the
Evolution Addressbook and compare each phone number until I get the
correct. 

Is this posible to do with Evolution?

Is this method correct? 

What methods must I call for retrieve the VCards?

I've seen there is a method "void getVCard(in CardID id)" but I don't
know what parameter give to the call and where the VCard I get will be
stored (the method returns void and there is no out parameter).

Thanks for all help you can give me.

On Sun, 2003-04-20 at 04:23, Chris Toshok wrote: 
On Sat, 2003-04-19 at 06:00, Iñigo Illán wrote:
Is there any how-to or tutorial explaining the Evolution's corba
Interfaces (mainly I would like to know the addressbook corba
interfaces). I've been looking the idl files, but I don't understand
what some functions do.

There's neither how-to nor tutorial, but I can answer specific questions
you have.

Chris
_______________________________________________
evolution maillist  -  evolution lists ximian com
http://lists.ximian.com/mailman/listinfo/evolution





P.D.: Magic is real......... unless declared integer. 

P.D.D.: Para entender lo que es la recursividad, primero hay que
entender lo que es la recursividad.



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