View Javadoc
1 /*** 2 * 3 * $Id$ 4 * 5 * Copyright (c) 2002-2003 JLCP.org 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a 8 * copy of this software and associated documentation files (the 9 * "Software"), to deal in the Software without restriction, including 10 * without limitation the rights to use, copy, modify, merge, publish, 11 * distribute, sublicense, and/or sell copies of the Software, and to 12 * permit persons to whom the Software is furnished to do so, subject to 13 * the following conditions: 14 * 15 * The above copyright notice and this permission notice shall be included 16 * in all copies or substantial portions of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 * 26 */ 27 28 package com.gotjava.model.calendar; 29 30 import com.gotjava.model.AbstractPersistableObject; 31 import com.gotjava.model.signon.JLCPUser; 32 33 import java.util.Date; 34 35 /*** 36 * <p> 37 * JavaBean implementation of a simplified VEVENT object based on the 38 * iCalendar specification (RFC2445). For more information see the 39 * calsch group documentation at http://www.calsch.org/ 40 * </p> 41 * <p> 42 * Currently only the very basic fields are avaliable. Repeating events are 43 * not yet supported and the categories mechanism is not final. 44 * </p> 45 * @author J Aaron Farr 46 */ 47 48 public class CalendarEvent extends AbstractPersistableObject { 49 50 private Date dtend; 51 private Date creationDate; 52 private Date modifiedDate; 53 private JLCPUser user; 54 private String classification; 55 private String location; 56 private String uid; 57 private String status; 58 private String summary; 59 private long duration; 60 private Date dtstart; 61 private JLCPUser organizer; 62 private int priority; 63 private boolean transparent = false; 64 private String url; 65 private Date lastModified; 66 private int seq; 67 private String category; 68 69 public CalendarEvent() { 70 } 71 72 /*** 73 * Event start time (see RFC2445 4.8.2.4 ) 74 */ 75 public Date getDtstart() { 76 return dtstart; 77 } 78 79 /*** 80 * Event start time (see RFC2445 4.8.2.4 ) 81 */ 82 public void setDtstart(Date dtstart) { 83 this.dtstart = dtstart; 84 } 85 86 /*** 87 * Event end time (see RFC2445 4.8.2.2 ). 88 */ 89 public Date getDtend() { 90 return dtend; 91 } 92 93 /*** 94 * Event end time (see RFC2445 4.8.2.2 ) 95 * <P> 96 * Note: the RFC specifies that one can set the end time _or_ the duration, 97 * not both. Setting the duration will affect this field. 98 * </p> 99 */ 100 public void setDtend(Date dtend) { 101 this.dtend = dtend; 102 // this.duration = this.dtend.getTime() - this.dtstart.getTime(); 103 } 104 105 /*** 106 * Event classification (see RFC2445 4.8.1.3 ). Used for access and security 107 * classification. The use of this is not yet implemented in JLCP. 108 */ 109 public String getClassification() { 110 return classification; 111 } 112 113 /*** 114 * Event classification (see RFC2445 4.8.1.3 ). Used for access and security 115 * classification. The use of this is not yet implemented in JLCP. 116 */ 117 public void setClassification(String classification) { 118 this.classification = classification; 119 } 120 121 /*** 122 * Event location, ie- place of occurance. (see RFC2445 4.8.1.7 ). This is 123 * seperate from locale and i18n. 124 */ 125 public String getLocation() { 126 return location; 127 } 128 129 /*** 130 * Event location, ie- place of occurance. (see RFC2445 4.8.1.7 ). This is 131 * seperate from locale and i18n. 132 */ 133 public void setLocation(String location) { 134 this.location = location; 135 } 136 137 /*** 138 * Event organizer. (see RFC2445 4.8.4.3 ) This is used for shared 139 * events. Personal events do not have an organizer. 140 */ 141 public JLCPUser getOrganizer() { 142 return organizer; 143 } 144 145 /*** 146 * Event organizer. (see RFC2445 4.8.4.3 ) This is used for shared 147 * events. Personal events do not have an organizer. 148 */ 149 public void setOrganizer(JLCPUser organizer) { 150 this.organizer = organizer; 151 } 152 153 /*** 154 * Event priority (see RFC2445 4.8.1.9 ). Should be a value 0-9. Zero is 155 * an undefined priority. One is the highest with nine as the lowest 156 * priority. Other integer values are reserved. 157 */ 158 public int getPriority() { 159 return priority; 160 } 161 162 /*** 163 * Event priority (see RFC2445 4.8.1.9 ). Should be a value 0-9. Zero is 164 * an undefined priority. One is the highest with nine as the lowest 165 * priority. Other integer values are reserved. 166 */ 167 public void setPriority(int priority) { 168 this.priority = priority; 169 } 170 171 /*** 172 * Event transparency (see RFC2445 4.8.2.7 ). If an event is transparent 173 * then it will not be flagged as "busy" time. 174 */ 175 public boolean isTransparent() { 176 return transparent; 177 } 178 179 /*** 180 * Event transparency (see RFC2445 4.8.2.7 ). If an event is transparent 181 * then it will not be flagged as "busy" time. 182 */ 183 public void setTransparent(boolean transparent) { 184 this.transparent = transparent; 185 } 186 187 /*** 188 * Event URL. (see RFC2445 4.8.4.6 ) Any valid URL associated with the 189 * event. 190 */ 191 public String getUrl() { 192 return url; 193 } 194 195 /*** 196 * Event URL. (see RFC2445 4.8.4.6 ) Any valid URL associated with the 197 * event. 198 */ 199 public void setUrl(String url) { 200 this.url = url; 201 } 202 /*** 203 * Event Unique Identifier (see RFC2445 4.8.4.7 ). 204 * <p> 205 * <code>[DateInMilliseconds]-[SeqId]-[username]@[hostname]</code> 206 * </p> 207 * <p> 208 * Example: 1048004868316-5936-user@jlcp.org 209 * </p> 210 */ 211 public String getUid() { 212 return uid; 213 } 214 /*** 215 * Event Unique Identifier (see RFC2445 4.8.4.7 ). 216 * <p> 217 * <code>[DateInMilliseconds]-[SeqId]-[username]@[hostname]</code> 218 * </p> 219 * <p> 220 * Example: 1048004868316-5936-user@jlcp.org 221 * </p> 222 * <p> 223 * This field is set by the CalendarManager. 224 * </p> 225 */ 226 public void setUid(String uid) { 227 this.uid = uid; 228 } 229 /*** 230 * Event last-modified date (see RFC2445 4.8.7.3 ) 231 */ 232 public Date getLastModified() { 233 return lastModified; 234 } 235 236 /*** 237 * Event last-modified date (see RFC2445 4.8.7.3 ) 238 */ 239 public void setLastModified(Date lastModified) { 240 this.lastModified = lastModified; 241 } 242 243 /*** 244 * Event sequence (see RFC2445 4.8.7.4 ). Used to track modications 245 * made to the event 246 */ 247 public int getSeq() { 248 return seq; 249 } 250 251 /*** 252 * Event sequence (see RFC2445 4.8.7.4 ). Used to track modications 253 * made to the event 254 */ 255 public void setSeq(int seq) { 256 this.seq = seq; 257 } 258 259 /*** 260 * Event status (see RFC2445 4.8.1.11 ). Valid values include 261 * "CONFIRMED", "CANCELLED", and "TENTATIVE". 262 */ 263 public String getStatus() { 264 return status; 265 } 266 267 /*** 268 * Event status (see RFC2445 4.8.1.11 ). Valid values include 269 * "CONFIRMED", "CANCELLED", and "TENTATIVE". 270 */ 271 public void setStatus(String status) { 272 this.status = status; 273 } 274 275 /*** 276 * Event summary or description (see RFC2445 4.8.1.12 ) 277 */ 278 public String getSummary() { 279 return summary; 280 } 281 282 /*** 283 * Event summary or description (see RFC2445 4.8.1.12 ) 284 */ 285 public void setSummary(String summary) { 286 this.summary = summary; 287 } 288 289 /*** 290 * Event duration (see RFC2445 4.8.2.5 ) 291 */ 292 public long getDuration() { 293 return duration; 294 } 295 296 /*** 297 * Event duration (see RFC2445 4.8.2.5 ). Setting this field adjusts the 298 * end date. Start Date should be set before setting this field. 299 */ 300 public void setDuration(long duration) { 301 this.duration = duration; 302 this.dtend = new Date(this.dtstart.getTime() + duration); 303 } 304 305 /*** 306 * Event category (see RFC2445 4.8.1.2 ). This field will be updated when 307 * a unified topic manager is avaliable. 308 */ 309 public String getCategory() { 310 return category; 311 } 312 313 /*** 314 * Event category (see RFC2445 4.8.1.2 ) 315 */ 316 public void setCategory(String category) { 317 this.category = category; 318 } 319 320 public void setCreationDate(Date date) { 321 this.creationDate = date; 322 } 323 324 public Date getCreationDate() { 325 return this.creationDate; 326 } 327 328 public void setModifiedDate(Date date) { 329 this.modifiedDate = date; 330 } 331 332 public Date getModifiedDate() { 333 return this.modifiedDate; 334 } 335 336 public JLCPUser getUser() { 337 return this.user; 338 } 339 340 public void setUser(JLCPUser user) { 341 this.user = user; 342 } 343 344 345 }

This page was automatically generated by Maven