| 1 package sellwin.domain; 2 3 import java.util.*; 4 import java.io.*; 5 6 10 16 public class Activity implements Serializable { 17 private long pk; 18 private long oppPK; 19 private String subject; 20 private String type; 21 private String place; 22 private String message; 23 private Date startDate; 24 private Integer duration; private boolean groupAlarm=false; private boolean groupAlarmAck=false; private Boolean alarm=new Boolean (false); private boolean alarmAck=false; private ArrayList attendees = new ArrayList(); private String modifiedBy; 31 private Date modifiedDate; 32 private boolean updatedLocally=false; 33 private boolean addedLocally=false; 34 35 public final static String [] TYPES = { 36 "Meeting", "Callback", "Conf Call", "Birthday", "Appt", "Delivery" 37 }; 38 39 public Activity() { 40 } 41 42 public Activity(String n) { 43 pk = 0L; 44 oppPK = 0L; 45 subject = n; 46 type = TYPES[0]; 47 duration = new Integer (15); 48 startDate = new Date(); 49 modifiedDate = new Date(); 50 } 51 52 public final long getPK() { return pk; } 53 public final void setPK(long pk) { this.pk = pk; } 54 55 public final long getOppPK() { return oppPK; } 56 public final void setOppPK(long pk) { oppPK = pk; } 57 58 public final void setSubject(String n) { subject = n; } 59 public final String getSubject() { return subject; } 60 61 public final void setType(String t) { type = t; } 62 public final String getType() { return type; } 63 64 public final String getPlace() { return place; } 65 public final void setPlace(String s) { place = s; } 66 67 public final String getMessage() { return message; } 68 public final void setMessage(String s) { message = s; } 69 70 public final void setStartDate(Date d) { startDate=d; } 71 public final Date getStartDate() { return startDate; } 72 73 public final void setDuration(Integer d) { duration=d; } 74 public final Integer getDuration() { return duration; } 75 76 public final boolean getGroupAlarm() { return groupAlarm; } 77 public final void setGroupAlarm(boolean t) { groupAlarm = t; } 78 79 public final boolean getGroupAlarmAck() { return groupAlarmAck; } 80 public final void setGroupAlarmAck(boolean b) { groupAlarmAck = b; } 81 82 public final Boolean getAlarm() { return alarm; } 83 public final void setAlarm(Boolean t) { alarm= t; } 84 85 public final boolean getAlarmAck() { return alarmAck; } 86 public final void setAlarmAck(boolean t) { alarmAck = t; } 87 88 public final ArrayList getAttendees() { return attendees; } 89 90 public final void addAttendee(String attendee) { 91 attendees.add(attendee); 92 } 93 94 public final String getModifiedBy() { return modifiedBy; } 95 public final void setModifiedBy(String s) { modifiedBy = s; } 96 public final Date getModifiedDate() { return modifiedDate; } 97 public final void setModifiedDate(Date d) { modifiedDate=d; } 98 99 public final void setUpdatedLocally(boolean b) { updatedLocally=b; } 100 public final void setAddedLocally(boolean b) { addedLocally=b; } 101 102 public final boolean getUpdatedLocally() { return updatedLocally; } 103 public final boolean getAddedLocally() { return addedLocally; } 104 105 public final void print() { 106 System.out.println("Activity"); 107 System.out.println("pk="+getPK()); 108 System.out.println("subject="+getSubject()); 109 System.out.println("place="+getPlace()); 110 System.out.println("message="+getMessage()); 111 System.out.println("type="+getType()); 112 System.out.println("start date="+getStartDate()); 113 System.out.println("alarm ="+getAlarm()); 114 System.out.println("alarm ack="+getAlarmAck()); 115 System.out.println("group alarm="+getGroupAlarm()); 116 System.out.println("group alarm ack="+getGroupAlarmAck()); 117 System.out.println("created by ="+getModifiedBy()); 118 System.out.println("created date ="+getModifiedDate()); 119 } 120 121 public final Activity copy() { 122 String copySubject = new String (subject); 123 Activity copy = new Activity(copySubject); 124 copy.pk = pk; 125 if (type != null) 126 copy.type = new String (type); 127 if (place != null) 128 copy.place = new String (place); 129 if (message != null) 130 copy.message = new String (message); 131 if (startDate != null) 132 copy.startDate = new Date(startDate.getTime()); 133 copy.duration = duration; 134 if (modifiedBy != null) 135 copy.modifiedBy = new String (modifiedBy); 136 if (modifiedDate != null) 137 copy.modifiedDate = new Date(modifiedDate.getTime()); 138 139 copy.alarmAck = alarmAck; 140 copy.alarm= alarm; 141 copy.groupAlarm = groupAlarm; 142 copy.groupAlarmAck = groupAlarmAck; 143 144 String attendee, attendeeCopy; 145 for (int i=0;i<attendees.size();i++) { 146 attendee = (String )attendees.get(i); 147 attendeeCopy = new String (attendee); 148 copy.addAttendee(attendeeCopy); 149 } 150 return copy; 151 } 152 } 153 | Popular Tags |