Changeset 490
- Timestamp:
- 05/18/06 09:59:01
- Files:
-
- trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Acl.java (modified) (2 diffs)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CDMkcolMethod.java (deleted)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavBWIntf.java (modified) (1 diff)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavBWServlet.java (modified) (1 diff)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/MkcalendarMethod.java (added)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/ReportMethod.java (modified) (1 diff)
- trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/calquery/FreeBusyQuery.java (modified) (3 diffs)
- trunk/calendar3/caldav/src/edu/rpi/cct/webdav/servlet/common/MethodBase.java (modified) (1 diff)
- trunk/calendar3/caldav/src/edu/rpi/cct/webdav/servlet/common/MkcolMethod.java (modified) (3 diffs)
- trunk/calendar3/caldav/src/edu/rpi/cct/webdav/servlet/common/PropPatchMethod.java (modified) (2 diffs)
- trunk/calendar3/caldav/src/edu/rpi/cct/webdav/servlet/common/Property.java (added)
- trunk/calendar3/caldavClientApi/src/org/bedework/caldav/client/api/CaldavClientIo.java (modified) (1 diff)
- trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java (modified) (1 diff)
- trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java (modified) (1 diff)
- trunk/calendar3/davdefs/src/org/bedework/davdefs/WebdavTags.java (modified) (6 diffs)
- trunk/calendar3/freebusyServer/src/org/bedework/freebusyServer/FreeBusyAggregator.java (modified) (1 diff)
- trunk/calendar3/http/src/org/bedework/http/client/caldav/CaldavClient.java (modified) (1 diff)
- trunk/calendar3/http/src/org/bedework/http/client/caldav/MkColMethod.java (added)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/subs/EndSubscribeAction.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/access/src/edu/rpi/cct/uwcal/access/Acl.java
r484 r490 54 54 package edu.rpi.cct.uwcal.access; 55 55 56 import java.io.Serializable; 56 57 import java.util.Collection; 57 58 import java.util.Iterator; … … 121 122 /** Result of evaluating access to an object for a principal 122 123 */ 123 public static class CurrentAccess {124 public static class CurrentAccess implements Serializable { 124 125 /** The Acl used to evaluate the access. We should not necessarily 125 126 * make this available to the client. trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavBWIntf.java
r472 r490 1230 1230 getSvci(); 1231 1231 1232 BwFreeBusy fb = freeBusy.getFreeBusy(svci, user); 1232 BwFreeBusy fb = freeBusy.getFreeBusy(svci, cnode.getCDURI().getCal(), 1233 user); 1233 1234 1234 1235 cnode.setFreeBusy(fb); trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/CaldavBWServlet.java
r310 r490 106 106 107 107 // Replace methods 108 methods.put("MKCALENDAR", new CDMkcolMethod());108 methods.put("MKCALENDAR", new MkcalendarMethod()); 109 109 methods.put("REPORT", new ReportMethod()); 110 110 } trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/ReportMethod.java
r472 r490 332 332 } 333 333 334 return HttpServletResponse.SC_INTERNAL_SERVER_ERROR;334 throw new WebdavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); 335 335 } 336 336 } trunk/calendar3/caldav/src/edu/rpi/cct/uwcal/caldav/calquery/FreeBusyQuery.java
r484 r490 55 55 package edu.rpi.cct.uwcal.caldav.calquery; 56 56 57 import org.bedework.calfacade.BwCalendar; 57 58 import org.bedework.calfacade.BwFreeBusy; 58 59 import org.bedework.calfacade.BwUser; … … 124 125 /** 125 126 * @param svci 127 * @param cal 126 128 * @param account 127 129 * @return BwFreeBusy 128 130 * @throws WebdavException 129 131 */ 130 public BwFreeBusy getFreeBusy(CalSvcI svci, String account) throws WebdavException { 132 public BwFreeBusy getFreeBusy(CalSvcI svci, BwCalendar cal, 133 String account) throws WebdavException { 131 134 try { 132 135 BwUser user = svci.findUser(account); … … 134 137 throw WebdavIntfException.unauthorized(); 135 138 } 136 BwFreeBusy fb = svci.getFreeBusy( null, user,139 BwFreeBusy fb = svci.getFreeBusy(cal, user, 137 140 timeRange.getStart(), timeRange.getEnd(), 138 141 null, false); trunk/calendar3/caldav/src/edu/rpi/cct/webdav/servlet/common/MethodBase.java
r418 r490 513 513 } 514 514 515 protected String getElementContent(Element el) throws WebdavException { 516 try { 517 return XmlUtil.getElementContent(el); 518 } catch (Throwable t) { 519 if (debug) { 520 getLogger().error(this, t); 521 } 522 523 throw new WebdavException(t); 524 } 525 } 526 515 527 /* ==================================================================== 516 528 * XmlEmit wrappers trunk/calendar3/caldav/src/edu/rpi/cct/webdav/servlet/common/MkcolMethod.java
r2 r490 79 79 } 80 80 81 /* Parse any content */81 /* Parse any content 82 82 Document doc = parseContent(req, resp); 83 83 */ 84 84 /* Create the node */ 85 85 String resourceUri = getResourceUri(req); … … 89 89 getNsIntf().makeCollection(req, node); 90 90 91 /* 91 92 if (doc != null) { 92 93 int st = processDoc(req, doc); … … 97 98 } 98 99 } 100 */ 99 101 100 102 resp.setStatus(HttpServletResponse.SC_CREATED); trunk/calendar3/caldav/src/edu/rpi/cct/webdav/servlet/common/PropPatchMethod.java
r2 r490 55 55 package edu.rpi.cct.webdav.servlet.common; 56 56 57 import org.bedework.davdefs.WebdavTags; 58 59 import edu.rpi.cct.webdav.servlet.shared.WebdavBadRequest; 57 60 import edu.rpi.cct.webdav.servlet.shared.WebdavException; 61 62 import java.util.ArrayList; 63 import java.util.Collection; 58 64 59 65 import javax.servlet.http.HttpServletRequest; 60 66 import javax.servlet.http.HttpServletResponse; 67 68 import org.w3c.dom.Element; 61 69 62 70 /** Class called to handle PROPPATCH … … 74 82 75 83 } 84 85 /** List of properties to set 86 * 87 */ 88 public static class PropertySetList extends ArrayList { 89 } 90 91 /** List of properties to remove 92 * 93 */ 94 public static class PropertyRemoveList extends ArrayList { 95 } 96 97 /** The given node should contain zero or more set or remove child elements. 98 * 99 * <p>Each set element should contain zero or more property tags with values. 100 * 101 * <p>Each remove element should contain zero or more empty property tags. 102 * 103 * <p>The returned Collection contains zero or more PropertySetList or 104 * PropertyRemoveList entries. 105 * 106 * @param node 107 * @return Collection 108 * @throws WebdavException 109 */ 110 protected Collection processUpdate(Element node) throws WebdavException { 111 ArrayList res = new ArrayList(); 112 113 try { 114 Element[] children = getChildren(node); 115 116 for (int i = 0; i < children.length; i++) { 117 Element curnode = children[i]; 118 Collection plist; 119 120 if (nodeMatches(curnode, WebdavTags.set)) { 121 plist = new PropertySetList(); 122 123 processPlist(plist, curnode, false); 124 } else if (nodeMatches(curnode, WebdavTags.remove)) { 125 plist = new PropertySetList(); 126 127 processPlist(plist, curnode, true); 128 } else { 129 throw new WebdavBadRequest(); 130 } 131 132 res.add(plist); 133 } 134 } catch (WebdavException wde) { 135 throw wde; 136 } catch (Throwable t) { 137 System.err.println(t.getMessage()); 138 if (debug) { 139 t.printStackTrace(); 140 } 141 142 throw new WebdavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); 143 } 144 145 return res; 146 } 147 148 /* Process the node which should contain either empty elements for remove or 149 * elements with or without values for remove==false 150 */ 151 private void processPlist(Collection plist, Element node, 152 boolean remove) throws WebdavException { 153 Element[] props = getChildren(node); 154 155 for (int i = 0; i < props.length; i++) { 156 Element prop = props[i]; 157 158 String ns = prop.getNamespaceURI(); 159 String nm = prop.getLocalName(); 160 String value = getElementContent(prop); 161 162 if (remove && (value != null)) { 163 throw new WebdavBadRequest(); 164 } 165 166 plist.add(new Property(ns, nm, value)); 167 168 if (debug) { 169 trace("reqtype: " + nm + " ns: " + ns + " value: " + value); 170 } 171 } 172 } 76 173 } 77 174 trunk/calendar3/caldavClientApi/src/org/bedework/caldav/client/api/CaldavClientIo.java
r483 r490 64 64 import org.apache.commons.httpclient.HostConfiguration; 65 65 import org.apache.commons.httpclient.HttpMethod; 66 import org.apache.commons.httpclient.URI;67 66 import org.apache.commons.httpclient.protocol.Protocol; 68 67 import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; trunk/calendar3/calsvc/src/org/bedework/calsvc/CalSvc.java
r487 r490 1033 1033 Collection subs; 1034 1034 1035 /* See if the calendar is a user root. */ 1036 1037 if (cal != null) { 1038 String[] ss = cal.getPath().split("/"); 1039 int pathLength = ss.length - 1; // First element is empty string 1040 1041 if ((pathLength == 2) && 1042 (ss[1].equals(getSyspars().getUserCalendarRoot()))) { 1043 cal = null; 1044 } 1045 } 1046 1035 1047 if (cal != null) { 1036 1048 getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); trunk/calendar3/calsvci/src/org/bedework/calsvci/CalSvcI.java
r439 r490 811 811 * events fall in the segment. 812 812 * 813 * @param cal Calendar to provide free-busy for. Null for default814 * collection (as specified by user).813 * @param cal Calendar to provide free-busy for. Null or the user root 814 * for default collection (as specified by user). 815 815 * @param who 816 816 * @param start trunk/calendar3/davdefs/src/org/bedework/davdefs/WebdavTags.java
r310 r490 298 298 299 299 /** */ 300 public static final QName prop = new QName(namespace, 301 "prop"); 302 303 /** */ 304 public static final QName property = new QName(namespace, 305 "property"); 300 public static final QName prop = new QName(namespace, "prop"); 301 302 /** */ 303 public static final QName property = new QName(namespace, "property"); 306 304 307 305 /** */ … … 310 308 311 309 /** */ 312 public static final QName propname = new QName(namespace, 313 "propname"); 314 315 /** */ 316 public static final QName propstat = new QName(namespace, 317 "propstat"); 310 public static final QName propname = new QName(namespace, "propname"); 311 312 /** */ 313 public static final QName propstat = new QName(namespace, "propstat"); 318 314 319 315 /** */ … … 322 318 323 319 /** */ 324 public static final QName read = new QName(namespace, 325 "read"); 326 327 /** */ 328 public static final QName readAcl = new QName(namespace, 329 "read-acl"); 320 public static final QName read = new QName(namespace, "read"); 321 322 /** */ 323 public static final QName readAcl = new QName(namespace, "read-acl"); 330 324 331 325 /** */ … … 338 332 339 333 /** */ 334 public static final QName remove = new QName(namespace, "remove"); 335 336 /** */ 340 337 public static final QName requiredPrincipal = new QName(namespace, 341 338 "required-principal"); … … 350 347 351 348 /** */ 352 public static final QName response = new QName(namespace, 353 "response"); 349 public static final QName response = new QName(namespace, "response"); 354 350 355 351 /** */ … … 358 354 359 355 /** */ 360 public static final QName self = new QName(namespace, 361 "self"); 362 363 /** */364 public static final QName source = new QName(namespace, 365 "source");366 367 /** */ 368 public static final QName status = new QName(namespace,369 "status");356 public static final QName self = new QName(namespace, "self"); 357 358 /** */ 359 public static final QName set = new QName(namespace, "set"); 360 361 /** */ 362 public static final QName source = new QName(namespace, "source"); 363 364 /** */ 365 public static final QName status = new QName(namespace, "status"); 370 366 371 367 /** */ trunk/calendar3/freebusyServer/src/org/bedework/freebusyServer/FreeBusyAggregator.java
r488 r490 31 31 import org.bedework.calfacade.BwUser; 32 32 import org.bedework.calfacade.CalFacadeException; 33 import org.bedework.calfacade.CalFacadeUtil;34 33 import org.bedework.calsvc.CalSvc; 35 34 import org.bedework.calsvci.CalSvcI; trunk/calendar3/http/src/org/bedework/http/client/caldav/CaldavClient.java
r310 r490 78 78 79 79 public void setMethodName(String name, String uri) throws CalFacadeException { 80 if (" REPORT".equals(name)) {81 setMethod(new ReportMethod(uri));80 if ("MKCOL".equals(name)) { 81 setMethod(new MkColMethod(uri)); 82 82 } else if ("PROPFIND".equals(name)) { 83 83 setMethod(new PropFindMethod(uri)); 84 } else if ("REPORT".equals(name)) { 85 setMethod(new ReportMethod(uri)); 84 86 } else { 85 87 super.setMethodName(name, uri); trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java
r487 r490 452 452 * @throws Throwable 453 453 */ 454 /**455 * @param request456 * @param form457 * @return458 * @throws Throwable459 */460 454 protected BwUser findUser(HttpServletRequest request, 461 455 BwActionFormBase form) throws Throwable { trunk/calendar3/webcommon/src/org/bedework/webcommon/subs/EndSubscribeAction.java
r487 r490 54 54 package org.bedework.webcommon.subs; 55 55 56 import org.bedework.calfacade.CalFacadeException;57 56 import org.bedework.calfacade.svc.BwPreferences; 58 57 import org.bedework.calfacade.svc.BwSubscription;
