Changeset 415
- Timestamp:
- 04/22/06 23:27:54
- Files:
-
- trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Ace.java (modified) (1 diff)
- trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/PrivilegeDefs.java (modified) (1 diff)
- trunk/calendar3/appcommon/src/org/bedework/appcommon/AccessAppUtil.java (modified) (16 diffs)
- trunk/calendar3/appcommon/src/org/bedework/appcommon/CalendarInfo.java (modified) (2 diffs)
- trunk/calendar3/appcommon/src/org/bedework/appcommon/EventFormatter.java (modified) (2 diffs)
- trunk/calendar3/appcommon/src/org/bedework/appcommon/FormattedEvents.java (modified) (1 diff)
- trunk/calendar3/appcommon/src/org/bedework/appcommon/FormattedFreeBusy.java (modified) (3 diffs)
- trunk/calendar3/appcommon/src/org/bedework/appcommon/TimeZonesParser.java (modified) (1 diff)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Calendars.java (modified) (2 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfHelper.java (modified) (3 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java (modified) (4 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/DbStatistics.java (modified) (2 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/EventProperties.java (modified) (2 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Events.java (modified) (4 diffs)
- trunk/calendar3/calCore/src/org/bedework/calcore/ldap/LdapConfigProperties.java (modified) (1 diff)
- trunk/calendar3/calEnv/src/org/bedework/calenv/CalOptions.java (modified) (2 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwCalendar.java (modified) (5 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwDateTime.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwDuration.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/BwStats.java (modified) (10 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeUtil.java (modified) (4 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/CoreEventInfo.java (modified) (3 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/CalTimezones.java (modified) (32 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/Calintf.java (modified) (2 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/EventsI.java (modified) (1 diff)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/BwPreferences.java (modified) (3 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/EventInfo.java (modified) (2 diffs)
- trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/UserAuth.java (modified) (2 diffs)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/EmitAccess.java (modified) (1 diff)
- trunk/calendar3/caldavClientApi/build.xml (modified) (1 diff)
- trunk/calendar3/caldavClientApi/src/org/bedework/caldav/client/CalintfCaldavImpl.java (modified) (7 diffs)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/BwIndexKey.java (modified) (13 diffs)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/BwIndexLuceneImpl.java (modified) (3 diffs)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (3 diffs)
- trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java (modified) (1 diff)
- trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcIPars.java (modified) (2 diffs)
- trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/Index.java (modified) (11 diffs)
- trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexDummyImpl.java (modified) (1 diff)
- trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexException.java (modified) (2 diffs)
- trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexLuceneImpl.java (modified) (21 diffs)
- trunk/calendar3/common/src/edu/rpi/sss/util/jsp/UtilAbstractAction.java (modified) (15 diffs)
- trunk/calendar3/common/src/edu/rpi/sss/util/servlets/ConfiguredXSLTFilter.java (modified) (1 diff)
- trunk/calendar3/common/src/edu/rpi/sss/util/servlets/io/WrappedResponse.java (modified) (1 diff)
- trunk/calendar3/common/src/edu/rpi/sss/util/xml/XmlEmit.java (modified) (4 diffs)
- trunk/calendar3/common/src/edu/rpi/sss/util/xml/XmlUtil.java (modified) (1 diff)
- trunk/calendar3/config/configs/democal.properties (modified) (1 diff)
- trunk/calendar3/config/src/edu/rpi/cct/uwcal/config/optionsApp/AbstractOptionsPanel.java (modified) (5 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/Defs.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpersonal.java (modified) (1 diff)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpublic.java (modified) (1 diff)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/ConfigCollection.java (modified) (10 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Webadmin.java (modified) (1 diff)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Webconfig.java (modified) (1 diff)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpersonal.java (modified) (1 diff)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpublic.java (modified) (1 diff)
- trunk/calendar3/config/src/org/bedework/webconfig/props/CommentProperty.java (modified) (2 diffs)
- trunk/calendar3/deployment/src/org/bedework/deployment/ApplicationXmlTask.java (modified) (5 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/Dumpling.java (modified) (1 diff)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/Restore.java (modified) (3 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/RestoreGlobals.java (modified) (4 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/EntityFieldRule.java (modified) (3 diffs)
- trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/FilterRule.java (modified) (1 diff)
- trunk/calendar3/icalendar/src/org/bedework/icalendar/BwEventUtil.java (modified) (4 diffs)
- trunk/calendar3/icalendar/src/org/bedework/icalendar/VEventUtil.java (modified) (1 diff)
- trunk/calendar3/test/src/org/bedework/httpunit/utils/TestUtils.java (modified) (1 diff)
- trunk/calendar3/test/src/org/bedework/tests/calsvc/CalSvcTest.java (modified) (3 diffs)
- trunk/calendar3/timers/src/org/bedework/timers/AlarmTask.java (modified) (1 diff)
- trunk/calendar3/timers/src/org/bedework/timers/Timers.java (modified) (1 diff)
- trunk/calendar3/timers/src/org/bedework/timers/service/DbPollerTimerService.java (modified) (2 diffs)
- trunk/calendar3/webadmin/src/org/bedework/webadmin/event/PEUpdateEventAction.java (modified) (4 diffs)
- trunk/calendar3/webclient/src/org/bedework/webclient/BwMailEventAction.java (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java (modified) (4 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/TimeDateComponents.java (modified) (2 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/calendars/UpdateCalendarAction.java (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/BaseTag.java (modified) (3 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/EmitCurrentPrivsTag.java (modified) (4 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/EmitTextTag.java (modified) (4 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/NameScopePropertyTag.java (modified) (3 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/NameScopeTag.java (modified) (3 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/NameTag.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Ace.java
r376 r415 399 399 * 400 400 * @param acl 401 * @param privs401 * @param getPrivileges 402 402 * @param name 403 403 * @param whoType trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/PrivilegeDefs.java
r376 r415 76 76 public static final char unspecified = '1'; 77 77 78 /** Shows an ace was inherited 79 */ 78 80 public static final char inheritedFlag = 'I'; 79 81 trunk/calendar3/appcommon/src/org/bedework/appcommon/AccessAppUtil.java
r331 r415 77 77 */ 78 78 public class AccessAppUtil implements Serializable { 79 /** xml rpivilege tags */ 79 80 public static final QName[] privTags = { 80 81 WebdavTags.all, // privAll = 0; … … 95 96 private XmlEmit xml; 96 97 97 /** Acls use tags in the webdav and caldav namespace. 98 /** Acls use tags in the webdav and caldav namespace. 98 99 * 99 100 * @param xml … … 102 103 this.xml = xml; 103 104 } 104 105 106 /** Represent the acl as an xml string 107 * 108 * @param acl 109 * @return String xml representation 110 * @throws CalFacadeException 111 */ 105 112 public static String getXmlAclString(Acl acl) throws CalFacadeException { 106 113 try { … … 109 116 xml.startEmit(su); 110 117 AccessAppUtil au = new AccessAppUtil(xml); 111 118 112 119 au.emitAcl(acl); 113 120 114 121 su.close(); 115 122 116 123 return su.toString(); 117 124 } catch (CalFacadeException cfe) { … … 148 155 } 149 156 157 /** Emit an acl as an xml string the current xml writer 158 * 159 * @param acl 160 * @throws CalFacadeException 161 */ 150 162 public void emitAcl(Acl acl) throws CalFacadeException { 151 163 try { … … 159 171 } 160 172 173 /** Emit the Collection of aces as an xml sing the current xml writer 174 * 175 * @param aces 176 * @throws CalFacadeException 177 */ 161 178 public void emitAces(Collection aces) throws CalFacadeException { 162 179 try { … … 188 205 189 206 /** Produce an xml representation of supported privileges. This is the same 190 * at all points in the system and is identical to the webdav/caldav 207 * at all points in the system and is identical to the webdav/caldav 191 208 * requirements. 192 * 209 * 193 210 * @throws CalFacadeException 194 211 */ … … 196 213 try { 197 214 xml.openTag(WebdavTags.supportedPrivilegeSet); 198 215 199 216 emitSupportedPriv(Privileges.getPrivAll()); 200 217 201 218 xml.closeTag(WebdavTags.supportedPrivilegeSet); 202 219 } catch (Throwable t) { … … 204 221 } 205 222 } 206 223 207 224 /** Produce an xml representation of current user privileges from an array 208 225 * of allowed/disallowed/unspecified flags indexed by a privilege index. 209 * 210 * @param priv s char[] of allowed/disallowed226 * 227 * @param privileges char[] of allowed/disallowed 211 228 * @throws CalFacadeException 212 229 */ … … 214 231 try { 215 232 xml.openTag(WebdavTags.currentUserPrivilegeSet); 216 233 217 234 for (int pi = 0; pi < privileges.length; pi++) { 218 235 if (privileges[pi] == PrivilegeDefs.allowed) { 219 236 // XXX further work - don't emit abstract privs or contained privs. 220 237 QName pr = privTags[pi]; 221 238 222 239 if (pr != null) { 223 240 xml.propertyTagVal(WebdavTags.privilege, pr); … … 225 242 } 226 243 } 227 244 228 245 xml.closeTag(WebdavTags.currentUserPrivilegeSet); 229 246 } catch (Throwable t) { … … 231 248 } 232 249 } 233 250 234 251 /** Produce an xml representation of current user privileges from an array 235 252 * of allowed/disallowed/unspecified flags indexed by a privilege index, 236 253 * returning the representation a a String 237 * 238 * @param priv s char[] of allowed/disallowed239 * @return String xml 240 * @throws CalFacadeException 241 */ 242 public static String getCurrentPrivSetString(char[] privileges) 254 * 255 * @param privileges char[] of allowed/disallowed 256 * @return String xml 257 * @throws CalFacadeException 258 */ 259 public static String getCurrentPrivSetString(char[] privileges) 243 260 throws CalFacadeException { 244 261 try { … … 247 264 xml.startEmit(su); 248 265 AccessAppUtil au = new AccessAppUtil(xml); 249 266 250 267 au.emitCurrentPrivSet(privileges); 251 268 252 269 su.close(); 253 270 254 271 return su.toString(); 255 272 } catch (CalFacadeException cfe) { … … 266 283 private void emitSupportedPriv(Privilege priv) throws Throwable { 267 284 xml.openTag(WebdavTags.supportedPrivilege); 268 285 269 286 xml.openTagNoNewline(WebdavTags.privilege); 270 287 xml.emptyTagSameLine(privTags[priv.getIndex()]); 271 288 xml.closeTagNoblanks(WebdavTags.privilege); 272 289 273 290 if (priv.getAbstractPriv()) { 274 291 xml.emptyTag(WebdavTags._abstract); 275 292 } 276 293 277 294 xml.property(WebdavTags.description, priv.getDescription()); 278 295 … … 281 298 emitSupportedPriv((Privilege)it.next()); 282 299 } 283 300 284 301 xml.closeTag(WebdavTags.supportedPrivilege); 285 302 } 286 303 287 304 private boolean emitAce(Ace ace, boolean denials, boolean aceOpen) throws Throwable { 288 305 Collection privs = ace.getPrivs(); … … 315 332 } 316 333 } 317 334 318 335 if (tagOpen) { 319 336 xml.closeTag(tag); 320 337 } 321 338 322 339 return aceOpen; 323 340 } trunk/calendar3/appcommon/src/org/bedework/appcommon/CalendarInfo.java
r278 r415 368 368 * ==================================================================== */ 369 369 370 /* *Get a String representation of a particular time field of the object.370 /* Get a String representation of a particular time field of the object. 371 371 * 372 372 * @param field The field to be returned, … … 388 388 } 389 389 390 /* *Return the size of the range for a given unit of time390 /* Return the size of the range for a given unit of time 391 391 * 392 392 * @param unit value defined in java.util.Calendar trunk/calendar3/appcommon/src/org/bedework/appcommon/EventFormatter.java
r372 r415 101 101 /** Constructor 102 102 * 103 * @param svci 103 104 * @param eventInfo 104 105 * @param calInfo … … 207 208 } 208 209 210 /** Emit current event access as an xml String 211 * 212 * @return String 213 */ 209 214 public String getXmlAccess() { 210 215 try { trunk/calendar3/appcommon/src/org/bedework/appcommon/FormattedEvents.java
r314 r415 76 76 /** Constructor 77 77 * 78 * @param svci 78 79 * @param events 79 80 * @param calInfo trunk/calendar3/appcommon/src/org/bedework/appcommon/FormattedFreeBusy.java
r375 r415 90 90 private Collection times; 91 91 92 /** Class to represent a free busy period 93 * 94 * @author Mike Douglass 95 */ 92 96 public static class FbPeriod { 93 97 int minutesStart; … … 95 99 int type; // From BwFreeBusyComponent 96 100 101 /** Constructor 102 * 103 * @param minutesStart 104 * @param minutesLength 105 * @param type 106 */ 97 107 public FbPeriod(int minutesStart, int minutesLength, int type) { 98 108 this.minutesStart = minutesStart; … … 134 144 } 135 145 146 /** Constructor 147 * 148 * <p>Generates a formatted free busy object suitable for gui interfaces. 149 * @param fb 150 * @throws CalFacadeException 151 */ 136 152 public FormattedFreeBusy(BwFreeBusy fb) throws CalFacadeException { 137 153 setWho(fb.getWho()); trunk/calendar3/appcommon/src/org/bedework/appcommon/TimeZonesParser.java
r297 r415 291 291 292 292 /** Get a logger for messages 293 * 294 * @return Logger 293 295 */ 294 296 protected Logger getLogger() { trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Calendars.java
r406 r415 78 78 * @param cal 79 79 * @param access 80 * @param user80 * @param currentMode 81 81 * @param debug 82 82 * @throws CalFacadeException … … 346 346 } 347 347 348 /** Create the special deleted calendar which holds deletion annotations to 349 * entities for which the user has no write access. 350 * 351 * @param user 352 * @throws CalFacadeException 353 */ 348 354 public void createDeletedCalendar(BwUser user) throws CalFacadeException { 349 355 StringBuffer sb = new StringBuffer(); trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfHelper.java
r301 r415 85 85 * @param cal 86 86 * @param access 87 * @param user87 * @param currentMode 88 88 * @param debug 89 89 */ 90 90 public CalintfHelper(Calintf cal, AccessUtil access, 91 int currentMode, 91 int currentMode, 92 92 boolean debug) { 93 93 this.cal = cal; … … 104 104 return cal.getSyspars(); 105 105 } 106 106 107 107 protected BwUser getUser() throws CalFacadeException { 108 108 return cal.getUser(); … … 110 110 111 111 /** Get a logger for messages 112 * 113 * @return Logger 112 114 */ 113 115 protected Logger getLogger() { trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/CalintfImpl.java
r406 r415 82 82 import org.bedework.calfacade.ifs.Calintf; 83 83 import org.bedework.calfacade.ifs.CalintfInfo; 84 import org.bedework.calfacade.ifs.EventsI; 84 85 import org.bedework.calfacade.ifs.Groups; 85 86 import org.bedework.icalendar.IcalTranslator; … … 164 165 private BwUser user; 165 166 166 private Events events;167 private EventsI events; 167 168 168 169 private Calendars calendars; … … 1131 1132 } 1132 1133 1134 public Collection getDeletedProxies(BwCalendar cal) throws CalFacadeException { 1135 return events.getDeletedProxies(cal); 1136 } 1137 1133 1138 /* ==================================================================== 1134 1139 * Synchronization … … 1330 1335 } 1331 1336 1332 /* *Get a logger for messages1337 /* Get a logger for messages 1333 1338 */ 1334 1339 private Logger getLogger() { trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/DbStatistics.java
r191 r415 78 78 */ 79 79 public class DbStatistics { 80 /** Dump the statistics to the log 81 * 82 * @param dbStats 83 */ 80 84 public static void dumpStats(Statistics dbStats) { 81 85 if (dbStats == null) { … … 88 92 } 89 93 94 /** Get the current statistics 95 * 96 * @param dbStats 97 * @return Collection 98 */ 90 99 public static Collection getStats(Statistics dbStats) { 91 100 /* XXX this ought to be property driven to some extent. The cache stats in trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/EventProperties.java
r301 r415 88 88 * @param cal Calintf object 89 89 * @param access 90 * @param user90 * @param currentMode 91 91 * @param keyFieldName Name of entity keyfield 92 92 * @param className Class of entity … … 95 95 * @param debug 96 96 */ 97 public EventProperties(Calintf cal, AccessUtil access, 98 int currentMode, 97 public EventProperties(Calintf cal, AccessUtil access, 98 int currentMode, 99 99 String keyFieldName, 100 100 String className, 101 101 String refQuery, 102 int minId, 102 int minId, 103 103 boolean debug) { 104 104 super(cal, access, currentMode, debug); trunk/calendar3/calCore/src/org/bedework/calcore/hibernate/Events.java
r406 r415 104 104 * @param cal 105 105 * @param access 106 * @param user106 * @param currentMode 107 107 * @param debug 108 108 */ … … 283 283 } 284 284 285 /** XXX temp I think286 * Retrieve event proxies in the trash - they will be used to remove events287 * from result sets.288 *289 * @return Collection of CoreEventInfo objects290 */291 public Collection getDeletedProxies() throws CalFacadeException {292 // Calintf supplies the calendar293 return null;294 }295 296 /** XXX temp I think297 * Retrieve event proxies in the trash - they will be used to remove events298 * from result sets.299 *300 * @param cal Deleted calendar object301 * @return Collection of CoreEventInfo objects302 */303 285 public Collection getDeletedProxies(BwCalendar cal) throws CalFacadeException { 304 286 HibSession sess = getSess(); … … 706 688 707 689 return ceis; 708 }709 710 public boolean editable(BwEvent val) throws CalFacadeException {711 if (currentMode == CalintfUtil.guestMode) {712 return false;713 }714 715 if (val.getPublick() != (currentMode == CalintfUtil.publicAdminMode)) {716 return false;717 }718 719 return getUser().equals(val.getCreator());720 690 } 721 691 … … 1112 1082 * @param override May be null if we retrieved the instance 1113 1083 * @param checked 1084 * @param recurRetrieval 1085 * @param freeBusy 1114 1086 * @return CoreEventInfo 1115 1087 * @throws CalFacadeException trunk/calendar3/calCore/src/org/bedework/calcore/ldap/LdapConfigProperties.java
r394 r415 99 99 private boolean debug; 100 100 101 /** 102 * @param val 103 */ 101 104 public void setInitialContextFactory(String val) { 102 105 initialContextFactory = val; 103 106 } 104 107 108 /** 109 * @return String 110 */ 105 111 public String getInitialContextFactory() { 106 112 return initialContextFactory; 107 113 } 108 114 115 /** 116 * @param val 117 */ 109 118 public void setSecurityAuthentication(String val) { 110 119 securityAuthentication = val; 111 120 } 112 121 122 /** 123 * @return String 124 */ 113 125 public String getSecurityAuthentication() { 114 126 return securityAuthentication; trunk/calendar3/calEnv/src/org/bedework/calenv/CalOptions.java
r394 r415 777 777 public ArrayList children; 778 778 779 /** 780 * @return Collection 781 */ 779 782 public Collection getChildren() { 780 783 if (children == null) { … … 784 787 } 785 788 789 /** Add a child 790 * 791 * @param val OptionElement 792 */ 786 793 public void addChild(OptionElement val) { 787 794 getChildren().add(val); trunk/calendar3/calFacade/src/org/bedework/calfacade/BwCalendar.java
r336 r415 102 102 /** The children of this calendar */ 103 103 private Collection children; 104 105 /* This field must only be used for cloned copies of an entity as it is 104 105 /* This field must only be used for cloned copies of an entity as it is 106 106 * specific to a current thread. 107 107 */ … … 274 274 * ==================================================================== */ 275 275 276 /** Only call fro cloned object 277 * 278 * @param val CurrentAccess 279 */ 276 280 public void setCurrentAccess(CurrentAccess val) { 277 281 currentAccess = val; 278 282 } 279 283 284 /** 285 * @return CurrentAccess 286 */ 280 287 public CurrentAccess getCurrentAccess() { 281 288 return currentAccess; … … 402 409 403 410 public int hashCode() { 404 if (getPath() == null) {405 return 1;406 }411 if (getPath() == null) { 412 return 1; 413 } 407 414 return getPath().hashCode(); 408 415 } … … 428 435 Iterator it = iterateChildren(); 429 436 boolean donech = false; 430 437 431 438 while (it.hasNext()) { 432 439 BwCalendar ch = (BwCalendar)it.next(); 433 440 434 441 if (!donech) { 435 442 donech = true; … … 437 444 sb.append(", "); 438 445 } 439 446 440 447 sb.append(ch.getPath()); 441 448 } 442 449 sb.append(")"); 443 450 444 451 if (getCurrentAccess() != null) { 445 452 sb.append(", currentAccess="); trunk/calendar3/calFacade/src/org/bedework/calfacade/BwDateTime.java
r375 r415 206 206 } 207 207 208 /** Create a copy of this object 209 * 210 * @param timezones 211 * @return BwDateTime 212 * @throws CalFacadeException 213 */ 208 214 public BwDateTime copy(CalTimezones timezones) throws CalFacadeException { 209 215 return makeDateTime(makeDtEnd(), timezones); trunk/calendar3/calFacade/src/org/bedework/calfacade/BwDuration.java
r187 r415 244 244 return new Duration(d); 245 245 } 246 246 247 /** Return true if this represents a zero duration 248 * 249 * @return boolean 250 */ 247 251 public boolean isZero() { 248 252 if (getWeeks() != 0) { 249 253 return false; 250 254 } 251 252 return ((getDays() == 0) && 255 256 return ((getDays() == 0) && 253 257 (getHours() == 0) && 254 258 (getMinutes() == 0) && trunk/calendar3/calFacade/src/org/bedework/calfacade/BwStats.java
r191 r415 56 56 57 57 import java.io.Serializable; 58 import java.util.ArrayList; 58 59 import java.util.Collection; 59 60 import java.util.Iterator; 60 import java.util.Vector;61 61 62 62 /** Some statistics for the Bedework calendar. These are not necessarily … … 71 71 */ 72 72 public static class StatsEntry { 73 // ENUM 74 /** */ 73 75 public final static int statKindHeader = 0; 76 /** */ 74 77 public final static int statKindStat = 1; 75 78 … … 78 81 private String statLabel; 79 82 83 // ENUM 84 /** */ 80 85 public final static int statTypeString = 0; 86 /** */ 81 87 public final static int statTypeInt = 1; 88 /** */ 82 89 public final static int statTypeLong = 2; 90 /** */ 83 91 public final static int statTypeDouble = 3; 84 92 private int statType; … … 86 94 private String statVal; 87 95 96 /** Constructor for an int val 97 * 98 * @param label 99 * @param val 100 */ 88 101 public StatsEntry(String label, int val) { 89 102 statKind = statKindStat; … … 93 106 } 94 107 108 /** Constructor for a long val 109 * 110 * @param label 111 * @param val 112 */ 95 113 public StatsEntry(String label, long val) { 96 114 statKind = statKindStat; … … 100 118 } 101 119 120 /** Constructor for a double val 121 * 122 * @param label 123 * @param val 124 */ 102 125 public StatsEntry(String label, double val) { 103 126 statKind = statKindStat; … … 107 130 } 108 131 132 /** Constructor for a String val 133 * 134 * @param label 135 * @param val 136 */ 109 137 public StatsEntry(String label, String val) { 110 138 statKind = statKindStat; … … 114 142 } 115 143 144 /** Constructor for a header 145 * 146 * @param header 147 */ 116 148 public StatsEntry(String header) { 117 149 statKind = statKindHeader; … … 119 151 } 120 152 153 /** 154 * @return int kind of stat 155 */ 121 156 public int getStatKind() { 122 157 return statKind; 123 158 } 124 159 160 /** 161 * @return String label 162 */ 125 163 public String getStatLabel() { 126 164 return statLabel; 127 165 } 128 166 167 /** 168 * @return int type 169 */ 129 170 public int getStatType() { 130 171 return statType; 131 172 } 132 173 174 /** 175 * @return String value 176 */ 133 177 public String getStatVal() { 134 178 return statVal; … … 207 251 } 208 252 253 /** 254 * @return Collection of StatsEntry 255 */ 209 256 public Collection getStats() { 210 Vector v = new Vector();211 212 v.add(new StatsEntry("Bedework statistics."));213 v.add(new StatsEntry("tzFetches", getTzFetches()));214 v.add(new StatsEntry("systemTzFetches", getSystemTzFetches()));215 v.add(new StatsEntry("tzStores", getTzStores()));216 217 v.add(new StatsEntry("event fetch time", getEventFetchTime()));218 v.add(new StatsEntry("event fetches", getEventFetches()));219 220 v.add(new StatsEntry("UTC dates cached", getDatesCached()));221 v.add(new StatsEntry("UTC date cache hits", getDateCacheHits()));222 v.add(new StatsEntry("UTC date cache misses", getDateCacheMisses()));223 224 return v;257 ArrayList al = new ArrayList(); 258 259 al.add(new StatsEntry("Bedework statistics.")); 260 al.add(new StatsEntry("tzFetches", getTzFetches())); 261 al.add(new StatsEntry("systemTzFetches", getSystemTzFetches())); 262 al.add(new StatsEntry("tzStores", getTzStores())); 263 264 al.add(new StatsEntry("event fetch time", getEventFetchTime())); 265 al.add(new StatsEntry("event fetches", getEventFetches())); 266 267 al.add(new StatsEntry("UTC dates cached", getDatesCached())); 268 al.add(new StatsEntry("UTC date cache hits", getDateCacheHits())); 269 al.add(new StatsEntry("UTC date cache misses", getDateCacheMisses())); 270 271 return al; 225 272 } 226 273 227 274 /** Turn the Collection of StatsEntry into a String for dumps. 275 * 276 * @param c Collection of StatsEntry 277 * @return String formatted result. 228 278 */ 229 279 public static String toString(Collection c) { trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeUtil.java
r375 r415 618 618 /** Event Info objects to extract from */ 619 619 public Collection events; 620 /* Start of period - updated at each call from endDt */620 /** Start of period - updated at each call from endDt */ 621 621 public BwDateTime startDt; 622 622 /** Duration of period */ … … 634 634 * @param pars GetPeriodsPars object 635 635 * @return Collection of EventInfo being one days events or empty for no events. 636 * @throws Throwable636 * @throws CalFacadeException 637 637 */ 638 638 public static Collection getPeriodsEvents(GetPeriodsPars pars) throws CalFacadeException { … … 691 691 } 692 692 693 /** Turn the int minutes into a 4 digit String hours and minutes value694 * 695 * @param int minutes696 * @return String time693 /** Turn the int minutes into a 4 digit String hours and minutes value 694 * 695 * @param minutes int 696 * @return String 4 digit hours + minutes 697 697 */ 698 698 public static String getTimeFromMinutes(int minutes) { … … 702 702 /** Return String value of par padded to 2 digits. 703 703 * @param val 704 * @return 704 * @return String 705 705 */ 706 706 public static String pad2(int val) { trunk/calendar3/calFacade/src/org/bedework/calfacade/CoreEventInfo.java
r356 r415 82 82 /** Constructor 83 83 * 84 * @param event 85 * @param currentAccess 84 86 */ 85 87 public CoreEventInfo(BwEvent event, CurrentAccess currentAccess) { … … 102 104 } 103 105 104 /* Set the current users access rights.106 /** Set the current users access rights. 105 107 * 106 108 * @param val CurrentAccess … … 110 112 } 111 113 112 /* Get the current users access rights.114 /** Get the current users access rights. 113 115 * 114 116 * @return CurrentAccess trunk/calendar3/calFacade/src/org/bedework/calfacade/base/CalintfBase.java
r406 r415 734 734 } 735 735 736 public boolean editable(BwEvent val) throws CalFacadeException {737 checkOpen();738 739 if (currentMode == CalintfDefs.guestMode) {740 return false;741 }742 743 if (val.getPublick() != (currentMode == CalintfDefs.publicAdminMode)) {744 return false;745 }746 747 return user.equals(val.getCreator());748 }749 750 736 public Collection getDeletedProxies() throws CalFacadeException { 737 throw new CalFacadeUnimplementedException(); 738 } 739 740 public Collection getDeletedProxies(BwCalendar cal) throws CalFacadeException { 751 741 throw new CalFacadeUnimplementedException(); 752 742 } trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/CalTimezones.java
r298 r415 78 78 public abstract class CalTimezones implements Serializable { 79 79 private transient Logger log; 80 80 81 81 protected boolean debug; 82 82 … … 88 88 89 89 boolean publick; 90 90 91 91 /** 92 92 * @param tz … … 95 95 init(tz); 96 96 } 97 97 98 98 /** Constructor 99 * 99 * 100 100 * @param tz 101 101 * @param publick … … 105 105 this.publick = publick; 106 106 } 107 107 108 108 /** (Re)init the object 109 * 109 * 110 110 * @param tz 111 * @param vtz112 111 */ 113 112 public void init(TimeZone tz) { 114 113 this.tz = tz; 115 114 } 116 115 116 /** Get the timezone 117 * 118 * @return TimeZone 119 */ 117 120 public TimeZone getTz() { 118 121 return tz; 119 122 } 120 123 121 124 /** 122 125 * @return true for public timezone … … 129 132 /* Map of user TimezoneInfo */ 130 133 protected HashMap timezones = new HashMap(); 131 134 132 135 /* Cache date only UTC values - we do a lot of those but the number of 133 136 * different dates should be limited. 134 * 137 * 135 138 * We have one cache per timezone 136 139 */ … … 138 141 139 142 private HashMap defaultDateCache = new HashMap(); 140 143 141 144 private long datesCached; 142 145 private long dateCacheHits; … … 146 149 this.debug = debug; 147 150 } 148 151 149 152 /** Save a timezone definition in the database. The timezone is in the 150 153 * form of a complete calendar definition containing a single VTimeZone … … 171 174 trace("register timezone with id " + id); 172 175 } 173 176 174 177 TimezoneInfo tzinfo = (TimezoneInfo)timezones.get(id); 175 178 176 179 if (tzinfo == null) { 177 180 tzinfo = new TimezoneInfo(timezone); … … 190 193 */ 191 194 public abstract TimeZone getTimeZone(final String id) throws CalFacadeException; 192 195 193 196 /** Get the default timezone for this system. 194 197 * … … 203 206 return defaultTimeZone; 204 207 } 205 208 206 209 /** Set the default timezone id for this system. 207 210 * … … 213 216 defaultTimeZoneId = id; 214 217 } 215 218 216 219 /** Get the default timezone id for this system. 217 220 * … … 222 225 return defaultTimeZoneId; 223 226 } 224 227 225 228 /** Find a timezone object in the database given the id. 226 229 * … … 231 234 */ 232 235 public abstract VTimeZone findTimeZone(final String id, BwUser owner) throws CalFacadeException; 233 236 234 237 /** Clear all public timezone objects. Implementing classes should call this. 235 238 * … … 243 246 defaultDateCache.clear(); 244 247 } 245 248 246 249 /** Refresh the public timezone table - presumably after a call to clearPublicTimezones. 247 250 * and many calls to saveTimeZone. … … 250 253 */ 251 254 public abstract void refreshTimezones() throws CalFacadeException; 252 255 253 256 private static DateFormat formatTd = new SimpleDateFormat("yyyyMMdd'T'HHmmss"); 254 257 private static Calendar cal = Calendar.getInstance(); … … 264 267 cal.setTimeZone(utctz); 265 268 } 266 269 267 270 /** Given a String time value and a possibly null tzid and/or timezone 268 271 * will return a UTC formatted value. The supplied time should be of the … … 270 273 * 271 274 * <p>The last form will be returned untouched, it's already UTC. 272 * 275 * 273 276 * <p>the first will have T000000 appended to the parameter value then the 274 277 * first and second will be converted to the equivalent UTC time. … … 285 288 * @throws CalFacadeException for bad parameters or timezone 286 289 */ 287 public synchronized String getUtc(String time, String tzid, TimeZone tz) 290 public synchronized String getUtc(String time, String tzid, TimeZone tz) 288 291 throws CalFacadeException { 289 292 /* XXX We probably need the ownerid to determine exactly which timezone … … 299 302 String dateKey = null; 300 303 HashMap cache = null; 301 304 302 305 if ((time.length() == 8) && CalFacadeUtil.isISODate(time)) { 303 306 /* See if we have it cached */ 304 307 305 308 if (tzid == null) { 306 309 cache = defaultDateCache; … … 314 317 } 315 318 } 316 319 317 320 String utc = (String)cache.get(time); 318 321 319 322 if (utc != null) { 320 323 dateCacheHits++; … … 323 326 324 327 /* Not in the cache - calculate it */ 325 328 326 329 dateCacheMisses++; 327 330 dateKey = time; … … 330 333 throw new CalFacadeBadDateException(time); 331 334 } 332 335 333 336 try { 334 337 boolean tzchanged = false; 335 338 336 339 /* If we get a null timezone and id we are being asked for the default. 337 340 * If we get a null tz and the tzid is the default id same again. 338 * 341 * 339 342 * Otherwise we are asked for something other than the default. 340 * 341 * So lasttzid is either 343 * 344 * So lasttzid is either 342 345 * 1. null - never been called 343 346 * 2. the default tzid 344 347 * 3. Some other tzid. 345 348 */ 346 349 347 350 if (tz == null) { 348 351 if (tzid == null) { 349 352 tzid = getDefaultTimeZoneId(); 350 353 } 351 354 352 355 if ((lasttzid == null) || (!lasttzid.equals(tzid))) { 353 356 if (tzid.equals(getDefaultTimeZoneId())) { … … 356 359 lasttz = getTimeZone(tzid); 357 360 } 358 361 359 362 if (lasttz == null) { 360 363 lasttzid = null; … … 376 379 } 377 380 } 378 379 381 382 380 383 if (tzchanged) { 381 384 if (debug) { … … 385 388 lasttzid = tzid; 386 389 } 387 390 388 391 cal.setTime(formatTd.parse(time)); 389 392 390 393 StringBuffer sb = new StringBuffer(); 391 394 digit4(sb, cal.get(Calendar.YEAR)); … … 397 400 digit2(sb, cal.get(Calendar.SECOND)); 398 401 sb.append('Z'); 399 402 400 403 String utc = sb.toString(); 401 404 402 405 if (dateKey != null) { 403 406 cache.put(dateKey, utc); 404 407 datesCached++; 405 408 } 406 409 407 410 return utc; 408 411 } catch (CalFacadeException cfe) { … … 413 416 } 414 417 } 415 418 416 419 /** 417 420 * @return Number of utc values cached … … 420 423 return datesCached; 421 424 } 422 425 423 426 /** 424 427 * @return date cache hits … … 427 430 return dateCacheHits; 428 431 } 429 432 430 433 /** 431 434 * @return data cache misses. … … 434 437 return dateCacheMisses; 435 438 } 436 439 437 440 /* ==================================================================== 438 441 * protected methods 439 442 * ==================================================================== */ 440 443 441 444 protected void digit2(StringBuffer sb, int val) throws CalFacadeException { 442 445 if (val > 99) { … … 448 451 sb.append(val); 449 452 } 450 453 451 454 protected void digit4(StringBuffer sb, int val) throws CalFacadeException { 452 455 if (val > 9999) { … … 462 465 sb.append(val); 463 466 } 464 467 465 468 466 469 /* Get a logger for messages trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/Calintf.java
r356 r415 372 372 * @param returnResult 373 373 * @return CurrentAccess 374 * @throws CalFacadeAccessException if returnResult false and no access 375 * @throws CalFacadeException 374 * @throws CalFacadeException if returnResult false and no access 376 375 */ 377 376 public CurrentAccess checkAccess(BwShareableDbentity ent, int desiredAccess, … … 693 692 */ 694 693 public Collection getSponsorRefs(BwSponsor val) throws CalFacadeException; 694 695 /* ==================================================================== 696 * Synchronization 697 * ==================================================================== */ 698 699 /** XXX temp I think 700 * Retrieve event proxies in the given calendar - they will be used to remove events 701 * from result sets. 702 * 703 * @return Collection of CoreEventInfo objects 704 * @throws CalFacadeException 705 */ 706 public Collection getDeletedProxies() throws CalFacadeException; 695 707 696 708 /* ==================================================================== trunk/calendar3/calFacade/src/org/bedework/calfacade/ifs/EventsI.java
r406 r415 139 139 140 140 /** XXX temp I think 141 * Retrieve event proxies in the trash- they will be used to remove events141 * Retrieve event proxies in the given calendar - they will be used to remove events 142 142 * from result sets. 143 143 * 144 * @param cal BwCalendar object restricting search or null. 144 145 * @return Collection of CoreEventInfo objects 146 * @throws CalFacadeException 145 147 */ 146 public Collection getDeletedProxies( ) throws CalFacadeException;148 public Collection getDeletedProxies(BwCalendar cal) throws CalFacadeException; 147 149 148 150 /* * Return true if this event is editable by the current user trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/BwPreferences.java
r408 r415 348 348 * 349 349 * @param val String time value 350 * @throws CalFacadeException 350 351 */ 351 352 public void setWorkdayStart(String val) throws CalFacadeException{ … … 364 365 * 365 366 * @param val String time value 367 * @throws CalFacadeException 366 368 */ 367 369 public void setWorkdayEnd(String val) throws CalFacadeException{ … … 453 455 * 454 456 * @param val String time value 457 * @return int minutes 458 * @throws CalFacadeException 455 459 */ 456 460 private int makeMinutesFromTime(String val) throws CalFacadeException{ trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/EventInfo.java
r356 r415 312 312 } 313 313 314 /* Set the current users access rights.314 /** Set the current users access rights. 315 315 * 316 316 * @param val CurrentAccess … … 320 320 } 321 321 322 /* Get the current users access rights.322 /** Get the current users access rights. 323 323 * 324 324 * @return CurrentAccess trunk/calendar3/calFacade/src/org/bedework/calfacade/svc/UserAuth.java
r336 r415 145 145 * @param cb CallBack object 146 146 * @param val Object 147 * @param debug 147 148 * @exception CalFacadeException If there's a problem 148 149 */ … … 170 171 * @param cb CallBack object 171 172 * @param val int sum of allowable access. 173 * @param debug 172 174 * @exception CalFacadeException If there's a problem 173 175 */ trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/EmitAccess.java
r320 r415 63 63 public class EmitAccess extends AccessAppUtil { 64 64 private String namespacePrefix; 65 65 66 66 /** Acls use tags in the webdav and caldav namespace. For use over caldav 67 67 * we shoud supply the uris. Otherwise a null namespace will be used. 68 68 * 69 * @param wdNamespace 70 * @param cdNamespace 71 * @param xml 69 * @param namespacePrefix String prefix 70 * @param xml XmlEmit 72 71 */ 73 72 public EmitAccess(String namespacePrefix, XmlEmit xml) { 74 73 super(xml); 75 74 76 75 this.namespacePrefix = namespacePrefix; 77 76 } trunk/calendar3/caldavClientApi/build.xml
r2 r415 45 45 46 46 <!-- Include the location of the compiled calendar classes --> 47 <pathelement location="${org.bedework.access.jar}"/> 47 48 <pathelement location="${org.bedework.http.jar}"/> 48 49 <pathelement location="${org.bedework.ical.jar}"/> trunk/calendar3/caldavClientApi/src/org/bedework/caldav/client/CalintfCaldavImpl.java
r321 r415 74 74 import org.bedework.calfacade.CalFacadeException; 75 75 import org.bedework.calfacade.CalintfDefs; 76 import org.bedework.calfacade.base.BwShareableDbentity; 76 77 import org.bedework.calfacade.base.CalintfBase; 77 78 import org.bedework.calfacade.filter.BwFilter; … … 80 81 import org.bedework.calfacade.ifs.Groups; 81 82 import org.bedework.http.client.HttpManager; 83 84 import edu.rpi.cct.uwcal.access.Acl.CurrentAccess; 82 85 83 86 import java.util.Collection; … … 290 293 * ==================================================================== */ 291 294 292 public void changeAccess(Object o, Collection aces) throws CalFacadeException { 293 checkOpen(); 294 throw new CalFacadeUnimplementedException(); 295 } 296 297 public Collection getAces(Object o) throws CalFacadeException { 295 public void changeAccess(BwShareableDbentity ent, 296 Collection aces) throws CalFacadeException { 297 checkOpen(); 298 throw new CalFacadeUnimplementedException(); 299 } 300 301 public CurrentAccess checkAccess(BwShareableDbentity ent, int desiredAccess, 302 boolean returnResult) throws CalFacadeException { 298 303 checkOpen(); 299 304 throw new CalFacadeUnimplementedException(); … … 373 378 } 374 379 375 public BwCalendar getCalendar(String path) throws CalFacadeException{ 376 checkOpen(); 377 378 throw new CalFacadeUnimplementedException(); 379 } 380 381 public BwCalendar getDefaultCalendar() throws CalFacadeException { 382 throw new CalFacadeUnimplementedException(); 383 } 384 385 public BwCalendar getTrashCalendar() throws CalFacadeException { 380 public BwCalendar getCalendar(String path, 381 int desiredAccess) throws CalFacadeException{ 382 checkOpen(); 383 384 throw new CalFacadeUnimplementedException(); 385 } 386 387 public BwCalendar getDefaultCalendar(BwUser user) throws CalFacadeException { 388 throw new CalFacadeUnimplementedException(); 389 } 390 391 public BwCalendar getTrashCalendar(BwUser user) throws CalFacadeException { 386 392 throw new CalFacadeUnimplementedException(); 387 393 } … … 583 589 } 584 590 585 public Collection getEvent(String guid, String rid, 586 Integer seqnum, 591 public Collection getEvent(BwCalendar calendar, String guid, String rid, 587 592 int recurRetrieval) throws CalFacadeException { 588 593 checkOpen(); … … 592 597 public Collection getEvents(BwCalendar calendar, BwFilter filter, 593 598 BwDateTime startDate, BwDateTime endDate, 594 int recurRetrieval )595 throws CalFacadeException {599 int recurRetrieval, 600 boolean freeBusy) throws CalFacadeException { 596 601 throw new CalFacadeUnimplementedException(); 597 602 } … … 611 616 checkOpen(); 612 617 throw new CalFacadeUnimplementedException(); 613 }614 615 public boolean editable(BwEvent val) throws CalFacadeException {616 checkOpen();617 618 if (currentMode == CalintfDefs.guestMode) {619 return false;620 }621 622 if (val.getPublick() != (currentMode == CalintfDefs.publicAdminMode)) {623 return false;624 }625 626 return user.equals(val.getCreator());627 618 } 628 619 trunk/calendar3/calsvc/src/org/bedework/calsvc/BwIndexKey.java
r369 r415 84 84 private String itemType; 85 85 86 /** Constructor 87 * 88 */ 86 89 public BwIndexKey() { 87 90 } 88 91 92 /** Constructor 93 * 94 * @param svci 95 */ 89 96 public BwIndexKey(CalSvcI svci) { 90 97 this.svci = svci; 91 98 } 92 99 100 /** Constructor 101 * 102 * @param svci 103 * @param score 104 */ 93 105 public BwIndexKey(CalSvcI svci, float score) { 94 106 this.score = score; … … 96 108 } 97 109 110 /** Set the item type with a value defined in BwIndexLuceneDefs 111 * 112 * @param val 113 */ 98 114 public void setItemType(String val) { 99 115 itemType = val; 100 116 } 101 117 118 /** Set the score 119 * 120 * @param val 121 */ 102 122 public void setScore(float val) { 103 123 score = val; 104 124 } 105 125 126 /** Set the key for a calendar (the path) 127 * 128 * @param key1 129 */ 106 130 public void setCalendarKey(String key1) { 107 131 this.key1 = key1; 108 132 } 109 133 134 /** Set the key for an event (encode ca+guid+recurid) 135 * 136 * @param key 137 * @throws IndexException 138 */ 110 139 public void setEventKey(String key) throws IndexException { 111 140 encoded = key.toCharArray(); … … 117 146 } 118 147 148 /** Encode an event key 149 * 150 * @param key1 151 * @param key2 152 * @param key3 153 * @return Strign encoded key 154 * @throws IndexException 155 */ 119 156 public String makeEventKey(String key1, String key2, 120 157 String key3) throws IndexException { … … 127 164 } 128 165 166 /* (non-Javadoc) 167 * @see edu.rpi.cct.misc.indexing.Index.Key#getRecord() 168 */ 129 169 public Object getRecord() throws IndexException { 130 170 try { … … 164 204 * ==================================================================== */ 165 205 166 /* *Current position in the key */206 /* Current position in the key */ 167 207 private int pos; 168 208 169 /* *When encoding a key we build it here.209 /* When encoding a key we build it here. 170 210 */ 171 211 private CharArrayWriter caw; … … 188 228 /** Back off one char 189 229 * 190 * @throws AccessException230 * @throws IndexException 191 231 */ 192 232 public void back() throws IndexException { … … 197 237 * 198 238 * @param n int number of chars 199 * @throws AccessException239 * @throws IndexException 200 240 */ 201 241 public void back(int n) throws IndexException { … … 260 300 * 261 301 * @return int length 262 * @throws AccessException302 * @throws IndexException 263 303 */ 264 304 public int getLength() throws IndexException { … … 288 328 * 289 329 * @return String decoded String value 290 * @throws AccessException330 * @throws IndexException 291 331 */ 292 332 public String getKeyString() throws IndexException { … … 309 349 /** Skip a String from the encoded acl at the current position. 310 350 * 311 * @throws AccessException351 * @throws IndexException 312 352 */ 313 353 public void skipString() throws IndexException { … … 335 375 * 336 376 * @param len 337 * @throws AccessException377 * @throws IndexException 338 378 */ 339 379 public void encodeLength(int len) throws IndexException { … … 355 395 * 356 396 * @param val 357 * @throws AccessException397 * @throws IndexException 358 398 */ 359 399 public void encodeString(String val) throws IndexException { … … 375 415 * 376 416 * @param c char 377 * @throws AccessException417 * @throws IndexException 378 418 */ 379 419 public void addChar(char c) throws IndexException { trunk/calendar3/calsvc/src/org/bedework/calsvc/BwIndexLuceneImpl.java
r369 r415 77 77 private BwIndexKey keyConverter = new BwIndexKey(); 78 78 79 /** Constructor 80 * 81 * @param svci 82 * @param sysfilePath 83 * @param admin 84 * @param debug 85 * @throws IndexException 86 */ 79 87 public BwIndexLuceneImpl(CalSvcI svci, 80 88 String sysfilePath, … … 140 148 * @param rec The record 141 149 * @return String String which uniquely identifies the record 150 * @throws IndexException 142 151 */ 143 152 public String makeKeyVal(Object rec) throws IndexException { … … 167 176 * @param rec The record 168 177 * @return String Name for the field/term 178 * @throws IndexException 169 179 */ 170 180 public String makeKeyName(Object rec) throws IndexException { trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r406 r415 1016 1016 } 1017 1017 1018 public BwCalendar getSubCalendar(BwSubscription val,1019 boolean freeBusy) throws CalFacadeException {1020 int desiredAccess = PrivilegeDefs.privRead;1021 if (freeBusy) {1022 desiredAccess = PrivilegeDefs.privReadFreeBusy;1023 }1024 1025 if (!val.getInternalSubscription() || val.getCalendarDeleted()) {1026 return null;1027 }1028 1029 BwCalendar calendar = val.getCalendar();1030 1031 if (calendar != null) {1032 // recheck access1033 if (getCal().checkAccess(calendar, desiredAccess, true) == null) {1034 val.setCalendar(null);1035 return null;1036 }1037 return calendar;1038 }1039 1040 String path;1041 String uri = val.getUri();1042 1043 if (uri.startsWith(CalFacadeDefs.bwUriPrefix)) {1044 path = uri.substring(CalFacadeDefs.bwUriPrefix.length());1045 } else {1046 // Shouldn't happen?1047 path = uri;1048 }1049 1050 if (debug) {1051 trace("Search for calendar \"" + path + "\"");1052 }1053 1054 try {1055 calendar = getCal().getCalendar(path, desiredAccess);1056 } catch (CalFacadeAccessException cfae) {1057 calendar = null;1058 }1059 1060 if (calendar == null) {1061 // Assume deleted1062 val.setCalendarDeleted(true);1063 updateSubscription(val);1064 } else {1065 val.setCalendar(calendar);1066 }1067 1068 return calendar;1069 }1070 1071 1018 /* ==================================================================== 1072 1019 * Free busy … … 1624 1571 } 1625 1572 1626 public Collection getEvents(BwSubscription sub, BwFilter filter, 1627 BwDateTime startDate, BwDateTime endDate, 1628 int recurRetrieval, 1629 boolean freeBusy) throws CalFacadeException { 1573 public DelEventResult deleteEvent(BwEvent event, 1574 boolean delUnreffedLoc) throws CalFacadeException { 1575 DelEventResult der = new DelEventResult(false, false, 0); 1576 1577 if (event == null) { 1578 return der; 1579 } 1580 1581 BwLocation loc = event.getLocation(); 1582 1583 Calintf.DelEventResult cider = getCal().deleteEvent(event); 1584 1585 if (!cider.eventDeleted) { 1586 return der; 1587 } 1588 1589 der.eventDeleted = true; 1590 der.alarmsDeleted = cider.alarmsDeleted; 1591 1592 if (delUnreffedLoc) { 1593 if ((loc != null) && 1594 (getCal().getLocationRefs(loc).size() == 0) && 1595 (getCal().deleteLocation(loc))) { 1596 der.locationDeleted = true; 1597 } 1598 } 1599 1600 return der; 1601 } 1602 1603 public EventUpdateResult addEvent(BwCalendar cal, 1604 BwEvent event, 1605 Collection overrides) throws CalFacadeException { 1606 EventUpdateResult updResult = new EventUpdateResult(); 1607 1608 if (event instanceof BwEventProxy) { 1609 BwEventProxy proxy = (BwEventProxy)event; 1610 BwEvent override = proxy.getRef(); 1611 setupSharableEntity(override); 1612 } else { 1613 setupSharableEntity(event); 1614 } 1615 1616 BwLocation loc = event.getLocation(); 1617 BwSponsor sp = event.getSponsor(); 1618 1619 if ((sp != null) && (ensureSponsorExists(sp) == null)) { 1620 updResult.sponsorsAdded++; 1621 } 1622 1623 if ((loc != null) && (ensureLocationExists(loc) == null)) { 1624 updResult.locationsAdded++; 1625 } 1626 1627 /* If no calendar has been assigned for this event set it to the default 1628 * calendar for non-public events or reject it for public events. 1629 */ 1630 1631 if (cal == null) { 1632 if (event.getPublick()) { 1633 throw new CalFacadeException("No calendar assigned"); 1634 } 1635 1636 cal = getPreferences().getDefaultCalendar(); 1637 } 1638 1639 if (!cal.getCalendarCollection()) { 1640 throw new CalFacadeAccessException(); 1641 } 1642 1643 event.setCalendar(cal); 1644 1645 event.setDtstamp(new DtStamp(new DateTime(true)).getValue()); 1646 event.setLastmod(new LastModified(new DateTime(true)).getValue()); 1647 event.setCreated(new Created(new DateTime(true)).getValue()); 1648 1649 if (event instanceof BwEventProxy) { 1650 BwEventProxy proxy = (BwEventProxy)event; 1651 BwEvent override = proxy.getRef(); 1652 getCal().addEvent(override, overrides); 1653 } else { 1654 getCal().addEvent(event, overrides); 1655 } 1656 1657 if (isPublicAdmin()) { 1658 /* Mail event to any subscribers */ 1659 } 1660 1661 return updResult; 1662 } 1663 1664 public void updateEvent(BwEvent event) throws CalFacadeException { 1665 event.setLastmod(new LastModified(new DateTime(true)).getValue()); 1666 1667 getCal().updateEvent(event); 1668 1669 if (isPublicAdmin()) { 1670 /* Mail event to any subscribers */ 1671 } 1672 } 1673 1674 /** For an event to which we have write access we simply mark it deleted. 1675 * 1676 * <p>Otherwise we add an annotation maarking the event as deleted. 1677 * 1678 * @param event 1679 * @throws CalFacadeException 1680 */ 1681 public void markDeleted(BwEvent event) throws CalFacadeException { 1682 CurrentAccess ca = getCal().checkAccess(event, PrivilegeDefs.privWrite, true); 1683 1684 if (ca.accessAllowed) { 1685 // Have write access - just set the flag and move it into the owners trash 1686 event.setDeleted(true); 1687 event.setCalendar(getCal().getTrashCalendar(event.getOwner())); 1688 updateEvent(event); 1689 return; 1690 } 1691 1692 // Need to annotate it as deleted 1693 1694 BwEventProxy proxy = BwEventProxy.makeAnnotation(event, event.getOwner()); 1695 1696 // Where does the ref go? Not in the same calendar - we have no access 1697 // Put it in the trash - but don't delete on empty trash 1698 1699 BwCalendar cal = getCal().getDeletedCalendar(getUser()); 1700 proxy.setOwner(getUser()); 1701 proxy.setDeleted(true); 1702 proxy.setCalendar(cal); 1703 addEvent(cal, proxy, null); 1704 } 1705 1706 /* ==================================================================== 1707 * Caldav support 1708 * Caldav as it stands at the moment requires that we save the arbitary 1709 * names clients might assign to events. 1710 * ==================================================================== */ 1711 1712 public Collection findEventsByName(BwCalendar cal, String val) 1713 throws CalFacadeException { 1714 return postProcess(getCal().getEventsByName(cal, val), (BwSubscription)null); 1715 } 1716 1717 /* ==================================================================== 1718 * Synchronization 1719 * ==================================================================== */ 1720 1721 public BwSynchInfo getSynchInfo() throws CalFacadeException { 1722 return getCal().getSynchInfo(); 1723 } 1724 1725 public void addSynchInfo(BwSynchInfo val) throws CalFacadeException { 1726 getCal().addSynchInfo(val); 1727 } 1728 1729 public void updateSynchInfo(BwSynchInfo val) throws CalFacadeException { 1730 getCal().updateSynchInfo(val); 1731 } 1732 1733 public BwSynchState getSynchState(BwEvent ev) 1734 throws CalFacadeException { 1735 return getCal().getSynchState(ev); 1736 } 1737 1738 public Collection getDeletedSynchStates() throws CalFacadeException { 1739 return getCal().getDeletedSynchStates(); 1740 } 1741 1742 public void addSynchState(BwSynchState val) 1743 throws CalFacadeException { 1744 getCal().addSynchState(val); 1745 } 1746 1747 public void updateSynchState(BwSynchState val) 1748 throws CalFacadeException { 1749 getCal().updateSynchState(val); 1750 } 1751 1752 public void getSynchData(BwSynchState val) throws CalFacadeException { 1753 getCal().getSynchData(val); 1754 } 1755 1756 public void setSynchData(BwSynchState val) throws CalFacadeException { 1757 getCal().setSynchData(val); 1758 } 1759 1760 public void updateSynchStates() throws CalFacadeException { 1761 getCal().updateSynchStates(); 1762 } 1763 1764 /* ==================================================================== 1765 * Alarms 1766 * ==================================================================== */ 1767 1768 public Collection getAlarms(BwEvent event, BwUser user) throws CalFacadeException { 1769 return getCal().getAlarms(event, user); 1770 } 1771 1772 public void setAlarm(BwEvent event, 1773 BwEventAlarm alarm) throws CalFacadeException { 1774 // Do some sort of validation here. 1775 alarm.setEvent(event); 1776 alarm.setOwner(getUser()); 1777 getCal().addAlarm(alarm); 1778 } 1779 1780 public void updateAlarm(BwAlarm val) throws CalFacadeException { 1781 getCal().updateAlarm(val); 1782 } 1783 1784 public Collection getUnexpiredAlarms(BwUser user) throws CalFacadeException { 1785 return getCal().getUnexpiredAlarms(user); 1786 } 1787 1788 public Collection getUnexpiredAlarms(BwUser user, long triggerTime) 1789 throws CalFacadeException { 1790 return getCal().getUnexpiredAlarms(user, triggerTime); 1791 } 1792 1793 /* ==================================================================== 1794 * Access control 1795 * ==================================================================== */ 1796 1797 /* This provides some limits to shareable entity updates for the 1798 * admin users. It is applied in addition to the normal access checks 1799 * applied at the lower levels. 1800 */ 1801 private void updateOK(Object o) throws CalFacadeException { 1802 if (isGuest()) { 1803 throw new CalFacadeAccessException(); 1804 } 1805 1806 if (isSuper()) { 1807 // Always ok 1808 return; 1809 } 1810 1811 if (!(o instanceof BwShareableDbentity)) { 1812 throw new CalFacadeAccessException(); 1813 } 1814 1815 if (!isPublicAdmin()) { 1816 // Normal access checks apply 1817 return; 1818 } 1819 1820 BwShareableDbentity ent = (BwShareableDbentity)o; 1821 1822 if (adminCanEditAllPublicSponsors || 1823 ent.getCreator().equals(currentUser())) { 1824 return; 1825 } 1826 1827 throw new CalFacadeAccessException(); 1828 } 1829 1830 /* This checks to see if the current user has owner access based on the 1831 * supplied object. This is used to limit access to objects not normally 1832 * shared such as preferences and related objects like veiws and subscriptions. 1833 */ 1834 private void checkOwnerOrSuper(Object o) throws CalFacadeException { 1835 if (isGuest()) { 1836 throw new CalFacadeAccessException(); 1837 } 1838 1839 if (isSuper()) { 1840 // Always ok? 1841 return; 1842 } 1843 1844 if (!(o instanceof BwOwnedDbentity)) { 1845 throw new CalFacadeAccessException(); 1846 } 1847 1848 BwOwnedDbentity ent = (BwOwnedDbentity)o; 1849 1850 BwUser u; 1851 1852 /*if (!isPublicAdmin()) { 1853 // Expect a different owner - always public-user???? 1854 return; 1855 }*/ 1856 1857 u = getUser(); 1858 1859 if (u.equals(ent.getOwner())) { 1860 return; 1861 } 1862 1863 throw new CalFacadeAccessException(); 1864 } 1865 1866 /* ==================================================================== 1867 * Package and protected methods 1868 * ==================================================================== */ 1869 1870 /** Get the current db session 1871 * 1872 * @return Object 1873 * @throws CalFacadeException 1874 */ 1875 Object getDbSession() throws CalFacadeException { 1876 return getCal().getDbSession(); 1877 } 1878 1879 /* ==================================================================== 1880 * Private methods 1881 * ==================================================================== */ 1882 1883 private Collection getEvents(BwSubscription sub, BwFilter filter, 1884 BwDateTime startDate, BwDateTime endDate, 1885 int recurRetrieval, 1886 boolean freeBusy) throws CalFacadeException { 1630 1887 TreeSet ts = new TreeSet(); 1631 1888 … … 1722 1979 } 1723 1980 1724 public DelEventResult deleteEvent(BwEvent event, 1725 boolean delUnreffedLoc) throws CalFacadeException { 1726 DelEventResult der = new DelEventResult(false, false, 0); 1727 1728 if (event == null) { 1729 return der; 1730 } 1731 1732 BwLocation loc = event.getLocation(); 1733 1734 Calintf.DelEventResult cider = getCal().deleteEvent(event); 1735 1736 if (!cider.eventDeleted) { 1737 return der; 1738 } 1739 1740 der.eventDeleted = true; 1741 der.alarmsDeleted = cider.alarmsDeleted; 1742 1743 if (delUnreffedLoc) { 1744 if ((loc != null) && 1745 (getCal().getLocationRefs(loc).size() == 0) && 1746 (getCal().deleteLocation(loc))) { 1747 der.locationDeleted = true; 1748 } 1749 } 1750 1751 return der; 1752 } 1753 1754 public EventUpdateResult addEvent(BwCalendar cal, 1755 BwEvent event, 1756 Collection overrides) throws CalFacadeException { 1757 EventUpdateResult updResult = new EventUpdateResult(); 1758 1759 if (event instanceof BwEventProxy) { 1760 BwEventProxy proxy = (BwEventProxy)event; 1761 BwEvent override = proxy.getRef(); 1762 setupSharableEntity(override); 1981 private BwCalendar getSubCalendar(BwSubscription val, 1982 boolean freeBusy) throws CalFacadeException { 1983 int desiredAccess = PrivilegeDefs.privRead; 1984 if (freeBusy) { 1985 desiredAccess = PrivilegeDefs.privReadFreeBusy; 1986 } 1987 1988 if (!val.getInternalSubscription() || val.getCalendarDeleted()) { 1989 return null; 1990 } 1991 1992 BwCalendar calendar = val.getCalendar(); 1993 1994 if (calendar != null) { 1995 // recheck access 1996 if (getCal().checkAccess(calendar, desiredAccess, true) == null) { 1997 val.setCalendar(null); 1998 return null; 1999 } 2000 return calendar; 2001 } 2002 2003 String path; 2004 String uri = val.getUri(); 2005 2006 if (uri.startsWith(CalFacadeDefs.bwUriPrefix)) { 2007 path = uri.substring(CalFacadeDefs.bwUriPrefix.length()); 1763 2008 } else { 1764 setupSharableEntity(event); 1765 } 1766 1767 BwLocation loc = event.getLocation(); 1768 BwSponsor sp = event.getSponsor(); 1769 1770 if ((sp != null) && (ensureSponsorExists(sp) == null)) { 1771 updResult.sponsorsAdded++; 1772 } 1773 1774 if ((loc != null) && (ensureLocationExists(loc) == null)) { 1775 updResult.locationsAdded++; 1776 } 1777 1778 /* If no calendar has been assigned for this event set it to the default 1779 * calendar for non-public events or reject it for public events. 1780 */ 1781 1782 if (cal == null) { 1783 if (event.getPublick()) { 1784 throw new CalFacadeException("No calendar assigned"); 1785 } 1786 1787 cal = getPreferences().getDefaultCalendar(); 1788 } 1789 1790 if (!cal.getCalendarCollection()) { 1791 throw new CalFacadeAccessException(); 1792 } 1793 1794 event.setCalendar(cal); 1795 1796 event.setDtstamp(new DtStamp(new DateTime(true)).getValue()); 1797 event.setLastmod(new LastModified(new DateTime(true)).getValue()); 1798 event.setCreated(new Created(new DateTime(true)).getValue()); 1799 1800 if (event instanceof BwEventProxy) { 1801 BwEventProxy proxy = (BwEventProxy)event; 1802 BwEvent override = proxy.getRef(); 1803 getCal().addEvent(override, overrides); 2009 // Shouldn't happen? 2010 path = uri; 2011 } 2012 2013 if (debug) { 2014 trace("Search for calendar \"" + path + "\""); 2015 } 2016 2017 try { 2018 calendar = getCal().getCalendar(path, desiredAccess); 2019 } catch (CalFacadeAccessException cfae) { 2020 calendar = null; 2021 } 2022 2023 if (calendar == null) { 2024 // Assume deleted 2025 val.setCalendarDeleted(true); 2026 updateSubscription(val); 1804 2027 } else { 1805 getCal().addEvent(event, overrides); 1806 } 1807 1808 if (isPublicAdmin()) { 1809 /* Mail event to any subscribers */ 1810 } 1811 1812 return updResult; 1813 } 1814 1815 public void updateEvent(BwEvent event) throws CalFacadeException { 1816 event.setLastmod(new LastModified(new DateTime(true)).getValue()); 1817 1818 getCal().updateEvent(event); 1819 1820 if (isPublicAdmin()) { 1821 /* Mail event to any subscribers */ 1822 } 1823 } 1824 1825 /** For an event to which we have write access we simply mark it deleted. 1826 * 1827 * <p>Otherwise we add an annotation maarking the event as deleted. 1828 * 1829 * @param event 1830 * @throws CalFacadeException 1831 */ 1832 public void markDeleted(BwEvent event) throws CalFacadeException { 1833 CurrentAccess ca = getCal().checkAccess(event, PrivilegeDefs.privWrite, true); 1834 1835 if (ca.accessAllowed) { 1836 // Have write access - just set the flag and move it into the owners trash 1837 event.setDeleted(true); 1838 event.setCalendar(getCal().getTrashCalendar(event.getOwner())); 1839 updateEvent(event); 1840 return; 1841 } 1842 1843 // Need to annotate it as deleted 1844 1845 BwEventProxy proxy = BwEventProxy.makeAnnotation(event, event.getOwner()); 1846 1847 // Where does the ref go? Not in the same calendar - we have no access 1848 // Put it in the trash - but don't delete on empty trash 1849 1850 BwCalendar cal = getCal().getDeletedCalendar(getUser()); 1851 proxy.setOwner(getUser()); 1852 proxy.setDeleted(true); 1853 proxy.setCalendar(cal); 1854 addEvent(cal, proxy, null); 1855 } 1856 1857 /* ==================================================================== 1858 * Caldav support 1859 * Caldav as it stands at the moment requires that we save the arbitary 1860 * names clients might assign to events. 1861 * ==================================================================== */ 1862 1863 public Collection findEventsByName(BwCalendar cal, String val) 1864 throws CalFacadeException { 1865 return postProcess(getCal().getEventsByName(cal, val), (BwSubscription)null); 1866 } 1867 1868 /* ==================================================================== 1869 * Synchronization 1870 * ==================================================================== */ 1871 1872 public BwSynchInfo getSynchInfo() throws CalFacadeException { 1873 return getCal().getSynchInfo(); 1874 } 1875 1876 public void addSynchInfo(BwSynchInfo val) throws CalFacadeException { 1877 getCal().addSynchInfo(val); 1878 } 1879 1880 public void updateSynchInfo(BwSynchInfo val) throws CalFacadeException { 1881 getCal().updateSynchInfo(val); 1882 } 1883 1884 public BwSynchState getSynchState(BwEvent ev) 1885 throws CalFacadeException { 1886 return getCal().getSynchState(ev); 1887 } 1888 1889 public Collection getDeletedSynchStates() throws CalFacadeException { 1890 return getCal().getDeletedSynchStates(); 1891 } 1892 1893 public void addSynchState(BwSynchState val) 1894 throws CalFacadeException { 1895 getCal().addSynchState(val); 1896 } 1897 1898 public void updateSynchState(BwSynchState val) 1899 throws CalFacadeException { 1900 getCal().updateSynchState(val); 1901 } 1902 1903 public void getSynchData(BwSynchState val) throws CalFacadeException { 1904 getCal().getSynchData(val); 1905 } 1906 1907 public void setSynchData(BwSynchState val) throws CalFacadeException { 1908 getCal().setSynchData(val); 1909 } 1910 1911 public void updateSynchStates() throws CalFacadeException { 1912 getCal().updateSynchStates(); 1913 } 1914 1915 /* ==================================================================== 1916 * Alarms 1917 * ==================================================================== */ 1918 1919 public Collection getAlarms(BwEvent event, BwUser user) throws CalFacadeException { 1920 return getCal().getAlarms(event, user); 1921 } 1922 1923 public void setAlarm(BwEvent event, 1924 BwEventAlarm alarm) throws CalFacadeException { 1925 // Do some sort of validation here. 1926 alarm.setEvent(event); 1927 alarm.setOwner(getUser()); 1928 getCal().addAlarm(alarm); 1929 } 1930 1931 public void updateAlarm(BwAlarm val) throws CalFacadeException { 1932 getCal().updateAlarm(val); 1933 } 1934 1935 public Collection getUnexpiredAlarms(BwUser user) throws CalFacadeException { 1936 return getCal().getUnexpiredAlarms(user); 1937 } 1938 1939 public Collection getUnexpiredAlarms(BwUser user, long triggerTime) 1940 throws CalFacadeException { 1941 return getCal().getUnexpiredAlarms(user, triggerTime); 1942 } 1943 1944 /* ==================================================================== 1945 * Access control 1946 * ==================================================================== */ 1947 1948 /* This provides some limits to shareable entity updates for the 1949 * admin users. It is applied in addition to the normal access checks 1950 * applied at the lower levels. 1951 */ 1952 private void updateOK(Object o) throws CalFacadeException { 1953 if (isGuest()) { 1954 throw new CalFacadeAccessException(); 1955 } 1956 1957 if (isSuper()) { 1958 // Always ok 1959 return; 1960 } 1961 1962 if (!(o instanceof BwShareableDbentity)) { 1963 throw new CalFacadeAccessException(); 1964 } 1965 1966 if (!isPublicAdmin()) { 1967 // Normal access checks apply 1968 return; 1969 } 1970 1971 BwShareableDbentity ent = (BwShareableDbentity)o; 1972 1973 if (adminCanEditAllPublicSponsors || 1974 ent.getCreator().equals(currentUser())) { 1975 return; 1976 } 1977 1978 throw new CalFacadeAccessException(); 1979 } 1980 1981 /* This checks to see if the current user has owner access based on the 1982 * supplied object. This is used to limit access to objects not normally 1983 * shared such as preferences and related objects like veiws and subscriptions. 1984 */ 1985 private void checkOwnerOrSuper(Object o) throws CalFacadeException { 1986 if (isGuest()) { 1987 throw new CalFacadeAccessException(); 1988 } 1989 1990 if (isSuper()) { 1991 // Always ok? 1992 return; 1993 } 1994 1995 if (!(o instanceof BwOwnedDbentity)) { 1996 throw new CalFacadeAccessException(); 1997 } 1998 1999 BwOwnedDbentity ent = (BwOwnedDbentity)o; 2000 2001 BwUser u; 2002 2003 /*if (!isPublicAdmin()) { 2004 // Expect a different owner - always public-user???? 2005 return; 2006 }*/ 2007 2008 u = getUser(); 2009 2010 if (u.equals(ent.getOwner())) { 2011 return; 2012 } 2013 2014 throw new CalFacadeAccessException(); 2015 } 2016 2017 /* ==================================================================== 2018 * Package and protected methods 2019 * ==================================================================== */ 2020 2021 /** Get the current db session 2022 * 2023 * @return Object 2024 */ 2025 Object getDbSession() throws CalFacadeException { 2026 return getCal().getDbSession(); 2027 } 2028 2029 /* ==================================================================== 2030 * Private methods 2031 * ==================================================================== */ 2028 val.setCalendar(calendar); 2029 } 2030 2031 return calendar; 2032 } 2032 2033 2033 2034 private void deleteOK(Object o) throws CalFacadeException { trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java
r395 r415 319 319 * <p>Note that the returned object may require a one time initialisation 320 320 * call to set it up correctly. 321 * @see org.bedework.calfacade.svc.UserAuth#initialise(String, UserAuth.CallBack, int )322 * @see org.bedework.calfacade.svc.UserAuth#initialise(String, UserAuth.CallBack, Object )321 * @see org.bedework.calfacade.svc.UserAuth#initialise(String, UserAuth.CallBack, int, boolean) 322 * @see org.bedework.calfacade.svc.UserAuth#initialise(String, UserAuth.CallBack, Object, boolean) 323 323 * 324 324 * @param user String account name trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcIPars.java
r301 r415 69 69 */ 70 70 private String user; 71 71 72 72 /** Environment properties prefix - e.g. "org.bedework.webpersonal." 73 73 */ … … 94 94 * @param authUser String authenticated user of the application 95 95 * @param user String user to act as 96 * @param en zPrefix String Environment properties prefix96 * @param envPrefix String Environment properties prefix 97 97 * @param publicAdmin true for admin 98 98 * @param caldav true if via caldav trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/Index.java
r369 r415 7 7 */ 8 8 public interface Index extends Serializable { 9 /** 10 * @param val 11 */ 9 12 public void setDebug(boolean val); 10 13 11 14 /** This might need to be called to open the index in the appropriate manner 12 15 * probably determined by information passed to the constructor. 16 * 17 * @throws IndexException 13 18 */ 14 19 public void open() throws IndexException; … … 16 21 /** This can be called to (re)create the index. It will destroy any 17 22 * previously existing index. 23 * 24 * @throws IndexException 18 25 */ 19 26 public void create() throws IndexException; 20 27 21 28 /** See if we need to call open 29 * 30 * @return boolean 22 31 */ 23 32 public boolean getIsOpen(); … … 40 49 * 41 50 * @param rec The record to index 51 * @throws IndexException 42 52 */ 43 53 public void indexRec(Object rec) throws IndexException; … … 46 56 * 47 57 * @param rec The record to unindex 58 * @throws IndexException 48 59 */ 49 60 public void unindexRec(Object rec) throws IndexException; … … 52 63 * 53 64 * @param recs The records to index 65 * @throws IndexException 54 66 */ 55 67 public void indexRecs(Object[] recs) throws IndexException; … … 59 71 * 60 72 * @param recs The records to index 73 * @throws IndexException 61 74 */ 62 75 public void indexNewRecs(Object[] recs) throws IndexException; … … 65 78 * 66 79 * @param recs The records to unindex 80 * @throws IndexException 67 81 */ 68 82 public void unindexRecs(Object[] recs) throws IndexException; … … 75 89 * @return int Number found. 0 means none found, 76 90 * -1 means indeterminate 91 * @throws IndexException 77 92 */ 78 93 public int search(String query) throws IndexException; … … 83 98 */ 84 99 public abstract class Key { 85 public float score; // Score this record 100 /** Score this record */ 101 public float score; 86 102 103 /** 104 * @return Object entity 105 * @throws IndexException 106 */ 87 107 public abstract Object getRecord() throws IndexException; 88 108 } … … 93 113 * @param keys Array for the record keys 94 114 * @return int Actual number of records 115 * @throws IndexException 95 116 */ 96 117 public int retrieve(int n, Key[] keys) throws IndexException; … … 98 119 /** Called if we intend to run a batch of updates. endBatch MUST be 99 120 * called or manual intervention may be required to remove locks. 121 * 122 * @throws IndexException 100 123 */ 101 124 public void startBatch() throws IndexException; 102 125 103 126 /** Called at the end of a batch of updates. 127 * 128 * @throws IndexException 104 129 */ 105 130 public void endBatch() throws IndexException; 106 131 107 132 /** Called to close at the end of a session. 133 * 134 * @throws IndexException 108 135 */ 109 136 public void close() throws IndexException; trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexDummyImpl.java
r369 r415 6 6 private boolean isOpen; 7 7 8 /** 9 * @throws IndexException 10 */ 8 11 public IndexDummyImpl() throws IndexException { 9 12 } trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexException.java
r369 r415 33 33 private String reason1; 34 34 35 /** 36 */ 35 37 public IndexException() { 36 38 super(); 37 39 } 38 40 41 /** 42 * @param cause 43 */ 39 44 public IndexException(Throwable cause) { 40 45 super(cause); 41 46 } 42 47 48 /** 49 * @param pr 50 */ 43 51 public IndexException(String pr) { 44 52 super(pr); 45 53 } 46 54 55 /** 56 * @param pr 57 * @param reason1 58 */ 47 59 public IndexException(String pr, String reason1) { 48 60 super(pr); … … 50 62 } 51 63 64 /** 65 * @return String rason1 66 */ 52 67 public String getReason1() { 53 68 return reason1; trunk/calendar3/common/src/edu/rpi/cct/misc/indexing/IndexLuceneImpl.java
r369 r415 57 57 * @param writeable true if the caller can update the index 58 58 * @param debug true if we want to see what's going on 59 * @throws IndexException 59 60 */ 60 61 public IndexLuceneImpl(String basePath, … … 72 73 * @param stopWords set of stop words, null for default. 73 74 * @param debug true if we want to see what's going on 75 * @throws IndexException 74 76 */ 75 77 public IndexLuceneImpl(String basePath, … … 85 87 } 86 88 89 /** 90 * @return boolean debugging flag 91 */ 87 92 public boolean getDebug() { 88 93 return debug; … … 95 100 * @param score The rating for this entry 96 101 * @return Index.Key new or reused object 102 * @throws IndexException 97 103 */ 98 104 public abstract Index.Key makeKey(Index.Key key, … … 104 110 * @param rec The record 105 111 * @return Term Lucene term which uniquely identifies the record 112 * @throws IndexException 106 113 */ 107 114 public abstract Term makeKeyTerm(Object rec) throws IndexException; … … 111 118 * @param rec The record 112 119 * @return String Name for the field/term 120 * @throws IndexException 113 121 */ 114 122 public abstract String makeKeyName(Object rec) throws IndexException; … … 118 126 * @param doc The =Document 119 127 * @param rec The record 128 * @throws IndexException 120 129 */ 121 130 public abstract void addFields(Document doc, … … 402 411 403 412 /** Called if we need to close the writer 413 * 414 * @throws IndexException 404 415 */ 405 416 public synchronized void closeWtr() throws IndexException { … … 421 432 422 433 /** Called if we need to close the reader 434 * 435 * @throws IndexException 423 436 */ 424 437 public synchronized void closeRdr() throws IndexException { … … 457 470 458 471 /** Ensure we're open 472 * 473 * @throws IndexException 459 474 */ 460 475 private void checkOpen() throws IndexException { … … 466 481 } 467 482 468 /* *Called to obtain the current or a new writer.483 /* Called to obtain the current or a new writer. 469 484 * 470 485 * @return IndexWriter writer to our index … … 488 503 } 489 504 490 /* *Called to obtain the current or a new reader.505 /* Called to obtain the current or a new reader. 491 506 * 492 507 * @return IndexReader reader of our index … … 511 526 512 527 513 /* *Called to unindex a record. The reader will be left528 /* Called to unindex a record. The reader will be left 514 529 * open. The writer must be closed and will stay closed. 515 530 * … … 538 553 } 539 554 540 /* *Called to index a record. The writer will be left open and the reader555 /* Called to index a record. The writer will be left open and the reader 541 556 * must be closed on entry and will stay closed. 542 557 * … … 569 584 * @param name String field name 570 585 * @param ss String array of keywords 586 * @throws IndexException 571 587 */ 572 588 protected void addKeyArray(Document doc, String name, String[] ss) … … 588 604 * @param name Field name 589 605 * @param dt The timestamp 606 * @throws IndexException 590 607 */ 591 608 protected void addTimestamp(Document doc, String name, Timestamp dt) … … 603 620 * @param name Field name 604 621 * @param val The value 622 * @throws IndexException 605 623 */ 606 624 protected void addString(Document doc, String name, String val) … … 618 636 * @param name Field name 619 637 * @param cost The cost in cents 638 * @throws IndexException 620 639 */ 621 640 protected void addCost(Document doc, String name, Long cost) … … 654 673 * @param name Field name 655 674 * @param val The value 675 * @throws IndexException 656 676 */ 657 677 protected void addKey(Document doc, String name, String val) … … 669 689 * @param name Field name 670 690 * @param val The value 691 * @throws IndexException 671 692 */ 672 693 protected void addLongStoredString(Document doc, String name, String val) … … 684 705 * @param name Field name 685 706 * @param val The value 707 * @throws IndexException 686 708 */ 687 709 protected void addLongString(Document doc, String name, String val) trunk/calendar3/common/src/edu/rpi/sss/util/jsp/UtilAbstractAction.java
r338 r415 635 635 /** Get the session id for the loggers. 636 636 * 637 * @param request 637 638 * @return String session id 638 639 */ … … 659 660 * 660 661 * @param request HttpServletRequest 662 * @param form 661 663 * @return boolean true for OK to log out. False - not allowed - ignore it. 662 664 */ … … 669 671 * 670 672 * @param request HttpServletRequest 673 * @param form 671 674 * @return null for continue, forwardLoggedOut to end session. 675 * @throws Throwable 672 676 */ 673 677 protected String checkLogOut(HttpServletRequest request, … … 691 695 * ==================================================================== */ 692 696 693 /* *We handle our own nocache headers instead of letting struts do it.697 /* We handle our own nocache headers instead of letting struts do it. 694 698 * Struts does it on every response but, if we are running with nocache, 695 699 * we need to be able to disable it for the occassional response. … … 738 742 * ==================================================================== */ 739 743 740 /* *Debugging routine to see if we can serialize the session.744 /* Debugging routine to see if we can serialize the session. 741 745 * We see session serialization errors in the web container if an 742 746 * unserializable object class gets embedded in the session somewhere … … 843 847 * @param form Action form 844 848 * @return String forward to here. null if no error found. 849 * @throws Throwable 845 850 */ 846 851 private String checkVarReq(HttpServletRequest request, … … 917 922 * @param request Needed to locate session 918 923 * @return String forward to here. null if no forward found. 924 * @throws Throwable 919 925 */ 920 926 private String checkForwardto(HttpServletRequest request) throws Throwable { … … 936 942 * 937 943 * @param request Needed to locate session 944 * @param form 938 945 * @return String forward to here on error. null for OK. 946 * @throws Throwable 939 947 */ 940 948 protected String checkConfirmationId(HttpServletRequest request, … … 963 971 * 964 972 * @param request Needed to locate session 973 * @param form 965 974 * @return String forward to here on error. null for OK. 975 * @throws Throwable 966 976 */ 967 977 protected String requireConfirmationId(HttpServletRequest request, … … 1118 1128 * @param name name of parameter 1119 1129 * @return String value 1130 * @throws Throwable 1120 1131 */ 1121 1132 protected String getReqPar(HttpServletRequest req, String name) throws Throwable { … … 1127 1138 * @param req 1128 1139 * @param name name of parameter 1140 * @param defaultVal 1129 1141 * @return int value 1142 * @throws Throwable 1130 1143 */ 1131 1144 protected int getIntReqPar(HttpServletRequest req, String name, … … 1148 1161 * @param req 1149 1162 * @param name name of parameter 1163 * @param defaultVal 1150 1164 * @return long value 1165 * @throws Throwable 1151 1166 */ 1152 1167 protected long getLongReqPar(HttpServletRequest req, String name, … … 1170 1185 * @param name name of parameter 1171 1186 * @return boolean value 1187 * @throws Throwable 1172 1188 */ 1173 1189 protected Boolean getBooleanReqPar(HttpServletRequest req, String name) … … 1196 1212 * @param request Needed to locate session 1197 1213 * @param messages Resources 1214 * @return ErrorEmitSvlt 1198 1215 */ 1199 1216 private ErrorEmitSvlt getErrorObj(HttpServletRequest request, … … 1214 1231 * @param request Needed to locate session 1215 1232 * @param messages Resources 1233 * @return MessageEmitSvlt 1216 1234 */ 1217 1235 private MessageEmitSvlt getMessageObj(HttpServletRequest request, trunk/calendar3/common/src/edu/rpi/sss/util/servlets/ConfiguredXSLTFilter.java
r2 r415 308 308 /** Obtain the presentation state from the session. Override if you want 309 309 * different behaviour. 310 * 311 * @param request 312 * @return PresentationState 310 313 */ 311 314 protected PresentationState getPresentationState(HttpServletRequest request) { trunk/calendar3/common/src/edu/rpi/sss/util/servlets/io/WrappedResponse.java
r2 r415 167 167 168 168 /** Get a logger for messages 169 * 170 * @return Logger 169 171 */ 170 172 protected Logger getLogger() { trunk/calendar3/common/src/edu/rpi/sss/util/xml/XmlEmit.java
r314 r415 69 69 private Writer wtr; 70 70 private boolean mustEmitNS; 71 71 72 72 private boolean noHeaders = false; 73 73 … … 95 95 /** construct an object which will be used to collect namespace names 96 96 * during the first phase and emit xml afetr startEmit is called. 97 * 97 * 98 98 * @param noHeaders boolean true to suppress headers 99 99 */ … … 120 120 public void startEmit(Writer wtr) throws IOException { 121 121 this.wtr = wtr; 122 122 123 123 if (!noHeaders) { 124 124 mustEmitNS = true; 125 125 126 126 writeHeader(); 127 127 } … … 293 293 } 294 294 295 /** Write a new line 296 * 297 * @throws IOException 298 */ 295 299 public void newline() throws IOException { 296 300 wtr.write("\n"); trunk/calendar3/common/src/edu/rpi/sss/util/xml/XmlUtil.java
r394 r415 300 300 } 301 301 302 /** Strip out the characters causing comparison problems. 302 /* Strip out the characters causing comparison problems. 303 * 304 * @param strVal 305 * @return 303 306 */ 304 307 private static String strip(String strVal) { trunk/calendar3/config/configs/democal.properties
r394 r415 163 163 164 164 org.bedework.app.UserCal.war.name=ucal 165 org.bedework.app.UserCal.deploy.j2ee=false166 165 org.bedework.app.UserCal.ear.name=ucal 167 166 org.bedework.app.UserCal.context.root=ucal trunk/calendar3/config/src/edu/rpi/cct/uwcal/config/optionsApp/AbstractOptionsPanel.java
r2 r415 187 187 188 188 /** Add some help text and increment the row. 189 * 190 * @param resourceName 189 191 */ 190 192 protected void showHelpText(String resourceName) { … … 208 210 209 211 /** Add some text and increment the row. 212 * 213 * @param resourceName 210 214 */ 211 215 protected void showTitleText(String resourceName) { … … 229 233 230 234 /** Add a label and separator and increment the row. 235 * 236 * @param titleName 231 237 */ 232 238 protected void addSeparator(String titleName) { … … 273 279 * 274 280 * <p>Otherwise we just create a checkbox to hold the property value. 281 * 282 * @param resourceName 283 * @param advancedField 284 * @return OptionsCheckBox 275 285 */ 276 286 protected OptionsCheckBox checkBox(String resourceName, boolean advancedField) { … … 323 333 * 324 334 * <p>Otherwise we just create a checkbox to hold the property value. 335 * 336 * @param resourceName 337 * @param advancedField 338 * @return OptionsTextField 325 339 */ 326 340 protected OptionsTextField textField(String resourceName, boolean advancedField) { trunk/calendar3/config/src/org/bedework/webconfig/Defs.java
r307 r415 62 62 /** This prefix never changes */ 63 63 public static final String envPrefix = "org.bedework.app.bwconfig."; 64 64 65 /* Types of application */ 66 /** */ 65 67 public static final String webconfigType = "webconfig"; 68 /** */ 66 69 public static final String webadminType = "webadmin"; 70 /** */ 67 71 public static final String webpublicType = "webpublic"; 72 /** */ 68 73 public static final String webuserType = "webuser"; 74 /** */ 69 75 public static final String publiccaldavType = "publiccaldav"; 76 /** */ 70 77 public static final String usercaldavType = "usercaldav"; 71 78 72 79 /** Valid types of application */ 73 80 public static final String[] appTypes = { … … 79 86 usercaldavType 80 87 }; 81 88 82 89 /** */ 83 90 public static final String modulesCollectionName = "modules"; 84 91 85 92 /** Default properties file (built in to application) */ 86 //public final static String defaultProperties = "/properties/calendar/default-bedework.properties"; 87 93 //public final static String defaultProperties = "/properties/calendar/default-bedework.properties"; 94 88 95 /* Types for properties */ 89 96 90 97 /** String property */ 91 98 public final static int typeString = 0; 92 99 93 100 /** Int property */ 94 101 public final static int typeInt = 1; 95 102 96 103 /** boolean property */ 97 104 public final static int typeBoolean = 2; 98 105 99 106 /** Choice property, i.e. One of n (radio) */ 100 public final static int typeChoice = 3; 101 107 public final static int typeChoice = 3; 108 102 109 /** Multi-value property - radio or select */ 103 public final static int typeMultiple = 4; 104 110 public final static int typeMultiple = 4; 111 105 112 /** Comment */ 106 public final static int typeComment = 5; 113 public final static int typeComment = 5; 107 114 } trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpersonal.java
r307 r415 62 62 /** Constructor 63 63 * 64 * @param onlyIf BooleanProperty - display collection only if true64 * @param name String name of application 65 65 * @throws Throwable 66 66 */ trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpublic.java
r307 r415 62 62 /** Constructor 63 63 * 64 * @param onlyIf BooleanProperty - display collection only if true64 * @param name String name of application 65 65 * @throws Throwable 66 66 */ trunk/calendar3/config/src/org/bedework/webconfig/collections/ConfigCollection.java
r307 r415 165 165 return properties; 166 166 } 167 167 168 168 /** Add a required boolean property to the collection 169 169 * … … 176 176 BooleanProperty prop = new BooleanProperty(name, suffix, true); 177 177 addProperty(prop); 178 179 return prop; 180 } 181 178 179 return prop; 180 } 181 182 182 /** Add a hidden boolean property to the collection 183 183 * … … 191 191 prop.setHidden(true); 192 192 addProperty(prop); 193 194 return prop; 195 } 196 193 194 return prop; 195 } 196 197 197 /** Add an optional boolean property to the collection 198 198 * … … 205 205 BooleanProperty prop = new BooleanProperty(name, suffix, false); 206 206 addProperty(prop); 207 208 return prop; 209 } 210 207 208 return prop; 209 } 210 211 211 /** Add a required int property to the collection 212 212 * … … 219 219 IntProperty prop = new IntProperty(name, suffix, true); 220 220 addProperty(prop); 221 222 return prop; 223 } 224 221 222 return prop; 223 } 224 225 225 /** Add a required text property to the collection 226 226 * … … 233 233 ConfigProperty prop = new ConfigProperty(name, suffix, true); 234 234 addProperty(prop); 235 236 return prop; 237 } 238 235 236 return prop; 237 } 238 239 239 /** Add a hidden text property to the collection 240 240 * … … 248 248 prop.setHidden(true); 249 249 addProperty(prop); 250 251 return prop; 252 } 253 250 251 return prop; 252 } 253 254 254 /** Add a required text property to the collection 255 255 * … … 264 264 ConfigProperty prop = new ConfigProperty(name, suffix, true, onlyIf); 265 265 addProperty(prop); 266 267 return prop; 268 } 269 266 267 return prop; 268 } 269 270 270 /** Add a required ordered list property to the collection 271 271 * 272 272 * @param name 273 273 * @param suffix 274 * @return 275 * @throws Throwable 276 */ 277 public OrderedListProperty requiredOrderedList(String name, 274 * @return OrderedListProperty 275 * @throws Throwable 276 */ 277 public OrderedListProperty requiredOrderedList(String name, 278 278 String suffix) throws Throwable { 279 279 OrderedListProperty prop = new OrderedListProperty(name, suffix, true); 280 280 addProperty(prop); 281 282 return prop; 283 } 284 281 282 return prop; 283 } 284 285 285 /** Add a required ordered multi list property to the collection 286 286 * … … 288 288 * @param suffix 289 289 * @param possibleValues String[] array of allowable values 290 * @return 291 * @throws Throwable 292 */ 293 public OrderedMultiListProperty requiredOrderedMultiList(String name, 290 * @return OrderedMultiListProperty 291 * @throws Throwable 292 */ 293 public OrderedMultiListProperty requiredOrderedMultiList(String name, 294 294 String suffix, 295 String[] possibleValues) 295 String[] possibleValues) 296 296 throws Throwable { 297 OrderedMultiListProperty prop = new OrderedMultiListProperty(name, suffix, true, 297 OrderedMultiListProperty prop = new OrderedMultiListProperty(name, suffix, true, 298 298 possibleValues); 299 299 addProperty(prop); 300 301 return prop; 302 } 303 300 301 return prop; 302 } 303 304 304 /** Add a comment to the collection 305 305 * … … 442 442 * ==================================================================== */ 443 443 444 /** 445 * @param o 446 * @return int 447 */ 444 448 public int compareTo(Object o) { 445 449 if (!(o instanceof ConfigCollection)) { trunk/calendar3/config/src/org/bedework/webconfig/collections/Webadmin.java
r307 r415 62 62 /** Constructor 63 63 * 64 * @param onlyIf BooleanProperty - display collection only if true64 * @param name String name of application 65 65 * @throws Throwable 66 66 */ trunk/calendar3/config/src/org/bedework/webconfig/collections/Webconfig.java
r307 r415 62 62 /** Constructor 63 63 * 64 * @param name String name of application 64 65 * @throws Throwable 65 66 */ trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpersonal.java
r307 r415 62 62 /** Constructor 63 63 * 64 * @param onlyIf BooleanProperty - display collection only if true64 * @param name String name of application 65 65 * @throws Throwable 66 66 */ trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpublic.java
r307 r415 62 62 /** Constructor 63 63 * 64 * @param onlyIf BooleanProperty - display collection only if true64 * @param name String name of application 65 65 * @throws Throwable 66 66 */ trunk/calendar3/config/src/org/bedework/webconfig/props/CommentProperty.java
r302 r415 64 64 * giving a property name of "org.bedework.webadmin.app.root" 65 65 * 66 * <p>A comment propert is just that - text to be inserted as a comment in the 66 * <p>A comment propert is just that - text to be inserted as a comment in the 67 67 * resulting properties file. 68 * 68 * 69 69 * @author Mike Douglass 70 70 */ … … 74 74 /** Constructor 75 75 * 76 * @param val ueString76 * @param val String 77 77 */ 78 78 public CommentProperty(String val) { trunk/calendar3/deployment/src/org/bedework/deployment/ApplicationXmlTask.java
r269 r415 89 89 90 90 private File warDir; 91 91 92 92 private String displayName; 93 93 … … 95 95 private Writer wtr; 96 96 97 /** Add a fileset 98 * 99 * @param set 100 */ 97 101 public void addFileset(FileSet set) { 98 102 filesets.add(set); … … 128 132 try { 129 133 getModules(); 130 134 131 135 FileUtils.newFileUtils().createNewFile(outFile, true); 132 136 133 137 wtr = new FileWriter(outFile); 134 138 … … 173 177 throw new BuildException(t); 174 178 } 175 } 179 } 176 180 177 181 /* Scan the filesets and extract files that end with ".jar" and directories … … 189 193 throw new BuildException("No wardir supplied"); 190 194 } 191 195 192 196 String[] warnames = warDir.list(fltr); 193 197 for (int wi = 0; wi < warnames.length; wi++) { 194 198 wars.add(warnames[wi]); 195 199 } 196 200 197 201 Iterator it = filesets.iterator(); 198 202 trunk/calendar3/dumprestore/src/org/bedework/dumprestore/dump/dumpling/Dumpling.java
r50 r415 226 226 227 227 /** Anything for which toString() works OK 228 * 229 * @param name 230 * @param val 231 * @throws Throwable 228 232 */ 229 233 protected void taggedVal(String name, Object val) throws Throwable { trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/Restore.java
r260 r415 116 116 * =================================================================== */ 117 117 118 /** 119 * @throws Throwable 120 */ 118 121 void open() throws Throwable { 119 122 if (globals.rintf == null) { … … 168 171 169 172 /** Called to finish off by writing out prefs. 173 * 174 * @throws Throwable 170 175 */ 171 176 private void makePrefs() throws Throwable { … … 247 252 * @param user BwUser object 248 253 * @param cal BwCalendar object 254 * @param display 255 * @param freeBusy 249 256 * @param publicCalendar 250 257 * @throws Throwable trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/RestoreGlobals.java
r260 r415 106 106 public boolean debug; 107 107 108 /** Map user with id of zero on to this id - fixes oversight */ 108 109 public static int mapUser0 = 1; 109 110 110 111 /** */ 111 112 public boolean debugEntity; … … 240 241 public int alarms; 241 242 242 /** If true we should discard all but users in onlyUsers 243 /** If true we should discard all but users in onlyUsers 243 244 * This helps when building demo data 244 245 */ … … 247 248 /** Users we preserve */ 248 249 public HashMap onlyUsersMap = new HashMap(); 249 250 250 251 /** counter */ 251 252 public static class SubscriptionsMap extends HashMap { … … 401 402 val.setId(id); 402 403 } 403 404 404 405 Integer keyid = new Integer(id); 405 406 if (get(keyid) != null) { trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/EntityFieldRule.java
r247 r415 250 250 field(name); 251 251 } 252 252 253 253 protected String fixedDateTimeFld() throws Exception { 254 254 String dtVal = stringFld(); 255 if ((dtVal.length() == 8) || 255 if ((dtVal.length() == 8) || 256 256 ((dtVal.charAt(13) == '0') && (dtVal.charAt(14) == '0'))) { 257 257 return dtVal; 258 258 } 259 259 260 260 String prefix = dtVal.substring(0, 13); 261 262 if (dtVal.length() == 16) { 263 return prefix + "00Z"; 261 262 if (dtVal.length() == 16) { 263 return prefix + "00Z"; 264 264 } 265 266 return prefix + "00"; 267 } 268 269 /** prehib to hib */ 265 266 return prefix + "00"; 267 } 268 269 /** prehib to hib 270 * 271 * @return BwDateTime 272 * @throws Exception 273 */ 270 274 protected BwDateTime dateFld() throws Exception { 271 275 if (fldval == null) { … … 295 299 } 296 300 297 /** prehib to hib */ 301 /** prehib to hib 302 * 303 * @param val 304 * @throws Exception 305 */ 298 306 protected void makeDateTimeFld(BwDateTime val) throws Exception { 299 307 if (fldval == null) { … … 327 335 } 328 336 329 /** Make an iso date time -- prehib to hib */ 337 /** Make an iso date time -- prehib to hib 338 * 339 * @return String 340 * @throws Exception 341 */ 330 342 protected String isoDateTimeFld() throws Exception { 331 343 if (fldval == null) { trunk/calendar3/dumprestore/src/org/bedework/dumprestore/restore/rules/FilterRule.java
r171 r415 188 188 } 189 189 190 /* *There are restrictions on what is valid in calendar names.190 /* There are restrictions on what is valid in calendar names. 191 191 */ 192 192 private String fixName(String val) { trunk/calendar3/icalendar/src/org/bedework/icalendar/BwEventUtil.java
r298 r415 142 142 */ 143 143 public static EventInfo toEvent(IcalCallback cb, 144 BwCalendar cal, 144 BwCalendar cal, 145 145 Collection evs, 146 146 VEvent val, … … 236 236 * expansions etc. 237 237 */ 238 Collection eis = cb.getEvent(cal, guid, rid, 238 Collection eis = cb.getEvent(cal, guid, rid, 239 239 CalFacadeDefs.retrieveRecurMaster); 240 240 if ((eis == null) || (eis.size() == 0)) { … … 795 795 }*/ 796 796 797 /* *Try to build a location from the supplied string. This only works if797 /* Try to build a location from the supplied string. This only works if 798 798 * the delimiters and keywords remain intact. 799 799 * … … 808 808 } 809 809 810 /* *Try to build a contact from the supplied string. This only works if810 /* Try to build a contact from the supplied string. This only works if 811 811 * the delimiters and keywords remain intact. 812 812 */ trunk/calendar3/icalendar/src/org/bedework/icalendar/VEventUtil.java
r310 r415 456 456 } 457 457 458 /* *Return the highest possible start date from this recurrence or null458 /* Return the highest possible start date from this recurrence or null 459 459 * if no count or until date specified 460 460 */ trunk/calendar3/test/src/org/bedework/httpunit/utils/TestUtils.java
r2 r415 347 347 } 348 348 349 /* *Get a logger for messages349 /* Get a logger for messages 350 350 */ 351 351 private Logger getLogger() { trunk/calendar3/test/src/org/bedework/tests/calsvc/CalSvcTest.java
r2 r415 143 143 * 144 144 * @param n int number of locations 145 * @param user 145 146 * @return int key of first added (remainder should follow) 147 * @throws Throwable 146 148 */ 147 149 private int addLocations(int n, … … 175 177 * 176 178 * @param n int number of sponsors 179 * @param user 177 180 * @return int key of first added (remainder should follow) 181 * @throws Throwable 178 182 */ 179 183 private int addSponsors(int n, … … 240 244 * @param locn int first location id 241 245 * @param spn int first sponsor id 246 * @param user 242 247 * @param desc some identifying text 243 248 * @return int key of first added (remainder should follow) 249 * @throws Throwable 244 250 */ 245 251 private int addEvents(int n, int locn, int spn, trunk/calendar3/timers/src/org/bedework/timers/AlarmTask.java
r2 r415 230 230 } 231 231 232 /* *Get a logger for messages232 /* Get a logger for messages 233 233 */ 234 234 private Logger getLogger() { trunk/calendar3/timers/src/org/bedework/timers/Timers.java
r2 r415 233 233 } 234 234 235 /* *Get a logger for messages235 /* Get a logger for messages 236 236 */ 237 237 private Logger getLogger() { trunk/calendar3/timers/src/org/bedework/timers/service/DbPollerTimerService.java
r301 r415 138 138 private void init() throws Throwable { 139 139 svci = new CalSvc(); 140 CalSvcIPars pars = new CalSvcIPars(account, 140 CalSvcIPars pars = new CalSvcIPars(account, 141 141 account, 142 142 null, // XXX needs envPrefix … … 166 166 } 167 167 168 /* *Get a logger for messages168 /* Get a logger for messages 169 169 */ 170 170 private Logger getLogger() { trunk/calendar3/webadmin/src/org/bedework/webadmin/event/PEUpdateEventAction.java
r365 r415 219 219 * the form. 220 220 * 221 * @param form 222 * @param svci 223 * @param event 224 * @param err 221 225 * @return boolean true OK, false not OK and message(s) emitted. 226 * @throws Throwable 222 227 */ 223 228 private boolean validateEventCalendar(PEActionForm form, CalSvcI svci, … … 258 263 /** 259 264 * 265 * @param form 266 * @param svci 267 * @param event 268 * @param err 260 269 * @return boolean false means something wrong, message emitted 261 270 * @throws Throwable … … 307 316 * the form. 308 317 * 318 * @param form 319 * @param svci 320 * @param event 321 * @param err 309 322 * @return boolean true OK, false not OK and message(s) emitted. 310 323 * @throws Throwable … … 359 372 * the form. 360 373 * 374 * @param form 375 * @param svci 376 * @param event 377 * @param err 361 378 * @return boolean true OK, false not OK and message(s) emitted. 362 379 * @throws Throwable trunk/calendar3/webclient/src/org/bedework/webclient/BwMailEventAction.java
r55 r415 124 124 * @param name name for attachment 125 125 * @param type mimetype for attachment 126 * @param form 127 * @throws Throwable 126 128 */ 127 129 private void mailMessage(Message val, trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java
r409 r415 52 52 to the maximum extent the law permits. 53 53 */ 54 55 54 package org.bedework.webcommon; 56 55 … … 314 313 * @param emitError Emit error messages for missing request par. 315 314 * @return boolean true there was a subname parameter 315 * @param cloneIt true if we should clone the result 316 316 * @throws Throwable 317 317 */ … … 605 605 * otherwise this is an explicit request to change group. 606 606 * @return String forward name 607 * @throws Throwable 607 608 */ 608 609 protected String checkGroup(HttpServletRequest request, … … 1257 1258 * @param loc LocationVO object 1258 1259 * @param cal 1259 * @throws CalFacadeException1260 * @throws Throwable 1260 1261 */ 1261 1262 protected void updateAuthPrefs(BwActionFormBase form, trunk/calendar3/webcommon/src/org/bedework/webcommon/TimeDateComponents.java
r257 r415 278 278 } 279 279 280 /** Sets this object's current date to now. 280 /** Sets this object's current date to now. 281 281 */ 282 282 public void setNow() { … … 584 584 } 585 585 586 /* *Get a logger for messages586 /* Get a logger for messages 587 587 */ 588 588 private Logger getLogger() { trunk/calendar3/webcommon/src/org/bedework/webcommon/calendars/UpdateCalendarAction.java
r408 r415 162 162 } 163 163 164 /* *Validate a calendar - we do not create these as a side effect.164 /* Validate a calendar - we do not create these as a side effect. 165 165 * 166 166 * @return boolean false means something wrong, message emitted trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/BaseTag.java
r336 r415 74 74 * found. 75 75 * @return Object null if none found. 76 * @throws JspTagException 76 77 */ 77 78 protected Object getObject(String name, String scope, … … 107 108 * found. 108 109 * @return int 0 if none found. 110 * @throws JspTagException 109 111 */ 110 112 protected int getInt(String name, String scope, … … 127 129 * @param scopeName String - same as struts values 128 130 * @return int value defined in PageContext 131 * @throws JspTagException 129 132 */ 130 133 protected int getScope(String scopeName) throws JspTagException { trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/EmitCurrentPrivsTag.java
r320 r415 76 76 /** Optional attribute: name of outer tag */ 77 77 private String tagName; 78 78 79 79 /** 80 80 * Constructor … … 82 82 public EmitCurrentPrivsTag() { 83 83 } 84 84 85 85 /** Called at end of Tag 86 86 * … … 97 97 tagName = property; 98 98 } 99 99 100 100 // Assume we're indented for the first tag 101 101 out.print('<'); … … 116 116 return EVAL_PAGE; 117 117 } 118 118 119 119 private String getXmlAccess(CurrentAccess ca) throws Throwable { 120 120 if (ca == null) { 121 121 return null; 122 122 } 123 123 124 124 return AccessAppUtil.getCurrentPrivSetString(ca.privileges); 125 125 } 126 126 127 /** 128 * @param val String name 129 */ 127 130 public void setTagName(String val) { 128 131 tagName = val; 129 132 } 130 133 134 /** 135 * @return String name 136 */ 131 137 public String getTagName() { 132 138 return tagName; trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/EmitTextTag.java
r320 r415 75 75 private String tagName; 76 76 77 /** Optional attribute: for those who like tidy xml 77 /** Optional attribute: for those who like tidy xml 78 78 * If specified we add teh value after a new line. */ 79 79 private String indent = null; 80 80 81 81 private boolean filter = true; 82 82 83 83 /** 84 84 * Constructor … … 86 86 public EmitTextTag() { 87 87 } 88 88 89 89 /** Called at end of Tag 90 90 * … … 101 101 tagName = property; 102 102 } 103 103 104 104 // Assume we're indented for the first tag 105 105 out.print('<'); 106 106 out.print(tagName); 107 107 108 108 if (indent != null) { 109 109 out.println('>'); … … 135 135 } 136 136 137 /** 138 * @param val String name 139 */ 137 140 public void setTagName(String val) { 138 141 tagName = val; 139 142 } 140 143 144 /** 145 * @return String name 146 */ 141 147 public String getTagName() { 142 148 return tagName; 143 149 } 144 150 151 /** 152 * @param val String indent 153 */ 145 154 public void setIndent(String val) { 146 155 indent = val; 147 156 } 148 157 158 /** 159 * @return String indent 160 */ 149 161 public String getIndent() { 150 162 return indent; 151 163 } 152 164 165 /** Should we filter output for html? 166 * 167 * @param val boolean 168 */ 153 169 public void setFilter(boolean val) { 154 170 filter = val; 155 171 } 156 172 173 /** Should we filter output for html? 174 * 175 * @return boolean 176 */ 157 177 public boolean getFilter() { 158 178 return filter; 159 179 } 160 180 161 181 private String formatted(String val) { 162 182 if (filter) { 163 183 return TagUtils.getInstance().filter(val); 164 184 } 165 185 166 186 return val; 167 187 } trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/NameScopePropertyTag.java
r312 r415 66 66 String property; 67 67 68 /** 69 * @param val 70 */ 68 71 public void setProperty(String val) { 69 72 property = val; 70 73 } 71 74 75 /** 76 * @return String 77 */ 72 78 public String getProperty() { 73 79 return property; … … 79 85 * found. 80 86 * @return Object null if none found. 87 * @throws JspTagException 81 88 */ 82 89 protected Object getObject(boolean required) throws JspTagException { … … 89 96 * found. 90 97 * @return String null if none found. 98 * @throws JspTagException 91 99 */ 92 100 protected String getString(boolean required) throws JspTagException { trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/NameScopeTag.java
r312 r415 64 64 String scope; 65 65 66 /** 67 * @param val 68 */ 66 69 public void setScope(String val) { 67 70 scope = val; 68 71 } 69 72 73 /** 74 * @return String 75 */ 70 76 public String getScope() { 71 77 return scope; … … 78 84 * found. 79 85 * @return Object null if none found. 86 * @throws JspTagException 80 87 */ 81 88 protected Object getObject(String property, boolean required) … … 90 97 * found. 91 98 * @return int 0 if none found. 99 * @throws JspTagException 92 100 */ 93 101 protected int getInt(String property, boolean required) trunk/calendar3/webcommon/src/org/bedework/webcommon/taglib/NameTag.java
r312 r415 55 55 56 56 /** Tag with a name attribute 57 * 57 * 58 58 * @author Mike Douglass 59 59 * … … 63 63 String name; 64 64 65 /** 66 * @param val 67 */ 65 68 public void setName(String val) { 66 69 name = val; 67 70 } 68 71 72 /** 73 * @return String name 74 */ 69 75 public String getName() { 70 76 return name;
