Changeset 223
- Timestamp:
- 02/28/06 08:49:07
- Files:
-
- trunk/calendar3/build.xml (modified) (1 diff)
- trunk/calendar3/calCore/resources/hbms/Calendar.hbm.xml (modified) (1 diff)
- trunk/calendar3/calCore/resources/hbms/Event.hbm.xml (modified) (1 diff)
- trunk/calendar3/calCore/resources/hbms/EventAnnotation.hbm.xml (modified) (3 diffs)
- trunk/calendar3/calCore/resources/hbms/TimeZone.hbm.xml (modified) (1 diff)
- trunk/calendar3/docs/todo.txt (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/RestoreGlobals.java (modified) (4 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/TimeZoneRule.java (modified) (3 diffs)
- trunk/calendar3/resources/mysql-schema.sql (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/build.xml
r218 r223 667 667 668 668 <path id="schema.cp"> 669 <!-- 669 670 <fileset dir="${org.bedework.default.lib}"> 670 671 <include name="**/*.jar"/> 671 672 </fileset> 673 --> 672 674 <!-- 673 675 <fileset dir="${org.bedework.temp.jars}"> trunk/calendar3/calCore/resources/hbms/Calendar.hbm.xml
r2 r223 38 38 39 39 <property name="name" column="name" type="text" not-null="true"/> 40 41 <!-- I wanted to specify unique="true" on this but mysql complains. 42 --> 40 43 <property name="path" column="path" type="text" not-null="true" 41 index="calpath" unique="true" lazy="false" /> 44 index="calpath" lazy="false" /> 45 42 46 <property name="summary" column="summary" type="text"/> 43 47 <property name="description" column="description" type="text"/> trunk/calendar3/calCore/resources/hbms/Event.hbm.xml
r207 r223 120 120 <property name="name" column="eventname" type="text"/> 121 121 122 <!-- (ownerid +) calendarid + guid + sequence +recurrence-id is a unique key. -->123 <property name="guid" type=" text" unique-key="event-key" />124 125 <property name="sequence" type="integer" unique-key="event-key"/>122 <!-- (ownerid +) calendarid + guid + recurrence-id is a unique key. --> 123 <property name="guid" type="string" length="500" unique-key="event-key" /> 124 125 <property name="sequence" type="integer" /> 126 126 127 127 <property name="transparency" column="transparency" type="text"/> trunk/calendar3/calCore/resources/hbms/EventAnnotation.hbm.xml
r2 r223 10 10 11 11 This definition differs from The event definition only in that all 12 fi les (except the index and sequence) may be null and the event does12 fields (except the index and sequence) may be null and the event does 13 13 not have a reference to another event. 14 14 =================================================================== --> … … 93 93 class="org.bedework.calfacade.BwCalendar" 94 94 column="calendarid" 95 index="idx_eventann_calendar" />95 index="idx_eventann_calendar" unique-key="eventann-key" /> 96 96 97 97 <property name="dtstamp" column="dtstamp" type="string" /> … … 121 121 <property name="name" column="eventname" type="text"/> 122 122 123 <!-- guid + sequence+ recurrence-id is a unique key. -->124 <property name="guid" type=" text" unique-key="eventann-key" />125 126 <property name="sequence" type="integer" unique-key="eventann-key"/>123 <!-- calendar + guid + recurrence-id is a unique key. --> 124 <property name="guid" type="string" length="500" unique-key="eventann-key" /> 125 126 <property name="sequence" type="integer" /> 127 127 128 128 <property name="transparency" column="transparency" type="text"/> trunk/calendar3/calCore/resources/hbms/TimeZone.hbm.xml
r68 r223 29 29 </property> 30 30 31 <property name="vtimezone" column="vtimezone" type=" string"/>31 <property name="vtimezone" column="vtimezone" type="text"/> 32 32 <property name="jtzid" column="jtzid" type="string"/> 33 33 </class> trunk/calendar3/docs/todo.txt
r207 r223 1 1 Todo 2 2 3 -------------------------------------------------------------------------------- 4 MySql 5 6 Have to edit schema then source it 7 Map user 0 on to user 1. 8 ??? 9 Add driver jar to tomcat common/lib 10 Need to change vtimezone def to text 3 11 -------------------------------------------------------------------------------- 4 12 Remove references to getEvent(id) trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/RestoreGlobals.java
r75 r223 106 106 public boolean debug; 107 107 108 public static int mapUser0 = 1; 109 108 110 /** */ 109 111 public boolean debugEntity; … … 386 388 */ 387 389 public void put(BwUser val) { 388 put(new Integer(val.getId()), val); 390 int id = val.getId(); 391 if (id ==0) { 392 id = mapUser0; 393 val.setId(id); 394 } 395 396 Integer keyid = new Integer(id); 397 if (get(keyid) != null) { 398 throw new RuntimeException("User already in table with id " + id); 399 } 400 put(keyid, val); 389 401 nameMap.put(val.getAccount(), val); 390 402 } … … 395 407 */ 396 408 public BwUser get(int id) { 409 if (id ==0) { 410 id = mapUser0; 411 } 397 412 return (BwUser)get(new Integer(id)); 398 413 } … … 669 684 publicUser.setSponsorAccess(getDefaultPublicAccess()); 670 685 671 publicUser.setId(0); 686 // Reserved id 1 for this user. 687 publicUser.setId(1); 672 688 673 689 if (rintf != null) { trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/TimeZoneRule.java
r59 r223 84 84 85 85 if (cl.size() != 1) { 86 error("Exception restoring " + entity); 86 87 throw new CalFacadeException(CalFacadeException.timezonesReadError, 87 88 cl.size() + " components in Calendar"); … … 90 91 Object o = cl.get(0); 91 92 if (!(o instanceof VTimeZone)) { 93 error("Exception restoring " + entity); 92 94 throw new CalFacadeException(CalFacadeException.timezonesReadError, 93 95 "component in Calendar not VTimeZone"); … … 98 100 globals.getTzcache().saveTimeZone(entity.getTzid(), (VTimeZone)o); 99 101 } catch (Throwable t) { 102 error("Exception restoring " + entity); 100 103 throw new Exception(t); 101 104 }
