#
# PUT a VCARD record into an addressbook
#
TYPE=PUT
URL=http://regression.host/caldav.php/user1/addressbook/mustrmahn.vcf

HEADER=User-Agent: DAViCalTester/public
HEADER=Content-Type: text/vcard; charset=utf-8
HEADER=If-None-Match: *
HEAD

BEGINDATA
BEGIN:VCARD
VERSION:3.0
N:Mustermann;Anton;Karl;Dr.;
FN:Überwerbung GmbH
NICKNAME:Boss
X-MAIDENNAME:Müller
X-PHONETIC-FIRST-NAME:Anto
X-PHONETIC-MIDDLE-NAME:Carl
X-PHONETIC-LAST-NAME:Mustrmahn
ORG:Überwerbung GmbH;Marketing
TITLE:CEO
EMAIL;type=INTERNET;type=WORK;type=pref:karl@mustermann.de
TEL;type=WORK;type=pref:+49 30 1234567
TEL;type=CELL:+49 172 1234567
item1.ADR;type=WORK;type=pref:;;Musterweg 1a;Musterhausen;;12345;DE
item1.X-ABADR:de
NOTE:Test vCard
item2.URL;type=pref:mustermann.de
item2.X-ABLabel:_$!<HomePage>!$_
BDAY;value=date:1969-08-16
X-AIM;type=WORK;type=pref:bethel69
X-JABBER;type=HOME;type=pref:bethel69@foo.com
PHOTO;BASE64:
[encoded data, 7821 characters]
  AACv0nhTLKvEkZWmoqKW6ueHxPmdLh5Qm4uXO3s7H//Z
item3.X-ABDATE;type=pref:2000-12-31
item3.X-ABLabel:_$!<Anniversary>!$_
X-ABShowAs:COMPANY
X-ABUID:73FD0F46-DE18-4F1F-AA2C-59E8738B4249\:ABPerson
END:VCARD
ENDDATA

QUERY
SELECT caldav_data.dav_name,
       version, nickname, fn, n, note, org, url, fburl, caladruri, caluri
  FROM caldav_data LEFT JOIN addressbook_resource USING(dav_id)
  WHERE caldav_data.dav_name ~ '/user1/addressbook/mustrmahn.vcf'
ENDQUERY

QUERY
SELECT 
       type, box_no, unit_no, street_address, locality, region, postcode, country, property
  FROM caldav_data 
        LEFT JOIN addressbook_address_adr USING(dav_id)
  WHERE caldav_data.dav_name ~ '/user1/addressbook/mustrmahn.vcf'
  ORDER BY dav_id, property
ENDQUERY

QUERY
SELECT 
        addressbook_address_tel.type, addressbook_address_tel.tel
  FROM caldav_data
        LEFT JOIN addressbook_address_tel USING(dav_id)
  WHERE caldav_data.dav_name ~ '/user1/addressbook/mustrmahn.vcf'
  ORDER BY dav_id, property
ENDQUERY

QUERY
SELECT 
        addressbook_address_email.type, addressbook_address_email.email
  FROM caldav_data
        LEFT JOIN addressbook_address_email USING(dav_id)
  WHERE caldav_data.dav_name ~ '/user1/addressbook/mustrmahn.vcf'
  ORDER BY dav_id, property
ENDQUERY


