[Bedework-commit] calendarapi r585 - in trunk: calCore/src/org/bedework/calcore/hibernate calFacade/src/org/bedework/calfacade calFacade/src/org/bedework/calfacade/base icalendar/src/org/bedework/icalendar

svnadmin at bedework.org svnadmin at bedework.org
Fri Mar 28 00:58:16 EDT 2008


Author: douglm
Date: 2008-03-28 00:58:08 -0400 (Fri, 28 Mar 2008)
New Revision: 585

Modified:
   trunk/calCore/src/org/bedework/calcore/hibernate/CoreEvents.java
   trunk/calFacade/src/org/bedework/calfacade/BwEvent.java
   trunk/calFacade/src/org/bedework/calfacade/BwEventProxy.java
   trunk/calFacade/src/org/bedework/calfacade/base/RecurrenceEntity.java
   trunk/icalendar/src/org/bedework/icalendar/VEventUtil.java
Log:
Fix a bug in handling of recurring event with a single rdate after the master start date/time. 

Resulted in two instances (correct) but deletion of rdate resulted in event being flagged as non-recurring (incorrect - still had one instance)

Modified: trunk/calCore/src/org/bedework/calcore/hibernate/CoreEvents.java
===================================================================
--- trunk/calCore/src/org/bedework/calcore/hibernate/CoreEvents.java	2008-03-28 02:18:01 UTC (rev 584)
+++ trunk/calCore/src/org/bedework/calcore/hibernate/CoreEvents.java	2008-03-28 04:58:08 UTC (rev 585)
@@ -226,7 +226,7 @@
     for (CoreEventInfo cei: ceis) {
       master = cei.getEvent();
 
-      if (!master.getRecurring()) {
+      if (!master.testRecurring()) {
         ts.add(cei);
       } else if (rid == null) {
         doRecurrence(cei, null, cals, null, null, null, recurRetrieval, false);
@@ -279,7 +279,7 @@
     for (CoreEventInfo cei: ceis) {
       BwEvent master = cei.getEvent();
 
-      if (!master.getRecurring()) {
+      if (!master.testRecurring()) {
         res.add(cei);
       } else {
         recurring.add(cei);
@@ -556,8 +556,7 @@
       // Access was not denied
 
       ev = cei.getEvent();
-      Boolean rec = ev.getRecurring();
-      if ((rec != null) && rec) {
+      if (ev.testRecurring()) {
         doRecurrence(cei, null, null, null, null, null, recurRetrieval, false);
       }
     }
@@ -602,7 +601,7 @@
     }
 
     if ((overrides != null) && (overrides.size() != 0)) {
-      if (!val.getRecurring()) {
+      if (!val.testRecurring()) {
         throwException(CalFacadeException.overridesForNonRecurring);
       }
 
@@ -813,7 +812,7 @@
         deleted.clear();
       }
 
-      if (val.getRecurring()) {
+      if (val.testRecurring()) {
         /* Check the instances and see if any changes need to be made.
          */
         updateRecurrences(val, overrides, changes);
@@ -824,7 +823,7 @@
 
       // XXX I don't think we want this updateRefs(val);
 
-      if (!val.getRecurring() || (overrides == null)) {
+      if (!val.testRecurring() || (overrides == null)) {
         return;
       }
 
@@ -857,7 +856,7 @@
       throw cfe;
     }
 
-    if (val.getRecurring() && (val.getRecurrenceId() == null)) {
+    if (val.testRecurring() && (val.getRecurrenceId() == null)) {
       // Master event - delete all instances and overrides.
       fixReferringAnnotations(val);
       deleteInstances(val, der);
@@ -1110,7 +1109,7 @@
     }
 
 //    if (mstr.getOwner().equals(getUser()) &&
-    if (mstr.getRecurring()) {
+    if (mstr.testRecurring()) {
       // A recurring event - retrieve the instance
       // from the recurrences table
       StringBuilder sb = new StringBuilder();

Modified: trunk/calFacade/src/org/bedework/calfacade/BwEvent.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/BwEvent.java	2008-03-28 02:18:01 UTC (rev 584)
+++ trunk/calFacade/src/org/bedework/calfacade/BwEvent.java	2008-03-28 04:58:08 UTC (rev 585)
@@ -1288,13 +1288,26 @@
    */
   @NoProxy
   public boolean isRecurringEntity() {
-    return hasExdates() ||
+    return testRecurring() ||
+           hasExdates() ||
            hasRdates() ||
            hasExrules() ||
            hasRrules();
   }
 
   /* (non-Javadoc)
+   * @see org.bedework.calfacade.base.RecurrenceEntity#testRecurring()
+   */
+  @NoProxy
+  public boolean testRecurring() {
+    if (getRecurring() == null) {
+      return false;
+    }
+
+    return getRecurring();
+  }
+
+  /* (non-Javadoc)
    * @see org.bedework.calfacade.base.RecurrenceEntity#hasRrules()
    */
   @NoProxy
@@ -1367,6 +1380,7 @@
 
     if (!c.contains(val)) {
       c.add(val);
+      setRecurring(true);
     }
   }
 

Modified: trunk/calFacade/src/org/bedework/calfacade/BwEventProxy.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/BwEventProxy.java	2008-03-28 02:18:01 UTC (rev 584)
+++ trunk/calFacade/src/org/bedework/calfacade/BwEventProxy.java	2008-03-28 04:58:08 UTC (rev 585)
@@ -1105,16 +1105,6 @@
    * ==================================================================== */
 
   /* (non-Javadoc)
-   * @see org.bedework.calfacade.BwEvent#isRecurring()
-   */
-  public boolean isRecurringEntity() {
-    return hasExdates() ||
-           hasRdates() ||
-           hasExrules() ||
-           hasRrules();
-  }
-
-  /* (non-Javadoc)
    * @see org.bedework.calfacade.BwEvent#hasRrules()
    */
   public boolean hasRrules() {

Modified: trunk/calFacade/src/org/bedework/calfacade/base/RecurrenceEntity.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/base/RecurrenceEntity.java	2008-03-28 02:18:01 UTC (rev 584)
+++ trunk/calFacade/src/org/bedework/calfacade/base/RecurrenceEntity.java	2008-03-28 04:58:08 UTC (rev 585)
@@ -127,6 +127,15 @@
    */
   public boolean isRecurringEntity();
 
+  /** if (getRecurring() == null) {
+   *    return false;
+   *    }
+   *
+   *    return getRecurring();
+   * @return true if this is a recurring entity.
+   */
+  public boolean testRecurring();
+
   /** True if we have rrules
    *
    * @return boolean

Modified: trunk/icalendar/src/org/bedework/icalendar/VEventUtil.java
===================================================================
--- trunk/icalendar/src/org/bedework/icalendar/VEventUtil.java	2008-03-28 02:18:01 UTC (rev 584)
+++ trunk/icalendar/src/org/bedework/icalendar/VEventUtil.java	2008-03-28 04:58:08 UTC (rev 585)
@@ -458,7 +458,7 @@
         pl.add(new Url(new URI(strval)));
       }
 
-      if (!isOverride && val.getRecurring().booleanValue()) {
+      if (!isOverride && val.testRecurring()) {
         doRecurring(val, pl);
       }
 



More information about the Bedework-commit mailing list