Changeset 218

Show
Ignore:
Timestamp:
02/27/06 10:39:11
Author:
douglm
Message:

Comment out deletion of tables in restore. It's probably not complete and doesn't work with mysql.

Also add some code to dump annotations.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/build.xml

    r161 r218  
    11<?xml version="1.0"?> 
    22 
    3 <!-- This is the main build file for UW Calendar which can be used in 
     3<!-- This is the main build file for bedework which can be used in 
    44     conjunction with Ant (http://jakarta.apache.org/ant/) to 
    55     build, deploy, and distribute the UW calendar project. Type 
     
    1717     a customized application. 
    1818 
    19      This file will only need mofification to add a specific target for your 
     19     This file will only need modification to add a specific target for your 
    2020     new application. These targets should be added in the appsuite 
    2121     section of the file. 
     
    658658    <property name="org.bedework.schema.hibernate.properties" 
    659659              location="${org.bedework.testsuite.base}/resources/hibernate.properties" /> 
    660     <copy todir="${schema.run.resources}
     660    <copy tofile="${schema.run.resources}/hibernate.properties
    661661          file="${org.bedework.schema.hibernate.properties}" /> 
    662662 
     663          <!-- 
    663664    <property name="org.bedework.hibernate.schema.properties" 
    664665              location="${schema.run.resources}/hibernate.properties" /> 
     666              --> 
    665667 
    666668    <path id="schema.cp"> 
     
    706708         and jdbc drivers on class path 
    707709         --> 
    708     <schemaexport properties="${org.bedework.hibernate.schema.properties}
     710    <schemaexport properties="${schema.run.resources}/hibernate.properties
    709711                  quiet="no" 
    710712                  text="${schema.text.only}" 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/Defs.java

    r50 r218  
    115115  public static final String sectionEvents = "events"; 
    116116  /** */ 
     117  public static final String sectionEventAnnotations = "event-annotations"; 
     118  /** */ 
    117119  public static final String sectionAdminGroups = "adminGroups"; 
    118120  /** */ 
     
    177179  public static final String objectEvent = "event"; 
    178180  /** */ 
     181  public static final String objectEventAnnotation = "event-annotation"; 
     182  /** */ 
    179183  public static final String objectAdminGroup = "adminGroup"; 
    180184  /** */ 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/DumpGlobals.java

    r48 r218  
    8989  /** */ 
    9090  public int events; 
     91   
    9192  /** */ 
    92   public int eventRefs; 
     93  public int eventAnnotations; 
    9394 
    9495  /** */ 
     
    117118    System.out.println("        authusers: " + authusers); 
    118119    System.out.println("           events: " + events); 
    119     System.out.println("        eventRefs: " + eventRefs); 
     120    System.out.println(" eventAnnotations: " + eventAnnotations); 
    120121    System.out.println("          filters: " + filters); 
    121122    System.out.println("      adminGroups: " + adminGroups); 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/DumpIntf.java

    r48 r218  
    5959 * <li>BwAuthUserPrefs</li> 
    6060 * <li>BwEvent</li> 
     61 * <li>BwEventAnnotation</li> 
    6162 * <li>BwAdminGroup</li> 
    6263 * <li>BwPreferences + BwSubscription + BwView</li> 
    6364 * 
    64  * <li>BwEventAnnotation</li> 
    6565 * <li>BwFilter</li> 
    6666 * <li>BwRecurrenceInstance</li> 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpAll.java

    r50 r218  
    121121    di.close(); 
    122122 
     123    info("Dumping event annotations."); 
     124    di.open(); 
     125    new DumpEvents(globals).dumpSection(di.getEventAnnotations()); 
     126    di.close(); 
     127 
    123128    /* 
    124129    info("Dumping filters."); 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/DumpEvents.java

    r49 r218  
    5656   */ 
    5757  public void dumpSection(Iterator it) throws Throwable { 
    58     tagStart(sectionEvents); 
     58    boolean taggedStart = false; 
     59    boolean annotations = false; 
    5960 
    6061    while (it.hasNext()) { 
    6162      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      } 
    6274 
    6375      dumpEvent(e); 
    6476    } 
    6577 
    66     tagEnd(sectionEvents); 
     78    if (annotations) { 
     79      tagEnd(sectionEventAnnotations); 
     80    } else { 
     81      tagEnd(sectionEvents); 
     82    } 
    6783  } 
    6884 
    6985  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    } 
    7199 
    72100    shareableContainedEntityTags(e); 
     
    159187    } 
    160188 
    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    } 
    168200  } 
    169201} 
  • trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/HibRestore.java

    r50 r218  
    141141    openSess(); 
    142142 
     143    /* This doesn't work - at least with mysql 
    143144    Connection conn = sess.connection(); 
    144145 
     
    294295      ps.executeUpdate(); 
    295296      ps.close(); 
    296       *
     297      *
    297298 
    298299    ps = conn.prepareStatement("SET REFERENTIAL_INTEGRITY TRUE"); 
    299300    ps.executeUpdate(); 
    300301    ps.close(); 
     302    */ 
    301303 
    302304    closeSess();