Changeset 510
- Timestamp:
- 05/29/06 23:12:48
- Files:
-
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java (modified) (1 diff)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Events.java (modified) (6 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeUtil.java (modified) (5 diffs)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java
r507 r510 1057 1057 GetPeriodsPars gpp = new GetPeriodsPars(); 1058 1058 1059 gpp. events = events;1059 gpp.periods = events; 1060 1060 gpp.startDt = start; 1061 1061 gpp.dur = granularity; trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Events.java
r507 r510 1303 1303 } 1304 1304 1305 /* *Note that the comparisons below are required to ensure that the1305 /* Note that the comparisons below are required to ensure that the 1306 1306 * start date is inclusive and the end date is exclusive. 1307 1307 * From CALDAV: … … 1311 1311 * (DTSTART <= start AND DTSTART+DURATION > start) OR 1312 1312 * (DTSTART >= start AND DTSTART < end) OR 1313 * (DTEND > start AND DTEND <= end) 1314 * 1315 * XXX This is wrong??? Last should be 1316 * XXX (DTEND > start AND DTEND < end) 1313 * (DTEND > start AND DTEND < end) 1317 1314 * 1318 1315 * case 1 has the event starting between the dates. … … 1335 1332 } 1336 1333 1334 /* 1337 1335 sb.append("((("); 1338 1336 … … 1348 1346 1349 1347 // case 3 1350 /*1351 sb.append(endField);1352 sb.append(" > :fromDate) and (");1353 sb.append(endField);1354 sb.append(" <= :toDate)))");1355 */1356 1348 sb.append(endField); 1357 1349 sb.append(" > :fromDate) and ("); … … 1359 1351 sb.append(" < :toDate)))"); 1360 1352 1361 / *1353 / * 1362 1354 (((ev.dtstart.datePart <= :fromDate) and (ev.dtend.datePart > :fromDate)) or 1363 1355 ((ev.dtstart.datePart >= :fromDate) and (ev.dtstart.datePart < :toDate)) or … … 1365 1357 ((ev.dtend.datePart >= :fromDate) and (ev.dtend.datePart < :toDate))) 1366 1358 */ 1359 sb.append("(("); 1360 sb.append(startField); 1361 sb.append(" < :toDate) and (("); 1362 1363 sb.append(endField); 1364 sb.append(" > :fromDate) or (("); 1365 1366 sb.append(startField); 1367 sb.append("="); 1368 sb.append(endField); 1369 sb.append(") and ("); 1370 sb.append(endField); 1371 sb.append(" >= :fromDate))))"); 1372 1373 /* 1374 ((start < to) and ((end > from) or 1375 ((start = end) and (end >= from)))) 1376 */ 1367 1377 return true; 1368 1378 } trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeUtil.java
r507 r510 60 60 import net.fortuna.ical4j.model.Parameter; 61 61 import net.fortuna.ical4j.model.ParameterList; 62 import net.fortuna.ical4j.model.Period; 62 63 import net.fortuna.ical4j.model.Property; 63 64 import net.fortuna.ical4j.model.property.DateProperty; … … 630 631 } 631 632 632 /** This class defines the e vents and the period of interest and can be passed633 * repeatedly to getPeriodsEvents.633 /** This class defines the entities which occupy time and the period of 634 * interest and can be passed repeatedly to getPeriodsEvents. 634 635 * 635 636 * <p>The end datetime will be updated ready for the next call. If endDt is … … 637 638 */ 638 639 public static class GetPeriodsPars { 639 /** Event Info o bjects to extract from */640 public Collection events;640 /** Event Info or EventPeriod or Period objects to extract from */ 641 public Collection periods; 641 642 /** Start of period - updated at each call from endDt */ 642 643 public BwDateTime startDt; … … 673 674 674 675 EntityRange er = new EntityRange(); 675 Iterator it = pars. events.iterator();676 Iterator it = pars.periods.iterator(); 676 677 while (it.hasNext()) { 677 678 er.setEntity(it.next()); 678 679 679 /* Eventis within range if:680 /* Period is within range if: 680 681 1. (((evStart <= :start) and (evEnd > :start)) or 681 682 2. ((evStart >= :start) and (evStart < :end)) or … … 758 759 } 759 760 761 if (o instanceof Period) { 762 Period p = (Period)o; 763 764 start = String.valueOf(p.getStart()); 765 start = String.valueOf(p.getEnd()); 766 767 return; 768 } 769 760 770 start = null; 761 771 end = null; trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r507 r510 1112 1112 GetPeriodsPars gpp = new GetPeriodsPars(); 1113 1113 1114 gpp. events = events;1114 gpp.periods = events; 1115 1115 gpp.startDt = start; 1116 1116 gpp.dur = granularity;
