263 lines
7.9 KiB
Plaintext
263 lines
7.9 KiB
Plaintext
BEGIN:VCARD
|
|
VERSION:3.0
|
|
PRODID:-//ownCloud//NONSGML Contacts 0.5.0.0//EN
|
|
UID:C6DA7E8B-CD70-0001-9A15-DB371F19DCE0
|
|
N:Contact Last Name;Contact First Name;;;
|
|
FN:Contact First Name Contact Last Name
|
|
ORG:work organisation;work department
|
|
NICKNAME:Contact Nickname
|
|
CATEGORIES:categories 1,categories 2,Business Partner,Customer,Provider,Fri
|
|
end,Press,VIP,category 3
|
|
ADR;TYPE=work:
|
|
;work address 2
|
|
;work address 1
|
|
;work city
|
|
;work state
|
|
;workzip
|
|
;work country
|
|
ADR;TYPE=home:;private address 2;private address 1;private address 3;privat
|
|
e state;privatezip;private country
|
|
TEL;TYPE=work:contact work
|
|
TEL;TYPE=home:contact home
|
|
TEL;TYPE=cell:contact mobile
|
|
TEL;TYPE=fax:contact fax
|
|
TEL;TYPE=pager:contact pager
|
|
X-MOZILLA-HTML:FALSE
|
|
EMAIL;TYPE=work:contact@email.com
|
|
EMAIL;TYPE=home:contact.additional.email.com
|
|
URL;TYPE=work:work.web.page
|
|
URL;TYPE=home:private.web/page
|
|
TITLE:work title
|
|
BDAY:1970-01-01
|
|
CUSTOM1:other custom 1
|
|
CUSTOM2:other custom 2
|
|
CUSTOM3:other custom 3
|
|
CUSTOM4:other custom 4
|
|
NOTE:other notes 1\nother notes 2\nother notes 3\nother notes 4\nother note
|
|
s 5\nother notes 6\nother notes 7\nother notes 8\nother notes 9\nother not
|
|
es 10\nother notes 11\nother notes 12\nother notes 13\nother notes 14\noth
|
|
er notes 15\nother notes 16\nother notes 17\nother notes 18\nother notes 1
|
|
9\nother notes 20
|
|
X-AIM:chat aim
|
|
REV:2015-11-25T23:17:35+00:00
|
|
END:VCARD
|
|
|
|
----------------
|
|
wget -c -P /var/tmp https://freeshell.de/~kaosmos/morefunctionsforAB-TB3-0.7.3.xpi
|
|
|
|
The extra values for messenger is missing above, all the new fields from morefunctionsforAB are missing below.
|
|
----------------
|
|
BEGIN:VCARD
|
|
VERSION:3.0
|
|
PRODID:-//Inverse inc.//SOGo Connector 1.0//EN
|
|
UID:C6DB6797-8760-0001-AE9B-12F0CBF72BA0
|
|
N:mf contact last;mf contact first;;;
|
|
FN:mf contact first mf contact last
|
|
ORG:work organisation;work department
|
|
NICKNAME:mf contact nickname
|
|
ADR;TYPE=work:;work address 2;work address 1;work city;work state;work zip;
|
|
work country
|
|
ADR;TYPE=home:;private address 2;private address 1;private city;private sta
|
|
te;private zip;private country
|
|
TEL;TYPE=work:mf contact work
|
|
TEL;TYPE=home:mf contact home
|
|
TEL;TYPE=cell:mf contact mobile
|
|
TEL;TYPE=fax:mf contact fax
|
|
TEL;TYPE=pager:mf contact pager
|
|
X-MOZILLA-HTML:FALSE
|
|
EMAIL;TYPE=work:mf.contact@email.com
|
|
EMAIL;TYPE=home:mf.contact2@email.com
|
|
URL;TYPE=work:work web
|
|
URL;TYPE=home:private.web
|
|
TITLE:work title
|
|
BDAY:1970-01-01
|
|
CUSTOM1:other custom 1
|
|
CUSTOM2:other custom 2
|
|
CUSTOM3:other custom 3
|
|
CUSTOM4:other custom 4
|
|
NOTE:notes1\nnotes2\nnotes3\nnotes4\nnotes5\nnotes6\nnotes7\nnotes8\nnotes9
|
|
\nnotes10\nnotes11\nnotes12
|
|
X-AIM:chat aim
|
|
END:VCARD
|
|
--------------------------
|
|
owncloud - not converted
|
|
--------------------------
|
|
UID:37e67bd498
|
|
X-ABSHOWAS:COMPANY
|
|
N:last name;first name;;additional title;
|
|
ORG:organization;additional department
|
|
FN:organization
|
|
NOTE:note1\nnote2\nnote2
|
|
REV:2015-11-28T20:31:50+00:00
|
|
NICKNAME:Nickname
|
|
TITLE:additional position
|
|
BDAY;VALUE=DATE:19700101
|
|
TEL;TYPE="WORK,VOICE";PREF=1:work phone
|
|
EMAIL;TYPE="INTERNET,INTERNET";PREF=1:email
|
|
IMPP;X-SERVICE-TYPE=aim;PREF=1:aim:aim messenger
|
|
CLOUD;TYPE=WORK;PREF=1:federated-cloud-id
|
|
URL;TYPE=INTERNET;PREF=1:homepage
|
|
ADR;TYPE=WORK;PREF=1:;;work address 1;work city;work state;work zip;work co
|
|
untry
|
|
END:VCARD
|
|
--------------------------
|
|
IMPP;X-SERVICE-TYPE=aim;PREF=1:aim:aim messenger
|
|
IMPP;X-SERVICE-TYPE=msn;PREF=2:msn:msn messenger
|
|
IMPP;X-SERVICE-TYPE=sip;PREF=3:sip:internet call
|
|
IMPP;X-SERVICE-TYPE=jabber;PREF=4:xmpp:jabber
|
|
|
|
--------------------------
|
|
import vobject
|
|
import datetime
|
|
|
|
# rfc6350 defines vcard4, this is not supported by sogo connect
|
|
|
|
# output_person_details has dictionary person_dict{}
|
|
# output_office_details has dictionary office_dict{}
|
|
# person details does not have address we want to use the office_dict{} address for the work details.
|
|
|
|
def create_vcard(the dict with the values);
|
|
new_vcard = vobject.vCard()
|
|
line = new_vcard.add('n')
|
|
line.n.value = dict.corresponding value
|
|
line.n.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('fn')
|
|
line.fn.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('org')
|
|
line.org.value = dict.corresponding value
|
|
line.org.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('nickname')
|
|
line.nickname.value = dict.corresponding value
|
|
|
|
# unlimited number of separate values, map to list with foreach areas of practice
|
|
line = new_vcard.add('categories')
|
|
line.categories.value = dict.corresponding value # multiple line from list in dict
|
|
|
|
# six lines, but the last 4 are city, state, zip and country for thunderbird
|
|
line = new_vcard.add('adr')
|
|
line.type_param = "work"
|
|
line.adr.value = dict.corresponding value # line one
|
|
line.adr.value = dict.corresponding value # line two
|
|
line.adr.value = dict.corresponding value # city
|
|
line.adr.value = dict.corresponding value # state
|
|
line.adr.value = dict.corresponding value # zip
|
|
line.adr.value = dict.corresponding value # country
|
|
|
|
# six lines, but the last 4 are city, state, zip and country for thunderbird
|
|
line = new_vcard.add('adr')
|
|
line.type_param = "home"
|
|
line.adr.value = dict.corresponding value # line one
|
|
line.adr.value = dict.corresponding value # line two
|
|
line.adr.value = dict.corresponding value # city
|
|
line.adr.value = dict.corresponding value # state
|
|
line.adr.value = dict.corresponding value # zip
|
|
line.adr.value = dict.corresponding value # country
|
|
|
|
line = new_vcard.add('tel')
|
|
line.tel.type_param = "work"
|
|
line.tel.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('tel')
|
|
line.tel.type_param = "home"
|
|
line.tel.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('tel')
|
|
line.tel.type_param = "cell"
|
|
line.tel.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('tel')
|
|
line.tel.type_param = "fax"
|
|
line.tel.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('tel')
|
|
line.tel.type_param = "pager"
|
|
line.tel.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('x-mozilla-html')
|
|
line.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('email')
|
|
line.email.type_param = "work"
|
|
line.email.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('email')
|
|
line.email.type_param = "home"
|
|
line.email.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('url')
|
|
line.email.type_param = "work"
|
|
line.email.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('url')
|
|
line.url.type_param = "home"
|
|
line.url.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('title')
|
|
line.title.value = dict.corresponding value
|
|
|
|
# Maybe reuse for date admitted or add an extra field
|
|
line = new_vcard.add('bday')
|
|
# line.bday.value = '1970-01-01'
|
|
line.bday.value = dict.corresponding value
|
|
|
|
# custom value 1-4
|
|
line = new_vcard.add('custom1')
|
|
line.custom1.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('custom2')
|
|
line.custom2.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('custom3')
|
|
line.custom3.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('custom4')
|
|
line.custom4.value = dict.corresponding value
|
|
|
|
# single value each separated with "\n"
|
|
line = new_vcard.add('note')
|
|
line.note.value = dict.corresponding value
|
|
|
|
line = new_vcard.add('x-aim')
|
|
line.x-aim.value = dict.corresponding value
|
|
|
|
#
|
|
line = new_vcard.add('rev')
|
|
#line.value = 2015-11-25T23:17:35+00:00 #use date function
|
|
line.rev.value =
|
|
|
|
# morefunctionsforAB-TB3 fields
|
|
# tab additional, 5 available slots
|
|
line = new_vcard.add('email')
|
|
line.email.type_param = "internet"
|
|
line.email.value =
|
|
line.email.value =
|
|
line.email.value =
|
|
line.email.value =
|
|
line.email.value =
|
|
|
|
# other data tab - aniversary, spouse, last modified, 8 extra categories
|
|
line = new_vcard.add('x-anniversary')
|
|
line.x-anniversay.value =
|
|
|
|
line = new_vcard.add('x-spouse')
|
|
line.x-spouse.value =
|
|
|
|
line = new_vcard.add('categories')
|
|
line.categories.type_param = "charset=utf"
|
|
line.categories.value =
|
|
line.categories.value =
|
|
line.categories.value =
|
|
line.categories.value =
|
|
line.categories.value =
|
|
line.categories.value =
|
|
line.categories.value =
|
|
line.categories.value =
|
|
|
|
|
|
|
|
return new_vcard.serialize()
|
|
return new_vcard.prettyPrint()
|