addressbook export module?
Christopher Browne
cbbrowne@hex.net
Mon, 16 Apr 2001 00:46:39 -0500
On Thu, 12 Apr 2001 13:19:48 CDT, the world broke into rejoicing as
linas@backlot.linas.org (Linas Vepstas) said:
> Is there a way to use the evolution contact manager inside another
> program? (I haven't yet , umm played with bonobo ... so my question
> is umm, a bit naive, but serious ...)
> I'm working on gnucash, and we need to store names and addresses so
> that they can be printed on an invoice.
> Traditionally, this is done by making 'name-address-phone-etc' a
> part of the accounting app. with its own gui, stored in its own
> database, etc. But this is dumb, why should I reinvent if I can
> somehow leverage evolution?
> So here's what I think I want ...
> -- a way to hit a button in gnucash, and have just the evolution
> contact manager pop up.
> -- allow user to select an existing entry (possibly using ldap),
> or add a new one.
> -- get a GUID from evolution that uniquely identifies that entry
> (so I can store it with my gnucash account info)
> -- be able to fetch name/addr info based on the guid (so I can
> pump it into the invoice report)
>
> Any thoughts? is this easy? hard? Do I have to seriously modify
> evolution to make it do this, or is there some readme/sample code out
> there that already shows me how to do exactly this?
There's IDL for "gnome_PIM" that seems more directly intended for this
purpose. The vCard_server interface offers two way communications,
both to push out "vCards," via set_record(), as well as the ability to
query, using get_record() and get_records().
You might, perhaps, find this as /usr/share/idl/gnome-pim.idl...
module gnome_PIM {
/* Exceptions */
exception PIM_busy{
};
struct vCard_X {
string name;
string val;
};
typedef sequence<vCard_X> vCard_X_seq;
/* We export the vCard information in unpacked form. This means
* that fields with multiple items (ie. N) are unpacked into a
* structure. In addition, escaped items are unescaped directly
* into a string */
/* First, we define the unpacked fields in a structure */
struct vCard_N {
string family; /* Public */
string given; /* John */
string additional; /* Quinlan */
string prefix; /* Mr. */
string suffix; /* Esq. */
};
struct vCard_BDAY {
/* hmmm -- is the time range needed here?
* I guess we should have a more universal time field. */
short year;
short month;
short day;
};
struct vCard_ADR {
string type; /* really needs to be better, i guess */
string pobox;
string extended_address;
string street_address;
string locality;
string region;
string postal_code;
string country_name;
};
struct vCard_TZ {
short offset; /* from UTC */
string name; /* ie. EST */
string locale; /* Raleigh/North America */
};
struct vCard_GEO {
float LAT;
float LON;
};
struct vCard_ORG {
string name;
string unit1;
string unit2;
string unit3;
string unit4;
};
/* Types -- see RFC 2426 for more details. */
struct vCard {
string FN;
vCard_N N;
string NICKNAME;
string PHOTO; /* how do we deal with binary data? */
vCard_BDAY BDAY;
vCard_ADR ADR;
vCard_ADR LABEL;
string TEL;
string EMAIL; /* only one email, I guess */
string MAILER;
vCard_TZ TZ;
vCard_GEO GEO;
string TITLE;
string ROLE;
string LOGO; /* more binary data */
string AGENT; /* uri or normal string */
vCard_ORG ORG;
string CATEGORIES;
string NOTE;
string PRODID; /* unimplemented, i guess... */
string REV;
string SORT_STRING; /* also unimplemented */
string SOUND; /* even more binary data */
string URL;
string UID;
string VVERSION;
string CLASS;
string KEY; /* more binary data */
vCard_X_seq X;
};
typedef sequence<vCard> vCard_seq;
interface vCard_server {
vCard_seq get_records ();
vCard get_record (in string UID);
void set_record (in string UID, in vCard record);
};
};
--
(reverse (concatenate 'string "ac.notelrac.teneerf@" "454aa"))
http://vip.hex.net/~cbbrowne/resume.html
Friends help you move. Real friends help you move bodies.