74 throw new DAV\Exception\Forbidden();
85 throw new DAV\Exception\Forbidden();
111 throw new DAV\Exception\MethodNotAllowed(
'Creating new files in this collection is not supported');
125 throw new DAV\Exception\MethodNotAllowed(
'Creating new collections in this collection is not supported');
138 if (
$name ===
'inbox' && $this->caldavBackend instanceof Backend\SchedulingSupport) {
139 return new Schedule\Inbox($this->caldavBackend, $this->principalInfo[
'uri']);
141 if (
$name ===
'outbox' && $this->caldavBackend instanceof Backend\SchedulingSupport) {
144 if (
$name ===
'notifications' && $this->caldavBackend instanceof Backend\NotificationSupport) {
149 foreach ($this->caldavBackend->getCalendarsForUser($this->principalInfo[
'uri']) as
$calendar) {
151 if ($this->caldavBackend instanceof Backend\SharingSupport) {
159 if ($this->caldavBackend instanceof Backend\SubscriptionSupport) {
160 foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo[
'uri']) as $subscription) {
161 if ($subscription[
'uri'] ===
$name) {
168 throw new NotFound(
'Node with name \'' .
$name .
'\' could not be found
'); 178 function childExists($name) { 181 return !!$this->getChild($name); 182 } catch (NotFound $e) { 193 function getChildren() { 195 $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri
']); 197 foreach ($calendars as $calendar) { 198 if ($this->caldavBackend instanceof Backend\SharingSupport) { 199 $objs[] = new SharedCalendar($this->caldavBackend, $calendar); 201 $objs[] = new Calendar($this->caldavBackend, $calendar); 205 if ($this->caldavBackend instanceof Backend\SchedulingSupport) { 206 $objs[] = new Schedule\Inbox($this->caldavBackend, $this->principalInfo['uri
']); 207 $objs[] = new Schedule\Outbox($this->principalInfo['uri
']); 210 // We're adding
a notifications node,
if it
's supported by the backend. 211 if ($this->caldavBackend instanceof Backend\NotificationSupport) { 212 $objs[] = new Notifications\Collection($this->caldavBackend, $this->principalInfo['uri
']); 215 // If the backend supports subscriptions, we'll
add those as well,
216 if ($this->caldavBackend instanceof Backend\SubscriptionSupport) {
217 foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo[
'uri']) as $subscription) {
237 $isSubscription =
false;
240 case '{DAV:}collection' :
241 case '{http://calendarserver.org/ns/}shared-owner' :
244 case '{urn:ietf:params:xml:ns:caldav}calendar' :
247 case '{http://calendarserver.org/ns/}subscribed' :
248 $isSubscription =
true;
251 throw new DAV\Exception\InvalidResourceType(
'Unknown resourceType: ' . $rt);
258 if ($isSubscription) {
259 if (!$this->caldavBackend instanceof Backend\SubscriptionSupport) {
260 throw new DAV\Exception\InvalidResourceType(
'This backend does not support subscriptions');
262 $this->caldavBackend->createSubscription($this->principalInfo[
'uri'],
$name, $properties);
264 } elseif ($isCalendar) {
265 $this->caldavBackend->createCalendar($this->principalInfo[
'uri'],
$name, $properties);
268 throw new DAV\Exception\InvalidResourceType(
'You can only create calendars and subscriptions in this collection');
281 return $this->principalInfo[
'uri'];
301 'privilege' =>
'{DAV:}read',
302 'principal' => $this->principalInfo[
'uri'],
306 'privilege' =>
'{DAV:}write',
307 'principal' => $this->principalInfo[
'uri'],
311 'privilege' =>
'{DAV:}read',
312 'principal' => $this->principalInfo[
'uri'] .
'/calendar-proxy-write',
316 'privilege' =>
'{DAV:}write',
317 'principal' => $this->principalInfo[
'uri'] .
'/calendar-proxy-write',
321 'privilege' =>
'{DAV:}read',
322 'principal' => $this->principalInfo[
'uri'] .
'/calendar-proxy-read',
346 if (!$this->caldavBackend instanceof Backend\SharingSupport) {
347 throw new DAV\Exception\NotImplemented(
'Sharing support is not implemented by this backend.');
350 return $this->caldavBackend->shareReply($href, $status, $calendarUri, $inReplyTo,
$summary);
374 return $this->caldavBackend->getCalendarObjectByUID($this->principalInfo[
'uri'], $uid);
This node represents a list of notifications.
shareReply($href, $status, $calendarUri, $inReplyTo, $summary=null)
This method is called when a user replied to a request to share.
createDirectory($filename)
Creates a new directory under this object.
The CalendarHome represents a node that is usually in a users' calendar-homeset.
The CalDAV scheduling outbox.
getCalendarObjectByUID($uid)
Searches through all of a users calendars and calendar objects to find an object with a specific UID...
This object represents a CalDAV calendar that is shared by a different user.
getOwner()
Returns the owner of the calendar home.
getChild($name)
Returns a single calendar, by name.
getName()
Returns the name of this object.
The CalDAV scheduling inbox.
createFile($filename, $data=null)
Creates a new file under this object.
The IExtendedCollection interface.
__construct(Backend\BackendInterface $caldavBackend, $principalInfo)
Constructor.
setRemainingResultCode($resultCode)
Sets the result code for all properties that did not have a result yet.
setName($name)
Updates the name of this object.
getLastModified()
Returns the last modification date.
createExtendedCollection($name, MkCol $mkCol)
Creates a new calendar or subscription.
This class represents a MKCOL operation.
getACL()
Returns a list of ACE's for this node.
getRemainingValues()
Returns the list of properties that don't have a result code yet.
This object represents a CalDAV calendar.
Implement this interface to create your own principal backends.
static splitPath($path)
Returns the 'dirname' and 'basename' for a path.
getResourceType()
Returns the resourcetype of the new collection.