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

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

BEGINDATA
BEGIN:VCARD
VERSION:3.0
REV:2010-03-29T09:23:34Z
UID:pas-id-4BB0719600000000
X-SKYPE;X-EVOLUTION-UI-SLOT=1;TYPE=HOME:karora__
X-JABBER;X-EVOLUTION-UI-SLOT=3;TYPE=HOME:karora@irc.oftc.net
TEL;X-EVOLUTION-UI-SLOT=3;TYPE=CELL:+64 22 123 4567
TEL;X-EVOLUTION-UI-SLOT=2;TYPE=HOME,VOICE:+64 4 123 4567
TEL;X-EVOLUTION-UI-SLOT=1;TYPE=WORK,VOICE:+64 22 123 4567
EMAIL;X-EVOLUTION-UI-SLOT=2;TYPE=HOME:andrew@mcmillan.net.nz
EMAIL;X-EVOLUTION-UI-SLOT=1;TYPE=WORK:andrew@morphoss.com
LABEL;TYPE=HOME:16 Kaka Place\nPorikana\n4173\nNew Zealand
ADR;TYPE=HOME:;;16 Kaka Place;Porikana;;4173;New Zealand
X-MOZILLA-HTML:FALSE
X-EVOLUTION-VIDEO-URL:
FBURL:https://davical.morphoss.com/freebusy.php/andrew@morphoss.com
CALADRURI:mailto:andrew@morphoss.com
CALURI:https://dotcal.com/karora
X-EVOLUTION-BLOG-URL:http://andrew.mcmillan.net.nz/
CATEGORIES:Developer,Personal,Debian,
X-EVOLUTION-FILE-AS:McMillan\, Andrew
N:McMillan;Andrew;Watson;;
FN:Andrew Watson McMillan
NOTE:Primary author of DAViCal CalDAV Server.
X-EVOLUTION-SPOUSE:Heather Buchanan
X-EVOLUTION-ANNIVERSARY:1989-04-22
BDAY:1958-07-26
NICKNAME:karora
X-EVOLUTION-ASSISTANT:
X-EVOLUTION-MANAGER:
ROLE:Geek
ORG:dotCal;;Porirua
TITLE:Chief Technology Officer
URL:http://andrew.mcmillan.net.nz/
END:VCARD
ENDDATA

QUERY
SELECT caldav_data.dav_name, caldav_data.dav_etag,
       version, uid, 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/andrew_mcmillan.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/andrew_mcmillan.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/andrew_mcmillan.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/andrew_mcmillan.vcf'
  ORDER BY dav_id, property
ENDQUERY


