[Bedework-commit] calendarapi r1380 -
trunk/icalendar/src/org/bedework/icalendar
svnadmin at bedework.org
svnadmin at bedework.org
Wed Sep 1 15:32:49 EDT 2010
Author: douglm
Date: 2010-09-01 15:32:48 -0400 (Wed, 01 Sep 2010)
New Revision: 1380
Modified:
trunk/icalendar/src/org/bedework/icalendar/VAlarmUtil.java
Log:
Getting a number of exceptions related to no descriptions for display alarms. The input code seems to check for that but the output is failing.
Use the event summary if the alarm description is missing.
Modified: trunk/icalendar/src/org/bedework/icalendar/VAlarmUtil.java
===================================================================
--- trunk/icalendar/src/org/bedework/icalendar/VAlarmUtil.java 2010-08-30 14:20:40 UTC (rev 1379)
+++ trunk/icalendar/src/org/bedework/icalendar/VAlarmUtil.java 2010-09-01 19:32:48 UTC (rev 1380)
@@ -263,11 +263,12 @@
}
for (BwAlarm alarm: als) {
- vals.add(setAlarm(alarm));
+ vals.add(setAlarm(ev, alarm));
}
}
- private static VAlarm setAlarm(final BwAlarm val) throws CalFacadeException {
+ private static VAlarm setAlarm(final BwEvent ev,
+ final BwAlarm val) throws CalFacadeException {
try {
VAlarm alarm = new VAlarm();
@@ -296,8 +297,15 @@
addProperty(alarm, new Attach(new URI(val.getAttach())));
}
} else if (atype == BwAlarm.alarmTypeDisplay) {
- checkRequiredProperty(val.getDescription(), "alarm-description");
- addProperty(alarm, new Description(val.getDescription()));
+ /* This is required but somehow we got a bunch of alarms with no description
+ * Is it possibly because of the rollback issue I (partially) fixed?
+ */
+ //checkRequiredProperty(val.getDescription(), "alarm-description");
+ if (val.getDescription() != null) {
+ addProperty(alarm, new Description(val.getDescription()));
+ } else {
+ addProperty(alarm, new Description(ev.getSummary()));
+ }
} else if (atype == BwAlarm.alarmTypeEmail) {
if (val.getAttach() != null) {
addProperty(alarm, new Attach(new URI(val.getAttach())));
More information about the Bedework-commit
mailing list