Changeset 369
- Timestamp:
- 04/13/06 09:35:10
- Files:
-
- trunk/calendar3/bldfiles/defjars.properties (modified) (1 diff)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Calendars.java (modified) (1 diff)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwFreeBusy.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/CalendarsI.java (modified) (3 diffs)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/calquery/FreeBusyQuery.java (modified) (1 diff)
- trunk/calendar3/calsvc/build.xml (modified) (1 diff)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/BwIndexKey.java (added)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/BwIndexLuceneDefs.java (added)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/BwIndexLuceneImpl.java (added)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (9 diffs)
- trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java (modified) (2 diffs)
- trunk/calendar3/common/build.xml (modified) (2 diffs)
- trunk/calendar3/common/src/edu/rpi/cct/misc (added)
- trunk/calendar3/common/src/edu/rpi/cct/misc/indexing (added)
- trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/Index.java (added)
- trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexDummyImpl.java (added)
- trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexException.java (added)
- trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexLuceneImpl.java (added)
- trunk/calendar3/common/src/edu/rpi/cct/uwcal/common (deleted)
- trunk/calendar3/lib/lucene-core-1.9.1.jar (added)
- trunk/calendar3/webclient/src/org/bedework/webclient/BwFreeBusyAction.java (modified) (1 diff)
- trunk/calendar3/webclient/war/docs/freeBusy.jsp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/bldfiles/defjars.properties
r312 r369 61 61 ical4j.jar.name=ical4j-0.9.19-pre.jar 62 62 ical4j.jar=${org.bedework.default.lib}/${ical4j.jar.name} 63 64 # lucene.jar Used for indexing and searching 65 lucene.jar.name=lucene-core-1.9.1.jar 66 lucene.jar=${org.bedework.default.lib}/${lucene.jar.name} 63 67 64 68 # regexp.jar Handles regular expressions trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Calendars.java
r360 r369 222 222 223 223 public BwCalendar getCalendars() throws CalFacadeException { 224 return getCalendars(getUser()); 225 } 226 227 public BwCalendar getCalendars(BwUser user) throws CalFacadeException { 224 228 HibSession sess = getSess(); 225 229 226 230 sess.namedQuery("getCalendarByPath"); 227 sess.setString("path", userCalendarRootPath + "/" + getUser().getAccount());231 sess.setString("path", userCalendarRootPath + "/" + user.getAccount()); 228 232 sess.cacheableQuery(); 229 233 trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java
r360 r369 817 817 } 818 818 819 public BwCalendar getCalendars(BwUser user) throws CalFacadeException { 820 checkOpen(); 821 822 return calendars.getCalendars(user); 823 } 824 819 825 public Collection getCalendarCollections() throws CalFacadeException { 820 826 checkOpen(); trunk/calendar3/calFacade/src/org/bedework/calfacade/BwFreeBusy.java
r366 r369 72 72 private BwDateTime end; 73 73 74 /** Collection of FreeBusyComponentVO74 /** Collection of BwFreeBusyComponent 75 75 */ 76 76 private Collection times; trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java
r360 r369 426 426 } 427 427 428 public BwCalendar getCalendars(BwUser user) throws CalFacadeException { 429 throw new CalFacadeUnimplementedException(); 430 } 431 428 432 public Collection getCalendarCollections() throws CalFacadeException { 429 433 checkOpen(); trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/CalendarsI.java
r360 r369 1 /* 2 Copyright (c) 2000-2005 University of Washington. All rights reserved. 3 4 Redistribution and use of this distribution in source and binary forms, 5 with or without modification, are permitted provided that: 6 7 The above copyright notice and this permission notice appear in 8 all copies and supporting documentation; 9 10 The name, identifiers, and trademarks of the University of Washington 11 are not used in advertising or publicity without the express prior 12 written permission of the University of Washington; 13 14 Recipients acknowledge that this distribution is made available as a 15 research courtesy, "as is", potentially with defects, without 16 any obligation on the part of the University of Washington to 17 provide support, services, or repair; 18 19 THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR 20 IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION 21 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 22 PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF 23 WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 24 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 25 PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING 26 NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH 27 THE USE OR PERFORMANCE OF THIS SOFTWARE. 28 */ 29 /* ********************************************************************** 30 Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved. 31 32 Redistribution and use of this distribution in source and binary forms, 33 with or without modification, are permitted provided that: 34 The above copyright notice and this permission notice appear in all 35 copies and supporting documentation; 36 37 The name, identifiers, and trademarks of Rensselaer Polytechnic 38 Institute are not used in advertising or publicity without the 39 express prior written permission of Rensselaer Polytechnic Institute; 40 41 DISCLAIMER: The software is distributed" AS IS" without any express or 42 implied warranty, including but not limited to, any implied warranties 43 of merchantability or fitness for a particular purpose or any warrant)' 44 of non-infringement of any current or pending patent rights. The authors 45 of the software make no representations about the suitability of this 46 software for any particular purpose. The entire risk as to the quality 47 and performance of the software is with the user. Should the software 48 prove defective, the user assumes the cost of all necessary servicing, 49 repair or correction. In particular, neither Rensselaer Polytechnic 50 Institute, nor the authors of the software are liable for any indirect, 51 special, consequential, or incidental damages related to the software, 52 to the maximum extent the law permits. 53 */ 1 54 package org.bedework.calfacade.ifs; 2 55 … … 41 94 /** Returns calendars owned by the current user. 42 95 * 43 * <p>For anonymous (public events) access, this method returns the same 44 * as getPublicCalendars(). 96 * <p>For authenticated, personal access this always returns the user 97 * entry in the /user calendar tree, e.g. for user smithj it would return 98 * an entry /user/smithj 99 * 100 * @return BwCalendar root with all children attached 101 * @throws CalFacadeException 102 */ 103 public BwCalendar getCalendars() throws CalFacadeException; 104 105 /** Returns calendars owned by the given user. 45 106 * 46 107 * <p>For authenticated, personal access this always returns the user … … 51 112 * @throws CalFacadeException 52 113 */ 53 public BwCalendar getCalendars( ) throws CalFacadeException;114 public BwCalendar getCalendars(BwUser user) throws CalFacadeException; 54 115 55 116 /** Return a list of user calendars in which calendar objects can be trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/calquery/FreeBusyQuery.java
r366 r369 147 147 try { 148 148 BwFreeBusy fb = svci.getFreeBusy(null, new BwUser(user), 149 tr.getStart(), tr.getEnd(), null); 149 tr.getStart(), tr.getEnd(), null, 150 false); 150 151 151 152 if (debug) { trunk/calendar3/calsvc/build.xml
r2 r369 31 31 <pathelement location="${ical4j.jar}"/> 32 32 <pathelement location="${log4j.jar}"/> 33 <pathelement location="${lucene.jar}"/> 33 34 <pathelement location="${org.bedework.calsvci.jar}"/> 34 35 <pathelement location="${org.bedework.calcore.jar}"/> trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r366 r369 100 100 //import org.bedework.mail.MailerIntf; 101 101 102 import edu.rpi.cct.misc.indexing.Index; 102 103 import edu.rpi.cct.uwcal.access.PrivilegeDefs; 103 104 import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; … … 128 129 private CalSvcIPars pars; 129 130 131 private Index indexer; 132 130 133 private boolean debug; 131 134 … … 1015 1018 public BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, 1016 1019 BwDateTime start, BwDateTime end, 1017 BwDuration granularity) 1020 BwDuration granularity, 1021 boolean returnAll) 1018 1022 throws CalFacadeException { 1019 1023 if (!(who instanceof BwUser)) { … … 1021 1025 } 1022 1026 1023 if (isGuest() || (!currentUser().equals(who))) {1024 // No access for the moment1025 throw new CalFacadeAccessException();1026 }1027 1028 1027 BwUser u = (BwUser)who; 1029 1028 Collection subs; 1030 1029 1031 1030 if (cal != null) { 1031 getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); 1032 1032 1033 BwSubscription sub = BwSubscription.makeSubscription(cal); 1033 1034 … … 1037 1038 subs = getSubscriptions(); 1038 1039 } else { 1040 getCal().checkAccess(getCal().getCalendars(u), 1041 PrivilegeDefs.privReadFreeBusy, false); 1042 1039 1043 subs = dbi.fetchPreferences(u).getSubscriptions(); 1040 1044 } … … 1080 1084 gpp.tzcache = getTimezones(); 1081 1085 1082 /* For the moment just build a single BwFreeBusyComponent 1083 */ 1084 BwFreeBusyComponent fbc = new BwFreeBusyComponent(); 1086 BwFreeBusyComponent fbc = null; 1087 1088 if (!returnAll) { 1089 // One component 1090 fbc = new BwFreeBusyComponent(); 1091 fb.addTime(fbc); 1092 } 1085 1093 1086 1094 int limit = 10000; // XXX do this better 1087 1095 while (gpp.startDt.before(end)) { 1088 if (debug) {1089 trace("gpp.startDt=" + gpp.startDt + " end=" + end);1090 }1096 //if (debug) { 1097 // trace("gpp.startDt=" + gpp.startDt + " end=" + end); 1098 //} 1091 1099 if (limit < 0) { 1092 1100 throw new CalFacadeException("org.bedework.svci.limit.exceeded"); … … 1096 1104 Collection periodEvents = CalFacadeUtil.getPeriodsEvents(gpp); 1097 1105 1098 if (periodEvents.size() != 0) { 1106 if (returnAll) { 1107 fbc = new BwFreeBusyComponent(); 1108 fb.addTime(fbc); 1109 fbc.addPeriod(new Period(new DateTime(gpp.startDt.getDtval()), 1110 new DateTime(gpp.endDt.getDtval()))); 1111 if (periodEvents.size() == 0) { 1112 fbc.setType(BwFreeBusyComponent.typeFree); 1113 } 1114 } else if (periodEvents.size() != 0) { 1099 1115 // Some events fall in the period. Add an entry. 1100 1116 … … 1103 1119 } 1104 1120 } 1105 fb.addTime(fbc);1106 1121 1107 1122 return fb; … … 2374 2389 } 2375 2390 2391 /* ==================================================================== 2392 * Private indexing methods 2393 * ==================================================================== */ 2394 2395 private Index getIndexer() throws CalFacadeException { 2396 try { 2397 if (indexer == null) { 2398 indexer = new BwIndexLuceneImpl(this, 2399 // XXX Schema change - in syspars 2400 "/temp/bedeworkindex", 2401 isPublicAdmin(), 2402 debug); 2403 } 2404 2405 return indexer; 2406 } catch (Throwable t) { 2407 throw new CalFacadeException(t); 2408 } 2409 } 2410 2411 /* Call to (re)index an event 2412 */ 2413 private void indexEvent(BwEvent ev) throws CalFacadeException { 2414 try { 2415 getIndexer().indexRec(ev); 2416 } catch (Throwable t) { 2417 throw new CalFacadeException(t); 2418 } 2419 } 2420 2421 private void unindexEvent(BwEvent ev) throws CalFacadeException { 2422 try { 2423 getIndexer().unindexRec(ev); 2424 } catch (Throwable t) { 2425 throw new CalFacadeException(t); 2426 } 2427 } 2428 2429 /* Call to (re)index a calendar 2430 */ 2431 private void indexCalendar(BwCalendar cal) throws CalFacadeException { 2432 try { 2433 getIndexer().indexRec(cal); 2434 } catch (Throwable t) { 2435 throw new CalFacadeException(t); 2436 } 2437 } 2438 2439 private void unindexCalendar(BwCalendar cal) throws CalFacadeException { 2440 try { 2441 getIndexer().unindexRec(cal); 2442 2443 // And all the children 2444 Iterator it = cal.iterateChildren(); 2445 while (it.hasNext()) { 2446 BwCalendar ch = (BwCalendar)it.next(); 2447 2448 unindexCalendar(ch); 2449 } 2450 } catch (Throwable t) { 2451 throw new CalFacadeException(t); 2452 } 2453 } 2454 2376 2455 /* Get a logger for messages 2377 2456 */ trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java
r366 r369 810 810 * null for one big glob. or set to e.g. 1 hour for 811 811 * hourly chunks. 812 * @param returnAll if true return entries for free time otherwise just for busy 813 * (only for granularity not null) 812 814 * @return BwFreeBusy 813 815 * @throws CalFacadeException … … 815 817 public abstract BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, 816 818 BwDateTime start, BwDateTime end, 817 BwDuration granularity) 819 BwDuration granularity, 820 boolean returnAll) 818 821 throws CalFacadeException; 819 822 trunk/calendar3/common/build.xml
r310 r369 17 17 18 18 <fileset id="base.java.sources" dir="${source.home}" > 19 <include name="edu/rpi/sss/util/**/*.java"/> 20 <include name="edu/rpi/cct/uwcal/**/*.java"/> 19 <include name="edu/rpi/**/*.java"/> 21 20 </fileset> 22 21 23 22 <patternset id="base.class.patternset"> 24 <include name="edu/rpi/sss/util/**/*.class"/> 25 <include name="edu/rpi/cct/uwcal/**/*.class"/> 23 <include name="edu/rpi/**/*.class"/> 26 24 </patternset> 27 25 … … 34 32 <pathelement location="${avalon.jar}"/> 35 33 <pathelement location="${log4j.jar}"/> 36 <pathelement location="${logkit.jar}"/> 34 <pathelement location="${log4j.jar}"/> 35 <pathelement location="${lucene.jar}"/> 37 36 <pathelement location="${jtidy.jar}"/> 38 37 </path> trunk/calendar3/webclient/src/org/bedework/webclient/BwFreeBusyAction.java
r366 r369 158 158 CalFacadeUtil.getDateTime(sdt, false, false, tzs), 159 159 CalFacadeUtil.getDateTime(edt, false, false, tzs), 160 dur );160 dur, true); 161 161 162 162 form.assignFreeBusy(fb); trunk/calendar3/webclient/war/docs/freeBusy.jsp
r313 r369 2 2 <%@ taglib uri='struts-logic' prefix='logic' %> 3 3 <%@ taglib uri='struts-genurl' prefix='genurl' %> 4 <%@ taglib uri='bedework' prefix='bw' %> 4 5 5 6 <%@ include file="/docs/header.jsp" %> … … 17 18 18 19 <freebusy> 19 < who><bean:write name="freeBusyObj" property="who.account" /></who>20 < start><bean:write name="freeBusyObj" property="start" /></start>21 < end><bean:write name="freeBusyObj" property="end" /></end>20 <bw:emitText name="freeBusyObj" property="who.account" tagName="who" /> 21 <bw:emitText name="freeBusyObj" property="start.dtval" tagName="start" /> 22 <bw:emitText name="freeBusyObj" property="end.dtval" tagName="end" /> 22 23 <logic:iterate id="freeBusyComponent" name="freeBusyObj" property="times" > 23 24 <freeBusyComponent>
