Changeset 426
- Timestamp:
- 05/01/06 10:16:14
- Files:
-
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavComponentNode.java (modified) (4 diffs)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/filter/Filter.java (modified) (5 diffs)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/filter/PropFilter.java (modified) (1 diff)
- trunk/calendar3/test/caldavTestData/eg/eg11.test (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavComponentNode.java
r417 r426 67 67 import edu.rpi.sss.util.xml.QName; 68 68 69 70 69 import net.fortuna.ical4j.model.Calendar; 71 70 import net.fortuna.ical4j.model.Component; 72 71 import net.fortuna.ical4j.model.component.VEvent; 73 72 73 import java.util.ArrayList; 74 74 import java.util.Collection; 75 75 import java.util.Iterator; 76 import java.util.Vector;77 76 78 77 /** Class to represent an entity such as events in caldav. … … 223 222 public void addEvent(BwEvent val) { 224 223 if (events == null) { 225 events = new Vector(); 226 } 227 events.add(val); 224 events = new ArrayList(); 225 } 226 227 EventInfo ei = new EventInfo(val); 228 229 ei.setRecurrenceId(val.getRecurrence().getRecurrenceId()); 230 events.add(ei); 228 231 } 229 232 … … 268 271 public Collection getProperties(String ns) throws WebdavIntfException { 269 272 init(true); 270 Vector v = new Vector();273 ArrayList al = new ArrayList(); 271 274 272 275 getVevent(); // init comp … … 275 278 } 276 279 277 addProp( v, ICalTags.summary, name);278 addProp( v, ICalTags.dtstart, comp.getDtstart());279 addProp( v, ICalTags.dtend, comp.getDtend());280 addProp( v, ICalTags.duration, comp.getDuration());281 addProp( v, ICalTags.transp, comp.getTransp());282 addProp( v, ICalTags.due, comp.getDue());280 addProp(al, ICalTags.summary, name); 281 addProp(al, ICalTags.dtstart, comp.getDtstart()); 282 addProp(al, ICalTags.dtend, comp.getDtend()); 283 addProp(al, ICalTags.duration, comp.getDuration()); 284 addProp(al, ICalTags.transp, comp.getTransp()); 285 addProp(al, ICalTags.due, comp.getDue()); 283 286 // addProp(v, ICalTags.completed, | date-time from RFC2518 284 addProp( v, ICalTags.status, comp.getStatus());287 addProp(al, ICalTags.status, comp.getStatus()); 285 288 // addProp(v, ICalTags.priority, | integer 286 289 // addProp(v, ICalTags.percentComplete, | integer 287 addProp( v, ICalTags.uid, comp.getUid());288 addProp( v, ICalTags.sequence, comp.getSequence());290 addProp(al, ICalTags.uid, comp.getUid()); 291 addProp(al, ICalTags.sequence, comp.getSequence()); 289 292 // addProp(v, ICalTags.recurrenceId, | date-time from RFC2518 290 293 // addProp(v, ICalTags.trigger, | see below TODO 291 294 292 295 // FIXME FIX FIX 293 addProp( v, ICalTags.hasRecurrence, "0");294 addProp( v, ICalTags.hasAlarm, "0");295 addProp( v, ICalTags.hasAttachment, "0");296 297 return v;296 addProp(al, ICalTags.hasRecurrence, "0"); 297 addProp(al, ICalTags.hasAlarm, "0"); 298 addProp(al, ICalTags.hasAttachment, "0"); 299 300 return al; 298 301 } 299 302 trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/filter/Filter.java
r423 r426 99 99 * if it matches the filter, which is to say: 100 100 * 101 * ("no is-defined element" OR "is-defined matches") AND 102 * ("no time-range element" OR "time-range matches") AND 103 * ("no sub-component filter" OR "all sub-component filters match") AND 104 * ("no property filter elements" OR "all property filters match") 105 * 106 * 107 * <!ELEMENT comp-filter (is-defined | time-range)? 108 * comp-filter* prop-filter*> 101 * A component of the type specified by the "name" attribute 102 * exists, and the CALDAV:comp-filter is empty, OR 103 * 104 * it contains at least one recurrence instance scheduled to overlap a 105 * given time range if a CALDAV:time-range XML element is specified, and 106 * that any CALDAV:prop-filter and CALDAV:comp-filter child elements 107 * also match. 108 * 109 * 110 * <!ELEMENT comp-filter (is-not-defined | (time-range?, 111 * prop-filter*, comp-filter*))> 109 112 * 110 113 * <!ATTLIST comp-filter name CDATA #REQUIRED> … … 119 122 * Limits the search to specific properties. 120 123 * Description: 121 * The "name" attribute MUST contain an iCalendar property name (e.g., "ATTENDEE"). When the 'prop-filter' executes, a property matches if: 122 * 123 * ("no is-defined element" OR "is-defined matches") AND 124 * ("no time-range element" OR "time-range matches") AND 125 * ("no text match element" OR "text-match matches") AND 126 * ("no parameter filter elements" OR "all parameter filters match") 127 * 128 * <!ELEMENT prop-filter (is-defined | time-range | text-match)? 129 * param-filter*> 124 * The "name" attribute MUST contain an iCalendar property name 125 * (e.g., "ATTENDEE"). When the 'prop-filter' executes, a property matches if: 126 * 127 * A property of the type specified by the "name" attribute 128 * exists, and the CALDAV:prop-filter is empty, OR it matches the 129 * CALDAV:time-range XML element or CALDAV:text-match conditions 130 * if specified, and that any CALDAV:param-filter child elements 131 * also match. 132 * 133 * or: 134 * 135 * A property of the type specified by the "name" attribute does 136 * not exist, and the CALDAV:is-not-defined element is specified. 137 * 138 * <!ELEMENT prop-filter ((is-not-defined | 139 * ((time-range | text-match)?, 140 * param-filter*))> 130 141 * 131 142 * <!ATTLIST prop-filter name CDATA #REQUIRED> … … 492 503 493 504 /** The given node must be a comp-filter element 494 * <!ELEMENT comp-filter (is-not-defined | time-range)?495 * comp-filter* prop-filter*>505 * <!ELEMENT comp-filter (is-not-defined | (time-range?, 506 * prop-filter*, comp-filter*))> 496 507 * 497 508 * <!ATTLIST comp-filter name CDATA #REQUIRED> … … 511 522 Element[] children = getChildren(nd); 512 523 524 if (children.length == 0) { 525 // Empty 526 return cf; 527 } 528 529 if ((children.length == 1) && 530 MethodBase.nodeMatches(children[0], CaldavTags.isNotDefined)) { 531 cf.setIsNotDefined(true); 532 return cf; 533 } 534 535 /* (time-range?, prop-filter*, comp-filter*) */ 536 513 537 try { 514 538 for (int i = 0; i < children.length; i++) { … … 521 545 } 522 546 523 if (MethodBase.nodeMatches(curnode, CaldavTags.isNotDefined)) { 524 if (cf.getTimeRange() != null) { 525 throw new WebdavBadRequest(); 526 } 527 528 cf.setIsNotDefined(true); 529 } else if (MethodBase.nodeMatches(curnode, CaldavTags.timeRange)) { 530 if (cf.getIsNotDefined()) { 531 throw new WebdavBadRequest(); 532 } 533 547 if (MethodBase.nodeMatches(curnode, CaldavTags.timeRange)) { 534 548 cf.setTimeRange(CalDavParseUtil.parseTimeRange(curnode, 535 549 intf.getSvci().getTimezones())); trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/filter/PropFilter.java
r423 r426 253 253 } else if (timeRange != null) { 254 254 timeRange.dump(log, indent + " "); 255 } else {255 } else if (match != null) { 256 256 match.dump(log, indent + " "); 257 257 } trunk/calendar3/test/caldavTestData/eg/eg11.test
r2 r426 21 21 <C:comp-filter name="VCALENDAR"> 22 22 <C:comp-filter name="VEVENT"> 23 <C:prop-filter name="ORGANIZER"> 24 <C:is-defined/> 25 </C:prop-filter> 23 <C:prop-filter name="ORGANIZER"/> 26 24 </C:comp-filter> 27 25 </C:comp-filter>
