#
# PUT a VCARD record into an addressbook
#
TYPE=PUT
URL=http://regression.host/caldav.php/user1/addressbook/F06EC844-EACD-4ADF-8823-588603991E04-ABSPlugin.vcf

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

BEGINDATA
BEGIN:VCARD
VERSION:3.0
N:McMillan;Andrew;;;
FN:Morphoss Ltd
ORG:Morphoss Ltd;
EMAIL;type=INTERNET;type=WORK;type=pref:andrew+davical@morphoss.com
TEL;type=WORK;type=pref:+64272332426
PHOTO;BASE64:
[encoded data, 24569 characters]
  YK0K+GkrOxC95XP/2Q==
X-ABShowAs:COMPANY
CATEGORIES:My Contacts
X-ABUID:685FC9B6-8446-45B8-89AF-3F3BC70CA03A\:ABPerson
UID:F26B8512-45DA-49ED-B285-23E64B0A68D1-ABSPlugin
REV:2010-06-23T00:01:37Z
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/F06EC844-EACD-4ADF-8823-588603991E04-ABSPlugin.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/F06EC844-EACD-4ADF-8823-588603991E04-ABSPlugin.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/F06EC844-EACD-4ADF-8823-588603991E04-ABSPlugin.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/F06EC844-EACD-4ADF-8823-588603991E04-ABSPlugin.vcf'
  ORDER BY dav_id, property
ENDQUERY


