Hello!

I am trying to figure out how I can translate between Evolution/SyncML
vCard format and CardDAV (in particular, Google Contacts).

Google Contacts seems to follow the format as used by Apple, which is
not surprising considering that Apple iOS and OS X are probably the main
clients using CardDAV.

The key difference is that CardDAV uses IMPP (rfc 4770) for all kinds of
chat protocols, whereas Evolution and several SyncML implementations use
one kind of X- extension per protocol (X-AIM, X-JABBER, ...).

Evolution:
X-JABBER;TYPE=HOME;X-EVOLUTION-UI-SLOT=2:JABBER DOE

Google CardDAV:
item5.IMPP;X-SERVICE-TYPE=GoogleTalk:xmpp:google%20talk
item5.X-ABLabel:Other

Note that X-SERVICE-TYPE=GoogleTalk is the provider of the service.
"xmpp:" is part of the URL value and defines the chat protocol used by
the service; the rest of the value uses URL encoding of special
characters (a space in this case). The label is just that, a label
chosen by the user.

Evolution doesn't have support for custom labels, so there is nothing
exactly corresponding to X-ABLabel yet. TYPE comes close.

Same for some dates (X-EVOLUTION-ANNIVERSARY vs. X-ABDate):

Evolution:
X-EVOLUTION-ANNIVERSARY:2006-01-09

Google CardDAV:
item3.X-ABDATE:1971-01-01
item3.X-ABLabel:Anniversary
item4.X-ABDATE:2000-02-01
item4.X-ABLabel:custom-label

The exception is BDAY, which is used by both sides.

Finally, the same difference exists for related persons:

Evolution:
X-EVOLUTION-SPOUSE:Joan Doe

Google CardDAV:
item16.X-ABRELATEDNAMES:spouse
item16.X-ABLabel:Spouse

At the moment, SyncEvolution uses separate fields for AIM (AIM_HANDLE,
an array) and spouse (a single value). I'm leaning towards changing that
into a more generic field list where there is one array for IMPP, one
array for DATE, and one array for related NAMES. I think that can be
mapped fairly directly to the vCard format used by Google CardDAV. For
example:

      <field name="IMPP" array="yes" type="string" compare="conflict"/> <!-- 
includes protocol: xmpp:google%20talk -->
      <field name="IMPP_SERVICE" array="yes" type="string" compare="conflict"/> 
<!-- GoogleTalk -->
      <field name="IMPP_LABEL" array="yes" type="string" compare="conflict"/> 
<!-- Other -->
      <field name="GROUP-TAG-IMPP" array="yes" type="string" 
compare="conflict"/> <!-- group tag connecting IMPP_LABEL = X-ABLabel with IMPP 
and IMPP_SERVICE -->

The bigger problem will be on the Evolution side. I don't see how I can
teach libsynthesis that a IMPP entry whose protocol (encoded as part of
the value!) is xmpp maps to X-JABBER.

Should I keep the traditional JABBER_HANDLE array and move entries back
and forth between it and the IMPP array? This could be done with
incoming/outgoing resp. afterread/beforewrite scripts.

Then the traditional profile will only use the JABBER_HANDLE, as before,
whereas the new profile only uses IMPP.

For SyncEvolution<->SyncEvolution syncing the new profile should be used
because it will be more complete. Perhaps I can achieve that by offering
multiple datatypes and then letting the sync engines negotiate the most
suitable one.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.




_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to