summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/chrome/content/synckolab/addressbookTools.js18
-rw-r--r--test/suite.js5
-rw-r--r--test/synckolab/parser/kolab3/calendarTest.js1
-rw-r--r--test/synckolab/parser/kolab3/xml/contact.complex.mime.xml3
-rw-r--r--test/synckolab/parser/kolab3/xml/contact.simple.mime.xml3
-rw-r--r--test/synckolab/parser/kolab3/xml/contact.test.mime.xml3
-rw-r--r--test/synckolab/parser/kolab3/xml/contact.test2.mime.xml3
-rw-r--r--test/synckolab/parser/kolab3/xml/event.complex.mime.xml135
-rw-r--r--test/synckolab/parser/kolab3/xml/list.test1.eml.xml3
9 files changed, 96 insertions, 78 deletions
diff --git a/src/chrome/content/synckolab/addressbookTools.js b/src/chrome/content/synckolab/addressbookTools.js
index 0c34314..0128173 100644
--- a/src/chrome/content/synckolab/addressbookTools.js
+++ b/src/chrome/content/synckolab/addressbookTools.js
@@ -1120,10 +1120,22 @@ synckolab.addressbookTools.xml2Card = function (xml, card) {
this.setCardProperty(card, "PreferMailFormat", synckolab.addressbookTools.MAIL_FORMAT_HTML);
}
break;
+
+ case "KIND": // kolab 3: individual for cards/group for mailing lists
+ if(cur.getFirstData() === "group") {
+ // set type to maillist
+ card.type = "maillist";
+ card.isMailList = true;
+ // make sure we have a collection for the contacts
+ if(!card.contacts) {
+ card.contacts = [];
+ }
+ }
+ break;
case "MEMBER": // kolab3: distribution list
- // set type to maillist
+ // set type to maillist (just to be sure)
card.type = "maillist";
card.isMailList = true;
// make sure we have a collection for the contacts
@@ -1295,6 +1307,7 @@ synckolab.addressbookTools.list2Kolab3 = function (card, fields) {
xml += " <uid>" + this.getUID(card) + "</uid>\n";
xml += " <creation-date>" + synckolab.tools.text.calDateTime2String(new Date(), false, true) + "</creation-date>\n";
xml += " <last-modification-date>" + synckolab.tools.text.calDateTime2String(new Date(), false, true) + "</last-modification-date>\n";
+ xml += " <kind><text>group</text></kind>\n";
// default: public - tbird doesnt know of other types of list like private
xml += " <sensitivity>public</sensitivity>\n";
@@ -1543,8 +1556,9 @@ synckolab.addressbookTools.card2Kolab3 = function (card, skipHeader, fields) {
xml += "<vcard>\n";
xml += " <uid><uri>" + synckolab.tools.text.encode4XML(this.getUID(card)) + "</uri></uid>\n";
- xml += " <prodid><text>SyncKolab " + synckolab.config.version + ", Kolab resource</text></prodid>\n"; // TODO add version
+ xml += " <prodid><text>SyncKolab " + synckolab.config.version + ", Kolab resource</text></prodid>\n";
xml += " <rev><timestamp>" + synckolab.tools.text.calDateTime2String(new Date(this.getCardProperty(card, "LastModifiedDate")*1000), false, true) + "Z</timestamp></rev>\n";
+ xml += " <kind><text>individual</text></kind>\n";
// ??
//xml += synckolab.tools.text.nodeWithContent("categories", this.getCardProperty(card, "Category"), false);
diff --git a/test/suite.js b/test/suite.js
index 544db40..0e13548 100644
--- a/test/suite.js
+++ b/test/suite.js
@@ -36,11 +36,12 @@ QUnit.log(function(details) {
});
// run the tests
+
load("test/synckolab/tools/textTest.js");
load("test/synckolab/tools/toolsTest.js");
-//load("test/synckolab/parser/kolab2/calendarTest.js");
-//load("test/synckolab/parser/kolab2/contactTest.js");
+load("test/synckolab/parser/kolab2/calendarTest.js");
+load("test/synckolab/parser/kolab2/contactTest.js");
load("test/synckolab/parser/kolab3/contactTest.js");
//load("test/synckolab/parser/kolab3/calendarTest.js");
diff --git a/test/synckolab/parser/kolab3/calendarTest.js b/test/synckolab/parser/kolab3/calendarTest.js
index c2133aa..7e9f38d 100644
--- a/test/synckolab/parser/kolab3/calendarTest.js
+++ b/test/synckolab/parser/kolab3/calendarTest.js
@@ -49,6 +49,7 @@ test("kolab3 synckolab.addressbookTools.parseMessageContent", function(){
// json -> kolab 3 xml
content = synckolab.calendarTools.json2kolab3(entry);
print(content);
+
/*
content = readFile("test/synckolab/parser/kolab3/json/"+src+".json");
jsonEntry = JSON.parse(content);
diff --git a/test/synckolab/parser/kolab3/xml/contact.complex.mime.xml b/test/synckolab/parser/kolab3/xml/contact.complex.mime.xml
index b6f074b..d621e31 100644
--- a/test/synckolab/parser/kolab3/xml/contact.complex.mime.xml
+++ b/test/synckolab/parser/kolab3/xml/contact.complex.mime.xml
@@ -4,6 +4,9 @@
<uid><uri>urn:uuid:Huu5X7hfYy</uri></uid>
<prodid><text>SyncKolab 3.0.0, Kolab resource</text></prodid>
<rev><timestamp>19700101T000000ZZ</timestamp></rev>
+ <kind>
+ <text>individual</text>
+ </kind>
<note>
<text>Notes</text>
</note>
diff --git a/test/synckolab/parser/kolab3/xml/contact.simple.mime.xml b/test/synckolab/parser/kolab3/xml/contact.simple.mime.xml
index 90b72a4..232951c 100644
--- a/test/synckolab/parser/kolab3/xml/contact.simple.mime.xml
+++ b/test/synckolab/parser/kolab3/xml/contact.simple.mime.xml
@@ -4,6 +4,9 @@
<uid><uri>urn:uuid:4xuyC0cyjV</uri></uid>
<prodid><text>SyncKolab 3.0.0, Kolab resource</text></prodid>
<rev><timestamp>19700101T000000ZZ</timestamp></rev>
+ <kind>
+ <text>individual</text>
+ </kind>
<n>
<given>Krause</given>
<surname>Volker</surname>
diff --git a/test/synckolab/parser/kolab3/xml/contact.test.mime.xml b/test/synckolab/parser/kolab3/xml/contact.test.mime.xml
index cc8f189..45269a7 100644
--- a/test/synckolab/parser/kolab3/xml/contact.test.mime.xml
+++ b/test/synckolab/parser/kolab3/xml/contact.test.mime.xml
@@ -4,6 +4,9 @@
<uid><uri>urn:uuid:e79e08cc-0f02-11e2-9e3c-000476ed9009</uri></uid>
<prodid><text>SyncKolab 3.0.0, Kolab resource</text></prodid>
<rev><timestamp>19700101T000000ZZ</timestamp></rev>
+ <kind>
+ <text>individual</text>
+ </kind>
<note>
<text>multi line
notes
diff --git a/test/synckolab/parser/kolab3/xml/contact.test2.mime.xml b/test/synckolab/parser/kolab3/xml/contact.test2.mime.xml
index c57df41..0831cb8 100644
--- a/test/synckolab/parser/kolab3/xml/contact.test2.mime.xml
+++ b/test/synckolab/parser/kolab3/xml/contact.test2.mime.xml
@@ -4,6 +4,9 @@
<uid><uri>urn: uuid:ebf6fdc2-1149-11e2-841b-000476ed9009</uri></uid>
<prodid><text>SyncKolab 3.0.0, Kolab resource</text></prodid>
<rev><timestamp>19700101T000000ZZ</timestamp></rev>
+ <kind>
+ <text>individual</text>
+ </kind>
<n>
<given>Wurst</given>
<surname>Hans</surname>
diff --git a/test/synckolab/parser/kolab3/xml/event.complex.mime.xml b/test/synckolab/parser/kolab3/xml/event.complex.mime.xml
index b6f074b..9b99d52 100644
--- a/test/synckolab/parser/kolab3/xml/event.complex.mime.xml
+++ b/test/synckolab/parser/kolab3/xml/event.complex.mime.xml
@@ -1,75 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
-<vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
-<vcard>
- <uid><uri>urn:uuid:Huu5X7hfYy</uri></uid>
- <prodid><text>SyncKolab 3.0.0, Kolab resource</text></prodid>
- <rev><timestamp>19700101T000000ZZ</timestamp></rev>
- <note>
- <text>Notes</text>
- </note>
- <n>
- <given>Lastname</given>
- <surname>Firstname</surname>
- </n>
- <fn><text>Displayname</text></fn>
- <url>
- <uri>www.homepage.org</uri>
- </url>
- <url>
- <uri>www.blog.test</uri>
- </url>
- <impp>
- <uri>messaging</uri>
- </impp>
- <title>
- <text>Title</text>
- </title>
- <nickname>
- <text>Nickname</text>
- </nickname>
- <bday> <date-time>2043</date-time>
-</bday>
- <anniversary> <date-time>2009-7-28</date-time>
-</anniversary>
- <tel>
- <parameters><type><text>home</text></type></parameters>
- <text>+4930-homephone</text>
- </tel>
- <tel>
- <parameters><type><text>work</text></type></parameters>
- <text>+4930-workphone</text>
- </tel>
- <tel>
- <parameters><type><text>fax</text><text>work</text></type></parameters>
- <text>+4930-fax</text>
- </tel>
- <tel>
- <parameters><type><text>cell</text></type></parameters>
- <text>+4930-mobile</text>
- </tel>
- <email>
- <parameters><pref><integer>1</integer></pref></parameters>
- <text>first@email.org</text>
- </email>
- <email>
- <text>second@email.org</text>
- </email>
- <adr>
- <parameters><type><text>home</text></type></parameters>
- <street>Home Street</street>
- <locality>Home Locality</locality>
- <region>Home Region</region>
- <code>Home Postal Code</code>
- <country>Gabon</country>
- </adr>
- <adr>
- <parameters><type><text>work</text></type></parameters>
- <street>Work Street</street>
- <locality>Work Locality</locality>
- <region>Work Region</region>
- <code>Work Postal Code</code>
- <country>Azerbaijan</country>
- </adr>
- <x-custom><identifier>X-AllowRemoteContent</identifier><value>true</value></x-custom>
-</vcard>
-</vcards> \ No newline at end of file
+<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+<vcalendar>
+<properties>
+ <prodid><text>Synckolab 3.0.0, Calendar Sync</text></prodid>
+ <version><text>2.0</text></version>
+</properties>
+<components><vevent>
+<properties>
+ <uid><text>KOrganizer-1687167952.818</text></uid>
+ <dtstart><date-time>2009-09-02T10:00:00</date-time></dtstart>
+ <dtend><date-time>2009-09-02T11:00:00</date-time></dtend>
+ <summary><text>Complex Event</text></summary>
+ <description><text>Some notes on this event.</text></description>
+ <sensitivity><text>PRIVATE</text></sensitivity>
+ <location><text>Here</text></location>
+<categories>
+ <text>Appointment</text>
+ <text>Business</text>
+</categories>
+ <recur>
+ <freq>WEEKLY</freq>
+ <byday>WE</byday>
+ <byday>FR</byday>
+ <interval>1</interval>
+ <count>10</count>
+ </recur>
+ <exdate>
+ <date>2009-09-04</date>
+ </exdate>
+ <attendee>
+ <parameter>
+ <cn><text>Attendee1</text></cn>
+ <partstat><text>NEEDS-ACTION</text></partstat>
+ <rsvp><boolean>true</boolean></rsvp>
+ <role><text>REQUIRED</text></role>
+ </parameter>
+ </attendee>
+ <attendee>
+ <parameter>
+ <cn><text>Attendee2</text></cn>
+ <partstat><text>ACCEPTED</text></partstat>
+ <rsvp><boolean>true</boolean></rsvp>
+ <role><text>RESOURCE</text></role>
+ </parameter>
+ </attendee>
+ <attendee>
+ <parameter>
+ <cn><text>Attendee3</text></cn>
+ <partstat><text>DECLINED</text></partstat>
+ <rsvp><boolean>false</boolean></rsvp>
+ <role><text>REQUIRED</text></role>
+ </parameter>
+ </attendee>
+ </properties>
+<components>
+<valarm>
+ <action><text>DISPLAY</text></action>
+</valarm>
+</components>
+</vevent>
+</components></vcalendar></icalendar> \ No newline at end of file
diff --git a/test/synckolab/parser/kolab3/xml/list.test1.eml.xml b/test/synckolab/parser/kolab3/xml/list.test1.eml.xml
index ce8c6e3..52ece54 100644
--- a/test/synckolab/parser/kolab3/xml/list.test1.eml.xml
+++ b/test/synckolab/parser/kolab3/xml/list.test1.eml.xml
@@ -5,6 +5,9 @@
<creation-date>20121010T233013Z</creation-date>
<last-modification-date>20121010T233013Z</last-modification-date>
<sensitivity>public</sensitivity>
+ <kind>
+ <text>group</text>
+ </kind>
<name>list-name</name>
<notes><text>list-description</text></notes>
<nickname>list-nickname</nickname>