[Bedework-commit] dumprestore r240 - in trunk/src/org/bedework/dumprestore/restore: . rules

svnadmin at bedework.org svnadmin at bedework.org
Thu Oct 2 11:36:45 EDT 2008


Author: douglm
Date: 2008-10-02 11:36:44 -0400 (Thu, 02 Oct 2008)
New Revision: 240

Modified:
   trunk/src/org/bedework/dumprestore/restore/Restore.java
   trunk/src/org/bedework/dumprestore/restore/RestoreGlobals.java
   trunk/src/org/bedework/dumprestore/restore/rules/CalendarRule.java
   trunk/src/org/bedework/dumprestore/restore/rules/SysparsRule.java
Log:
Undo the scheduling calendar code added a few days back.

make some further fixes to scheduling. Replies appear to work fine

Modified: trunk/src/org/bedework/dumprestore/restore/Restore.java
===================================================================
--- trunk/src/org/bedework/dumprestore/restore/Restore.java	2008-10-02 13:52:41 UTC (rev 239)
+++ trunk/src/org/bedework/dumprestore/restore/Restore.java	2008-10-02 15:36:44 UTC (rev 240)
@@ -140,18 +140,6 @@
         // done earlier
       } else if (args[i].equals("-skipspecialcals")) {
         globals.skipSpecialCals = true;
-      } else if (argpar("-convertScheduleCollections", args, i)) {
-        globals.convertScheduleCollections = true;
-        i++;
-        if (args[i].equals("all")) {
-          globals.convertScheduleDefault = false;
-        } else if (args[i].equals("defaultOnly")) {
-          globals.convertScheduleDefault = true;
-        } else {
-          error("Illegal argument: '" + args[i] + "'");
-          usage();
-          return false;
-        }
       } else if (args[i].equals("-fixcaltype")) {
         globals.fixCaltype = true;
       } else if (argpar("-indexroot", args, i)) {
@@ -206,7 +194,6 @@
     System.out.println("       -f restorefilename");
     System.out.println("       -[n]debug");
     System.out.println("       -indexroot lucene-index-root-path");
-    System.out.println("       -convertScheduleCollections (all | defaultOnly)");
     System.out.println("");
   }
 

Modified: trunk/src/org/bedework/dumprestore/restore/RestoreGlobals.java
===================================================================
--- trunk/src/org/bedework/dumprestore/restore/RestoreGlobals.java	2008-10-02 13:52:41 UTC (rev 239)
+++ trunk/src/org/bedework/dumprestore/restore/RestoreGlobals.java	2008-10-02 15:36:44 UTC (rev 240)
@@ -89,11 +89,6 @@
    * Restore flags and variables.
    * ******************************************************************** */
 
-  /** Convert scheduling calendar types for CalDAV - pre bw 3.5 to 3.5 or after.
-   * Required for new scheduling draft.
-   */
-  public boolean convertScheduleCollections;
-
   /** If we are converting we either convert all or the default calendar only.
    */
   public boolean convertScheduleDefault;

Modified: trunk/src/org/bedework/dumprestore/restore/rules/CalendarRule.java
===================================================================
--- trunk/src/org/bedework/dumprestore/restore/rules/CalendarRule.java	2008-10-02 13:52:41 UTC (rev 239)
+++ trunk/src/org/bedework/dumprestore/restore/rules/CalendarRule.java	2008-10-02 15:36:44 UTC (rev 240)
@@ -126,8 +126,6 @@
       return;
     }
 
-    checkFixScheduleCollections(entity);
-
     try {
       if (globals.rintf != null) {
         /* If the parent is null then this should be one of the root calendars,
@@ -144,31 +142,4 @@
       throw new Exception(t);
     }
   }
-
-  private void checkFixScheduleCollections(BwCalendar col) throws Exception {
-    if (!globals.convertScheduleCollections ||
-        (col.getCalType() != BwCalendar.calTypeCollection) ||
-        col.getPublick()) {
-      return;
-    }
-
-    if (!globals.convertScheduleDefault) {
-      // Doing all
-      col.setCalType(BwCalendar.calTypeSchedulingCollection);
-      return;
-    }
-
-    // Need to set the default.
-
-    BwSystem sys = globals.getSyspars();
-    String calpath = col.getPath();
-    String[] pes = calpath.split("/");
-    int pathLength = pes.length - 1;  // First element is empty string
-
-    if ((pathLength == 3) &&
-        sys.getUserCalendarRoot().equals(pes[1]) &&
-        sys.getUserDefaultCalendar().equals(col.getName())) {
-      col.setCalType(BwCalendar.calTypeSchedulingCollection);
-    }
-  }
 }

Modified: trunk/src/org/bedework/dumprestore/restore/rules/SysparsRule.java
===================================================================
--- trunk/src/org/bedework/dumprestore/restore/rules/SysparsRule.java	2008-10-02 13:52:41 UTC (rev 239)
+++ trunk/src/org/bedework/dumprestore/restore/rules/SysparsRule.java	2008-10-02 15:36:44 UTC (rev 240)
@@ -77,18 +77,6 @@
   public void begin(String ns, String name, Attributes att) throws Exception {
     super.begin(ns, name, att);
 
-    /* As this is the first thing we do after processing version information,
-     * we carry out any version related checks here.
-     */
-    if (beforeVersion(3, 5)) {
-      if (!globals.convertScheduleCollections) {
-        error("Must specify -convertScheduleCalendars all or");
-        error("             -convertScheduleCalendars defaultOnly ");
-        error("  when converting to version 3.5 or after from before 3.5");
-        handleException(new Exception("Must specify -convertScheduleCalendars"));
-      }
-    }
-
     /* Use the global object. */
     pop();
     push(globals.getSyspars());



More information about the Bedework-commit mailing list