[Bedework-commit] caldav r329 - in trunk:
boeingexchange/src/edu/rpi/cct/bedework/caldav/exchange
bwcaldav/src/org/bedework/caldav/bwserver
domino/src/edu/rpi/cct/bedework/caldav/domino
google/src/edu/rpi/cct/bedework/caldav/google
server/src/org/bedework/caldav/server
server/src/org/bedework/caldav/server/calquery
server/src/org/bedework/caldav/server/filter
svnadmin at bedework.org
svnadmin at bedework.org
Wed Feb 25 23:37:56 EST 2009
Author: douglm
Date: 2009-02-25 23:37:44 -0500 (Wed, 25 Feb 2009)
New Revision: 329
Added:
trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwCalDAVCollection.java
trunk/server/src/org/bedework/caldav/server/CalDAVCollection.java
trunk/server/src/org/bedework/caldav/server/CalDAVCollectionBase.java
Modified:
trunk/boeingexchange/src/edu/rpi/cct/bedework/caldav/exchange/BexchangeSysIntfImpl.java
trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java
trunk/domino/src/edu/rpi/cct/bedework/caldav/domino/DominoSysIntfImpl.java
trunk/google/src/edu/rpi/cct/bedework/caldav/google/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/CaldavURI.java
trunk/server/src/org/bedework/caldav/server/PostMethod.java
trunk/server/src/org/bedework/caldav/server/SysIntf.java
trunk/server/src/org/bedework/caldav/server/calquery/FreeBusyQuery.java
trunk/server/src/org/bedework/caldav/server/filter/Filter.java
Log:
Fixed relatively small bug in GroupsDbImpl and in CalDAV
Made large set of changes to use class WdCollection throughout CalDAV rather than BwCalendar. Part of move to detach CalDAV project from bedework core.
Modified: trunk/boeingexchange/src/edu/rpi/cct/bedework/caldav/exchange/BexchangeSysIntfImpl.java
===================================================================
--- trunk/boeingexchange/src/edu/rpi/cct/bedework/caldav/exchange/BexchangeSysIntfImpl.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/boeingexchange/src/edu/rpi/cct/bedework/caldav/exchange/BexchangeSysIntfImpl.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -25,10 +25,11 @@
*/
package edu.rpi.cct.bedework.caldav.exchange;
+import org.bedework.caldav.server.CalDAVCollection;
+import org.bedework.caldav.server.CalDAVCollectionBase;
import org.bedework.caldav.server.PropertyHandler;
import org.bedework.caldav.server.SysIntf;
import org.bedework.caldav.server.PropertyHandler.PropertyType;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwDateTime;
import org.bedework.calfacade.BwEvent;
import org.bedework.calfacade.BwEventProxy;
@@ -409,14 +410,14 @@
throw new WebdavException("unimplemented");
}
- public Collection<EventInfo> getEvents(BwCalendar cal,
+ public Collection<EventInfo> getEvents(CalDAVCollection col,
BwFilter filter,
RecurringRetrievalMode recurRetrieval)
throws WebdavException {
throw new WebdavException("unimplemented");
}
- public EventInfo getEvent(BwCalendar cal, String val,
+ public EventInfo getEvent(CalDAVCollection col, String val,
RecurringRetrievalMode recurRetrieval)
throws WebdavException {
throw new WebdavException("unimplemented");
@@ -430,7 +431,7 @@
throw new WebdavException("unimplemented");
}
- public void deleteCalendar(BwCalendar cal) throws WebdavException {
+ public void deleteCollection(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -438,7 +439,8 @@
throw new WebdavException("unimplemented");
}
- public BwEvent getFreeBusy(final Collection<BwCalendar> cals,
+ public BwEvent getFreeBusy(final CalDAVCollection col,
+ final int depth,
final String account,
final BwDateTime start,
final BwDateTime end) throws WebdavException {
@@ -446,14 +448,8 @@
* http://t1.egenconsulting.com:80/servlet/Freetime/John?start-min=2006-07-11T12:00:00Z&start-max=2006-07-16T12:00:00Z
*/
try {
- /* XXX can only handle a single calendar at the moment */
- if (cals.size() != 1) {
- throw new WebdavBadRequest("Cannot handle multiple calendars");
- }
+ String serviceName = getServiceName(col.getPath());
- BwCalendar cal = cals.iterator().next();
- String serviceName = getServiceName(cal.getPath());
-
BexchangeInfo di = serversInfo.get(serviceName);
if (di == null) {
throw new WebdavBadRequest("Unknown service" + serviceName);
@@ -532,7 +528,14 @@
throw new WebdavException("unimplemented");
}
- public void updateAccess(BwCalendar cal,
+ public CurrentAccess checkAccess(CalDAVCollection col,
+ int desiredAccess,
+ boolean returnResult)
+ throws WebdavException {
+ throw new WebdavException("unimplemented");
+ }
+
+ public void updateAccess(CalDAVCollection col,
Acl acl) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -542,20 +545,20 @@
throw new WebdavException("unimplemented");
}
- /* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#makeCollection(org.bedework.calfacade.BwCalendar, boolean, java.lang.String)
- */
- public int makeCollection(BwCalendar cal,
- boolean calendarCollection,
- String parentPath) throws WebdavException {
+ public CalDAVCollection newCollectionObject(boolean calendarCollection,
+ String parentPath) throws WebdavException {
throw new WebdavException("unimplemented");
}
+ public int makeCollection(CalDAVCollection col) throws WebdavException {
+ throw new WebdavException("unimplemented");
+ }
+
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#copyMove(org.bedework.calfacade.BwCalendar, org.bedework.calfacade.BwCalendar, boolean)
*/
- public void copyMove(BwCalendar from,
- BwCalendar to,
+ public void copyMove(CalDAVCollection from,
+ CalDAVCollection to,
boolean copy,
boolean overwrite) throws WebdavException {
throw new WebdavException("unimplemented");
@@ -565,14 +568,14 @@
* @see org.bedework.caldav.server.SysIntf#copyMove(org.bedework.calfacade.svc.EventInfo, org.bedework.calfacade.BwCalendar, java.lang.String, boolean, boolean)
*/
public boolean copyMove(EventInfo from,
- BwCalendar to,
+ CalDAVCollection to,
String name,
boolean copy,
boolean overwrite) throws WebdavException {
throw new WebdavException("unimplemented");
}
- public BwCalendar getCalendar(String path) throws WebdavException {
+ public CalDAVCollection getCollection(String path) throws WebdavException {
// XXX Just fake it up for the moment.
/* The path should always start with /server-name/user
*/
@@ -581,29 +584,33 @@
String namePart = (String)l.get(l.size() - 1);
- BwCalendar cal = new BwCalendar();
- cal.setName(namePart);
- cal.setPath(path);
+ CalDAVCollectionBase col = new CalDAVCollectionBase(CalDAVCollection.calTypeCalendarColl,
+ true);
+ col.setName(namePart);
+ col.setPath(path);
String owner = (String)l.get(1);
- cal.setOwnerHref(owner);
+ col.setOwner(new User(owner));
- return cal;
+ return col;
}
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#updateCalendar(org.bedework.calfacade.BwCalendar)
*/
- public void updateCalendar(BwCalendar val) throws WebdavException {
+ public void updateCollection(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
- public Collection<BwCalendar> getCalendars(BwCalendar cal) throws WebdavException {
+ public Collection<CalDAVCollection> getCollections(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
- public void resolveAlias(BwCalendar cal) throws WebdavException {
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#resolveAlias(org.bedework.caldav.server.CalDAVCollection)
+ */
+ public void resolveAlias(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -614,7 +621,7 @@
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#putFile(org.bedework.calfacade.BwCalendar, org.bedework.calfacade.BwResource)
*/
- public void putFile(BwCalendar coll,
+ public void putFile(CalDAVCollection col,
BwResource val) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -622,7 +629,7 @@
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#getFile(org.bedework.calfacade.BwCalendar, java.lang.String)
*/
- public BwResource getFile(BwCalendar coll,
+ public BwResource getFile(CalDAVCollection col,
String name) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -637,7 +644,7 @@
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#getFiles(org.bedework.calfacade.BwCalendar)
*/
- public Collection<BwResource> getFiles(BwCalendar coll) throws WebdavException {
+ public Collection<BwResource> getFiles(CalDAVCollection coll) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -676,7 +683,8 @@
throw new WebdavException("unimplemented");
}
- public Icalendar fromIcal(BwCalendar cal, Reader rdr) throws WebdavException {
+ public Icalendar fromIcal(CalDAVCollection col,
+ Reader rdr) throws WebdavException {
throw new WebdavException("unimplemented");
}
Added: trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwCalDAVCollection.java
===================================================================
--- trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwCalDAVCollection.java (rev 0)
+++ trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwCalDAVCollection.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -0,0 +1,254 @@
+/* **********************************************************************
+ Copyright 2006 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.bwserver;
+
+import org.bedework.caldav.server.CalDAVCollection;
+import org.bedework.calfacade.BwCalendar;
+
+import edu.rpi.cct.webdav.servlet.shared.WdCollection;
+import edu.rpi.cct.webdav.servlet.shared.WebdavException;
+import edu.rpi.cmt.access.AccessPrincipal;
+
+/**
+ * @author douglm
+ *
+ */
+public class BwCalDAVCollection extends CalDAVCollection {
+ private BwSysIntfImpl intf;
+
+ BwCalendar col;
+
+ /**
+ * @param intf
+ * @param col
+ * @throws WebdavException
+ */
+ BwCalDAVCollection(BwSysIntfImpl intf, BwCalendar col) throws WebdavException {
+ this.intf = intf;
+ this.col = col;
+ }
+
+ /* ====================================================================
+ * Abstract method implementations
+ * ==================================================================== */
+
+ public boolean isAlias() throws WebdavException {
+ return getCol().getCalType() == BwCalendar.calTypeAlias;
+ }
+
+ public WdCollection getAliasTarget() throws WebdavException {
+ return new BwCalDAVCollection(intf, col.getAliasTarget());
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#setCalType(int)
+ */
+ public void setCalType(int val) throws WebdavException {
+ getCol().setCalType(val);
+ }
+
+ public int getCalType() throws WebdavException {
+ return getCol().getCalType();
+ }
+
+ public boolean freebusyAllowed() throws WebdavException {
+ return getCol().getCollectionInfo().allowFreeBusy;
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#entitiesAllowed()
+ */
+ public boolean entitiesAllowed() throws WebdavException {
+ return getCol().getCollectionInfo().entitiesAllowed;
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#setAffectsFreeBusy(boolean)
+ */
+ public void setAffectsFreeBusy(boolean val) throws WebdavException {
+ getCol().setAffectsFreeBusy(val);
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#getAffectsFreeBusy()
+ */
+ public boolean getAffectsFreeBusy() throws WebdavException {
+ return getCol().getAffectsFreeBusy();
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#setTimezone(java.lang.String)
+ */
+ public void setTimezone(String val) throws WebdavException {
+ getCol().setTimezone(val);
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#getTimezone()
+ */
+ public String getTimezone() throws WebdavException {
+ return getCol().getTimezone();
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#setColor(java.lang.String)
+ */
+ public void setColor(String val) throws WebdavException {
+ getCol().setColor(val);
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#getColor()
+ */
+ public String getColor() throws WebdavException {
+ return getCol().getColor();
+ }
+
+ /* ====================================================================
+ * Overrides
+ * ==================================================================== */
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#setName(java.lang.String)
+ */
+ public void setName(String val) throws WebdavException {
+ getCol().setName(val);
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#getName()
+ */
+ public String getName() throws WebdavException {
+ return getCol().getName();
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#setDisplayName(java.lang.String)
+ */
+ public void setDisplayName(String val) throws WebdavException {
+ getCol().setSummary(val);
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#getDisplayName()
+ */
+ public String getDisplayName() throws WebdavException {
+ return getCol().getSummary();
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#setPath(java.lang.String)
+ */
+ public void setPath(String val) throws WebdavException {
+ getCol().setPath(val);
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#getPath()
+ */
+ public String getPath() throws WebdavException {
+ return getCol().getPath();
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#setParentPath(java.lang.String)
+ */
+ public void setParentPath(String val) throws WebdavException {
+ getCol().setColPath(val);
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#getParentPath()
+ */
+ public String getParentPath() throws WebdavException {
+ return getCol().getColPath();
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#setOwner(edu.rpi.cmt.access.AccessPrincipal)
+ */
+ public void setOwner(AccessPrincipal val) {
+ col.setOwnerHref(val.getPrincipalRef());
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#getOwner()
+ */
+ public AccessPrincipal getOwner() throws WebdavException {
+ return intf.getPrincipal(getCol().getOwnerHref());
+ }
+
+ public void setCreated(String val) throws WebdavException {
+ getCol().setCreated(val);
+ }
+
+ public String getCreated() throws WebdavException {
+ return getCol().getCreated();
+ }
+
+ public void setLastmod(String val) throws WebdavException {
+ getCol().getLastmod().setTimestamp(val);
+ }
+
+ public String getLastmod() throws WebdavException {
+ return getCol().getLastmod().getTimestamp();
+ }
+
+ public void setSequence(int val) throws WebdavException {
+ getCol().getLastmod().setSequence(val);
+ }
+
+ public int getSequence() throws WebdavException {
+ return getCol().getLastmod().getSequence();
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#setDescription(java.lang.String)
+ */
+ public void setDescription(String val) throws WebdavException {
+ getCol().setDescription(val);
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#getDescription()
+ */
+ public String getDescription() throws WebdavException {
+ return getCol().getDescription();
+ }
+
+ /* ====================================================================
+ * Private methods
+ * ==================================================================== */
+
+ private BwCalendar getCol() throws WebdavException {
+ if (col == null) {
+ col = new BwCalendar();
+ }
+
+ return col;
+ }
+}
Modified: trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java
===================================================================
--- trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -25,17 +25,20 @@
*/
package org.bedework.caldav.bwserver;
+import org.bedework.caldav.server.CalDAVCollection;
import org.bedework.caldav.server.PropertyHandler;
import org.bedework.caldav.server.SysIntf;
import org.bedework.caldav.server.PropertyHandler.PropertyType;
import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwDateTime;
import org.bedework.calfacade.BwEvent;
+import org.bedework.calfacade.BwEventObj;
import org.bedework.calfacade.BwEventProxy;
import org.bedework.calfacade.BwPrincipal;
import org.bedework.calfacade.BwResource;
import org.bedework.calfacade.BwSystem;
import org.bedework.calfacade.BwUser;
+import org.bedework.calfacade.CalFacadeDefs;
import org.bedework.calfacade.RecurringRetrievalMode;
import org.bedework.calfacade.ScheduleResult;
import org.bedework.calfacade.base.BwShareableDbentity;
@@ -399,9 +402,9 @@
} else {
String path = getUrlHandler().unprefix(matchVal);
- BwCalendar cal = getCalendar(path);
- if (cal != null) {
- cui = getCalPrincipalInfo(getPrincipal(cal.getOwnerHref()));
+ CalDAVCollection col = getCollection(path);
+ if (col != null) {
+ cui = getCalPrincipalInfo(col.getOwner());
}
}
@@ -519,12 +522,16 @@
}
}
- public Collection<EventInfo> getEvents(BwCalendar cal,
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#getEvents(org.bedework.caldav.server.CalDAVCollection, org.bedework.calfacade.filter.BwFilter, org.bedework.calfacade.RecurringRetrievalMode)
+ */
+ public Collection<EventInfo> getEvents(CalDAVCollection col,
BwFilter filter,
RecurringRetrievalMode recurRetrieval)
throws WebdavException {
try {
- return getSvci().getEventsHandler().getEvents(cal, filter, null, null,
+ return getSvci().getEventsHandler().getEvents(unwrap(col), filter,
+ null, null,
recurRetrieval);
} catch (CalFacadeAccessException cfae) {
throw new WebdavForbidden();
@@ -537,11 +544,14 @@
}
}
- public EventInfo getEvent(BwCalendar cal, String val,
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#getEvent(org.bedework.caldav.server.CalDAVCollection, java.lang.String, org.bedework.calfacade.RecurringRetrievalMode)
+ */
+ public EventInfo getEvent(CalDAVCollection col, String val,
RecurringRetrievalMode recurRetrieval)
throws WebdavException {
try {
- return getSvci().getEventsHandler().get(cal.getPath(), val, recurRetrieval);
+ return getSvci().getEventsHandler().get(col.getPath(), val, recurRetrieval);
} catch (Throwable t) {
throw new WebdavException(t);
}
@@ -556,14 +566,6 @@
}
}
- public void deleteCalendar(BwCalendar cal) throws WebdavException {
- try {
- getSvci().getCalendarsHandler().delete(cal, true);
- } catch (Throwable t) {
- throw new WebdavException(t);
- }
- }
-
public ScheduleResult requestFreeBusy(EventInfo val) throws WebdavException {
try {
BwEvent ev = val.getEvent();
@@ -590,7 +592,11 @@
}
}
- public BwEvent getFreeBusy(final Collection<BwCalendar> cals,
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#getFreeBusy(org.bedework.caldav.server.CalDAVCollection, int, java.lang.String, org.bedework.calfacade.BwDateTime, org.bedework.calfacade.BwDateTime)
+ */
+ public BwEvent getFreeBusy(final CalDAVCollection col,
+ final int depth,
final String account,
final BwDateTime start,
final BwDateTime end) throws WebdavException {
@@ -600,7 +606,44 @@
throw new WebdavUnauthorized();
}
- return getSvci().getScheduler().getFreeBusy(cals, user, start, end);
+ BwCalendar bwCol = unwrap(col);
+
+ int calType = bwCol.getCalType();
+
+ if (!BwCalendar.collectionInfo[calType].allowFreeBusy) {
+ throw new WebdavForbidden(WebdavTags.supportedReport);
+ }
+
+ Collection<BwCalendar> cals = new ArrayList<BwCalendar>();
+
+ if (calType == BwCalendar.calTypeCollection) {
+ cals.add(bwCol);
+ } else if (depth == 0) {
+ /* Cannot return anything */
+ } else {
+ /* Make new cal object with just calendar collections as children */
+
+ for (BwCalendar ch: getSvci().getCalendarsHandler().getChildren(bwCol)) {
+ // For depth 1 we only add calendar collections
+ if ((depth > 1) ||
+ (ch.getCalType() == BwCalendar.calTypeCollection)) {
+ cals.add(ch);
+ }
+ }
+ }
+
+ BwEvent fb;
+ if (cals.isEmpty()) {
+ // Retiurn an empty object
+ fb = new BwEventObj();
+ fb.setEntityType(CalFacadeDefs.entityTypeFreeAndBusy);
+ fb.setDtstart(start);
+ fb.setDtend(end);
+ } else {
+ fb = getSvci().getScheduler().getFreeBusy(cals, user, start, end);
+ }
+
+ return fb;
} catch (CalFacadeException cfe) {
throw new WebdavException(cfe);
} catch (WebdavException wde) {
@@ -621,10 +664,10 @@
}
}
- public void updateAccess(BwCalendar cal,
- Acl acl) throws WebdavException {
+ public void updateAccess(BwEvent ev,
+ Acl acl) throws WebdavException{
try {
- getSvci().changeAccess(cal, acl.getAces(), true);
+ getSvci().changeAccess(ev, acl.getAces(), true);
} catch (CalFacadeAccessException cfae) {
throw new WebdavForbidden();
} catch (CalFacadeException cfe) {
@@ -634,10 +677,35 @@
}
}
- public void updateAccess(BwEvent ev,
- Acl acl) throws WebdavException{
+ /* ====================================================================
+ * Collections
+ * ==================================================================== */
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#newCollectionObject(boolean, java.lang.String)
+ */
+ public CalDAVCollection newCollectionObject(boolean isCalendarCollection,
+ String parentPath) throws WebdavException {
+ BwCalendar col = new BwCalendar();
+
+ if (isCalendarCollection) {
+ col.setCalType(BwCalendar.calTypeCollection);
+ } else {
+ col.setCalType(BwCalendar.calTypeFolder);
+ }
+
+ col.setColPath(parentPath);
+
+ return new BwCalDAVCollection(this, col);
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#updateAccess(org.bedework.caldav.server.CalDAVCollection, edu.rpi.cmt.access.Acl)
+ */
+ public void updateAccess(CalDAVCollection col,
+ Acl acl) throws WebdavException {
try {
- getSvci().changeAccess(ev, acl.getAces(), true);
+ getSvci().changeAccess(unwrap(col), acl.getAces(), true);
} catch (CalFacadeAccessException cfae) {
throw new WebdavForbidden();
} catch (CalFacadeException cfe) {
@@ -647,20 +715,25 @@
}
}
+ public CurrentAccess checkAccess(CalDAVCollection col,
+ int desiredAccess,
+ boolean returnResult)
+ throws WebdavException {
+ try {
+ return getSvci().checkAccess(unwrap(col), desiredAccess, returnResult);
+ } catch (CalFacadeException cfe) {
+ throw new WebdavException(cfe);
+ }
+ }
+
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#makeCollection(org.bedework.calfacade.BwCalendar, boolean, java.lang.String)
+ * @see org.bedework.caldav.server.SysIntf#makeCollection(org.bedework.caldav.server.CalDAVCollection)
*/
- public int makeCollection(BwCalendar cal,
- boolean calendarCollection,
- String parentPath) throws WebdavException {
- if (calendarCollection) {
- cal.setCalType(BwCalendar.calTypeCollection);
- } else {
- cal.setCalType(BwCalendar.calTypeFolder);
- }
+ public int makeCollection(CalDAVCollection col) throws WebdavException {
+ BwCalendar bwCol = unwrap(col);
try {
- getSvci().getCalendarsHandler().add(cal, parentPath);
+ getSvci().getCalendarsHandler().add(bwCol, bwCol.getColPath());
return HttpServletResponse.SC_CREATED;
} catch (CalFacadeAccessException cfae) {
throw new WebdavForbidden();
@@ -679,24 +752,27 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#copyMove(org.bedework.calfacade.BwCalendar, org.bedework.calfacade.BwCalendar, boolean)
+ * @see org.bedework.caldav.server.SysIntf#copyMove(org.bedework.caldav.server.CalDAVCollection, org.bedework.caldav.server.CalDAVCollection, boolean, boolean)
*/
- public void copyMove(BwCalendar from,
- BwCalendar to,
+ public void copyMove(CalDAVCollection from,
+ CalDAVCollection to,
boolean copy,
boolean overwrite) throws WebdavException {
try {
+ BwCalendar bwFrom = unwrap(from);
+ BwCalendar bwTo = unwrap(to);
+
if (!copy) {
/* Move the from collection to the new location "to".
* If the parent calendar is the same in both cases, this is just a rename.
*/
- if ((from.getColPath() == null) || (to.getColPath() == null)) {
+ if ((bwFrom.getColPath() == null) || (bwTo.getColPath() == null)) {
throw new WebdavForbidden("Cannot move root");
}
- if (from.getColPath().equals(to.getColPath())) {
+ if (bwFrom.getColPath().equals(bwTo.getColPath())) {
// Rename
- getSvci().getCalendarsHandler().rename(from, to.getName());
+ getSvci().getCalendarsHandler().rename(bwFrom, to.getName());
return;
}
}
@@ -711,14 +787,17 @@
throw new WebdavException("unimplemented");
}
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#copyMove(org.bedework.calfacade.svc.EventInfo, org.bedework.caldav.server.CalDAVCollection, java.lang.String, boolean, boolean)
+ */
public boolean copyMove(EventInfo from,
- BwCalendar to,
+ CalDAVCollection to,
String name,
boolean copy,
boolean overwrite) throws WebdavException {
CopyMoveStatus cms;
try {
- cms = getSvci().getEventsHandler().copyMoveNamed(from, to, name,
+ cms = getSvci().getEventsHandler().copyMoveNamed(from, unwrap(to), name,
copy, overwrite, false);
} catch (CalFacadeAccessException cfae) {
throw new WebdavForbidden();
@@ -755,11 +834,17 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#getCalendar(java.lang.String)
+ * @see org.bedework.caldav.server.SysIntf#getCollection(java.lang.String)
*/
- public BwCalendar getCalendar(String path) throws WebdavException {
+ public CalDAVCollection getCollection(String path) throws WebdavException {
try {
- return getSvci().getCalendarsHandler().get(path);
+ BwCalendar col = getSvci().getCalendarsHandler().get(path);
+
+ if (col == null) {
+ return null;
+ }
+
+ return new BwCalDAVCollection(this, col);
} catch (CalFacadeAccessException cfae) {
throw new WebdavForbidden();
} catch (CalFacadeException cfe) {
@@ -769,12 +854,9 @@
}
}
- /* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#updateCalendar(org.bedework.calfacade.BwCalendar)
- */
- public void updateCalendar(BwCalendar val) throws WebdavException {
+ public void updateCollection(CalDAVCollection col) throws WebdavException {
try {
- getSvci().getCalendarsHandler().update(val);
+ getSvci().getCalendarsHandler().update(unwrap(col));
} catch (CalFacadeAccessException cfae) {
throw new WebdavForbidden();
} catch (CalFacadeException cfe) {
@@ -788,11 +870,34 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#getCalendars(org.bedework.calfacade.BwCalendar)
+ * @see org.bedework.caldav.server.SysIntf#deleteCollection(org.bedework.caldav.server.CalDAVCollection)
*/
- public Collection<BwCalendar> getCalendars(BwCalendar cal) throws WebdavException {
+ public void deleteCollection(CalDAVCollection col) throws WebdavException {
try {
- return getSvci().getCalendarsHandler().getChildren(cal);
+ getSvci().getCalendarsHandler().delete(unwrap(col), true);
+ } catch (Throwable t) {
+ throw new WebdavException(t);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#getCollections(org.bedework.caldav.server.CalDAVCollection)
+ */
+ public Collection<CalDAVCollection> getCollections(CalDAVCollection col) throws WebdavException {
+ try {
+ Collection<BwCalendar> bwch = getSvci().getCalendarsHandler().getChildren(unwrap(col));
+
+ Collection<CalDAVCollection> ch = new ArrayList<CalDAVCollection>();
+
+ if (bwch == null) {
+ return ch;
+ }
+
+ for (BwCalendar c: bwch) {
+ ch.add(new BwCalDAVCollection(this, c));
+ }
+
+ return ch;
} catch (CalFacadeAccessException cfae) {
throw new WebdavForbidden();
} catch (CalFacadeException cfe) {
@@ -803,11 +908,11 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#resolveAlias(org.bedework.calfacade.BwCalendar)
+ * @see org.bedework.caldav.server.SysIntf#resolveAlias(org.bedework.caldav.server.CalDAVCollection)
*/
- public void resolveAlias(BwCalendar cal) throws WebdavException {
+ public void resolveAlias(CalDAVCollection col) throws WebdavException {
try {
- getSvci().getCalendarsHandler().resolveAlias(cal, true, false);
+ getSvci().getCalendarsHandler().resolveAlias(unwrap(col), true, false);
} catch (CalFacadeAccessException cfae) {
throw new WebdavForbidden();
} catch (CalFacadeException cfe) {
@@ -822,9 +927,9 @@
* ==================================================================== */
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#putFile(org.bedework.calfacade.BwCalendar, org.bedework.calfacade.BwResource)
+ * @see org.bedework.caldav.server.SysIntf#putFile(org.bedework.caldav.server.CalDAVCollection, org.bedework.calfacade.BwResource)
*/
- public void putFile(BwCalendar coll,
+ public void putFile(CalDAVCollection coll,
BwResource val) throws WebdavException {
try {
getSvci().getResourcesHandler().save(coll.getPath(), val);
@@ -838,9 +943,9 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#getFile(org.bedework.calfacade.BwCalendar, java.lang.String)
+ * @see org.bedework.caldav.server.SysIntf#getFile(org.bedework.caldav.server.CalDAVCollection, java.lang.String)
*/
- public BwResource getFile(BwCalendar coll,
+ public BwResource getFile(CalDAVCollection coll,
String name) throws WebdavException {
try {
return getSvci().getResourcesHandler().get(coll.getPath() + "/" + name);
@@ -869,9 +974,9 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#getFiles(org.bedework.calfacade.BwCalendar)
+ * @see org.bedework.caldav.server.SysIntf#getFiles(org.bedework.caldav.server.CalDAVCollection)
*/
- public Collection<BwResource> getFiles(BwCalendar coll) throws WebdavException {
+ public Collection<BwResource> getFiles(CalDAVCollection coll) throws WebdavException {
try {
return getSvci().getResourcesHandler().getAll(coll.getPath());
} catch (CalFacadeAccessException cfae) {
@@ -953,10 +1058,13 @@
}
}
- public Icalendar fromIcal(BwCalendar cal, Reader rdr) throws WebdavException {
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#fromIcal(org.bedework.caldav.server.CalDAVCollection, java.io.Reader)
+ */
+ public Icalendar fromIcal(CalDAVCollection col, Reader rdr) throws WebdavException {
getSvci(); // Ensure open
try {
- return trans.fromIcal(cal, rdr);
+ return trans.fromIcal(unwrap(col), rdr);
} catch (IcalMalformedException ime) {
throw new WebdavBadRequest(ime.getMessage());
} catch (Throwable t) {
@@ -992,6 +1100,15 @@
* Private methods
* ==================================================================== */
+ private BwCalendar unwrap(CalDAVCollection col) throws WebdavException {
+ if (!(col instanceof BwCalDAVCollection)) {
+ throw new WebdavBadRequest("Unknown implemenation of BwCalDAVCollection" +
+ col.getClass());
+ }
+
+ return ((BwCalDAVCollection)col).col;
+ }
+
/**
* @return CalSvcI
* @throws WebdavException
Modified: trunk/domino/src/edu/rpi/cct/bedework/caldav/domino/DominoSysIntfImpl.java
===================================================================
--- trunk/domino/src/edu/rpi/cct/bedework/caldav/domino/DominoSysIntfImpl.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/domino/src/edu/rpi/cct/bedework/caldav/domino/DominoSysIntfImpl.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -25,10 +25,11 @@
*/
package edu.rpi.cct.bedework.caldav.domino;
+import org.bedework.caldav.server.CalDAVCollection;
+import org.bedework.caldav.server.CalDAVCollectionBase;
import org.bedework.caldav.server.PropertyHandler;
import org.bedework.caldav.server.SysIntf;
import org.bedework.caldav.server.PropertyHandler.PropertyType;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwDateTime;
import org.bedework.calfacade.BwEvent;
import org.bedework.calfacade.BwEventObj;
@@ -417,14 +418,14 @@
throw new WebdavException("unimplemented");
}
- public Collection<EventInfo> getEvents(BwCalendar cal,
+ public Collection<EventInfo> getEvents(CalDAVCollection col,
BwFilter filter,
RecurringRetrievalMode recurRetrieval)
throws WebdavException {
throw new WebdavException("unimplemented");
}
- public EventInfo getEvent(BwCalendar cal, String val,
+ public EventInfo getEvent(CalDAVCollection col, String val,
RecurringRetrievalMode recurRetrieval)
throws WebdavException {
throw new WebdavException("unimplemented");
@@ -438,7 +439,7 @@
throw new WebdavException("unimplemented");
}
- public void deleteCalendar(BwCalendar cal) throws WebdavException {
+ public void deleteCollection(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -446,7 +447,8 @@
throw new WebdavException("unimplemented");
}
- public BwEvent getFreeBusy(final Collection<BwCalendar> cals,
+ public BwEvent getFreeBusy(final CalDAVCollection col,
+ final int depth,
final String account,
final BwDateTime start,
final BwDateTime end) throws WebdavException {
@@ -454,14 +456,8 @@
* http://t1.egenconsulting.com:80/servlet/Freetime/John?start-min=2006-07-11T12:00:00Z&start-max=2006-07-16T12:00:00Z
*/
try {
- /* XXX can only handle a single calendar at the moment */
- if (cals.size() != 1) {
- throw new WebdavBadRequest("Cannot handle multiple calendars");
- }
+ String serviceName = getServiceName(col.getPath());
- BwCalendar cal = cals.iterator().next();
- String serviceName = getServiceName(cal.getPath());
-
DominoInfo di = serversInfo.get(serviceName);
if (di == null) {
throw new WebdavBadRequest("Unknwon service: " + serviceName);
@@ -471,7 +467,7 @@
req.setMethod("GET");
req.setUrl(di.getUrlPrefix() + "/" +
- cal.getOwnerHref() + "?" +
+ col.getOwner().getPrincipalRef() + "?" +
"start-min=" + makeDateTime(start) + "&" +
"start-max=" + makeDateTime(end));
@@ -568,7 +564,14 @@
throw new WebdavException("unimplemented");
}
- public void updateAccess(BwCalendar cal,
+ public CurrentAccess checkAccess(CalDAVCollection col,
+ int desiredAccess,
+ boolean returnResult)
+ throws WebdavException {
+ throw new WebdavException("unimplemented");
+ }
+
+ public void updateAccess(CalDAVCollection col,
Acl acl) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -578,68 +581,69 @@
throw new WebdavException("unimplemented");
}
- /* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#makeCollection(org.bedework.calfacade.BwCalendar, boolean, java.lang.String)
- */
- public int makeCollection(BwCalendar cal,
- boolean calendarCollection,
- String parentPath) throws WebdavException {
+ public CalDAVCollection newCollectionObject(boolean calendarCollection,
+ String parentPath) throws WebdavException {
throw new WebdavException("unimplemented");
}
+ public int makeCollection(CalDAVCollection col) throws WebdavException {
+ throw new WebdavException("unimplemented");
+ }
+
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#copyMove(org.bedework.calfacade.BwCalendar, org.bedework.calfacade.BwCalendar, boolean)
*/
- public void copyMove(BwCalendar from,
- BwCalendar to,
+ public void copyMove(CalDAVCollection from,
+ CalDAVCollection to,
boolean copy,
boolean overwrite) throws WebdavException {
throw new WebdavException("unimplemented");
}
- /* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#copyMove(org.bedework.calfacade.svc.EventInfo, org.bedework.calfacade.BwCalendar, java.lang.String, boolean, boolean)
- */
public boolean copyMove(EventInfo from,
- BwCalendar to,
+ CalDAVCollection to,
String name,
boolean copy,
boolean overwrite) throws WebdavException {
throw new WebdavException("unimplemented");
}
- public BwCalendar getCalendar(String path) throws WebdavException {
+ public CalDAVCollection getCollection(String path) throws WebdavException {
// XXX Just fake it up for the moment.
/* The path should always start with /server-name/user
*/
- List l = splitUri(path, true);
+ List<String> l = splitUri(path, true);
String namePart = (String)l.get(l.size() - 1);
- BwCalendar cal = new BwCalendar();
- cal.setName(namePart);
- cal.setPath(path);
+ CalDAVCollectionBase col = new CalDAVCollectionBase(CalDAVCollection.calTypeCalendarColl,
+ true);
+ col.setName(namePart);
+ col.setPath(path);
String owner = (String)l.get(1);
- cal.setOwnerHref(owner);
+ col.setOwner(new User(owner));
- return cal;
+ return col;
}
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#updateCalendar(org.bedework.calfacade.BwCalendar)
*/
- public void updateCalendar(BwCalendar val) throws WebdavException {
+ public void updateCollection(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
- public Collection<BwCalendar> getCalendars(BwCalendar cal) throws WebdavException {
+ public Collection<CalDAVCollection> getCollections(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
- public void resolveAlias(BwCalendar cal) throws WebdavException {
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#resolveAlias(org.bedework.caldav.server.CalDAVCollection)
+ */
+ public void resolveAlias(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -650,7 +654,7 @@
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#putFile(org.bedework.calfacade.BwCalendar, org.bedework.calfacade.BwResource)
*/
- public void putFile(BwCalendar coll,
+ public void putFile(CalDAVCollection coll,
BwResource val) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -658,7 +662,7 @@
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#getFile(org.bedework.calfacade.BwCalendar, java.lang.String)
*/
- public BwResource getFile(BwCalendar coll,
+ public BwResource getFile(CalDAVCollection coll,
String name) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -673,7 +677,7 @@
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#getFiles(org.bedework.calfacade.BwCalendar)
*/
- public Collection<BwResource> getFiles(BwCalendar coll) throws WebdavException {
+ public Collection<BwResource> getFiles(CalDAVCollection coll) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -712,7 +716,8 @@
throw new WebdavException("unimplemented");
}
- public Icalendar fromIcal(BwCalendar cal, Reader rdr) throws WebdavException {
+ public Icalendar fromIcal(CalDAVCollection col,
+ Reader rdr) throws WebdavException {
throw new WebdavException("unimplemented");
}
Modified: trunk/google/src/edu/rpi/cct/bedework/caldav/google/GoogleSysIntfImpl.java
===================================================================
--- trunk/google/src/edu/rpi/cct/bedework/caldav/google/GoogleSysIntfImpl.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/google/src/edu/rpi/cct/bedework/caldav/google/GoogleSysIntfImpl.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -25,10 +25,11 @@
*/
package edu.rpi.cct.bedework.caldav.google;
+import org.bedework.caldav.server.CalDAVCollection;
+import org.bedework.caldav.server.CalDAVCollectionBase;
import org.bedework.caldav.server.PropertyHandler;
import org.bedework.caldav.server.SysIntf;
import org.bedework.caldav.server.PropertyHandler.PropertyType;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwDateTime;
import org.bedework.calfacade.BwEvent;
import org.bedework.calfacade.BwEventObj;
@@ -337,14 +338,14 @@
throw new WebdavException("unimplemented");
}
- public Collection<EventInfo> getEvents(BwCalendar cal,
+ public Collection<EventInfo> getEvents(CalDAVCollection col,
BwFilter filter,
RecurringRetrievalMode recurRetrieval)
throws WebdavException {
throw new WebdavException("unimplemented");
}
- public EventInfo getEvent(BwCalendar cal, String val,
+ public EventInfo getEvent(CalDAVCollection col, String val,
RecurringRetrievalMode recurRetrieval)
throws WebdavException {
throw new WebdavException("unimplemented");
@@ -358,7 +359,7 @@
throw new WebdavException("unimplemented");
}
- public void deleteCalendar(BwCalendar cal) throws WebdavException {
+ public void deleteCollection(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -366,7 +367,8 @@
throw new WebdavException("unimplemented");
}
- public BwEvent getFreeBusy(final Collection<BwCalendar> cals,
+ public BwEvent getFreeBusy(final CalDAVCollection col,
+ int depth,
final String account,
final BwDateTime start,
final BwDateTime end) throws WebdavException {
@@ -410,13 +412,6 @@
</feed>
*/
try {
- /* XXX can only handle a single calendar at the moment */
- if (cals.size() != 1) {
- throw new WebdavBadRequest("Cannot handle multiple calendars");
- }
-
- //BwCalendar cal = cals.iterator().next();
-
URL feedUrl = new URL(feedUrlPrefix + account + "@gmail.com/public/free-busy");
CalendarQuery q = new CalendarQuery(feedUrl);
@@ -499,7 +494,19 @@
throw new WebdavException("unimplemented");
}
- public void updateAccess(BwCalendar cal,
+ public CurrentAccess checkAccess(CalDAVCollection col,
+ int desiredAccess,
+ boolean returnResult)
+ throws WebdavException {
+ throw new WebdavException("unimplemented");
+ }
+
+ public CalDAVCollection newCollectionObject(boolean isCalendarCollection,
+ String parentPath) throws WebdavException {
+ throw new WebdavException("unimplemented");
+ }
+
+ public void updateAccess(CalDAVCollection col,
Acl acl) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -509,20 +516,15 @@
throw new WebdavException("unimplemented");
}
- /* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#makeCollection(org.bedework.calfacade.BwCalendar, boolean, java.lang.String)
- */
- public int makeCollection(BwCalendar cal,
- boolean calendarCollection,
- String parentPath) throws WebdavException {
+ public int makeCollection(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#copyMove(org.bedework.calfacade.BwCalendar, org.bedework.calfacade.BwCalendar, boolean)
*/
- public void copyMove(BwCalendar from,
- BwCalendar to,
+ public void copyMove(CalDAVCollection from,
+ CalDAVCollection to,
boolean copy,
boolean overwrite) throws WebdavException {
throw new WebdavException("unimplemented");
@@ -532,7 +534,7 @@
* @see org.bedework.caldav.server.SysIntf#copyMove(org.bedework.calfacade.svc.EventInfo, org.bedework.calfacade.BwCalendar, java.lang.String, boolean, boolean)
*/
public boolean copyMove(EventInfo from,
- BwCalendar to,
+ CalDAVCollection to,
String name,
boolean copy,
boolean overwrite) throws WebdavException {
@@ -540,9 +542,9 @@
}
/* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#getCalendar(java.lang.String)
+ * @see org.bedework.caldav.server.SysIntf#getCollection(java.lang.String)
*/
- public BwCalendar getCalendar(String path) throws WebdavException {
+ public CalDAVCollection getCollection(String path) throws WebdavException {
// XXX Just fake it up for the moment.
int pos = path.lastIndexOf("/");
@@ -553,10 +555,6 @@
String namePart = path.substring(pos + 1);
- BwCalendar cal = new BwCalendar();
- cal.setName(namePart);
- cal.setPath(path);
-
String owner;
if (pos == 0) {
@@ -566,23 +564,31 @@
owner = path.substring(1, endName);
}
- cal.setOwnerHref(owner);
+ CalDAVCollectionBase col = new CalDAVCollectionBase(CalDAVCollection.calTypeCalendarColl,
+ true);
+ col.setName(namePart);
+ col.setPath(path);
- return cal;
+ col.setOwner(new User(owner));
+
+ return col;
}
/* (non-Javadoc)
* @see org.bedework.caldav.server.SysIntf#updateCalendar(org.bedework.calfacade.BwCalendar)
*/
- public void updateCalendar(BwCalendar val) throws WebdavException {
+ public void updateCollection(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
- public Collection<BwCalendar> getCalendars(BwCalendar cal) throws WebdavException {
+ public Collection<CalDAVCollection> getCollections(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
- public void resolveAlias(BwCalendar cal) throws WebdavException {
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.SysIntf#resolveAlias(org.bedework.caldav.server.CalDAVCollection)
+ */
+ public void resolveAlias(CalDAVCollection col) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -590,18 +596,12 @@
* Files
* ==================================================================== */
- /* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#putFile(org.bedework.calfacade.BwCalendar, org.bedework.calfacade.BwResource)
- */
- public void putFile(BwCalendar coll,
+ public void putFile(CalDAVCollection coll,
BwResource val) throws WebdavException {
throw new WebdavException("unimplemented");
}
- /* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#getFile(org.bedework.calfacade.BwCalendar, java.lang.String)
- */
- public BwResource getFile(BwCalendar coll,
+ public BwResource getFile(CalDAVCollection coll,
String name) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -613,10 +613,7 @@
throw new WebdavException("unimplemented");
}
- /* (non-Javadoc)
- * @see org.bedework.caldav.server.SysIntf#getFiles(org.bedework.calfacade.BwCalendar)
- */
- public Collection<BwResource> getFiles(BwCalendar coll) throws WebdavException {
+ public Collection<BwResource> getFiles(CalDAVCollection coll) throws WebdavException {
throw new WebdavException("unimplemented");
}
@@ -655,7 +652,7 @@
throw new WebdavException("unimplemented");
}
- public Icalendar fromIcal(BwCalendar cal, Reader rdr) throws WebdavException {
+ public Icalendar fromIcal(CalDAVCollection col, Reader rdr) throws WebdavException {
throw new WebdavException("unimplemented");
}
Added: trunk/server/src/org/bedework/caldav/server/CalDAVCollection.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CalDAVCollection.java (rev 0)
+++ trunk/server/src/org/bedework/caldav/server/CalDAVCollection.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -0,0 +1,129 @@
+/* **********************************************************************
+ 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.WdCollection;
+import edu.rpi.cct.webdav.servlet.shared.WebdavException;
+
+/** Class to represent a collection in CalDAV
+ *
+ * @author douglm
+ *
+ */
+public abstract class CalDAVCollection extends WdCollection {
+ /** Indicate unknown type */
+ public final static int calTypeUnknown = -1;
+
+ /** Normal folder */
+ public final static int calTypeCollection = 0;
+
+ /** Normal calendar collection */
+ public final static int calTypeCalendarColl = 1;
+
+ /** Inbox */
+ public final static int calTypeInbox = 2;
+
+ /** Outbox */
+ public final static int calTypeOutbox = 3;
+
+ /** Constructor
+ *
+ * @throws WebdavException
+ */
+ public CalDAVCollection() throws WebdavException {
+ super();
+ }
+
+ /* ====================================================================
+ * Abstract methods
+ * ==================================================================== */
+
+ /**
+ * @param val
+ * @throws WebdavException
+ */
+ public abstract void setCalType(int val) throws WebdavException;
+
+ /**
+ * @return int
+ * @throws WebdavException
+ */
+ public abstract int getCalType() throws WebdavException;
+
+ /**
+ * @return true if freebusy reports are allowed
+ * @throws WebdavException
+ */
+ public abstract boolean freebusyAllowed() throws WebdavException;
+
+ /**
+ * @return true if entities can be stored
+ * @throws WebdavException
+ */
+ public abstract boolean entitiesAllowed() throws WebdavException;
+
+ /**
+ *
+ * @param val true if the calendar takes part in free/busy calculations
+ * @throws WebdavException
+ */
+ public abstract void setAffectsFreeBusy(boolean val) throws WebdavException;
+
+ /**
+ *
+ * @return boolean true if the calendar takes part in free/busy calculations
+ * @throws WebdavException
+ */
+ public abstract boolean getAffectsFreeBusy() throws WebdavException;
+
+ /** Set the collection timezone property
+ *
+ * @param val
+ * @throws WebdavException
+ */
+ public abstract void setTimezone(String val) throws WebdavException;
+
+ /** Get the collection timezone property
+ *
+ * @return String vtimezone spec
+ * @throws WebdavException
+ */
+ public abstract String getTimezone() throws WebdavException;
+
+ /** Set the calendar color property
+ *
+ * @param val
+ * @throws WebdavException
+ */
+ public abstract void setColor(String val) throws WebdavException;
+
+ /** Get the calendar color property
+ *
+ * @return String calendar color
+ * @throws WebdavException
+ */
+ public abstract String getColor() throws WebdavException;
+}
Added: trunk/server/src/org/bedework/caldav/server/CalDAVCollectionBase.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CalDAVCollectionBase.java (rev 0)
+++ trunk/server/src/org/bedework/caldav/server/CalDAVCollectionBase.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -0,0 +1,149 @@
+/* **********************************************************************
+ 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.WdCollection;
+import edu.rpi.cct.webdav.servlet.shared.WebdavException;
+
+/** Simple implementation of class to represent a collection in CalDAV
+ *
+ * @author douglm
+ *
+ */
+public class CalDAVCollectionBase extends CalDAVCollection {
+ private int calType;
+
+ /** Resource collection. According to the CalDAV spec a collection may exist
+ * inside a calendar collection but no calendar collection must be so
+ * contained at any depth. (RFC 4791 Section 4.2) */
+ public final static int calTypeResource = 9;
+
+ private boolean freebusyAllowed;
+
+ private boolean affectsFreeBusy = true;
+
+ private String timezone;
+
+ private String color;
+
+ /** Constructor
+ *
+ * @param calType
+ * @param freebusyAllowed
+ * @throws WebdavException
+ */
+ public CalDAVCollectionBase(int calType,
+ boolean freebusyAllowed) throws WebdavException {
+ super();
+
+ this.calType = calType;
+ this.freebusyAllowed = freebusyAllowed;
+ }
+
+ /* ====================================================================
+ * Abstract method implementations
+ * ==================================================================== */
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#isAlias()
+ */
+ public boolean isAlias() throws WebdavException {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WdCollection#getAliasTarget()
+ */
+ public WdCollection getAliasTarget() throws WebdavException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#setCalType(int)
+ */
+ public void setCalType(int val) throws WebdavException {
+ calType = val;
+ }
+
+ public int getCalType() throws WebdavException {
+ return calType;
+ }
+
+ public boolean freebusyAllowed() throws WebdavException {
+ return freebusyAllowed;
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#entitiesAllowed()
+ */
+ public boolean entitiesAllowed() throws WebdavException {
+ return (calType == calTypeCalendarColl) ||
+ (calType == calTypeInbox) ||
+ (calType == calTypeOutbox);
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#setAffectsFreeBusy(boolean)
+ */
+ public void setAffectsFreeBusy(boolean val) throws WebdavException {
+ affectsFreeBusy = val;
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#getAffectsFreeBusy()
+ */
+ public boolean getAffectsFreeBusy() throws WebdavException {
+ return affectsFreeBusy;
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#setTimezone(java.lang.String)
+ */
+ public void setTimezone(String val) throws WebdavException {
+ timezone = val;
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#getTimezone()
+ */
+ public String getTimezone() throws WebdavException {
+ return timezone;
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#setColor(java.lang.String)
+ */
+ public void setColor(String val) throws WebdavException {
+ color = val;
+ }
+
+ /* (non-Javadoc)
+ * @see org.bedework.caldav.server.CalDAVCollection#getColor()
+ */
+ public String getColor() throws WebdavException {
+ return color;
+ }
+}
Modified: trunk/server/src/org/bedework/caldav/server/CaldavBWIntf.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavBWIntf.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/CaldavBWIntf.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -30,7 +30,6 @@
import org.bedework.caldav.server.calquery.CalendarData;
import org.bedework.caldav.server.calquery.FreeBusyQuery;
import org.bedework.caldav.server.filter.Filter;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwEvent;
import org.bedework.calfacade.BwEventObj;
import org.bedework.calfacade.BwOrganizer;
@@ -41,7 +40,6 @@
import org.bedework.calfacade.ScheduleResult;
import org.bedework.calfacade.RecurringRetrievalMode.Rmode;
import org.bedework.calfacade.ScheduleResult.ScheduleRecipientResult;
-import org.bedework.calfacade.base.BwShareableDbentity;
import org.bedework.calfacade.base.TimeRange;
import org.bedework.calfacade.configs.CalDAVConfig;
import org.bedework.calfacade.env.CalOptionsFactory;
@@ -307,23 +305,20 @@
* @see edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf#canPut(edu.rpi.cct.webdav.servlet.shared.WebdavNsNode)
*/
public boolean canPut(WebdavNsNode node) throws WebdavException {
- BwShareableDbentity ent;
- int access = PrivilegeDefs.privWriteContent;
+ if (!(node instanceof CaldavComponentNode)) {
+ return false;
+ }
- if (node instanceof CaldavComponentNode) {
- CaldavComponentNode comp = (CaldavComponentNode)node;
+ CaldavComponentNode comp = (CaldavComponentNode)node;
- if (comp.getEventInfo() != null) {
- ent = comp.getEventInfo().getEvent();
- } else {
- ent = comp.getCollection(true); // deref - we're trying to put into the target
- access = PrivilegeDefs.privBind;
- }
+ if (comp.getEventInfo() != null) {
+ return sysi.checkAccess(comp.getEventInfo().getEvent(),
+ PrivilegeDefs.privWriteContent,
+ true).getAccessAllowed();
} else {
- return false;
+ return sysi.checkAccess((CalDAVCollection)comp.getCollection(true), // deref - we're trying to put into the target
+ PrivilegeDefs.privBind, true).getAccessAllowed();
}
-
- return sysi.checkAccess(ent, access, true).getAccessAllowed();
}
/* (non-Javadoc)
@@ -389,68 +384,20 @@
return getNodeInt(uri, existance, nodeType, null, null, null);
}
- private WebdavNsNode getNodeInt(String uri,
- int existance,
- int nodeType,
- BwCalendar cal,
- EventInfo ei,
- BwResource r) throws WebdavException {
- if (debug) {
- debugMsg("About to get node for " + uri);
- }
-
- if (uri == null) {
- return null;
- }
-
- try {
- CaldavURI wi = findURI(uri, existance, nodeType, cal, ei, r);
-
- if (wi == null) {
- throw new WebdavNotFound(uri);
- }
-
- WebdavNsNode nd = null;
- AccessPrincipal ap = wi.getPrincipal();
-
- if (ap != null) {
- if (ap.getKind() == Ace.whoTypeUser) {
- nd = new CaldavUserNode(wi, sysi, null, debug);
- } else if (ap.getKind() == Ace.whoTypeGroup) {
- nd = new CaldavGroupNode(wi, sysi, null, debug);
- }
- } else if (wi.isCollection()) {
- nd = new CaldavCalNode(wi, sysi, debug);
- } else if (wi.isResource()) {
- nd = new CaldavResourceNode(wi, sysi, debug);
- } else {
- nd = new CaldavComponentNode(wi, sysi, debug);
- }
-
- return nd;
- } catch (WebdavException we) {
- throw we;
- } catch (Throwable t) {
- throw new WebdavException(t);
- }
- }
-
public void putNode(WebdavNsNode node)
throws WebdavException {
}
public void delete(WebdavNsNode node) throws WebdavException {
try {
- CaldavBwNode bwnode = getBwnode(node);
+ if (node instanceof CaldavResourceNode) {
+ CaldavResourceNode rnode = (CaldavResourceNode)node;
- if (bwnode instanceof CaldavResourceNode) {
- CaldavResourceNode rnode = (CaldavResourceNode)bwnode;
-
BwResource r = rnode.getResource();
sysi.deleteFile(r);
- } else if (bwnode instanceof CaldavComponentNode) {
- CaldavComponentNode cnode = (CaldavComponentNode)bwnode;
+ } else if (node instanceof CaldavComponentNode) {
+ CaldavComponentNode cnode = (CaldavComponentNode)node;
BwEvent ev = cnode.getEventInfo().getEvent();
@@ -465,15 +412,15 @@
}
}
} else {
- if (!(bwnode instanceof CaldavCalNode)) {
+ if (!(node instanceof CaldavCalNode)) {
throw new WebdavUnauthorized();
}
- CaldavCalNode cnode = (CaldavCalNode)bwnode;
+ CaldavCalNode cnode = (CaldavCalNode)node;
- BwCalendar cal = cnode.getCollection(false); // Don't deref for delete
+ CalDAVCollection col = (CalDAVCollection)cnode.getCollection(false); // Don't deref for delete
- sysi.deleteCalendar(cal);
+ sysi.deleteCollection(col);
}
} catch (WebdavException we) {
throw we;
@@ -487,53 +434,48 @@
*/
public Collection<WebdavNsNode> getChildren(WebdavNsNode node) throws WebdavException {
try {
- CaldavBwNode wdnode = getBwnode(node);
-
ArrayList<WebdavNsNode> al = new ArrayList<WebdavNsNode>();
- if (!wdnode.isCollection()) {
+ if (!node.isCollection()) {
// Don't think we should have been called
return al;
}
if (debug) {
- debugMsg("About to get children for " + wdnode.getUri());
+ debugMsg("About to get children for " + node.getUri());
}
- Collection children = wdnode.getChildren();
+ Collection children = node.getChildren();
if (children == null) {
// Perhaps no access
return al;
}
- String uri = wdnode.getUri();
- BwCalendar parent = wdnode.getCollection(true); // deref
+ String uri = node.getUri();
+ CalDAVCollection parent = (CalDAVCollection)node.getCollection(true); // deref
- Iterator it = children.iterator();
-
- while (it.hasNext()) {
- Object o = it.next();
- BwCalendar cal = null;
+ for (Object o: children) {
+ CalDAVCollection col = null;
BwResource r = null;
EventInfo ei = null;
String name;
int nodeType;
- if (o instanceof BwCalendar) {
- cal = (BwCalendar)o;
- name = cal.getName();
+ if (o instanceof CalDAVCollection) {
+ col = (CalDAVCollection)o;
+ name = col.getName();
nodeType = WebdavNsIntf.nodeTypeCollection;
if (debug) {
- debugMsg("Found child " + cal);
+ debugMsg("Found child " + col);
}
} else if (o instanceof BwResource) {
- cal = parent;
+ col = parent;
r = (BwResource)o;
name = r.getName();
nodeType = WebdavNsIntf.nodeTypeEntity;
} else if (o instanceof EventInfo) {
- cal = parent;
+ col = parent;
ei = (EventInfo)o;
name = ei.getEvent().getName();
nodeType = WebdavNsIntf.nodeTypeEntity;
@@ -543,7 +485,7 @@
al.add(getNodeInt(uri + "/" + name,
WebdavNsIntf.existanceDoesExist,
- nodeType, cal, ei, r));
+ nodeType, col, ei, r));
}
return al;
@@ -568,9 +510,7 @@
return null;
}
- CaldavBwNode bwnode = getBwnode(node);
-
- return bwnode.getContent();
+ return node.getContent();
} catch (WebdavException we) {
throw we;
} catch (Throwable t) {
@@ -591,7 +531,7 @@
throw new WebdavException("Unexpected node type");
}
- CaldavResourceNode bwnode = (CaldavResourceNode)getBwnode(node);
+ CaldavResourceNode bwnode = (CaldavResourceNode)node;
BwResource r = bwnode.getResource();
if (r.getContent() == null) {
@@ -686,14 +626,14 @@
}
/**
- * @param cal
+ * @param col
* @param rdr
* @return Icalendar
* @throws WebdavException
*/
- public Icalendar getIcal(BwCalendar cal, Reader rdr)
+ public Icalendar getIcal(CalDAVCollection col, Reader rdr)
throws WebdavException {
- return sysi.fromIcal(cal, new MyReader(rdr));
+ return sysi.fromIcal(col, new MyReader(rdr));
}
/* (non-Javadoc)
@@ -712,19 +652,20 @@
throw new WebdavException(HttpServletResponse.SC_PRECONDITION_FAILED);
}
- CaldavComponentNode bwnode = (CaldavComponentNode)getBwnode(node);
- BwCalendar cal = bwnode.getCollection(true); // deref - put into target
+ CaldavComponentNode bwnode = (CaldavComponentNode)node;
+ CalDAVCollection col = (CalDAVCollection)node.getCollection(true); // deref - put into target
boolean calContent = false;
if ((contentTypePars != null) && contentTypePars.length > 0) {
calContent = contentTypePars[0].equals("text/calendar");
}
- if (!cal.getCalendarCollection() || !calContent) {
+ if ((col.getCalType() != CalDAVCollection.calTypeCalendarColl) ||
+ !calContent) {
throw new WebdavForbidden(CaldavTags.supportedCalendarData);
}
- Icalendar ic = sysi.fromIcal(cal, new MyReader(contentRdr));
+ Icalendar ic = sysi.fromIcal(col, new MyReader(contentRdr));
/** We can only put a single resource - that resource will be an ics file
* containing freebusy information or an event or todo and possible overrides.
@@ -774,10 +715,11 @@
throw new WebdavException(HttpServletResponse.SC_PRECONDITION_FAILED);
}
- CaldavResourceNode bwnode = (CaldavResourceNode)getBwnode(node);
- BwCalendar cal = bwnode.getCollection(true);
+ CaldavResourceNode bwnode = (CaldavResourceNode)node;
+ CalDAVCollection col = (CalDAVCollection)node.getCollection(true);
- if ((cal == null) || cal.getCalendarCollection()) {
+ if ((col == null) ||
+ (col.getCalType() == CalDAVCollection.calTypeCalendarColl)) {
throw new WebdavException(HttpServletResponse.SC_PRECONDITION_FAILED);
}
@@ -846,7 +788,7 @@
r.setContentLength(res.length);
if (create) {
- sysi.putFile(cal, r);
+ sysi.putFile(col, r);
} else {
sysi.updateFile(r, true);
}
@@ -864,10 +806,10 @@
String ifEtag) throws WebdavException {
BwEvent ev = evinfo.getEvent();
String entityName = bwnode.getEntityName();
- BwCalendar cal = bwnode.getCollection(true); // deref
+ CalDAVCollection col = (CalDAVCollection)bwnode.getCollection(true); // deref
boolean created = false;
- ev.setColPath(cal.getPath());
+ ev.setColPath(col.getPath());
if (debug) {
debugMsg("putContent: intf has event with name " + entityName +
@@ -961,28 +903,31 @@
HttpServletResponse resp,
WebdavNsNode node) throws WebdavException {
try {
- CaldavCalNode bwnode = (CaldavCalNode)getBwnode(node);
+ if (!(node instanceof CaldavCalNode)) {
+ throw new WebdavBadRequest("Not a valid node object " +
+ node.getClass().getName());
+ }
+ CaldavCalNode bwnode = (CaldavCalNode)node;
+
/* The uri should have an entity name representing the new collection
- * and a calendar object representing the parent.
+ * and a collection object representing the parent.
*
* A namepart of null means that the path already exists
*/
- BwCalendar newCal = bwnode.getCollection(false); // No deref?
+ CalDAVCollection newCol = (CalDAVCollection)bwnode.getCollection(false); // No deref?
- BwCalendar parent = getSysi().getCalendar(newCal.getColPath());
- if (parent.getCalendarCollection()) {
+ CalDAVCollection parent = getSysi().getCollection(newCol.getParentPath());
+ if (parent.getCalType() == CalDAVCollection.calTypeCalendarColl) {
throw new WebdavForbidden(CaldavTags.calendarCollectionLocationOk);
}
- if (newCal.getName() == null) {
+ if (newCol.getName() == null) {
throw new WebdavForbidden("Forbidden: Null name");
}
- resp.setStatus(sysi.makeCollection(newCal,
- "MKCALENDAR".equalsIgnoreCase(req.getMethod()),
- parent.getPath()));
+ resp.setStatus(sysi.makeCollection(newCol));
} catch (WebdavException we) {
throw we;
} catch (Throwable t) {
@@ -1051,17 +996,17 @@
/* XXX This is NOT rename - we really move or copy.
* For the moment we'll deref both - but I think there are alias issues here
*/
- BwCalendar fromCal = fromCalNode.getCollection(true);
- BwCalendar toCal = toCalNode.getCollection(true);
+ CalDAVCollection fromCol = (CalDAVCollection)fromCalNode.getCollection(true);
+ CalDAVCollection toCol = (CalDAVCollection)toCalNode.getCollection(true);
- if ((fromCal == null) || (toCal == null)) {
+ if ((fromCol == null) || (toCol == null)) {
// What do we do here?
resp.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED);
return;
}
- getSysi().copyMove(fromCal, toCal, copy, overwrite);
+ getSysi().copyMove(fromCol, toCol, copy, overwrite);
if (toCalNode.getExists()) {
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
} else {
@@ -1090,10 +1035,10 @@
EventInfo fromEi = from.getEventInfo();
/* deref - copy/move into targetted collection */
- BwCalendar toCal = toNode.getCollection(true);
+ CalDAVCollection toCol = (CalDAVCollection)toNode.getCollection(true);
if (!getSysi().copyMove(fromEi,
- toCal, toNode.getEntityName(), copy,
+ toCol, toNode.getEntityName(), copy,
overwrite)) {
resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
} else {
@@ -1270,41 +1215,6 @@
return;
}
- /*
- CaldavCalNode calNode = (CaldavCalNode)node;
-
- BwCalendar cal = calNode.getCalendar();
- if (cal == null) {
- resp.sendError(HttpServletResponse.SC_NOT_FOUND, calPath);
- return;
- }
-
- BwFilter filter = null;
-
- String cat = req.getParameter("cat");
- if (cat != null) {
- PropertyInfo pi = PropertyIndex.propertyInfoByPname.get("CATEGORIES");
- BwObjectFilter<String> f = new BwObjectFilter<String>(null, pi.getPindex());
- f.setEntity(cat);
- f.setExact(false);
-
- filter = f;
- }
-
- try {
- BwDateTime sdt = dp.start;
- BwDateTime edt = dp.end;
-
- if (debug) {
- debugMsg("getEvents for start = " + sdt +
- " end = " + edt);
- }
-
- BwSubscription sub = BwSubscription.makeSubscription(cal);
-
- RecurringRetrievalMode rrm = new RecurringRetrievalMode(Rmode.expanded,
- sdt, edt);
- */
Collection<EventInfo> evs = new ArrayList<EventInfo>();
for (WebdavNsNode child: getChildren(node)) {
@@ -1402,7 +1312,7 @@
// May need a real principal hierarchy
if (node instanceof CaldavCalNode) {
// XXX to dref or not deref?
- sysi.updateAccess(((CaldavCalNode)node).getCollection(true), info.acl);
+ sysi.updateAccess((CalDAVCollection)node.getCollection(true), info.acl);
} else if (node instanceof CaldavComponentNode) {
sysi.updateAccess(((CaldavComponentNode)node).getEventInfo().getEvent(),
info.acl);
@@ -1417,11 +1327,10 @@
}
public void emitAcl(WebdavNsNode node) throws WebdavException {
- CaldavBwNode cdnode = getBwnode(node);
Acl acl = null;
try {
- if (cdnode.isCollection()) {
+ if (node.isCollection()) {
acl = node.getCurrentAccess().getAcl();
} else if (node instanceof CaldavComponentNode) {
acl = ((CaldavComponentNode)node).getEventInfo().getCurrentAccess().getAcl();
@@ -1620,7 +1529,7 @@
public Collection<WebdavNsNode> query(WebdavNsNode wdnode,
RecurringRetrievalMode retrieveRecur,
Filter fltr) throws WebdavException {
- CaldavBwNode node = getBwnode(wdnode);
+ CaldavBwNode node = (CaldavBwNode)wdnode;
Collection<EventInfo> events;
events = fltr.query(node, retrieveRecur);
@@ -1645,8 +1554,8 @@
for (EventInfo ei: events) {
BwEvent ev = ei.getEvent();
- BwCalendar cal = getSysi().getCalendar(ev.getColPath());
- String uri = cal.getPath();
+ CalDAVCollection col = getSysi().getCollection(ev.getColPath());
+ String uri = col.getPath();
/* If no name was assigned use the guid */
String evName = ev.getName();
@@ -1675,7 +1584,7 @@
CaldavComponentNode evnode = (CaldavComponentNode)getNodeInt(evuri,
WebdavNsIntf.existanceDoesExist,
WebdavNsIntf.nodeTypeEntity,
- cal, ei, null);
+ col, ei, null);
evnodes.add(evnode);
/*evnodeMap.put(evuri, evnode);
@@ -1711,7 +1620,7 @@
int depth) throws WebdavException {
try {
/* We need to deref as the freebusy comes from the target */
- BwCalendar c = cnode.getCollection(true);
+ CalDAVCollection c = (CalDAVCollection)cnode.getCollection(true);
if (c == null) {
// XXX - exception?
@@ -1730,40 +1639,56 @@
}
}
- /**
- * @param node
- * @return CaldavBwNode
- * @throws WebdavException
- */
- public CaldavBwNode getBwnode(WebdavNsNode node)
- throws WebdavException {
- if (!(node instanceof CaldavBwNode)) {
- throw new WebdavException("Not a valid node object " +
- node.getClass().getName());
+ /* ====================================================================
+ * Private methods
+ * ==================================================================== */
+
+ private WebdavNsNode getNodeInt(String uri,
+ int existance,
+ int nodeType,
+ CalDAVCollection col,
+ EventInfo ei,
+ BwResource r) throws WebdavException {
+ if (debug) {
+ debugMsg("About to get node for " + uri);
}
- return (CaldavBwNode)node;
- }
-
- /**
- * @param node
- * @param errstatus
- * @return CaldavCalNode
- * @throws WebdavException
- */
- public CaldavCalNode getCalnode(WebdavNsNode node, int errstatus)
- throws WebdavException {
- if (!(node instanceof CaldavCalNode)) {
- throw new WebdavException(errstatus);
+ if (uri == null) {
+ return null;
}
- return (CaldavCalNode)node;
- }
+ try {
+ CaldavURI wi = findURI(uri, existance, nodeType, col, ei, r);
- /* ====================================================================
- * Private methods
- * ==================================================================== */
+ if (wi == null) {
+ throw new WebdavNotFound(uri);
+ }
+ WebdavNsNode nd = null;
+ AccessPrincipal ap = wi.getPrincipal();
+
+ if (ap != null) {
+ if (ap.getKind() == Ace.whoTypeUser) {
+ nd = new CaldavUserNode(wi, sysi, null, debug);
+ } else if (ap.getKind() == Ace.whoTypeGroup) {
+ nd = new CaldavGroupNode(wi, sysi, null, debug);
+ }
+ } else if (wi.isCollection()) {
+ nd = new CaldavCalNode(wi, sysi, debug);
+ } else if (wi.isResource()) {
+ nd = new CaldavResourceNode(wi, sysi, debug);
+ } else {
+ nd = new CaldavComponentNode(wi, sysi, debug);
+ }
+
+ return nd;
+ } catch (WebdavException we) {
+ throw we;
+ } catch (Throwable t) {
+ throw new WebdavException(t);
+ }
+ }
+
/** Find the named item by following down the path from the root.
* This requires the names at each level to be unique (and present)
*
@@ -1780,7 +1705,7 @@
* @param uri String uri - just the path part
* @param existance Say's something about the state of existance
* @param nodeType Say's something about the type of node
- * @param cal Supplied BwCalendar object if we already have it.
+ * @param collection Supplied CalDAVCollection object if we already have it.
* @param ei
* @param rsrc
* @return CaldavURI object representing the uri
@@ -1789,7 +1714,7 @@
private CaldavURI findURI(String uri,
int existance,
int nodeType,
- BwCalendar cal,
+ final CalDAVCollection collection,
EventInfo ei,
BwResource rsrc) throws WebdavException {
try {
@@ -1832,11 +1757,11 @@
String name = null;
if (ei != null) {
name = ei.getEvent().getName();
- curi = new CaldavURI(cal, ei, name, true);
+ curi = new CaldavURI(collection, ei, name, true);
} else if (rsrc != null) {
- curi = new CaldavURI(cal, rsrc, true);
+ curi = new CaldavURI(collection, rsrc, true);
} else {
- curi = new CaldavURI(cal, ei, name, true);
+ curi = new CaldavURI(collection, ei, name, true);
}
//putUriPath(curi);
@@ -1849,9 +1774,9 @@
if (debug) {
debugMsg("search for collection uri \"" + uri + "\"");
}
- cal = sysi.getCalendar(uri);
+ CalDAVCollection col = sysi.getCollection(uri);
- if (cal == null) {
+ if (col == null) {
if ((nodeType == WebdavNsIntf.nodeTypeCollection) &&
(existance != WebdavNsIntf.existanceNot) &&
(existance != WebdavNsIntf.existanceMay)) {
@@ -1866,10 +1791,10 @@
}
if (debug) {
- debugMsg("create collection uri - cal=\"" + cal.getPath() + "\"");
+ debugMsg("create collection uri - cal=\"" + col.getPath() + "\"");
}
- curi = new CaldavURI(cal, true);
+ curi = new CaldavURI(col, true);
//putUriPath(curi);
return curi;
@@ -1887,9 +1812,9 @@
}
/* Look for the parent */
- cal = sysi.getCalendar(split.path);
+ CalDAVCollection col = sysi.getCollection(split.path);
- if (cal == null) {
+ if (col == null) {
if (nodeType == WebdavNsIntf.nodeTypeCollection) {
// Trying to create calendar/collection with no parent
throw new WebdavException(HttpServletResponse.SC_CONFLICT);
@@ -1900,41 +1825,39 @@
if (nodeType == WebdavNsIntf.nodeTypeCollection) {
// Trying to create calendar/collection
- BwCalendar newCal = new BwCalendar();
+ CalDAVCollection newCol = getSysi().newCollectionObject(false,
+ col.getPath());
+ newCol.setName(split.name);
+ newCol.setPath(col.getPath() + "/" + newCol.getName());
- newCal.setColPath(cal.getPath());
- newCal.setName(split.name);
- newCal.setPath(cal.getPath() + "/" + newCal.getName());
+ curi = new CaldavURI(newCol, false);
- curi = new CaldavURI(newCal, false);
- //putUriPath(curi);
-
return curi;
}
- if (cal.getCalendarCollection()) {
+ if (col.getCalType() == CalDAVCollection.calTypeCalendarColl) {
if (debug) {
- debugMsg("find event(s) - cal=\"" + cal.getPath() + "\" name=\"" +
+ debugMsg("find event(s) - cal=\"" + col.getPath() + "\" name=\"" +
split.name + "\"");
}
RecurringRetrievalMode rrm =
new RecurringRetrievalMode(Rmode.overrides);
- ei = sysi.getEvent(cal, split.name, rrm);
+ ei = sysi.getEvent(col, split.name, rrm);
if ((existance == WebdavNsIntf.existanceMust) && (ei == null)) {
throw new WebdavNotFound(uri);
}
- curi = new CaldavURI(cal, ei, split.name, ei != null);
+ curi = new CaldavURI(col, ei, split.name, ei != null);
} else {
if (debug) {
- debugMsg("find resource - cal=\"" + cal.getPath() + "\" name=\"" +
+ debugMsg("find resource - cal=\"" + col.getPath() + "\" name=\"" +
split.name + "\"");
}
/* Look for a resource */
- rsrc = sysi.getFile(cal, split.name);
+ rsrc = sysi.getFile(col, split.name);
if ((existance == WebdavNsIntf.existanceMust) && (rsrc == null)) {
throw new WebdavNotFound(uri);
@@ -1945,10 +1868,10 @@
if (!exists) {
rsrc = new BwResource();
rsrc.setName(split.name);
- rsrc.setColPath(cal.getPath());
+ rsrc.setColPath(col.getPath());
}
- curi = new CaldavURI(cal, rsrc, exists);
+ curi = new CaldavURI(col, rsrc, exists);
}
//putUriPath(curi);
Modified: trunk/server/src/org/bedework/caldav/server/CaldavBwNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavBwNode.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/CaldavBwNode.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -25,8 +25,7 @@
*/
package org.bedework.caldav.server;
-import org.bedework.calfacade.BwCalendar;
-
+import edu.rpi.cct.webdav.servlet.shared.WdCollection;
import edu.rpi.cct.webdav.servlet.shared.WebdavException;
import edu.rpi.cct.webdav.servlet.shared.WebdavNsIntf;
import edu.rpi.cct.webdav.servlet.shared.WebdavNsNode;
@@ -45,7 +44,7 @@
public abstract class CaldavBwNode extends WebdavNsNode {
// protected CaldavURI cdURI;
- protected BwCalendar cal;
+ protected CalDAVCollection col;
private final static HashMap<QName, PropertyTagEntry> propertyNames =
new HashMap<QName, PropertyTagEntry>();
@@ -60,7 +59,7 @@
/* for accessing calendars */
private SysIntf sysi;
- CaldavBwNode(CaldavURI cdURI, SysIntf sysi, boolean debug) {
+ CaldavBwNode(CaldavURI cdURI, SysIntf sysi, boolean debug) throws WebdavException {
super(sysi.getUrlHandler(), cdURI.getPath(), cdURI.isCollection(),
cdURI.getUri(), debug);
@@ -79,35 +78,22 @@
* Public methods
* ==================================================================== */
- /** The node may refer to a collection object which may in fact be an alias to
- * another. For deletions we want to remove the alias itself.
- *
- * <p>Move and rename are also targetted at the alias.
- *
- * <p>Other operations are probably intended to work on the underlying target
- * of the alias.
- *
- * @param deref true if we want to act upon the target of an alias.
- * @return Collection this node represents
- * @throws WebdavException
- */
- public BwCalendar getCollection(boolean deref) throws WebdavException {
+ public WdCollection getCollection(boolean deref) throws WebdavException {
if (!deref) {
- return cal;
+ return col;
}
- BwCalendar curCal = cal;
+ WdCollection curCol = col;
- if ((curCal != null) &&
- (curCal.getCalType() == BwCalendar.calTypeAlias)) {
- curCal = cal.getAliasTarget();
- if (curCal == null) {
- getSysi().resolveAlias(cal);
- curCal = cal.getAliasTarget();
+ if ((curCol != null) && curCol.isAlias()) {
+ curCol = col.getAliasTarget();
+ if (curCol == null) {
+ getSysi().resolveAlias(col);
+ curCol = col.getAliasTarget();
}
}
- return curCal;
+ return curCol;
}
/**
@@ -119,26 +105,14 @@
return false;
}
- BwCalendar c = getCollection(true);
+ CalDAVCollection c = (CalDAVCollection)getCollection(true);
if (c == null) {
return false;
}
- return c.getCalendarCollection();
+ return c.getCalType() == CalDAVCollection.calTypeCalendarColl;
}
- /** Return a collection of children objects. These will all be calendar
- * entities.
- *
- * <p>Default is to return null
- *
- * @return Collection
- * @throws WebdavException
- */
- public Collection getChildren() throws WebdavException {
- return null;
- }
-
/**
* @return CalSvcI
*/
@@ -170,6 +144,13 @@
return false;
}
+ /* (non-Javadoc)
+ * @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getChildren()
+ */
+ public Collection getChildren() throws WebdavException {
+ return null;
+ }
+
/* ====================================================================
* Property methods
* ==================================================================== */
Modified: trunk/server/src/org/bedework/caldav/server/CaldavCalNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavCalNode.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/CaldavCalNode.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -27,7 +27,6 @@
package org.bedework.caldav.server;
import org.bedework.caldav.server.SysIntf.CalPrincipalInfo;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwEvent;
import org.bedework.calfacade.RecurringRetrievalMode;
import org.bedework.calfacade.RecurringRetrievalMode.Rmode;
@@ -113,11 +112,12 @@
* @param cdURI
* @param sysi
* @param debug
+ * @throws WebdavException
*/
- public CaldavCalNode(CaldavURI cdURI, SysIntf sysi, boolean debug) {
+ public CaldavCalNode(CaldavURI cdURI, SysIntf sysi, boolean debug) throws WebdavException {
super(cdURI, sysi, debug);
- cal = cdURI.getCal();
+ col = cdURI.getCol();
collection = true;
allowsGet = false;
@@ -129,18 +129,14 @@
*/
public AccessPrincipal getOwner() throws WebdavException {
if (owner == null) {
- if (cal == null) {
+ if (col == null) {
return null;
}
- owner = getSysi().getPrincipal(cal.getOwnerHref());
+ owner = col.getOwner();
}
- if (owner != null) {
- return owner;
- }
-
- return null;
+ return owner;
}
public void init(boolean content) throws WebdavException {
@@ -154,13 +150,13 @@
*/
public String getEtagValue(boolean strong) throws WebdavException {
/* We need the etag of the target if this is an alias */
- BwCalendar c = getCollection(true); // deref
+ CalDAVCollection c = (CalDAVCollection)getCollection(true); // deref
if (c == null) {
return null;
}
- String val = c.getLastmod().getTagValue();
+ String val = c.getTagValue();
if (strong) {
return "\"" + val + "\"";
@@ -175,22 +171,22 @@
*/
public boolean getSchedulingAllowed() throws WebdavException {
/* It's the alias target that matters */
- BwCalendar c = getCollection(true); // deref
+ CalDAVCollection c = (CalDAVCollection)getCollection(true); // deref
if (c == null) {
return false;
}
int type = c.getCalType();
- if (type == BwCalendar.calTypeInbox) {
+ if (type == CalDAVCollection.calTypeInbox) {
return true;
}
- if (type == BwCalendar.calTypeOutbox) {
+ if (type == CalDAVCollection.calTypeOutbox) {
return true;
}
- if (type == BwCalendar.calTypeCollection) {
+ if (type == CalDAVCollection.calTypeCalendarColl) {
return true;
}
@@ -206,9 +202,9 @@
return;
}
- BwCalendar c = getCollection(false); // Don't deref
+ CalDAVCollection c = (CalDAVCollection)getCollection(false); // Don't deref
- c.setCalType(BwCalendar.calTypeCollection);
+ c.setCalType(CalDAVCollection.calTypeCalendarColl);
}
public Collection getChildren() throws WebdavException {
@@ -218,19 +214,19 @@
*/
try {
- BwCalendar c = getCollection(true); // deref
+ CalDAVCollection c = (CalDAVCollection)getCollection(true); // deref
if (c == null) { // no access?
return null;
}
- if (!c.getCollectionInfo().entitiesAllowed) {
+ if (!c.entitiesAllowed()) {
if (debug) {
debugMsg("POSSIBLE SEARCH: getChildren for cal " + c.getPath());
}
ArrayList ch = new ArrayList();
- ch.addAll(getSysi().getCalendars(c));
+ ch.addAll(getSysi().getCollections(c));
ch.addAll(getSysi().getFiles(c));
return ch;
@@ -290,8 +286,8 @@
*/
public void update() throws WebdavException {
// ALIAS probably not unaliasing here
- if (cal != null) {
- getSysi().updateCalendar(cal);
+ if (col != null) {
+ getSysi().updateCollection(col);
}
}
@@ -339,11 +335,11 @@
* @see edu.rpi.cct.webdav.servlet.shared.WebdavNsNode#getDisplayname()
*/
public String getDisplayname() throws WebdavException {
- if (cal == null) {
+ if (col == null) {
return null;
}
- return cal.getName();
+ return col.getName();
}
/* (non-Javadoc)
@@ -351,12 +347,12 @@
*/
public String getLastmodDate() throws WebdavException {
init(false);
- if (cal == null) {
+ if (col == null) {
return null;
}
try {
- return DateTimeUtil.fromISODateTimeUTCtoRfc822(cal.getLastmod().getTimestamp());
+ return DateTimeUtil.fromISODateTimeUTCtoRfc822(col.getLastmod());
} catch (Throwable t) {
throw new WebdavException(t);
}
@@ -371,7 +367,7 @@
return currentAccess;
}
- BwCalendar c = getCollection(true); // We want access of underlying object?
+ CalDAVCollection c = (CalDAVCollection)getCollection(true); // We want access of underlying object?
if (c == null) {
return null;
@@ -419,21 +415,21 @@
try {
if (XmlUtil.nodeMatches(val, WebdavTags.description)) {
if (checkCalForSetProp(spr)) {
- cal.setDescription(XmlUtil.getElementContent(val));
+ col.setDescription(XmlUtil.getElementContent(val));
}
return true;
}
if (XmlUtil.nodeMatches(val, CaldavTags.calendarDescription)) {
if (checkCalForSetProp(spr)) {
- cal.setDescription(XmlUtil.getElementContent(val));
+ col.setDescription(XmlUtil.getElementContent(val));
}
return true;
}
if (XmlUtil.nodeMatches(val, WebdavTags.displayname)) {
if (checkCalForSetProp(spr)) {
- cal.setSummary(XmlUtil.getElementContent(val));
+ col.setDisplayName(XmlUtil.getElementContent(val));
}
return true;
}
@@ -460,9 +456,9 @@
Element cval = XmlUtil.getOnlyElement(val);
if (XmlUtil.nodeMatches(cval, CaldavTags.opaque)) {
- cal.setAffectsFreeBusy(true);
+ col.setAffectsFreeBusy(true);
} else if (XmlUtil.nodeMatches(cval, CaldavTags.transparent)) {
- cal.setAffectsFreeBusy(true);
+ col.setAffectsFreeBusy(true);
} else {
throw new WebdavBadRequest();
}
@@ -472,7 +468,7 @@
if (XmlUtil.nodeMatches(val, CaldavTags.calendarFreeBusySet)) {
// Only valid for inbox
- if (cal.getCalType() != BwCalendar.calTypeInbox) {
+ if (col.getCalType() != CalDAVCollection.calTypeInbox) {
throw new WebdavForbidden("Not on inbox");
}
@@ -487,7 +483,7 @@
StringReader sr = new StringReader(XmlUtil.getElementContent(val));
// This call automatically saves the timezone in the db
- Icalendar ic = getSysi().fromIcal(cal, sr);
+ Icalendar ic = getSysi().fromIcal(col, sr);
if ((ic == null) ||
(ic.size() != 0) || // No components other than timezones
@@ -500,7 +496,7 @@
TimeZone tz = ic.getTimeZones().iterator().next();
- cal.setTimezone(tz.getID());
+ col.setTimezone(tz.getID());
} catch (WebdavException wde) {
throw wde;
} catch (Throwable t) {
@@ -511,7 +507,7 @@
}
if (XmlUtil.nodeMatches(val, AppleIcalTags.calendarColor)) {
- cal.setColor(XmlUtil.getElementContent(val));
+ col.setColor(XmlUtil.getElementContent(val));
return true;
}
@@ -545,7 +541,7 @@
XmlEmit xml = intf.getXmlEmit();
try {
- BwCalendar c = getCollection(true); // deref this
+ CalDAVCollection c = (CalDAVCollection)getCollection(true); // deref this
if (c == null) {
// Probably no access
return false;
@@ -558,16 +554,16 @@
xml.openTag(tag);
xml.emptyTag(WebdavTags.collection);
if (debug) {
- debugMsg("generatePropResourcetype for " + cal);
+ debugMsg("generatePropResourcetype for " + col);
}
//boolean isCollection = cal.getCalendarCollection();
- if (calType == BwCalendar.calTypeInbox) {
+ if (calType == CalDAVCollection.calTypeInbox) {
xml.emptyTag(CaldavTags.scheduleInbox);
- } else if (calType == BwCalendar.calTypeOutbox) {
+ } else if (calType == CalDAVCollection.calTypeOutbox) {
xml.emptyTag(CaldavTags.scheduleOutbox);
- } else if (calType == BwCalendar.calTypeCollection) {
+ } else if (calType == CalDAVCollection.calTypeCalendarColl) {
xml.emptyTag(CaldavTags.calendar);
}
xml.closeTag(tag);
@@ -590,7 +586,7 @@
}
if (tag.equals(CaldavTags.scheduleDefaultCalendarURL) &&
- (calType == BwCalendar.calTypeInbox)) {
+ (calType == CalDAVCollection.calTypeInbox)) {
xml.openTag(tag);
CalPrincipalInfo cinfo = getSysi().getCalPrincipalInfo(getOwner());
@@ -604,13 +600,13 @@
}
if (tag.equals(AppleServerTags.getctag)) {
- xml.property(tag, cal.getLastmod().getTagValue());
+ xml.property(tag, col.getTagValue());
return true;
}
if (tag.equals(AppleIcalTags.calendarColor)) {
- String val = cal.getColor();
+ String val = col.getColor();
if (val == null) {
return false;
@@ -622,12 +618,12 @@
}
if (tag.equals(CaldavTags.calendarDescription)) {
- xml.property(tag, cal.getDescription());
+ xml.property(tag, col.getDescription());
return true;
}
- if ((cal.getCalType() == BwCalendar.calTypeInbox) &&
+ if ((col.getCalType() == CalDAVCollection.calTypeInbox) &&
(tag.equals(CaldavTags.calendarFreeBusySet))) {
xml.openTag(tag);
@@ -649,7 +645,7 @@
* <C:comp name="VTODO"/>
* </C:supported-calendar-component-set>
*/
- if (!cal.getCalendarCollection()) {
+ if (calType != CalDAVCollection.calTypeCalendarColl) {
return true;
}
@@ -684,7 +680,7 @@
}
if (tag.equals(CaldavTags.calendarTimezone)) {
- String tzid = cal.getTimezone();
+ String tzid = col.getTimezone();
if (tzid == null) {
return false;
@@ -729,7 +725,7 @@
*/
public Collection<QName> getSupportedReports() throws WebdavException {
Collection<QName> res = new ArrayList<QName>();
- BwCalendar c = getCollection(true); // deref
+ CalDAVCollection c = (CalDAVCollection)getCollection(true); // deref
if (c == null) {
return res;
@@ -738,7 +734,7 @@
res.addAll(super.getSupportedReports());
/* Cannot do free-busy on in and outbox */
- if (c.getCollectionInfo().allowFreeBusy) {
+ if (c.freebusyAllowed()) {
res.add(CaldavTags.freeBusyQuery); // Calendar access
}
@@ -750,7 +746,7 @@
* ==================================================================== */
public String toString() {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append("CaldavCalNode{cduri=");
sb.append("path=");
@@ -771,7 +767,7 @@
* ==================================================================== */
private boolean checkCalForSetProp(SetPropertyResult spr) {
- if (cal != null) {
+ if (col != null) {
return true;
}
Modified: trunk/server/src/org/bedework/caldav/server/CaldavComponentNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavComponentNode.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/CaldavComponentNode.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -163,7 +163,7 @@
SysIntf sysi, boolean debug) throws WebdavException {
super(cdURI, sysi, debug);
- cal = cdURI.getCal();
+ col = cdURI.getCol();
collection = false;
allowsGet = true;
entityName = cdURI.getEntityName();
Modified: trunk/server/src/org/bedework/caldav/server/CaldavResourceNode.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavResourceNode.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/CaldavResourceNode.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -74,7 +74,7 @@
super(cdURI, sysi, debug);
resource = cdURI.getResource();
- cal = cdURI.getCal();
+ col = cdURI.getCol();
collection = false;
allowsGet = true;
entityName = cdURI.getEntityName();
Modified: trunk/server/src/org/bedework/caldav/server/CaldavURI.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/CaldavURI.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/CaldavURI.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -54,10 +54,10 @@
package org.bedework.caldav.server;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwResource;
import org.bedework.calfacade.svc.EventInfo;
+import edu.rpi.cct.webdav.servlet.shared.WebdavException;
import edu.rpi.cmt.access.AccessPrincipal;
/** We map uris onto an object which may be a calendar or an
@@ -77,7 +77,7 @@
/* For a resource or an entity, this is the containing collection
*/
- BwCalendar cal;
+ CalDAVCollection col;
BwResource resource;
@@ -88,42 +88,38 @@
String entityName;
String path; // for principals
-// boolean userUri; // entityname is user
-
boolean resourceUri; // entityname is resource
-// boolean groupUri;// entityname is group
-
/** Reference to a collection
*
- * @param cal
+ * @param col
* @param exists true if the referenced object exists
*/
- CaldavURI(BwCalendar cal, boolean exists) {
- init(cal, null, null, null, exists);
+ CaldavURI(CalDAVCollection col, boolean exists) {
+ init(col, null, null, null, exists);
}
/** Reference to a contained entity
*
- * @param cal
+ * @param col
* @param entity
* @param entityName
* @param exists true if the referenced object exists
*/
- CaldavURI(BwCalendar cal, EventInfo entity, String entityName,
+ CaldavURI(CalDAVCollection col, EventInfo entity, String entityName,
boolean exists) {
- init(cal, null, entity, entityName, exists);
+ init(col, null, entity, entityName, exists);
}
/** Reference to a contained resource
*
- * @param cal
+ * @param col
* @param res
* @param exists true if the referenced object exists
*/
- CaldavURI(BwCalendar cal, BwResource res,
+ CaldavURI(CalDAVCollection col, BwResource res,
boolean exists) {
- init(cal, res, null, res.getName(), exists);
+ init(col, res, null, res.getName(), exists);
resourceUri = true;
}
@@ -133,15 +129,15 @@
CaldavURI(AccessPrincipal pi) {
principal = pi;
exists = true;
- cal = null;
+ col = null;
entityName = pi.getAccount();
path = pi.getPrincipalRef();
}
- private void init(BwCalendar cal, BwResource res,
+ private void init(CalDAVCollection col, BwResource res,
EventInfo entity, String entityName,
boolean exists) {
- this.cal = cal;
+ this.col = col;
this.resource = res;
this.entity = entity;
this.entityName = entityName;
@@ -156,10 +152,10 @@
}
/**
- * @return BwCalendar
+ * @return CalDAVCollection
*/
- public BwCalendar getCal() {
- return cal;
+ public CalDAVCollection getCol() {
+ return col;
}
/**
@@ -178,9 +174,10 @@
/**
* @return String
+ * @throws WebdavException
*/
- public String getCalName() {
- return cal.getName();
+ public String getCalName() throws WebdavException {
+ return col.getName();
}
/**
@@ -192,19 +189,21 @@
/**
* @return String
+ * @throws WebdavException
*/
- public String getPath() {
+ public String getPath() throws WebdavException {
if (principal != null) {
return path;
}
- return cal.getPath();
+ return col.getPath();
}
/**
* @return String
+ * @throws WebdavException
*/
- public String getUri() {
+ public String getUri() throws WebdavException {
if ((entityName == null) ||
(principal != null)) {
return getPath();
@@ -254,9 +253,14 @@
}
public String toString() {
- StringBuffer sb = new StringBuffer("CaldavURI{path=");
+ StringBuilder sb = new StringBuilder("CaldavURI{path=");
- sb.append(getPath());
+ try {
+ sb.append(getPath());
+ } catch (Throwable t) {
+ sb.append("Exception: ");
+ sb.append(t.getMessage());
+ }
sb.append(", entityName=");
sb.append(String.valueOf(entityName));
sb.append("}");
@@ -265,13 +269,17 @@
}
public int hashCode() {
- if (principal != null) {
- return principal.hashCode();
- }
+ try {
+ if (principal != null) {
+ return principal.hashCode();
+ }
- int hc = entityName.hashCode();
+ int hc = entityName.hashCode();
- return hc * 3 + cal.getPath().hashCode();
+ return hc * 3 + col.getPath().hashCode();
+ } catch (Throwable t) {
+ throw new RuntimeException(t);
+ }
}
public boolean equals(Object o) {
@@ -289,19 +297,19 @@
return principal.equals(that.principal);
}
- if (cal == null) {
- if (that.cal != null) {
+ if (col == null) {
+ if (that.col != null) {
return false;
}
return true;
}
- if (that.cal == null) {
+ if (that.col == null) {
return false;
}
- if (!cal.equals(that.cal)) {
+ if (!col.equals(that.col)) {
return false;
}
Modified: trunk/server/src/org/bedework/caldav/server/PostMethod.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/PostMethod.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/PostMethod.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -26,7 +26,6 @@
package org.bedework.caldav.server;
import org.bedework.caldav.server.SysIntf.CalPrincipalInfo;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwEvent;
import org.bedework.calfacade.BwOrganizer;
import org.bedework.calfacade.ScheduleResult;
@@ -83,7 +82,7 @@
Icalendar ic;
- BwCalendar cal;
+ CalDAVCollection cal;
/* true if this is a realtime request from some other server */
boolean realTime;
@@ -259,13 +258,14 @@
}
/* (CALDAV:supported-collection) */
- CaldavCalNode calnode = intf.getCalnode(node,
- HttpServletResponse.SC_FORBIDDEN);
+ if (!(node instanceof CaldavCalNode)) {
+ throw new WebdavException(HttpServletResponse.SC_FORBIDDEN);
+ }
/* Don't deref - this should be targetted at a real outbox */
- pars.cal = calnode.getCollection(false);
+ pars.cal = (CalDAVCollection)node.getCollection(false);
- if (pars.cal.getCalType() != BwCalendar.calTypeOutbox) {
+ if (pars.cal.getCalType() != CalDAVCollection.calTypeOutbox) {
if (debug) {
debugMsg("Not targetted at Outbox");
}
Modified: trunk/server/src/org/bedework/caldav/server/SysIntf.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/SysIntf.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/SysIntf.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -26,7 +26,6 @@
package org.bedework.caldav.server;
import org.bedework.caldav.server.PropertyHandler.PropertyType;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwDateTime;
import org.bedework.calfacade.BwEvent;
import org.bedework.calfacade.BwEventProxy;
@@ -326,34 +325,34 @@
public void updateEvent(EventInfo event,
ChangeTable changes) throws WebdavException;
- /** Return the events for the current user in the given calendar using the
+ /** Return the events for the current user in the given collection using the
* supplied filter. Stored freebusy objects are returned as BwEvent
* objects with the appropriate entity type.
*
* <p>We flag the desired entity types.
*
- * @param cal
+ * @param col
* @param filter - if non-null defines a search filter
* @param recurRetrieval How recurring event is returned.
* @return Collection populated event value objects
* @throws WebdavException
*/
- public Collection<EventInfo> getEvents(BwCalendar cal,
+ public Collection<EventInfo> getEvents(CalDAVCollection col,
BwFilter filter,
RecurringRetrievalMode recurRetrieval)
throws WebdavException;
- /** Get events given the calendar and String name. Return null for not
+ /** Get events given the collection and String name. Return null for not
* found. There should be only one event or none. For recurring, the
* overrides and possibly the instances will be attached.
*
- * @param cal BwCalendar object
+ * @param col CalDAVCollection object
* @param val String possible name
* @param recurRetrieval
* @return EventInfo or null
* @throws WebdavException
*/
- public EventInfo getEvent(BwCalendar cal, String val,
+ public EventInfo getEvent(CalDAVCollection col, String val,
RecurringRetrievalMode recurRetrieval)
throws WebdavException;
@@ -365,12 +364,6 @@
public void deleteEvent(BwEvent ev,
boolean scheduleReply) throws WebdavException;
- /**
- * @param cal
- * @throws WebdavException
- */
- public void deleteCalendar(BwCalendar cal) throws WebdavException;
-
/** Get the free busy for one or more principals based on the given VFREEBUSY
* request.
*
@@ -383,16 +376,18 @@
throws WebdavException;
/** Generate a free busy object for the given time period which reflects
- * the state of the given calendar.
+ * the state of the given collection.
*
- * @param cals
+ * @param col
+ * @param depth
* @param account
* @param start
* @param end
* @return BwEvent
* @throws WebdavException
*/
- public BwEvent getFreeBusy(final Collection<BwCalendar> cals,
+ public BwEvent getFreeBusy(final CalDAVCollection col,
+ final int depth,
final String account,
final BwDateTime start,
final BwDateTime end) throws WebdavException;
@@ -412,96 +407,126 @@
throws WebdavException;
/**
- * @param cal
+ * @param ev
* @param acl
* @throws WebdavException
*/
- public void updateAccess(BwCalendar cal,
+ public void updateAccess(BwEvent ev,
Acl acl) throws WebdavException;
+ /** Copy or move the given entity to the destination collection with the given name.
+ * Status is set on return
+ *
+ * @param from Source entity
+ * @param to Destination collection
+ * @param name String name of new entity
+ * @param copy true for copying
+ * @param overwrite destination exists
+ * @return true if destination created (i.e. not updated)
+ * @throws WebdavException
+ */
+ public boolean copyMove(EventInfo from,
+ CalDAVCollection to,
+ String name,
+ boolean copy,
+ boolean overwrite) throws WebdavException;
+
+ /* ====================================================================
+ * Collections
+ * ==================================================================== */
+
+ /** Return a new object representing the parameters. No collection is
+ * created. makeCollection must be called subsequently with the object.
+ *
+ * @param isCalendarCollection
+ * @param parentPath
+ * @return CalDAVCollection
+ * @throws WebdavException
+ */
+ public CalDAVCollection newCollectionObject(boolean isCalendarCollection,
+ String parentPath) throws WebdavException;
+
/**
- * @param ev
+ * @param col
* @param acl
* @throws WebdavException
*/
- public void updateAccess(BwEvent ev,
+ public void updateAccess(CalDAVCollection col,
Acl acl) throws WebdavException;
+ /** Check the access for the given entity. Returns the current access
+ * or null or optionally throws a no access exception.
+ *
+ * @param col
+ * @param desiredAccess
+ * @param returnResult
+ * @return CurrentAccess
+ * @throws WebdavException if returnResult false and no access
+ */
+ public CurrentAccess checkAccess(CalDAVCollection col,
+ int desiredAccess,
+ boolean returnResult)
+ throws WebdavException;
+
/**
- * @param cal Initialised collection object
- *
- * @param calendarCollection
- * @param parentPath
+ * @param col Initialised collection object
* @return int status
* @throws WebdavException
*/
- public int makeCollection(BwCalendar cal,
- boolean calendarCollection,
- String parentPath) throws WebdavException;
+ public int makeCollection(CalDAVCollection col) throws WebdavException;
/** Copy or move the collection to another location.
* Status is set on return
*
- * @param from Source calendar
- * @param to Destination calendar
+ * @param from Source collection
+ * @param to Destination collection
* @param copy true for copying
* @param overwrite destination exists
* @throws WebdavException
*/
- public void copyMove(BwCalendar from,
- BwCalendar to,
+ public void copyMove(CalDAVCollection from,
+ CalDAVCollection to,
boolean copy,
boolean overwrite) throws WebdavException;
- /** Copy or move the given entity to the destination calendar with the given name.
- * Status is set on return
+ /** Get a collection given the path
*
- * @param from Source entity
- * @param to Destination calendar
- * @param name String name of new entity
- * @param copy true for copying
- * @param overwrite destination exists
- * @return true if destination created (i.e. not updated)
+ * @param path String path of calendar
+ * @return CalDAVCollection null for unknown collection
* @throws WebdavException
*/
- public boolean copyMove(EventInfo from,
- BwCalendar to,
- String name,
- boolean copy,
- boolean overwrite) throws WebdavException;
+ public CalDAVCollection getCollection(String path) throws WebdavException;
- /** Get a calendar given the path
+ /** Update a collection.
*
- * @param path String path of calendar
- * @return BwCalendar null for unknown calendar
+ * @param val updated CalDAVCollection object
* @throws WebdavException
*/
- public BwCalendar getCalendar(String path) throws WebdavException;
+ public void updateCollection(CalDAVCollection val) throws WebdavException;
- /** Update a calendar.
- *
- * @param val updated BwCalendar object
+ /**
+ * @param col
* @throws WebdavException
*/
- public void updateCalendar(BwCalendar val) throws WebdavException;
+ public void deleteCollection(CalDAVCollection col) throws WebdavException;
- /** Returns children of the given calendar to which the current user has
+ /** Returns children of the given collection to which the current user has
* some access.
*
- * @param cal parent calendar
- * @return Collection of BwCalendar
+ * @param col parent collection
+ * @return Collection of CalDAVCollection
* @throws WebdavException
*/
- public Collection<BwCalendar> getCalendars(BwCalendar cal)
+ public Collection<CalDAVCollection> getCollections(CalDAVCollection col)
throws WebdavException;
/** If the parameter is an alias and the target has not been resolved it will
- * be fetched adn implanted in the paramater object.
+ * be fetched and implanted in the parameter object.
*
- * @param cal
+ * @param col
* @throws WebdavException
*/
- public void resolveAlias(BwCalendar cal) throws WebdavException;
+ public void resolveAlias(CalDAVCollection col) throws WebdavException;
/* ====================================================================
* Files
@@ -509,21 +534,21 @@
/** PUT a file.
*
- * @param coll BwCalendar defining recipient collection
+ * @param coll CalDAVCollection defining recipient collection
* @param val BwResource
* @throws WebdavException
*/
- public void putFile(BwCalendar coll,
+ public void putFile(CalDAVCollection coll,
BwResource val) throws WebdavException;
/** GET a file.
*
- * @param coll BwCalendar containing file
+ * @param coll CalDAVCollection containing file
* @param name
* @return BwResource
* @throws WebdavException
*/
- public BwResource getFile(BwCalendar coll,
+ public BwResource getFile(CalDAVCollection coll,
String name) throws WebdavException;
/** Get resource content given the resource. It will be set in the resource
@@ -536,11 +561,11 @@
/** Get the files in a collection.
*
- * @param coll BwCalendar containing file
+ * @param coll CalDAVCollection containing file
* @return Collection of BwResource
* @throws WebdavException
*/
- public Collection<BwResource> getFiles(BwCalendar coll) throws WebdavException;
+ public Collection<BwResource> getFiles(CalDAVCollection coll) throws WebdavException;
/** Update a file.
*
@@ -595,12 +620,12 @@
/** Convert the Icalendar reader to a Collection of Calendar objects
*
- * @param cal calendar in which to place entities
+ * @param col collection in which to place entities
* @param rdr
* @return Icalendar
* @throws WebdavException
*/
- public Icalendar fromIcal(BwCalendar cal, Reader rdr) throws WebdavException;
+ public Icalendar fromIcal(CalDAVCollection col, Reader rdr) throws WebdavException;
/** Create a Calendar object from the named timezone and convert to
* a String representation
Modified: trunk/server/src/org/bedework/caldav/server/calquery/FreeBusyQuery.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/calquery/FreeBusyQuery.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/calquery/FreeBusyQuery.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -25,27 +25,20 @@
*/
package org.bedework.caldav.server.calquery;
+import org.bedework.caldav.server.CalDAVCollection;
import org.bedework.caldav.server.SysIntf;
import org.bedework.calfacade.base.TimeRange;
import org.bedework.calfacade.util.xml.CalDavParseUtil;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.BwEvent;
-import org.bedework.calfacade.BwEventObj;
-import org.bedework.calfacade.CalFacadeDefs;
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.sss.util.xml.XmlUtil;
import edu.rpi.sss.util.xml.tagdefs.CaldavTags;
-import edu.rpi.sss.util.xml.tagdefs.WebdavTags;
import org.apache.log4j.Logger;
import org.w3c.dom.Node;
-import java.util.ArrayList;
-import java.util.Collection;
-
/**
* @author Mike Douglass douglm @ rpi.edu
*/
@@ -94,53 +87,20 @@
/**
* @param sysi
- * @param cal
+ * @param col
* @param account
* @param depth
* @return BwEvent
* @throws WebdavException
*/
- public BwEvent getFreeBusy(SysIntf sysi, BwCalendar cal,
+ public BwEvent getFreeBusy(SysIntf sysi, CalDAVCollection col,
String account,
int depth) throws WebdavException {
try {
- int calType = cal.getCalType();
+ BwEvent fb = sysi.getFreeBusy(col, depth, account,
+ timeRange.getStart(),
+ timeRange.getEnd());
- if (!BwCalendar.collectionInfo[calType].allowFreeBusy) {
- throw new WebdavForbidden(WebdavTags.supportedReport);
- }
-
- Collection<BwCalendar> cals = new ArrayList<BwCalendar>();
-
- if (calType == BwCalendar.calTypeCollection) {
- cals.add(cal);
- } else if (depth == 0) {
- /* Cannot return anything */
- } else {
- /* Make new cal object with just calendar collections as children */
-
- for (BwCalendar ch: sysi.getCalendars(cal)) {
- // For depth 1 we only add calendar collections
- if ((depth > 1) ||
- (ch.getCalType() == BwCalendar.calTypeCollection)) {
- cals.add(ch);
- }
- }
- }
-
- BwEvent fb;
- if (cals.isEmpty()) {
- // Retiurn an empty object
- fb = new BwEventObj();
- fb.setEntityType(CalFacadeDefs.entityTypeFreeAndBusy);
- fb.setDtstart(timeRange.getStart());
- fb.setDtend(timeRange.getEnd());
- } else {
- fb = sysi.getFreeBusy(cals, account,
- timeRange.getStart(),
- timeRange.getEnd());
- }
-
if (debug) {
trace("Got " + fb);
}
Modified: trunk/server/src/org/bedework/caldav/server/filter/Filter.java
===================================================================
--- trunk/server/src/org/bedework/caldav/server/filter/Filter.java 2009-02-25 15:22:33 UTC (rev 328)
+++ trunk/server/src/org/bedework/caldav/server/filter/Filter.java 2009-02-26 04:37:44 UTC (rev 329)
@@ -25,9 +25,9 @@
*/
package org.bedework.caldav.server.filter;
+import org.bedework.caldav.server.CalDAVCollection;
import org.bedework.caldav.server.CaldavBwNode;
import org.bedework.caldav.server.CaldavComponentNode;
-import org.bedework.calfacade.BwCalendar;
import org.bedework.calfacade.CalFacadeDefs;
import org.bedework.calfacade.RecurringRetrievalMode;
import org.bedework.calfacade.exc.CalFacadeException;
@@ -188,7 +188,7 @@
Collection<EventInfo> events;
- BwCalendar c = wdnode.getCollection(true);
+ CalDAVCollection c = (CalDAVCollection)wdnode.getCollection(true);
if (c == null) {
return null;
}
More information about the Bedework-commit
mailing list