51 return 'notifications';
69 $server->
on(
'method:GET', [$this,
'httpGet'], 90);
70 $server->
on(
'propFind', [$this,
'propFind']);
72 $server->xml->namespaceMap[self::NS_CALENDARSERVER] =
'cs';
73 $server->resourceTypeMapping[
'\\Sabre\\CalDAV\\Notifications\\ICollection'] =
'{' . self::NS_CALENDARSERVER .
'}notification';
75 array_push($server->protectedProperties,
76 '{' . self::NS_CALENDARSERVER .
'}notification-URL',
77 '{' . self::NS_CALENDARSERVER .
'}notificationtype' 95 $principalUrl = $node->getPrincipalUrl();
98 $propFind->
handle(
'{' . self::NS_CALENDARSERVER .
'}notification-URL',
function() use ($principalUrl,
$caldavPlugin) {
100 $notificationPath =
$caldavPlugin->getCalendarHomeForPrincipal($principalUrl) .
'/notifications/';
107 if ($node instanceof
INode) {
110 '{' . self::NS_CALENDARSERVER .
'}notificationtype',
111 [$node,
'getNotificationType']
133 $node = $this->server->tree->getNodeForPath(
$path);
138 if (!$node instanceof
INode)
141 $writer = $this->server->xml->getWriter();
142 $writer->contextUri = $this->server->getBaseUri();
143 $writer->openMemory();
144 $writer->startDocument(
'1.0',
'UTF-8');
145 $writer->startElement(
'{http://calendarserver.org/ns/}notification');
146 $node->getNotificationType()->xmlSerializeFull($writer);
147 $writer->endElement();
149 $response->
setHeader(
'Content-Type',
'application/xml');
150 $response->
setHeader(
'ETag', $node->getETag());
152 $response->
setBody($writer->outputMemory());
174 'description' =>
'Adds support for caldav-notifications, which is required to enable caldav-sharing.',
175 'link' =>
'http://sabre.io/dav/caldav-sharing/',
This interface represents a HTTP response.
httpGet(RequestInterface $request, ResponseInterface $response)
This event is triggered before the usual GET request handler.
The RequestInterface represents a HTTP request.
handle($propertyName, $valueOrCallBack)
Handles a specific property.
getPluginInfo()
Returns a bunch of meta-data about the plugin.
The baseclass for all server plugins.
setBody($body)
Updates the body resource with a new stream.
on($eventName, callable $callBack, $priority=100)
Subscribe to an event.
foreach($paths as $path) $request
const NS_CALENDARSERVER
This is the namespace for the proprietary calendarserver extensions.
This node represents a single notification.
This class holds all the information about a PROPFIND request.
propFind(PropFind $propFind, BaseINode $node)
PropFind.
setStatus($status)
Sets the HTTP status code.
getPath()
Returns the relative path.
getPluginName()
Returns a plugin name.
initialize(Server $server)
This initializes the plugin.
setHeader($name, $value)
Updates a HTTP header.