[Bedework-commit] caldav r302 - in trunk:
boeingexchange/src/edu/rpi/cct/bedework/caldav
bwcaldav/src/org/bedework/caldav/bwserver
domino/src/edu/rpi/cct/bedework/caldav
google/src/edu/rpi/cct/bedework/caldav
server/src/org/bedework/caldav/server
svnadmin at bedework.org
svnadmin at bedework.org
Fri Nov 14 01:38:39 EST 2008
Author: douglm
Date: 2008-11-14 01:38:25 -0500 (Fri, 14 Nov 2008)
New Revision: 302
Removed:
trunk/server/src/org/bedework/caldav/server/CalDavOptionsMethod.java
trunk/server/src/org/bedework/caldav/server/CaldavGroupNode.java
trunk/server/src/org/bedework/caldav/server/CaldavPrincipalNode.java
Modified:
trunk/boeingexchange/src/edu/rpi/cct/bedework/caldav/BexchangeSysIntfImpl.java
trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java
trunk/domino/src/edu/rpi/cct/bedework/caldav/DominoSysIntfImpl.java
trunk/google/src/edu/rpi/cct/bedework/caldav/GoogleSysIntfImpl.java
trunk/server/src/org/bedework/caldav/server/CaldavBWIntf.java
trunk/server/src/org/bedework/caldav/server/CaldavBwNode.java
trunk/server/src/org/bedework/caldav/server/CaldavCalNode.java
trunk/server/src/org/bedework/caldav/server/CaldavComponentNode.java
trunk/server/src/org/bedework/caldav/server/CaldavResourceNode.java
trunk/server/src/org/bedework/caldav/server/CaldavUserNode.java
trunk/server/src/org/bedework/caldav/server/MkcalendarMethod.java
trunk/server/src/org/bedework/caldav/server/SysIntf.java
Log:
1. Move options classes into rpiutil to make them availabkle to other packages.
2. Make changes to the WebDAV classes to facilitate building of extra WebDAV based services (such as CardDAV)
Modified: trunk/boeingexchange/src/edu/rpi/cct/bedework/caldav/BexchangeSysIntfImpl.java
===================================================================
--- trunk/boeingexchange/src/edu/rpi/cct/bedework/caldav/BexchangeSysIntfImpl.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/boeingexchange/src/edu/rpi/cct/bedework/caldav/BexchangeSysIntfImpl.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -644,10 +644,10 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#copyMoveFile(org.bedework.calfacade.BwResource, org.bedework.calfacade.BwCalendar, java.lang.String, boolean, boolean)
+ * @see org.bedework.caldav.server.SysIntf#copyMoveFile(org.bedework.calfacade.BwResource, java.lang.String, java.lang.String, boolean, boolean)
*/
public boolean copyMoveFile(BwResource from,
- BwCalendar to,
+ String toPath,
String name,
boolean copy,
boolean overwrite) throws WebdavException {
Modified: trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java
===================================================================
--- trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -956,15 +956,15 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#copyMoveFile(org.bedework.calfacade.BwResource, org.bedework.calfacade.BwCalendar, java.lang.String, boolean, boolean)
+ * @see org.bedework.caldav.server.SysIntf#copyMoveFile(org.bedework.calfacade.BwResource, java.lang.String, java.lang.String, boolean, boolean)
*/
public boolean copyMoveFile(BwResource from,
- BwCalendar to,
+ String toPath,
String name,
boolean copy,
boolean overwrite) throws WebdavException {
try {
- return getSvci().getResourcesHandler().copyMove(from, to.getPath(), name,
+ return getSvci().getResourcesHandler().copyMove(from, toPath, name,
copy,
overwrite);
} catch (CalFacadeAccessException cfae) {
Modified: trunk/domino/src/edu/rpi/cct/bedework/caldav/DominoSysIntfImpl.java
===================================================================
--- trunk/domino/src/edu/rpi/cct/bedework/caldav/DominoSysIntfImpl.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/domino/src/edu/rpi/cct/bedework/caldav/DominoSysIntfImpl.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -672,10 +672,10 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#copyMoveFile(org.bedework.calfacade.BwResource, org.bedework.calfacade.BwCalendar, java.lang.String, boolean, boolean)
+ * @see org.bedework.caldav.server.SysIntf#copyMoveFile(org.bedework.calfacade.BwResource, java.lang.String, java.lang.String, boolean, boolean)
*/
public boolean copyMoveFile(BwResource from,
- BwCalendar to,
+ String toPath,
String name,
boolean copy,
boolean overwrite) throws WebdavException {
Modified: trunk/google/src/edu/rpi/cct/bedework/caldav/GoogleSysIntfImpl.java
===================================================================
--- trunk/google/src/edu/rpi/cct/bedework/caldav/GoogleSysIntfImpl.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/google/src/edu/rpi/cct/bedework/caldav/GoogleSysIntfImpl.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -614,10 +614,10 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#copyMoveFile(org.bedework.calfacade.BwResource, org.bedework.calfacade.BwCalendar, java.lang.String, boolean, boolean)
+ * @see org.bedework.caldav.server.SysIntf#copyMoveFile(org.bedework.calfacade.BwResource, java.lang.String, java.lang.String, boolean, boolean)
*/
public boolean copyMoveFile(BwResource from,
- BwCalendar to,
+ String toPath,
String name,
boolean copy,
boolean overwrite) throws WebdavException {
Deleted: trunk/server/src/org/bedework/caldav/server/CalDavOptionsMethod.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CalDavOptionsMethod.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/CalDavOptionsMethod.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -1,70 +0,0 @@
-/*
- Copyright (c) 2000-2005 University of Washington. All rights reserved.
-
- Redistribution and use of this distribution in source and binary forms,
- with or without modification, are permitted provided that:
-
- The above copyright notice and this permission notice appear in
- all copies and supporting documentation;
-
- The name, identifiers, and trademarks of the University of Washington
- are not used in advertising or publicity without the express prior
- written permission of the University of Washington;
-
- Recipients acknowledge that this distribution is made available as a
- research courtesy, "as is", potentially with defects, without
- any obligation on the part of the University of Washington to
- provide support, services, or repair;
-
- THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR
- IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION
- ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
- WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING
- NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-/* **********************************************************************
- Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved.
-
- Redistribution and use of this distribution in source and binary forms,
- with or without modification, are permitted provided that:
- The above copyright notice and this permission notice appear in all
- copies and supporting documentation;
-
- The name, identifiers, and trademarks of Rensselaer Polytechnic
- Institute are not used in advertising or publicity without the
- express prior written permission of Rensselaer Polytechnic Institute;
-
- DISCLAIMER: The software is distributed" AS IS" without any express or
- implied warranty, including but not limited to, any implied warranties
- of merchantability or fitness for a particular purpose or any warrant)'
- of non-infringement of any current or pending patent rights. The authors
- of the software make no representations about the suitability of this
- software for any particular purpose. The entire risk as to the quality
- and performance of the software is with the user. Should the software
- prove defective, the user assumes the cost of all necessary servicing,
- repair or correction. In particular, neither Rensselaer Polytechnic
- Institute, nor the authors of the software are liable for any indirect,
- special, consequential, or incidental damages related to the software,
- to the maximum extent the law permits.
-*/
-package org.bedework.caldav.server;
-
-import edu.rpi.cct.webdav.servlet.common.OptionsMethod;
-import edu.rpi.cct.webdav.servlet.shared.WebdavException;
-
-import javax.servlet.http.HttpServletResponse;
-
-/** Add our own dav header
- *
- * @author Mike Douglass douglm at rpi.edu
- *
- */
-public class CalDavOptionsMethod extends OptionsMethod {
- protected void addDavHeader(HttpServletResponse resp) throws WebdavException {
- resp.addHeader("DAV", "1, 2, 3, access-control, calendar-access");
- }
-}
Modified: trunk/server/src/org/bedework/caldav/server/CaldavBWIntf.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavBWIntf.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/CaldavBWIntf.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -33,6 +33,7 @@
import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwEvent;
import org.bedework.calfacade.BwEventObj;
+import org.bedework.calfacade.BwGroup;
import org.bedework.calfacade.BwOrganizer;
import org.bedework.calfacade.BwResource;
import org.bedework.calfacade.BwResourceContent;
@@ -44,7 +45,6 @@
import org.bedework.calfacade.base.BwShareableDbentity;
import org.bedework.calfacade.configs.CalDAVConfig;
import org.bedework.calfacade.env.CalOptionsFactory;
-import org.bedework.calfacade.env.CalOptionsI;
import org.bedework.calfacade.svc.EventInfo;
import org.bedework.calfacade.util.CalFacadeUtil;
import org.bedework.calfacade.util.DateTimeUtil;
@@ -62,9 +62,11 @@
import edu.rpi.cct.webdav.servlet.shared.WebdavBadRequest;
import edu.rpi.cct.webdav.servlet.shared.WebdavException;
import edu.rpi.cct.webdav.servlet.shared.WebdavForbidden;
+import edu.rpi.cct.webdav.servlet.shared.WebdavGroupNode;
import edu.rpi.cct.webdav.servlet.shared.WebdavNotFound;
import edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf;
import edu.rpi.cct.webdav.servlet.shared.WebdavNsNode;
+import edu.rpi.cct.webdav.servlet.shared.WebdavPrincipalNode;
import edu.rpi.cct.webdav.servlet.shared.WebdavProperty;
import edu.rpi.cct.webdav.servlet.shared.WebdavServerError;
import edu.rpi.cct.webdav.servlet.shared.WebdavUnauthorized;
@@ -77,6 +79,7 @@
import edu.rpi.cmt.access.PrivilegeDefs;
import edu.rpi.cmt.access.WhoDefs;
import edu.rpi.cmt.access.AccessXmlUtil.AccessXmlCb;
+import edu.rpi.sss.util.OptionsI;
import edu.rpi.sss.util.xml.XmlEmit;
import edu.rpi.sss.util.xml.XmlUtil;
import edu.rpi.sss.util.xml.tagdefs.CaldavDefs;
@@ -181,8 +184,7 @@
namespacePrefix = WebdavUtils.getUrlPrefix(req);
namespace = namespacePrefix + "/schema";
- CalOptionsI opts = CalOptionsFactory.getOptions("org.bedework.app.",
- debug);
+ OptionsI opts = CalOptionsFactory.getOptions(debug);
config = (CalDAVConfig)opts.getAppProperty(appName);
if (config == null) {
config = new CalDAVConfig();
@@ -228,7 +230,7 @@
* @see edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf#getDavHeader(edu.rpi.cct.webdav.servlet.shared.WebdavNsNode)
*/
public String getDavHeader(WebdavNsNode node) throws WebdavException {
- return "1, access-control, calendar-access, calendar-schedule, calendar-auto-schedule";
+ return super.getDavHeader(node) + ", calendar-access, calendar-schedule, calendar-auto-schedule";
}
protected CalDAVConfig getConfig() {
@@ -413,7 +415,9 @@
if (wi.isUser()) {
nd = new CaldavUserNode(wi, sysi, null, debug);
} else if (wi.isGroup()) {
- nd = new CaldavGroupNode(wi, sysi, debug);
+ nd = new WebdavGroupNode(sysi.getUrlHandler(), wi.getPath(),
+ new BwGroup(wi.getEntityName()),
+ wi.isCollection(), debug);
} else if (wi.isCollection()) {
nd = new CaldavCalNode(wi, sysi, debug);
} else if (wi.isResource()) {
@@ -530,8 +534,8 @@
}
al.add(getNodeInt(uri + "/" + name,
- WebdavNsIntf.existanceDoesExist,
- nodeType, cal, ei, r));
+ WebdavNsIntf.existanceDoesExist,
+ nodeType, cal, ei, r));
}
return al;
@@ -1092,10 +1096,8 @@
return;
}
- BwCalendar toCal = toNode.getCalendar();
-
if (!getSysi().copyMoveFile(from.getResource(),
- toCal, toNode.getEntityName(), copy,
+ toNode.getPath(), toNode.getEntityName(), copy,
overwrite)) {
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
} else {
@@ -1348,10 +1350,10 @@
/* (non-Javadoc)
* @see edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf#getPrincipals(java.lang.String, edu.rpi.cct.webdav.servlet.shared.PrincipalPropertySearch)
*/
- public Collection<CaldavBwNode> getPrincipals(String resourceUri,
+ public Collection<WebdavPrincipalNode> getPrincipals(String resourceUri,
PrincipalPropertySearch pps)
throws WebdavException {
- ArrayList<CaldavBwNode> pnodes = new ArrayList<CaldavBwNode>();
+ ArrayList<WebdavPrincipalNode> pnodes = new ArrayList<WebdavPrincipalNode>();
for (CalUserInfo cui: sysi.getPrincipals(resourceUri, pps)) {
pnodes.add(new CaldavUserNode(new CaldavURI(cui.account,
@@ -1689,7 +1691,7 @@
int depth) throws WebdavException {
try {
BwEvent fb = freeBusy.getFreeBusy(sysi, cnode.getCalendar(),
- cnode.getOwner(),
+ cnode.getOwner().getAccount(),
depth);
cnode.setFreeBusy(fb);
Modified: trunk/server/src/org/bedework/caldav/server/CaldavBwNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavBwNode.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/CaldavBwNode.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -172,7 +172,7 @@
try {
if (tag.equals(CaldavTags.calendarUserAddressSet)) {
xml.openTag(tag);
- xml.property(WebdavTags.href, sysi.userToCaladdr(getOwner()));
+ xml.property(WebdavTags.href, sysi.userToCaladdr(getOwner().getAccount()));
xml.closeTag(tag);
return true;
@@ -180,7 +180,7 @@
if (tag.equals(CaldavTags.calendarHomeSet)) {
xml.openTag(tag);
- generateHref(xml, sysi.getCalUserInfo(getOwner(), false).userHomePath);
+ generateHref(xml, sysi.getCalUserInfo(getOwner().getAccount(), false).userHomePath);
xml.closeTag(tag);
return true;
Modified: trunk/server/src/org/bedework/caldav/server/CaldavCalNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavCalNode.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/CaldavCalNode.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -67,6 +67,7 @@
import edu.rpi.cct.webdav.servlet.shared.WebdavException;
import edu.rpi.cct.webdav.servlet.shared.WebdavForbidden;
import edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf;
+import edu.rpi.cmt.access.AccessPrincipal;
import edu.rpi.cmt.access.PrivilegeDefs;
import edu.rpi.cmt.access.Acl.CurrentAccess;
import edu.rpi.sss.util.xml.XmlEmit;
@@ -172,7 +173,7 @@
/* (non-Javadoc)
* @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getOwner()
*/
- public String getOwner() throws WebdavException {
+ public AccessPrincipal getOwner() throws WebdavException {
if (owner == null) {
if (cal == null) {
return null;
@@ -182,7 +183,7 @@
}
if (owner != null) {
- return owner.getAccount();
+ return owner;
}
return null;
@@ -238,11 +239,11 @@
}
/**
- * @param forMkCalendar
+ * @param methodTag - acts as a flag for the method type
* @throws WebdavException
*/
- public void setDefaults(boolean forMkCalendar) throws WebdavException {
- if (!forMkCalendar) {
+ public void setDefaults(QName methodTag) throws WebdavException {
+ if (!CaldavTags.mkcalendar.equals(methodTag)) {
return;
}
@@ -477,8 +478,6 @@
if (XmlUtil.nodeMatches(val, WebdavTags.resourcetype)) {
Collection<Element> propVals = XmlUtil.getElements(val);
- //boolean schedule = false;
-
for (Element pval: propVals) {
if (XmlUtil.nodeMatches(pval, WebdavTags.collection)) {
// Fine
@@ -489,22 +488,8 @@
// Fine again
continue;
}
-
- if (XmlUtil.nodeMatches(pval, CaldavTags.scheduleCalendar)) {
- //schedule = true;
- continue;
- }
}
- /*
- if (exists) {
- if ((cal.getCalType() == BwCalendar.calTypeSchedulingCollection) != schedule) {
- throw new WebdavBadRequest();
- }
- } else if (schedule) {
- cal.setCalType(BwCalendar.calTypeSchedulingCollection);
- }
- */
return true;
}
Modified: trunk/server/src/org/bedework/caldav/server/CaldavComponentNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavComponentNode.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/CaldavComponentNode.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -69,6 +69,7 @@
import edu.rpi.cct.webdav.servlet.shared.WebdavException;
import edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf;
import edu.rpi.cct.webdav.servlet.shared.WebdavProperty;
+import edu.rpi.cmt.access.AccessPrincipal;
import edu.rpi.cmt.access.Acl.CurrentAccess;
import edu.rpi.sss.util.xml.XmlEmit;
import edu.rpi.sss.util.xml.tagdefs.CaldavTags;
@@ -242,7 +243,7 @@
/* (non-Javadoc)
* @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getOwner()
*/
- public String getOwner() throws WebdavException {
+ public AccessPrincipal getOwner() throws WebdavException {
if (owner == null) {
if (eventInfo == null) {
return null;
@@ -255,7 +256,7 @@
}
if (owner != null) {
- return owner.getAccount();
+ return owner;
}
return null;
Deleted: trunk/server/src/org/bedework/caldav/server/CaldavGroupNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavGroupNode.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/CaldavGroupNode.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -1,128 +0,0 @@
-/* **********************************************************************
- Copyright 2007 Rensselaer Polytechnic Institute. All worldwide rights reserved.
-
- Redistribution and use of this distribution in source and binary forms,
- with or without modification, are permitted provided that:
- The above copyright notice and this permission notice appear in all
- copies and supporting documentation;
-
- The name, identifiers, and trademarks of Rensselaer Polytechnic
- Institute are not used in advertising or publicity without the
- express prior written permission of Rensselaer Polytechnic Institute;
-
- DISCLAIMER: The software is distributed" AS IS" without any express or
- implied warranty, including but not limited to, any implied warranties
- of merchantability or fitness for a particular purpose or any warrant)'
- of non-infringement of any current or pending patent rights. The authors
- of the software make no representations about the suitability of this
- software for any particular purpose. The entire risk as to the quality
- and performance of the software is with the user. Should the software
- prove defective, the user assumes the cost of all necessary servicing,
- repair or correction. In particular, neither Rensselaer Polytechnic
- Institute, nor the authors of the software are liable for any indirect,
- special, consequential, or incidental damages related to the software,
- to the maximum extent the law permits.
-*/
-package org.bedework.caldav.server;
-
-import edu.rpi.cct.webdav.servlet.shared.WebdavException;
-import edu.rpi.cmt.access.Acl.CurrentAccess;
-
-import java.util.Collection;
-
-/** Class to represent a user in caldav. Should only be created in
- response to an incoming url which references principals.
- *
- * @author Mike Douglass douglm at rpi.edu
- */
-public class CaldavGroupNode extends CaldavPrincipalNode {
- /**
- * @param cdURI
- * @param sysi
- * @param debug
- * @throws WebdavException
- */
- public CaldavGroupNode(CaldavURI cdURI, SysIntf sysi,
- boolean debug) throws WebdavException {
- super(cdURI, sysi, debug);
- groupPrincipal = true;
- }
-
- public Collection getChildren() throws WebdavException {
- return null;
- }
-
- /* ====================================================================
- * Abstract methods
- * ==================================================================== */
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getCurrentAccess()
- */
- public CurrentAccess getCurrentAccess() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getEtagValue(boolean)
- */
- public String getEtagValue(boolean strong) throws WebdavException {
- String val = "1234567890";
-
- if (strong) {
- return "\"" + val + "\"";
- }
-
- return "W/\"" + val + "\"";
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#trailSlash()
- */
- public boolean trailSlash() {
- return true;
- }
-
- /* ====================================================================
- * Required webdav properties
- * ==================================================================== */
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getContentLang()
- */
- public String getContentLang() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getContentLen()
- */
- public int getContentLen() throws WebdavException {
- return 0;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getContentType()
- */
- public String getContentType() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getCreDate()
- */
- public String getCreDate() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getLastmodDate()
- */
- public String getLastmodDate() throws WebdavException {
- return null;
- }
-
- /* ====================================================================
- * Private methods
- * ==================================================================== */
-}
Deleted: trunk/server/src/org/bedework/caldav/server/CaldavPrincipalNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavPrincipalNode.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/CaldavPrincipalNode.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -1,274 +0,0 @@
-/*
- Copyright (c) 2000-2005 University of Washington. All rights reserved.
-
- Redistribution and use of this distribution in source and binary forms,
- with or without modification, are permitted provided that:
-
- The above copyright notice and this permission notice appear in
- all copies and supporting documentation;
-
- The name, identifiers, and trademarks of the University of Washington
- are not used in advertising or publicity without the express prior
- written permission of the University of Washington;
-
- Recipients acknowledge that this distribution is made available as a
- research courtesy, "as is", potentially with defects, without
- any obligation on the part of the University of Washington to
- provide support, services, or repair;
-
- THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR
- IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION
- ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
- WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING
- NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-/* **********************************************************************
- Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved.
-
- Redistribution and use of this distribution in source and binary forms,
- with or without modification, are permitted provided that:
- The above copyright notice and this permission notice appear in all
- copies and supporting documentation;
-
- The name, identifiers, and trademarks of Rensselaer Polytechnic
- Institute are not used in advertising or publicity without the
- express prior written permission of Rensselaer Polytechnic Institute;
-
- DISCLAIMER: The software is distributed" AS IS" without any express or
- implied warranty, including but not limited to, any implied warranties
- of merchantability or fitness for a particular purpose or any warrant)'
- of non-infringement of any current or pending patent rights. The authors
- of the software make no representations about the suitability of this
- software for any particular purpose. The entire risk as to the quality
- and performance of the software is with the user. Should the software
- prove defective, the user assumes the cost of all necessary servicing,
- repair or correction. In particular, neither Rensselaer Polytechnic
- Institute, nor the authors of the software are liable for any indirect,
- special, consequential, or incidental damages related to the software,
- to the maximum extent the law permits.
-*/
-
-package org.bedework.caldav.server;
-
-import edu.rpi.cct.webdav.servlet.shared.WebdavException;
-import edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf;
-import edu.rpi.cmt.access.Acl.CurrentAccess;
-import edu.rpi.sss.util.xml.XmlEmit;
-import edu.rpi.sss.util.xml.tagdefs.WebdavTags;
-
-import org.bedework.calfacade.BwCalendar;
-
-import org.w3c.dom.Element;
-
-import java.util.Collection;
-import java.util.HashMap;
-
-import javax.xml.namespace.QName;
-
-/** Class to represent a principal in caldav.
- *
- *
- * @author Mike Douglass douglm at rpi.edu
- */
-public class CaldavPrincipalNode extends CaldavBwNode {
- private String displayName;
-
- private final static HashMap<QName, PropertyTagEntry> propertyNames =
- new HashMap<QName, PropertyTagEntry>();
-
- static {
- addPropEntry(propertyNames, WebdavTags.groupMemberSet);
- addPropEntry(propertyNames, WebdavTags.groupMembership);
- }
-
- /**
- * @param cdURI
- * @param sysi
- * @param debug
- * @throws WebdavException
- */
- public CaldavPrincipalNode(CaldavURI cdURI, SysIntf sysi,
- boolean debug) throws WebdavException {
- super(cdURI, sysi, debug);
- displayName = cdURI.getEntityName();
-// if (displayName.startsWith("/")) {
-// debugMsg(displayName);
-// }
- }
-
- /**
- * @return BwCalendar containing this entity
- */
- public BwCalendar getCalendar() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getOwner()
- */
- public String getOwner() throws WebdavException {
- return displayName;
- }
-
- public Collection getChildren() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#update()
- */
- public void update() throws WebdavException {
- }
-
- /* ====================================================================
- * Abstract methods
- * ==================================================================== */
-
- public CurrentAccess getCurrentAccess() throws WebdavException {
- return null;
- }
-
- public String getEtagValue(boolean strong) throws WebdavException {
- String val = "1234567890";
-
- if (strong) {
- return "\"" + val + "\"";
- }
-
- return "W/\"" + val + "\"";
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#trailSlash()
- */
- public boolean trailSlash() {
- return true;
- }
-
- /* ====================================================================
- * Required webdav properties
- * ==================================================================== */
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getContentLang()
- */
- public String getContentLang() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getContentLen()
- */
- public int getContentLen() throws WebdavException {
- return 0;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getContentType()
- */
- public String getContentType() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getCreDate()
- */
- public String getCreDate() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getDisplayname()
- */
- public String getDisplayname() throws WebdavException {
- return displayName;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getLastmodDate()
- */
- public String getLastmodDate() throws WebdavException {
- return null;
- }
-
- /* ====================================================================
- * Property methods
- * ==================================================================== */
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#removeProperty(org.w3c.dom.Element)
- */
- public boolean removeProperty(Element val,
- SetPropertyResult spr) throws WebdavException {
- warn("Unimplemented - removeProperty");
-
- return false;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#setProperty(org.w3c.dom.Element)
- */
- public boolean setProperty(Element val,
- SetPropertyResult spr) throws WebdavException {
- if (super.setProperty(val, spr)) {
- return true;
- }
-
- return false;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#knownProperty(edu.rpi.sss.util.xml.QName)
- */
- public boolean knownProperty(QName tag) {
- if (propertyNames.get(tag) != null) {
- return true;
- }
-
- // Not ours
- return super.knownProperty(tag);
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#generatePropertyValue(edu.rpi.sss.util.xml.QName, edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf, boolean)
- */
- public boolean generatePropertyValue(QName tag,
- WebdavNsIntf intf,
- boolean allProp) throws WebdavException {
- String ns = tag.getNamespaceURI();
- XmlEmit xml = intf.getXmlEmit();
-
- /* Deal with webdav properties */
- if (!ns.equals(WebdavTags.namespace)) {
- // Not ours
- return super.generatePropertyValue(tag, intf, allProp);
- }
-
- try {
- if (tag.equals(WebdavTags.groupMemberSet)) {
- // PROPTODO
- xml.emptyTag(tag);
- return true;
- }
-
- if (tag.equals(WebdavTags.groupMembership)) {
- // PROPTODO
- xml.emptyTag(tag);
- return true;
- }
-
- // Not known - try higher
- return super.generatePropertyValue(tag, intf, allProp);
- } catch (Throwable t) {
- throw new WebdavException(t);
- }
- }
-
- /* ====================================================================
- * Private methods
- * ==================================================================== */
-}
Modified: trunk/server/src/org/bedework/caldav/server/CaldavResourceNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavResourceNode.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/CaldavResourceNode.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -62,6 +62,7 @@
import org.w3c.dom.Element;
import edu.rpi.cct.webdav.servlet.shared.WebdavException;
+import edu.rpi.cmt.access.AccessPrincipal;
import edu.rpi.cmt.access.PrivilegeDefs;
import edu.rpi.cmt.access.Acl.CurrentAccess;
@@ -159,7 +160,7 @@
/* (non-Javadoc)
* @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getOwner()
*/
- public String getOwner() throws WebdavException {
+ public AccessPrincipal getOwner() throws WebdavException {
if (owner == null) {
if (resource == null) {
return null;
@@ -169,7 +170,7 @@
}
if (owner != null) {
- return owner.getAccount();
+ return owner;
}
return null;
Modified: trunk/server/src/org/bedework/caldav/server/CaldavUserNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavUserNode.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/CaldavUserNode.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -1,33 +1,5 @@
-/*
- Copyright (c) 2000-2005 University of Washington. All rights reserved.
-
- Redistribution and use of this distribution in source and binary forms,
- with or without modification, are permitted provided that:
-
- The above copyright notice and this permission notice appear in
- all copies and supporting documentation;
-
- The name, identifiers, and trademarks of the University of Washington
- are not used in advertising or publicity without the express prior
- written permission of the University of Washington;
-
- Recipients acknowledge that this distribution is made available as a
- research courtesy, "as is", potentially with defects, without
- any obligation on the part of the University of Washington to
- provide support, services, or repair;
-
- THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR
- IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION
- ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
- WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING
- NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
- THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
/* **********************************************************************
- Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved.
+ Copyright 2008 Rensselaer Polytechnic Institute. All worldwide rights reserved.
Redistribution and use of this distribution in source and binary forms,
with or without modification, are permitted provided that:
@@ -54,9 +26,11 @@
package org.bedework.caldav.server;
+import org.bedework.calfacade.BwUser;
+
import edu.rpi.cct.webdav.servlet.shared.WebdavException;
import edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf;
-import edu.rpi.cmt.access.Acl.CurrentAccess;
+import edu.rpi.cct.webdav.servlet.shared.WebdavUserNode;
import edu.rpi.sss.util.xml.XmlEmit;
import edu.rpi.sss.util.xml.tagdefs.CaldavDefs;
import edu.rpi.sss.util.xml.tagdefs.CaldavTags;
@@ -70,9 +44,9 @@
/** Class to represent a user in caldav.
*
*
- * @author Mike Douglass douglm at rpi.edu
+ * @author Mike Douglass douglm rpi.edu
*/
-public class CaldavUserNode extends CaldavPrincipalNode {
+public class CaldavUserNode extends WebdavUserNode {
private SysIntf.CalUserInfo ui;
private final static HashMap<QName, PropertyTagEntry> propertyNames =
@@ -92,96 +66,21 @@
public CaldavUserNode(CaldavURI cdURI, SysIntf sysi,
SysIntf.CalUserInfo ui,
boolean debug) throws WebdavException {
- super(cdURI, sysi, debug);
+ super(sysi.getUrlHandler(), cdURI.getPath(),
+ new BwUser(cdURI.getEntityName()),
+ cdURI.isCollection(), debug);
this.ui = ui;
if (ui == null) {
this.ui = sysi.getCalUserInfo(cdURI.getEntityName(), false);
}
- userPrincipal = true;
}
/* ====================================================================
- * Abstract methods
- * ==================================================================== */
-
- public CurrentAccess getCurrentAccess() throws WebdavException {
- return null;
- }
-
- public String getEtagValue(boolean strong) throws WebdavException {
- String val = "1234567890";
-
- if (strong) {
- return "\"" + val + "\"";
- }
-
- return "W/\"" + val + "\"";
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#trailSlash()
- */
- public boolean trailSlash() {
- return true;
- }
-
- /* ====================================================================
- * Required webdav properties
- * ==================================================================== */
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getContentLang()
- */
- public String getContentLang() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getContentLen()
- */
- public int getContentLen() throws WebdavException {
- return 0;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getContentType()
- */
- public String getContentType() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getCreDate()
- */
- public String getCreDate() throws WebdavException {
- return null;
- }
-
- /* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getLastmodDate()
- */
- public String getLastmodDate() throws WebdavException {
- return null;
- }
-
- /* ====================================================================
* Property methods
* ==================================================================== */
/* (non-Javadoc)
- * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#knownProperty(edu.rpi.sss.util.xml.QName)
- */
- public boolean knownProperty(QName tag) {
- if (propertyNames.get(tag) != null) {
- return true;
- }
-
- // Not ours
- return super.knownProperty(tag);
- }
-
- /* (non-Javadoc)
* @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#generatePropertyValue(edu.rpi.sss.util.xml.QName, edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf, boolean)
*/
public boolean generatePropertyValue(QName tag,
@@ -223,8 +122,4 @@
return res;
}
-
- /* ====================================================================
- * Private methods
- * ==================================================================== */
}
Modified: trunk/server/src/org/bedework/caldav/server/MkcalendarMethod.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/MkcalendarMethod.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/MkcalendarMethod.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -68,13 +68,13 @@
boolean success = true;
- node.setDefaults(true);
+ node.setDefaults(CaldavTags.mkcalendar);
if (doc != null) {
success = processDoc(req, resp, doc, node, CaldavTags.mkcalendar, true);
}
- // XXX Make calendar using properties sent in request
+ // Make calendar using properties sent in request
if (success) {
getNsIntf().makeCollection(req, resp, node);
}
Modified: trunk/server/src/org/bedework/caldav/server/SysIntf.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/SysIntf.java 2008-11-07 21:18:59 UTC (rev 301)
+++ trunk/server/src/org/bedework/caldav/server/SysIntf.java 2008-11-14 06:38:25 UTC (rev 302)
@@ -581,7 +581,7 @@
* Status is set on return
*
* @param from Source resource
- * @param to Destination collection
+ * @param toPath Destination collection path
* @param name String name of new entity
* @param copy true for copying
* @param overwrite destination exists
@@ -589,7 +589,7 @@
* @throws WebdavException
*/
public boolean copyMoveFile(BwResource from,
- BwCalendar to,
+ String toPath,
String name,
boolean copy,
boolean overwrite) throws WebdavException;
More information about the Bedework-commit
mailing list