1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 11:12:22 -05:00

Caldav: additional VCalendar properties for rebuilt item: VALARM (reminder)

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1441 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-09-13 20:08:05 +00:00
parent 7619bb715d
commit 50fc71c7f1
2 changed files with 20 additions and 2 deletions

View File

@ -1307,10 +1307,11 @@ public class DavExchangeSession extends ExchangeSession {
result = getICSFromItemProperties();
}
// debug code
if (new String(result).indexOf("VTODO") < 0) {
/*if (new String(result).indexOf("VTODO") < 0) {
LOGGER.debug("Original body: " + new String(result));
result = getICSFromItemProperties();
LOGGER.debug("Rebuilt body: " + new String(result));
}
}*/
return result;
}
@ -1338,6 +1339,8 @@ public class DavExchangeSession extends ExchangeSession {
davPropertyNameSet.add(Field.getPropertyName("sensitivity"));
davPropertyNameSet.add(Field.getPropertyName("alldayevent"));
davPropertyNameSet.add(Field.getPropertyName("busystatus"));
davPropertyNameSet.add(Field.getPropertyName("reminderset"));
davPropertyNameSet.add(Field.getPropertyName("reminderdelta"));
PropFindMethod propFindMethod = new PropFindMethod(permanentUrl, davPropertyNameSet, 0);
try {
@ -1405,6 +1408,18 @@ public class DavExchangeSession extends ExchangeSession {
"1".equals(getPropertyIfExists(davPropertySet, "alldayevent")) ? "TRUE" : "FALSE");
vEvent.setPropertyValue("X-MICROSOFT-CDO-BUSYSTATUS", getPropertyIfExists(davPropertySet, "busystatus"));
if ("1".equals(getPropertyIfExists(davPropertySet, "reminderset"))) {
VObject vAlarm = new VObject();
vAlarm.type = "VALARM";
vAlarm.setPropertyValue("ACTION", "DISPLAY");
vAlarm.setPropertyValue("DISPLAY", "Reminder");
String reminderdelta = getPropertyIfExists(davPropertySet, "reminderdelta");
VProperty vProperty = new VProperty("TRIGGER", "-PT"+reminderdelta+ 'M');
vProperty.addParam("VALUE", "DURATION");
vAlarm.addProperty(vProperty);
vEvent.addVObject(vAlarm);
}
localVCalendar.addVObject(vEvent);
result = localVCalendar.toString().getBytes("UTF-8");
} catch (MessagingException e) {

View File

@ -177,6 +177,9 @@ public class Field {
createField(URN_SCHEMAS_CALENDAR, "rrule"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:rrule/PtypMultipleString
createField(URN_SCHEMAS_CALENDAR, "exdate"); // DistinguishedPropertySetType.PublicStrings/urn:schemas:calendar:exdate/PtypMultipleTime
createField(SCHEMAS_MAPI, "reminderset"); // PidLidReminderSet
createField(SCHEMAS_MAPI, "reminderdelta"); // PidLidReminderDelta
// TODO
createField(SCHEMAS_MAPI, "allattendeesstring"); // PidLidAllAttendeesString
createField(SCHEMAS_MAPI, "required_attendees"); // PidLidRequiredAttendees