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

svnadmin at bedework.org svnadmin at bedework.org
Thu Mar 4 09:41:26 EST 2010


Author: douglm
Date: 2010-03-04 09:41:26 -0500 (Thu, 04 Mar 2010)
New Revision: 360

Modified:
   trunk/build.xml
   trunk/src/org/bedework/dumprestore/restore/HibRestore.java
   trunk/src/org/bedework/dumprestore/restore/RestoreGlobals.java
Log:
Two updates

1. Delay the posting of system events until after commmit. The posted events generally refer to entities which will not be updated/added/deleted until the commit takes place.

2. Turned out that setting the users preferred timezone set the system default timezone as well. 

Rename the method to make it clear what's happening. Add a new method to maintain a thread local default timezone id which must be set on entry.

Modified: trunk/build.xml
===================================================================
--- trunk/build.xml	2010-03-04 14:38:26 UTC (rev 359)
+++ trunk/build.xml	2010-03-04 14:41:26 UTC (rev 360)
@@ -54,6 +54,7 @@
     <getJar name="bw-client" version="3.6" project="calendarapi" />
     <getJar name="bw-icalendar" version="3.6" project="calendarapi" />
     <getJar name="bw-indexer" version="3.6" project="indexer" />
+    <getJar name="bw-sysevents" version="3.6" project="calendarapi" />
     <getJar name="rpiaccess" version="3.6" project="access" />
     <getJar name="rpiutil" version="3.6" project="rpiutil" />
 

Modified: trunk/src/org/bedework/dumprestore/restore/HibRestore.java
===================================================================
--- trunk/src/org/bedework/dumprestore/restore/HibRestore.java	2010-03-04 14:38:26 UTC (rev 359)
+++ trunk/src/org/bedework/dumprestore/restore/HibRestore.java	2010-03-04 14:41:26 UTC (rev 360)
@@ -64,6 +64,7 @@
 import org.bedework.calfacade.svc.EventInfo;
 import org.bedework.calfacade.svc.prefs.BwPreferences;
 import org.bedework.calfacade.util.AccessUtilI;
+import org.bedework.sysevents.events.SysEvent;
 
 import edu.rpi.cmt.access.AccessException;
 import edu.rpi.cmt.access.AccessPrincipal;
@@ -941,6 +942,10 @@
         throw new CalFacadeException(t);
       }
     }
+
+    public void postNotification(final SysEvent ev) throws CalFacadeException {
+      /* Assume we are going to reindex - ignore system events for a restore */
+    }
   }
 
   private void handleException(final Throwable t, final String msg) {

Modified: trunk/src/org/bedework/dumprestore/restore/RestoreGlobals.java
===================================================================
--- trunk/src/org/bedework/dumprestore/restore/RestoreGlobals.java	2010-03-04 14:38:26 UTC (rev 359)
+++ trunk/src/org/bedework/dumprestore/restore/RestoreGlobals.java	2010-03-04 14:41:26 UTC (rev 360)
@@ -461,7 +461,7 @@
 
     Timezones.initTimezones(tzserverUri);
 
-    Timezones.setDefaultTzid(syspars.getTzid());
+    Timezones.setSystemDefaultTzid(syspars.getTzid());
   }
 
   /**



More information about the Bedework-commit mailing list