Changeset 218
- Timestamp:
- 02/27/06 10:39:11
- Files:
-
- trunk/calendar3/build.xml (modified) (4 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/Defs.java (modified) (2 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/DumpGlobals.java (modified) (2 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/DumpIntf.java (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpAll.java (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpEvents.java (modified) (2 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/HibRestore.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/build.xml
r161 r218 1 1 <?xml version="1.0"?> 2 2 3 <!-- This is the main build file for UW Calendarwhich can be used in3 <!-- This is the main build file for bedework which can be used in 4 4 conjunction with Ant (http://jakarta.apache.org/ant/) to 5 5 build, deploy, and distribute the UW calendar project. Type … … 17 17 a customized application. 18 18 19 This file will only need mo fification to add a specific target for your19 This file will only need modification to add a specific target for your 20 20 new application. These targets should be added in the appsuite 21 21 section of the file. … … 658 658 <property name="org.bedework.schema.hibernate.properties" 659 659 location="${org.bedework.testsuite.base}/resources/hibernate.properties" /> 660 <copy to dir="${schema.run.resources}"660 <copy tofile="${schema.run.resources}/hibernate.properties" 661 661 file="${org.bedework.schema.hibernate.properties}" /> 662 662 663 <!-- 663 664 <property name="org.bedework.hibernate.schema.properties" 664 665 location="${schema.run.resources}/hibernate.properties" /> 666 --> 665 667 666 668 <path id="schema.cp"> … … 706 708 and jdbc drivers on class path 707 709 --> 708 <schemaexport properties="${ org.bedework.hibernate.schema.properties}"710 <schemaexport properties="${schema.run.resources}/hibernate.properties" 709 711 quiet="no" 710 712 text="${schema.text.only}" trunk/calendar3/dumprestore/src/org/bedework/dumprestore/Defs.java
r50 r218 115 115 public static final String sectionEvents = "events"; 116 116 /** */ 117 public static final String sectionEventAnnotations = "event-annotations"; 118 /** */ 117 119 public static final String sectionAdminGroups = "adminGroups"; 118 120 /** */ … … 177 179 public static final String objectEvent = "event"; 178 180 /** */ 181 public static final String objectEventAnnotation = "event-annotation"; 182 /** */ 179 183 public static final String objectAdminGroup = "adminGroup"; 180 184 /** */ trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/DumpGlobals.java
r48 r218 89 89 /** */ 90 90 public int events; 91 91 92 /** */ 92 public int event Refs;93 public int eventAnnotations; 93 94 94 95 /** */ … … 117 118 System.out.println(" authusers: " + authusers); 118 119 System.out.println(" events: " + events); 119 System.out.println(" eventRefs: " + eventRefs);120 System.out.println(" eventAnnotations: " + eventAnnotations); 120 121 System.out.println(" filters: " + filters); 121 122 System.out.println(" adminGroups: " + adminGroups); trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/DumpIntf.java
r48 r218 59 59 * <li>BwAuthUserPrefs</li> 60 60 * <li>BwEvent</li> 61 * <li>BwEventAnnotation</li> 61 62 * <li>BwAdminGroup</li> 62 63 * <li>BwPreferences + BwSubscription + BwView</li> 63 64 * 64 * <li>BwEventAnnotation</li>65 65 * <li>BwFilter</li> 66 66 * <li>BwRecurrenceInstance</li> trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpAll.java
r50 r218 121 121 di.close(); 122 122 123 info("Dumping event annotations."); 124 di.open(); 125 new DumpEvents(globals).dumpSection(di.getEventAnnotations()); 126 di.close(); 127 123 128 /* 124 129 info("Dumping filters."); trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpEvents.java
r49 r218 56 56 */ 57 57 public void dumpSection(Iterator it) throws Throwable { 58 tagStart(sectionEvents); 58 boolean taggedStart = false; 59 boolean annotations = false; 59 60 60 61 while (it.hasNext()) { 61 62 BwEvent e = (BwEvent)it.next(); 63 64 if (!taggedStart) { 65 if (e instanceof BwEventAnnotation) { 66 tagStart(sectionEventAnnotations); 67 annotations = true; 68 } else { 69 tagStart(sectionEvents); 70 } 71 72 taggedStart = true; 73 } 62 74 63 75 dumpEvent(e); 64 76 } 65 77 66 tagEnd(sectionEvents); 78 if (annotations) { 79 tagEnd(sectionEventAnnotations); 80 } else { 81 tagEnd(sectionEvents); 82 } 67 83 } 68 84 69 85 private void dumpEvent(BwEvent e) throws Throwable { 70 tagStart(objectEvent); 86 BwEventAnnotation ann = null; 87 88 if (e instanceof BwEventAnnotation) { 89 ann = (BwEventAnnotation)e; 90 taggedVal("target", ann.getTarget().getId()); 91 taggedVal("master", ann.getMaster().getId()); 92 } 93 94 if (ann == null) { 95 tagStart(objectEvent); 96 } else { 97 tagStart(objectEventAnnotation); 98 } 71 99 72 100 shareableContainedEntityTags(e); … … 159 187 } 160 188 161 if (e instanceof BwEventAnnotation) { 162 taggedVal("target", ((BwEventAnnotation)e).getId()); 163 } 164 165 tagEnd(objectEvent); 166 167 globals.events++; 189 if (ann == null) { 190 tagEnd(objectEvent); 191 192 globals.events++; 193 } else { 194 taggedVal("target", ann.getTarget().getId()); 195 taggedVal("master", ann.getMaster().getId()); 196 tagEnd(objectEventAnnotation); 197 198 globals.eventAnnotations++; 199 } 168 200 } 169 201 } trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/HibRestore.java
r50 r218 141 141 openSess(); 142 142 143 /* This doesn't work - at least with mysql 143 144 Connection conn = sess.connection(); 144 145 … … 294 295 ps.executeUpdate(); 295 296 ps.close(); 296 * /297 * / 297 298 298 299 ps = conn.prepareStatement("SET REFERENTIAL_INTEGRITY TRUE"); 299 300 ps.executeUpdate(); 300 301 ps.close(); 302 */ 301 303 302 304 closeSess();
