Changeset 48
- Timestamp:
- 01/28/06 23:54:51
- Files:
-
- trunk/calendar3/.classpath (modified) (1 diff)
- trunk/calendar3/bldfiles/defjars.properties (modified) (1 diff)
- trunk/calendar3/bldfiles/globalDefs.xml (modified) (2 diffs)
- trunk/calendar3/build.xml (modified) (4 diffs)
- trunk/calendar3/calCore/resources/hbms/Alarm.hbm.xml (modified) (3 diffs)
- trunk/calendar3/calCore/resources/hbms/Event.hbm.xml (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwAlarm.java (modified) (11 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwEventAlarm.java (modified) (19 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwRecurrence.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwTimeZone.java (modified) (5 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwTodo.java (modified) (3 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwTodoAlarm.java (modified) (18 diffs)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (1 diff)
- trunk/calendar3/docs/todo.txt (modified) (1 diff)
- trunk/calendar3/dumprestore (added)
- trunk/calendar3/dumprestore/build.xml (copied) (copied from trunk/calendar3/tools/dumprestore/build.xml) (10 diffs)
- trunk/calendar3/dumprestore/properties (added)
- trunk/calendar3/dumprestore/properties/dumprestore.properties (moved) (moved from trunk/calendar3/tools/properties/dumprestore.properties)
- trunk/calendar3/dumprestore/properties/fix.properties (moved) (moved from trunk/calendar3/tools/properties/fix.properties)
- trunk/calendar3/dumprestore/properties/hibernate.properties (moved) (moved from trunk/calendar3/tools/properties/hibernate.properties)
- trunk/calendar3/dumprestore/properties/log4j.xml (moved) (moved from trunk/calendar3/tools/properties/log4j.xml)
- trunk/calendar3/dumprestore/resources (moved) (moved from trunk/calendar3/tools/resources)
- trunk/calendar3/dumprestore/src (added)
- trunk/calendar3/dumprestore/src/org (added)
- trunk/calendar3/dumprestore/src/org/bedework (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/BwDbLastmod.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/Defs.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/Dump.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/DumpGlobals.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/DumpIntf.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/HibDump.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/HibRestore.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/Restore.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/RestoreGlobals.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/RestoreIntf.java (added)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/TimezonesImpl.java (added)
- trunk/calendar3/test/src/org/bedework/tests/calsvc/CalSvcAlarmsTest.java (modified) (1 diff)
- trunk/calendar3/tools/build.xml (modified) (1 diff)
- trunk/calendar3/tools/dumprestore (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/BwDbLastmod.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/Defs.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/dump/Dump.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/dump/DumpGlobals.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/dump/DumpIntf.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/dump/HibDump.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/dump/dumpling (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/restore/HibRestore.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/restore/Restore.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/restore/RestoreGlobals.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/restore/RestoreIntf.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/restore/TimezonesImpl.java (deleted)
- trunk/calendar3/tools/src/org/bedework/tools/dumprestore/restore/rules (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/.classpath
r18 r48 2 2 <classpath> 3 3 <classpathentry kind="src" path="access/src"/> 4 <classpathentry kind="src" path="caldavClientApi/src"/>5 <classpathentry kind="src" path="http/src"/>6 <classpathentry kind="src" path="logging/src"/>7 <classpathentry kind="src" path="icalendar/src"/>8 <classpathentry kind="src" path="calsvc/src"/>9 <classpathentry kind="src" path="mail/src"/>10 4 <classpathentry kind="src" path="appcommon/src"/> 11 5 <classpathentry kind="src" path="calCore/src"/> 12 6 <classpathentry kind="src" path="caldav/src"/> 7 <classpathentry kind="src" path="caldavClientApi/src"/> 13 8 <classpathentry kind="src" path="calEnv/src"/> 14 9 <classpathentry kind="src" path="calFacade/src"/> 10 <classpathentry kind="src" path="calsvc/src"/> 15 11 <classpathentry kind="src" path="calsvci/src"/> 16 12 <classpathentry kind="src" path="common/src"/> 17 13 <classpathentry kind="src" path="config/src"/> 14 <classpathentry kind="src" path="dumprestore/src"/> 15 <classpathentry kind="src" path="http/src"/> 16 <classpathentry kind="src" path="icalendar/src"/> 18 17 <classpathentry kind="src" path="locale/src"/> 18 <classpathentry kind="src" path="logging/src"/> 19 <classpathentry kind="src" path="mail/src"/> 19 20 <classpathentry kind="src" path="synchml/src"/> 20 21 <classpathentry kind="src" path="test/src"/> trunk/calendar3/bldfiles/defjars.properties
r18 r48 124 124 org.bedework.config.jar=${org.bedework.temp.jars}/${org.bedework.config.jar.name} 125 125 126 org.bedework.dumprestore.jar.name=bwdumprestore-${product.version}.jar 127 org.bedework.dumprestore.jar=${org.bedework.temp.jars}/${org.bedework.dumprestore.jar.name} 128 126 129 org.bedework.http.jar.name=bwhttp-${product.version}.jar 127 130 org.bedework.http.jar=${org.bedework.temp.jars}/${org.bedework.http.jar.name} trunk/calendar3/bldfiles/globalDefs.xml
r2 r48 6 6 =================================================================== --> 7 7 8 <project name="uwcalGlobalDefs" default=" bld.all">8 <project name="uwcalGlobalDefs" default="globalDefs"> 9 9 <property environment="env"/> 10 10 … … 70 70 <property name="org.bedework.core.base" location="${calendar.dir}/calCore" /> 71 71 <property name="org.bedework.deployment.base" location="${calendar.dir}/deployment" /> 72 <property name="org.bedework.dumprestore.base" location="${calendar.dir}/dumprestore" /> 72 73 <property name="org.bedework.http.base" location="${calendar.dir}/http" /> 73 74 <property name="org.bedework.ical.base" location="${calendar.dir}/icalendar" /> trunk/calendar3/build.xml
r2 r48 97 97 bld.synchml,bld.caldav, 98 98 bld.timers,build.tools, 99 bld.dumprestore, 99 100 bld.test,bld.config" 100 101 description="Build war and ear files"> … … 235 236 ${org.bedework.common.base}/src: 236 237 ${org.bedework.config.base}/src: 238 ${org.bedework.dumprestore.base}/src: 237 239 ${org.bedework.http.base}/src: 238 240 ${org.bedework.ical.base}/src: … … 530 532 </target> 531 533 534 <target name="bld.dumprestore" 535 depends="init,bld.appcommon" 536 description="Build calendar dumprestore suite"> 537 <ant antfile="${org.bedework.dumprestore.base}/build.xml" inheritrefs="true" 538 target="build" /> 539 </target> 540 532 541 <!-- ======================== tools Targets ======================== 533 542 This builds the tools … … 545 554 546 555 <target name="dumpdb" depends="init"> 547 <ant antfile="${org.bedework. tools.base}/build.xml" inheritrefs="true"556 <ant antfile="${org.bedework.dumprestore.base}/build.xml" inheritrefs="true" 548 557 target="dumpdb" /> 549 558 </target> 550 559 551 560 <target name="restoredb" depends="init"> 552 <ant antfile="${org.bedework. tools.base}/build.xml" inheritrefs="true"561 <ant antfile="${org.bedework.dumprestore.base}/build.xml" inheritrefs="true" 553 562 target="restoredb" /> 554 563 </target> 555 564 556 565 <target name="initdb" depends="init"> 557 <ant antfile="${org.bedework. tools.base}/build.xml" inheritrefs="true"566 <ant antfile="${org.bedework.dumprestore.base}/build.xml" inheritrefs="true" 558 567 target="initdb" /> 559 568 </target> trunk/calendar3/calCore/resources/hbms/Alarm.hbm.xml
r2 r48 58 58 </discriminator> 59 59 60 <version name="seq uence" column="sequence" type="long" />60 <version name="seq" column="sequence" type="integer" /> 61 61 62 62 <property name="alarmType" column="alarm_type" type="integer" /> 63 63 64 64 <!-- 65 <many-to-one name=" user" insert="false" update="false"65 <many-to-one name="owner" insert="false" update="false" 66 66 class="org.bedework.calfacade.BwUser" > 67 <column name=" userid"/>67 <column name="ownerid"/> 68 68 </many-to-one> 69 69 --> 70 70 71 <many-to-one name=" user"71 <many-to-one name="owner" 72 72 class="org.bedework.calfacade.BwUser" 73 73 unique="true" > 74 <column name=" userid" not-null="true" index="valarms_user" />74 <column name="ownerid" not-null="true" index="valarms_user" /> 75 75 </many-to-one> 76 76 … … 125 125 <query name="getAlarms"><![CDATA[ 126 126 from org.bedework.calfacade.BwAlarm as al 127 where al.event = :ev and al. user=:user127 where al.event = :ev and al.owner=:user 128 128 ]]></query> 129 129 130 130 <query name="getUnexpiredAlarmsUser"><![CDATA[ 131 131 from org.bedework.calfacade.BwAlarm as al 132 where al.expired = false and al. user=:user132 where al.expired = false and al.owner=:user 133 133 ]]></query> 134 134 … … 142 142 <query name="getUnexpiredAlarmsUserTime"><![CDATA[ 143 143 from org.bedework.calfacade.BwAlarm as al 144 where al.expired = false and al. user=:user and144 where al.expired = false and al.owner=:user and 145 145 al.triggerTime <= :tt 146 146 ]]></query> trunk/calendar3/calCore/resources/hbms/Event.hbm.xml
r2 r48 144 144 <set name="attendees" table="event_attendees" 145 145 cascade="all-delete-orphan" > 146 <key column=" attendeeid"/>146 <key column="eventid"/> 147 147 <many-to-many class="org.bedework.calfacade.BwAttendee" /> 148 148 </set> trunk/calendar3/calFacade/src/org/bedework/calfacade/BwAlarm.java
r2 r48 54 54 package org.bedework.calfacade; 55 55 56 import org.bedework.calfacade.base.BwOwnedDbentity; 56 57 import org.bedework.calfacade.ifs.Attendees; 57 58 import org.bedework.calfacade.ifs.AttendeesI; … … 71 72 * @author Mike Douglass douglm@rpi.edu 72 73 */ 73 public abstract class BwAlarm implements AttendeesI, Comparable, Serializable {74 public abstract class BwAlarm extends BwOwnedDbentity implements AttendeesI, Comparable, Serializable { 74 75 /** audio */ 75 76 public final static int alarmTypeAudio = 0; … … 93 94 protected int alarmType; 94 95 95 protected int id = CalFacadeDefs.unsavedItemKey;96 97 protected int userid;98 99 /** The user */100 protected BwUser user;101 102 96 protected String trigger; 103 97 protected boolean triggerStart; … … 118 112 protected Attendees attendeesHelper; 119 113 120 protected long sequence;121 122 114 /* ------------------------- Non-db fields ---------------------------- */ 123 115 … … 134 126 /** Constructor for all fields (for db retrieval) 135 127 * 128 * @param owner Owner of alarm 136 129 * @param alarmType type of alarm 137 * @param user Owner of alarm138 130 * @param trigger This specifies the time for the alarm in rfc format 139 131 * @param triggerStart true if we trigger off the start … … 151 143 * @param summary String summary (email) 152 144 * @param attendees Collection of attendees 153 * @param sequence long sequence value 154 */ 155 public BwAlarm(int alarmType, 156 BwUser user, 157 String trigger, 158 boolean triggerStart, 159 boolean triggerDateTime, 160 String duration, 161 int repeat, 162 long triggerTime, 163 long previousTrigger, 164 int repeatCount, 165 boolean expired, 166 String attach, 167 String description, 168 String summary, 169 Collection attendees, 170 long sequence) { 145 */ 146 public BwAlarm(BwUser owner, 147 int alarmType, 148 String trigger, 149 boolean triggerStart, 150 boolean triggerDateTime, 151 String duration, 152 int repeat, 153 long triggerTime, 154 long previousTrigger, 155 int repeatCount, 156 boolean expired, 157 String attach, 158 String description, 159 String summary, 160 Collection attendees) { 161 super(owner, false); 171 162 this.alarmType = alarmType; 172 this.user = user;173 if (user != null) {174 this.userid = user.getId();175 }176 163 this.trigger = trigger; 177 164 this.triggerStart = triggerStart; … … 187 174 this.summary = summary; 188 175 setAttendees(attendees); 189 190 this.sequence = sequence;191 176 } 192 177 … … 209 194 public int getAlarmType() { 210 195 return alarmType; 211 }212 213 /** Set the id for this alarm214 *215 * @param val alarm id216 */217 public void setId(int val) {218 id = val;219 }220 221 /** Get the alarm's id222 *223 * @return int the alarm's unique id224 */225 public int getId() {226 return id;227 }228 229 /** Set the userid230 *231 * @param val userid232 */233 public void setUserid(int val) {234 userid = val;235 }236 237 /** Get the user id238 *239 * @return int the userid240 */241 public int getUserid() {242 return userid;243 }244 245 /** set the user246 *247 * @param val UserVO user248 */249 public void setUser(BwUser val) {250 user = val;251 if (user == null) {252 userid = CalFacadeDefs.unsavedItemKey;253 } else {254 userid = user.getId();255 }256 }257 258 /** Get the user259 *260 * @return UserVO user, userVO261 */262 public BwUser getUser() {263 return user;264 196 } 265 197 … … 601 533 } 602 534 603 /** Set sequence value604 *605 * @param val606 */607 public void setSequence(long val) {608 sequence = val;609 }610 611 /**612 * @return long sequence value613 */614 public long getSequence() {615 return sequence;616 }617 618 535 /* ==================================================================== 619 536 * Mappng methods … … 719 636 --------------------------------------------------------*/ 720 637 721 /* ==================================================================== 722 * Object methods 723 * ==================================================================== */ 724 725 public int compareTo(Object o) { 726 if (!(o instanceof BwAlarm)) { 727 throw new ClassCastException(); 728 } 729 730 if (equals(o)) { 731 return 0; 732 } 733 734 BwAlarm that = (BwAlarm)o; 735 736 try { 737 if (that.getTriggerTime() > getTriggerTime()) { 738 return -1; 739 } 740 741 return 1; 742 } catch (Throwable t) { 743 throw new RuntimeException(t); 744 } 745 } 746 747 public int hashCode() { 748 int hc = 31 * alarmType; 749 750 if (user != null) { 751 hc *= user.hashCode(); 752 } 753 754 hc *= trigger.hashCode(); 755 if (triggerStart) { 756 hc *= 2; 757 } 758 759 if (duration != null) { 760 hc *= duration.hashCode(); 761 hc *= (repeat + 1); 762 } 763 764 return hc; 765 } 766 767 /* We consider two alarms equal if their user, times and 768 * durations match. 769 */ 770 public boolean equals(Object obj) { 771 if (obj == this) { 772 return true; 773 } 774 775 if (!(obj instanceof BwAlarm)) { 776 return false; 777 } 778 779 BwAlarm that = (BwAlarm)obj; 780 781 if (that.alarmType != alarmType) { 782 return false; 783 } 784 785 if (!eqObj(user, that.user)) { 786 return false; 787 } 788 789 if (!eqObj(trigger, that.trigger)) { 790 return false; 791 } 792 793 if (that.triggerStart != triggerStart) { 794 return false; 795 } 796 797 if (duration != null) { 798 if (!eqObj(duration, that.duration)) { 799 return false; 800 } 801 802 if (that.repeat != repeat) { 803 return false; 804 } 805 } 806 807 return true; 808 } 809 810 /** Compare two possibly null obects 811 * 812 * @param o1 813 * @param o2 814 * @return boolean true for equal 815 */ 816 public boolean eqObj(Object o1, Object o2) { 817 if (o1 == null) { 818 return o2 == null; 819 } 820 821 if (o2 == null) { 822 return false; 823 } 824 825 return o1.equals(o2); 826 } 827 828 public String toString() { 829 StringBuffer sb = new StringBuffer(); 830 831 sb.append("ValarmVO{id="); 832 sb.append(id); 833 638 protected void toStringSegment(StringBuffer sb) { 639 super.toStringSegment(sb); 834 640 sb.append(", type="); 835 sb.append(alarmTypes[alarmType]); 836 837 sb.append(", owner="); 838 839 if (user == null) { 840 sb.append("**********null************"); 841 } else { 842 sb.append(user.getAccount()); 843 } 641 sb.append(alarmTypes[getAlarmType()]); 844 642 845 643 sb.append(", trigger("); 846 if ( triggerStart) {644 if (getTriggerStart()) { 847 645 sb.append("START)="); 848 646 } else { 849 647 sb.append("END)="); 850 648 } 851 sb.append( trigger);852 853 if ( duration!= null) {649 sb.append(getTrigger()); 650 651 if (getDuration() != null) { 854 652 sb.append(", duration="); 855 sb.append( duration);653 sb.append(getDuration()); 856 654 sb.append(", repeat="); 857 sb.append( repeat);858 } 859 860 if ( alarmType== alarmTypeAudio) {861 if ( attach!= null) {655 sb.append(getRepeat()); 656 } 657 658 if (getAlarmType() == alarmTypeAudio) { 659 if (getAttach() != null) { 862 660 sb.append(", attach="); 863 sb.append( attach);864 } 865 } else if ( alarmType== alarmTypeDisplay) {661 sb.append(getAttach()); 662 } 663 } else if (getAlarmType() == alarmTypeDisplay) { 866 664 sb.append(", description="); 867 sb.append( description);868 } else if ( alarmType== alarmTypeEmail) {665 sb.append(getDescription()); 666 } else if (getAlarmType() == alarmTypeEmail) { 869 667 sb.append(", description="); 870 sb.append( description);668 sb.append(getDescription()); 871 669 sb.append(", summary="); 872 sb.append( summary);670 sb.append(getSummary()); 873 671 sb.append(", attendees=["); 874 672 Iterator it = iterateAttendees(); … … 879 677 if (attach != null) { 880 678 sb.append(", attach="); 881 sb.append( attach);882 } 883 } else if ( alarmType== alarmTypeProcedure) {679 sb.append(getAttach()); 680 } 681 } else if (getAlarmType() == alarmTypeProcedure) { 884 682 sb.append(", attach="); 885 sb.append( attach);683 sb.append(getAttach()); 886 684 if (description != null) { 887 685 sb.append(", description="); 888 sb.append(description); 889 } 890 } 891 892 sb.append(", sequence="); 893 sb.append(sequence); 686 sb.append(getDescription()); 687 } 688 } 689 } 690 691 /* ==================================================================== 692 * Object methods 693 * ==================================================================== */ 694 695 public int compareTo(Object o) { 696 if (!(o instanceof BwAlarm)) { 697 throw new ClassCastException(); 698 } 699 700 if (equals(o)) { 701 return 0; 702 } 703 704 BwAlarm that = (BwAlarm)o; 705 706 try { 707 if (that.getTriggerTime() > getTriggerTime()) { 708 return -1; 709 } 710 711 return 1; 712 } catch (Throwable t) { 713 throw new RuntimeException(t); 714 } 715 } 716 717 public int hashCode() { 718 int hc = 31 * alarmType; 719 720 if (getOwner() != null) { 721 hc *= getOwner().hashCode(); 722 } 723 724 hc *= trigger.hashCode(); 725 if (triggerStart) { 726 hc *= 2; 727 } 728 729 if (duration != null) { 730 hc *= duration.hashCode(); 731 hc *= (repeat + 1); 732 } 733 734 return hc; 735 } 736 737 /* We consider two alarms equal if their user, times and 738 * durations match. 739 */ 740 public boolean equals(Object obj) { 741 if (obj == this) { 742 return true; 743 } 744 745 if (!(obj instanceof BwAlarm)) { 746 return false; 747 } 748 749 BwAlarm that = (BwAlarm)obj; 750 751 if (that.getAlarmType() != getAlarmType()) { 752 return false; 753 } 754 755 if (!eqObj(getOwner(), that.getOwner())) { 756 return false; 757 } 758 759 if (!eqObj(getTrigger(), that.getTrigger())) { 760 return false; 761 } 762 763 if (that.getTriggerStart() != getTriggerStart()) { 764 return false; 765 } 766 767 if (duration != null) { 768 if (!eqObj(getDuration(), that.getDuration())) { 769 return false; 770 } 771 772 if (that.getRepeat() != getRepeat()) { 773 return false; 774 } 775 } 776 777 return true; 778 } 779 780 /** Compare two possibly null obects 781 * 782 * @param o1 783 * @param o2 784 * @return boolean true for equal 785 */ 786 public boolean eqObj(Object o1, Object o2) { 787 if (o1 == null) { 788 return o2 == null; 789 } 790 791 if (o2 == null) { 792 return false; 793 } 794 795 return o1.equals(o2); 796 } 797 798 public String toString() { 799 StringBuffer sb = new StringBuffer("BwAlarm{"); 800 801 toStringSegment(sb); 894 802 sb.append("}"); 895 803 trunk/calendar3/calFacade/src/org/bedework/calfacade/BwEventAlarm.java
r2 r48 83 83 * 84 84 * @param event EventVO for this alarm - if non-null todo == null 85 * @param owner Owner of alarm 85 86 * @param alarmType type of alarm 86 * @param user Owner of alarm87 87 * @param trigger This specifies the time for the alarm in rfc format 88 88 * @param triggerStart true if we trigger off the start … … 100 100 * @param summary String summary (email) 101 101 * @param attendees Collection of attendees 102 * @param sequence long sequence value103 102 */ 104 103 public BwEventAlarm(BwEvent event, 104 BwUser owner, 105 105 int alarmType, 106 BwUser user,107 106 String trigger, 108 107 boolean triggerStart, … … 117 116 String description, 118 117 String summary, 119 Collection attendees, 120 long sequence) { 121 super(alarmType, user, trigger, triggerStart, triggerDateTime, 118 Collection attendees) { 119 super(owner, alarmType, trigger, triggerStart, triggerDateTime, 122 120 duration, repeat, triggerTime, previousTrigger, 123 121 repeatCount, expired, attach, description, 124 summary, attendees , sequence);122 summary, attendees); 125 123 setEvent(event); 126 124 } … … 129 127 * 130 128 * @param event 131 * @param user129 * @param owner 132 130 * @param trigger 133 131 * @param triggerStart … … 139 137 */ 140 138 public static BwEventAlarm audioAlarm(BwEvent event, 141 BwUser user,139 BwUser owner, 142 140 String trigger, 143 141 boolean triggerStart, … … 146 144 int repeat, 147 145 String attach) { 148 return new BwEventAlarm(event, alarmTypeAudio, user,146 return new BwEventAlarm(event, owner, alarmTypeAudio, 149 147 trigger, triggerStart, triggerDateTime, 150 148 duration, repeat, 151 149 0, 0, 0, false, 152 150 attach, 153 null, null, null , 0);151 null, null, null); 154 152 } 155 153 … … 157 155 * 158 156 * @param event 159 * @param user157 * @param owner 160 158 * @param trigger 161 159 * @param triggerStart … … 167 165 */ 168 166 public static BwEventAlarm displayAlarm(BwEvent event, 169 BwUser user,167 BwUser owner, 170 168 String trigger, 171 169 boolean triggerStart, … … 174 172 int repeat, 175 173 String description) { 176 return new BwEventAlarm(event, alarmTypeDisplay, user,174 return new BwEventAlarm(event, owner, alarmTypeDisplay, 177 175 trigger, triggerStart, triggerDateTime, 178 176 duration, repeat, 179 177 0, 0, 0, false, 180 null, description, null, null , 0);178 null, description, null, null); 181 179 } 182 180 … … 184 182 * 185 183 * @param event 186 * @param user184 * @param owner 187 185 * @param trigger 188 186 * @param triggerStart … … 197 195 */ 198 196 public static BwEventAlarm emailAlarm(BwEvent event, 199 BwUser user,197 BwUser owner, 200 198 String trigger, 201 199 boolean triggerStart, … … 207 205 String summary, 208 206 Collection attendees) { 209 return new BwEventAlarm(event, alarmTypeEmail, user,207 return new BwEventAlarm(event, owner, alarmTypeEmail, 210 208 trigger, triggerStart, triggerDateTime, 211 209 duration, repeat, 212 210 0, 0, 0, false, 213 211 attach, 214 description, summary, attendees , 0);212 description, summary, attendees); 215 213 } 216 214 … … 218 216 * 219 217 * @param event 220 * @param user218 * @param owner 221 219 * @param trigger 222 220 * @param triggerStart … … 229 227 */ 230 228 public static BwEventAlarm procedureAlarm(BwEvent event, 231 BwUser user,229 BwUser owner, 232 230 String trigger, 233 231 boolean triggerStart, … … 237 235 String attach, 238 236 String description) { 239 return new BwEventAlarm(event, alarmTypeProcedure, user,237 return new BwEventAlarm(event, owner, alarmTypeProcedure, 240 238 trigger, triggerStart, triggerDateTime, 241 239 duration, repeat, 242 240 0, 0, 0, false, 243 241 attach, 244 description, null, null , 0);242 description, null, null); 245 243 } 246 244 … … 363 361 364 362 public String toString() { 365 StringBuffer sb = new StringBuffer( );366 367 sb.append("BwEventAlarm{");363 StringBuffer sb = new StringBuffer("BwEventAlarm{"); 364 365 toStringSegment(sb); 368 366 369 367 if (event != null) { … … 372 370 } 373 371 374 sb.append(", ");375 376 sb.append(super.toString());377 372 sb.append("}"); 378 373 … … 383 378 try { 384 379 BwEventAlarm a = new BwEventAlarm(null, //event 380 null, // user 385 381 getAlarmType(), 386 null, // user387 382 getTrigger(), 388 383 getTriggerStart(), … … 397 392 getDescription(), 398 393 getSummary(), 399 cloneAttendees(), 400 getSequence() 401 ); 394 cloneAttendees()); 402 395 403 396 // Don't clone event , they are cloning us 404 397 405 if (get User() != null) {406 a.set User((BwUser)getUser().clone());398 if (getOwner() != null) { 399 a.setOwner((BwUser)getOwner().clone()); 407 400 } 408 401 trunk/calendar3/calFacade/src/org/bedework/calfacade/BwRecurrence.java
r2 r48 82 82 private Collection exrules; 83 83 84 /** Collection of DateTimeVOrdate values84 /** Collection of BwDateTime rdate values 85 85 */ 86 86 private Collection rdates; 87 87 88 /** Collection of DateTimeVOexdate values88 /** Collection of BwDateTime exdate values 89 89 */ 90 90 private Collection exdates; trunk/calendar3/calFacade/src/org/bedework/calfacade/BwTimeZone.java
r2 r48 54 54 package org.bedework.calfacade; 55 55 56 import java.io.Serializable;56 import org.bedework.calfacade.base.BwOwnedDbentity; 57 57 58 58 /** Represents a stored timezone. This whole area is somewhat problematical, … … 70 70 * @version 1.0 71 71 */ 72 public class BwTimeZone implements Serializable { 73 private int id = CalFacadeDefs.unsavedItemKey; 74 72 public class BwTimeZone extends BwOwnedDbentity { 75 73 /** This is the timezone id this is known by. 76 74 */ 77 75 private String tzid; 78 79 /* * We store timezones in CalendarVO objects.80 * /81 private CalendarVO calendar;82 */83 84 /** User who owns this timezone */85 private BwUser owner;86 87 private boolean publick;88 76 89 77 private String vtimezone; // rfc2554 representation … … 98 86 */ 99 87 public BwTimeZone() { 100 }101 102 /** Set the id for this timezone103 *104 * @param val alarm id105 */106 public void setId(int val) {107 id = val;108 }109 110 /** Get the timezone's id111 *112 * @return int the timezone's unique id113 */114 public int getId() {115 return id;116 88 } 117 89 … … 130 102 public String getTzid() { 131 103 return tzid; 132 }133 134 /* * Set the timezone's calendar135 *136 * @param val CalendarVO timezone's calendar137 * /138 public void setCalendar(CalendarVO val) {139 calendar = val;140 }141 142 /* * Get the timezone's calendar143 *144 * @return CalendarVO the timezone's calendar145 * /146 public CalendarVO getCalendar() {147 return calendar;148 }*/149 150 /** Set the timezone public flag151 *152 * @param val true if the timezone is public153 */154 public void setPublick(boolean val) {155 publick = val;156 }157 158 /**159 * @return boolean true for public160 */161 public boolean getPublick() {162 return publick;163 }164 165 /**166 * @param val UserVO timezone owner167 */168 public void setOwner(BwUser val) {169 owner = val;170 }171 172 /**173 * @return UserVO timezone's owner174 */175 public BwUser getOwner() {176 return owner;177 104 } 178 105 … … 258 185 259 186 public String toString() { 260 StringBuffer sb = new StringBuffer( );187 StringBuffer sb = new StringBuffer("TimeZoneVO{"); 261 188 262 sb.append("TimeZoneVO{id="); 263 sb.append(id); 189 super.toStringSegment(sb); 264 190 sb.append(", tzid="); 265 191 sb.append(tzid); 266 sb.append(", publick=");267 sb.append(getPublick());268 sb.append(", owner=");269 sb.append(owner);270 192 sb.append(", jtzid="); 271 193 sb.append(jtzid); trunk/calendar3/calFacade/src/org/bedework/calfacade/BwTodo.java
r2 r48 54 54 package org.bedework.calfacade; 55 55 56 import java.io.Serializable;56 import org.bedework.calfacade.base.BwShareableContainedDbentity; 57 57 58 58 /** This will be populated with the Vtodo fields. … … 60 60 * @author Mike Douglass douglm@rpi.edu 61 61 */ 62 public class BwTodo implements Serializable { 63 private int id = CalFacadeDefs.unsavedItemKey; 62 public class BwTodo extends BwShareableContainedDbentity { 64 63 65 64 private BwDateTime dtstart; … … 68 67 * Bean methods 69 68 * ==================================================================== */ 70 71 /**72 Set the id for this event73 @param val Event id74 */75 public void setId(int val) {76 id = val;77 }78 79 /** Get the event's unique id80 *81 * @return int the event's unique id82 */83 public int getId() {84 return id;85 }86 69 87 70 /** Set the event's start trunk/calendar3/calFacade/src/org/bedework/calfacade/BwTodoAlarm.java
r2 r48 83 83 * 84 84 * @param todo TodoVO for this alarm - if non-null event == null 85 * @param owner Owner of alarm 85 86 * @param alarmType type of alarm 86 * @param user Owner of alarm87 87 * @param trigger This specifies the time for the alarm in rfc format 88 88 * @param triggerStart true if we trigger off the start … … 100 100 * @param summary String summary (email) 101 101 * @param attendees Collection of attendees 102 * @param sequence long sequence value103 102 */ 104 103 public BwTodoAlarm(BwTodo todo, 104 BwUser owner, 105 105 int alarmType, 106 BwUser user,107 106 String trigger, 108 107 boolean triggerStart, … … 117 116 String description, 118 117 String summary, 119 Collection attendees, 120 long sequence) { 121 super(alarmType, user, trigger, triggerStart, triggerDateTime, 118 Collection attendees) { 119 super(owner, alarmType, trigger, triggerStart, triggerDateTime, 122 120 duration, repeat, triggerTime, previousTrigger, 123 121 repeatCount, expired, attach, description, 124 summary, attendees , sequence);122 summary, attendees); 125 123 this.todo = todo; 126 124 } … … 129 127 * 130 128 * @param todo 131 * @param user129 * @param owner 132 130 * @param trigger 133 131 * @param triggerStart … … 139 137 */ 140 138 public static BwTodoAlarm audioAlarm(BwTodo todo, 141 BwUser user,139 BwUser owner, 142 140 String trigger, 143 141 boolean triggerStart, … … 146 144 int repeat, 147 145 String attach) { 148 return new BwTodoAlarm(todo, alarmTypeAudio, user,146 return new BwTodoAlarm(todo, owner, alarmTypeAudio, 149 147 trigger, triggerStart, triggerDateTime, 150 148 duration, repeat, 151 149 0, 0, 0, false, 152 150 attach, 153 null, null, null , 0);151 null, null, null); 154 152 } 155 153 … … 157 155 * 158 156 * @param todo 159 * @param user157 * @param owner 160 158 * @param trigger 161 159 * @param triggerStart … … 167 165 */ 168 166 public static BwTodoAlarm displayAlarm(BwTodo todo, 169 BwUser user,167 BwUser owner, 170 168 String trigger, 171 169 boolean triggerStart, … … 174 172 int repeat, 175 173 String description) { 176 return new BwTodoAlarm(todo, alarmTypeDisplay, user,174 return new BwTodoAlarm(todo, owner, alarmTypeDisplay, 177 175 trigger, triggerStart, triggerDateTime, 178 176 duration, repeat, 179 177 0, 0, 0, false, 180 null, description, null, null , 0);178 null, description, null, null); 181 179 } 182 180 … … 184 182 * 185 183 * @param todo 186 * @param user184 * @param owner 187 185 * @param trigger 188 186 * @param triggerStart … … 197 195 */ 198 196 public static BwTodoAlarm emailAlarm(BwTodo todo, 199 BwUser user,197 BwUser owner, 200 198 String trigger, 201 199 boolean triggerStart, … … 207 205 String summary, 208 206 Collection attendees) { 209 return new BwTodoAlarm(todo, alarmTypeEmail, user,207 return new BwTodoAlarm(todo, owner, alarmTypeEmail, 210 208 trigger, triggerStart, triggerDateTime, 211 209 duration, repeat, 212 210 0, 0, 0, false, 213 211 attach, 214 description, summary, attendees , 0);212 description, summary, attendees); 215 213 } 216 214 … … 218 216 * 219 217 * @param todo 220 * @param user218 * @param owner 221 219 * @param trigger 222 220 * @param triggerStart … … 229 227 */ 230 228 public static BwTodoAlarm procedureAlarm(BwTodo todo, 231 BwUser user,229 BwUser owner, 232 230 String trigger, 233 231 boolean triggerStart, … … 237 235 String attach, 238 236 String description) { 239 return new BwTodoAlarm(todo, alarmTypeProcedure, user,237 return new BwTodoAlarm(todo, owner, alarmTypeProcedure, 240 238 trigger, triggerStart, triggerDateTime, 241 239 duration, repeat, 242 240 0, 0, 0, false, 243 241 attach, 244 description, null, null , 0);242 description, null, null); 245 243 } 246 244 … … 349 347 350 348 public String toString() { 351 StringBuffer sb = new StringBuffer( );352 353 sb.append("TodoAlarmVO{");349 StringBuffer sb = new StringBuffer("BwTodoAlarm{"); 350 351 toStringSegment(sb); 354 352 355 353 if (todo != null) { … … 358 356 } 359 357 360 sb.append(", ");361 362 sb.append(super.toString());363 358 sb.append("}"); 364 359 … … 367 362 368 363 public Object clone() { 369 BwTodoAlarm a = new BwTodoAlarm(null, //todo 370 alarmType, 371 null, // user 372 trigger, 373 triggerStart, 374 triggerDateTime, 375 duration, 376 repeat, 377 triggerTime, 378 previousTrigger, 379 repeatCount, 380 expired, 381 attach, 382 description, 383 summary, 384 cloneAttendees(), 385 sequence 386 ); 387 388 // Don't clone event or todo, they are cloning us 389 390 if (user != null) { 391 a.setUser((BwUser)user.clone()); 392 } 393 394 return a; 364 try { 365 BwTodoAlarm a = new BwTodoAlarm(null, //todo 366 null, // user 367 getAlarmType(), 368 getTrigger(), 369 getTriggerStart(), 370 getTriggerDateTime(), 371 getDuration(), 372 getRepeat(), 373 getTriggerTime(), 374 getPreviousTrigger(), 375 getRepeatCount(), 376 getExpired(), 377 getAttach(), 378 getDescription(), 379 getSummary(), 380 cloneAttendees()); 381 382 // Don't clone event or todo, they are cloning us 383 384 if (getOwner() != null) { 385 a.setOwner((BwUser)getOwner().clone()); 386 } 387 388 return a; 389 } catch (Throwable t) { 390 throw new RuntimeException(t); 391 } 395 392 } 396 393 } trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r47 r48 1605 1605 // Do some sort of validation here. 1606 1606 alarm.setEvent(event); 1607 alarm.set User(getUser());1607 alarm.setOwner(getUser()); 1608 1608 getCal().addAlarm(alarm); 1609 1609 } trunk/calendar3/docs/todo.txt
r47 r48 2 2 3 3 -------------------------------------------------------------------------------- 4 -------------------------------------------------------------------------------- 5 maxDescriptionLength out of BwEvent - into syspars? 4 6 -------------------------------------------------------------------------------- 5 7 Check all day events are correct in all clients. trunk/calendar3/dumprestore/build.xml
r43 r48 2 2 3 3 <!-- ============= Calendar db interface test classes ================== 4 This is the build.xml for the uwcal calendar dbi test..4 This is the build.xml for the bedework calendar dump restore. 5 5 6 6 Authors: Mike Douglass douglm@rpi.edu … … 8 8 9 9 <project name="cal.db.dumprestore" default="init" > 10 <property name="base.name" value=" tools.dumprestore"/>10 <property name="base.name" value="dumprestore"/> 11 11 12 12 <target name="init"> 13 13 <dirname property="this.dir" file="${ant.file}"/> 14 14 <property name="source.home" location="${this.dir}/src"/> 15 16 <property name="dump.class" value="org.bedework.dumprestore.dump.Dump" /> 17 <property name="restore.class" value="org.bedework.dumprestore.restore.Restore" /> 15 18 16 19 <property name="org.bedework.dump.jdbcdriver.jar" … … 53 56 <!-- add any properties we might want --> 54 57 <pathelement location="${dumprestore.run.resources}" /> 55 <pathelement location="${org.bedework. tools.base}/properties" />58 <pathelement location="${org.bedework.dumprestore.base}/properties" /> 56 59 57 60 <!-- add the mapping file from appsuite --> … … 86 89 <!-- add any properties we might want --> 87 90 <pathelement location="${dumprestore.run.resources}" /> 88 <pathelement location="${org.bedework. tools.base}/properties" />91 <pathelement location="${org.bedework.dumprestore.base}/properties" /> 89 92 90 93 <!-- add the mapping file from appsuite --> … … 94 97 location="${dumprestore.run.base}/resources/hibernate.properties"/> 95 98 </path> 99 </target> 100 101 <target name="build" 102 depends="init" 103 description="Build calendar dumprestore jars"> 104 <!-- ==================== Sources and classes ====================== --> 105 106 <fileset id="base.java.sources" dir="${source.home}" > 107 <include name="org/bedework/dumprestore/**/*.java"/> 108 </fileset> 109 110 <patternset id="base.class.patternset"> 111 <include name="org/bedework/dumprestore/**/*.class"/> 112 </patternset> 113 114 <!-- ==================== Compilation Classpath ==================== --> 115 116 <path id="compile.classpath"> 117 <pathelement location="${log4j.jar}"/> 118 <pathelement location="${ical4j.jar}"/> 119 <pathelement location="${digester.jar}"/> 120 <pathelement location="${hibernate.jar}"/> 121 <pathelement location="${org.bedework.calfacadeshared.jar}"/> 122 <pathelement location="${org.bedework.calsvci.jar}"/> 123 <pathelement location="${org.bedework.calcore.jar}"/> 124 <pathelement location="${org.bedework.access.jar}"/> 125 <pathelement location="${org.bedework.appcommon.jar}"/> 126 </path> 127 128 <!-- ==================== Build Target ============================= --> 129 130 <property name="build.jar.file" location="${org.bedework.dumprestore.jar}" /> 131 132 <ant antfile="${buildjar}" inheritRefs="true" target="build" /> 96 133 </target> 97 134 … … 105 142 <!-- Load the properties from the properties directory --> 106 143 <property name="cal.dumprestore.properties" 107 location="${org.bedework. tools.base}/properties/dumprestore.properties"/>144 location="${org.bedework.dumprestore.base}/properties/dumprestore.properties"/> 108 145 <echo message="Using db properties in ${cal.dumprestore.properties}" /> 109 146 … … 127 164 <echo message="dumping to ${org.bedework.dump.arg.dumpfile}" /> 128 165 129 <java classname="${dump.class}"166 <java classname="${dump.class}" 130 167 fork="true" 131 168 failonerror="true"> … … 148 185 <!-- Load the properties from the properties directory --> 149 186 <property name="cal.dumprestore.properties" 150 location="${org.bedework. tools.base}/properties/dumprestore.properties"/>187 location="${org.bedework.dumprestore.base}/properties/dumprestore.properties"/> 151 188 <echo message="Using db properties in ${cal.dumprestore.properties}" /> 152 189 … … 192 229 <echo message="restoring from ${org.bedework.restore.arg.dumpfile}" /> 193 230 194 <java classname="${restore.class}"231 <java classname="${restore.class}" 195 232 fork="true" 196 233 failonerror="true"> … … 252 289 description="Run bedework db restore app to initialise db"> 253 290 <property name="org.bedework.restore.arg.dumpfile" 254 location="${org.bedework. tools.base}/resources/initbedework.xml"/>291 location="${org.bedework.dumprestore.base}/resources/initbedework.xml"/> 255 292 <antcall target="restoredb" inheritrefs="true" /> 256 293 </target> trunk/calendar3/test/src/org/bedework/tests/calsvc/CalSvcAlarmsTest.java
r2 r48 303 303 BwEventAlarm alarm = (BwEventAlarm)it.next(); 304 304 305 BwUser auser = alarm.get User();305 BwUser auser = alarm.getOwner(); 306 306 assertNotNull("Expecting non-null alarm for user " + user, auser); 307 307 trunk/calendar3/tools/build.xml
r18 r48 62 62 ================================================================= --> 63 63 64 <target name="dumpdb"65 depends="build"66 description="Run calendar db dump app">67 <ant antfile="${org.bedework.tools.base}/dumprestore/build.xml" inheritrefs="true"68 target="dumpdb" >69 <property name="dump.class" value="org.bedework.tools.dumprestore.dump.Dump" />70 </ant>71 </target>72 73 <target name="restoredb"74 depends="build"75 description="Run calendar db restore app">76 <ant antfile="${org.bedework.tools.base}/dumprestore/build.xml" inheritrefs="true"77 target="restoredb" >78 <property name="restore.class" value="org.bedework.tools.dumprestore.restore.Restore" />79 </ant>80 </target>81 82 <target name="initdb"83 depends="build"84 description="Run calendar db restore app to init db">85 <ant antfile="${org.bedework.tools.base}/dumprestore/build.xml" inheritrefs="true"86 target="initdb" >87 <property name="restore.class" value="org.bedework.tools.dumprestore.restore.Restore" />88 </ant>89 </target>90 91 64 <target name="tzconvert" 92 65 depends="build"
