51 return 'notifications';
69 $server->on(
'method:GET', [$this,
'httpGet'], 90);
70 $server->on(
'propFind', [$this,
'propFind']);
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/',
foreach($paths as $path) $request
An exception for terminatinating execution or to throw for unit testing.
initialize(Server $server)
This initializes the plugin.
httpGet(RequestInterface $request, ResponseInterface $response)
This event is triggered before the usual GET request handler.
const NS_CALENDARSERVER
This is the namespace for the proprietary calendarserver extensions.
getPluginInfo()
Returns a bunch of meta-data about the plugin.
getPluginName()
Returns a plugin name.
propFind(PropFind $propFind, BaseINode $node)
PropFind.
This class holds all the information about a PROPFIND request.
handle($propertyName, $valueOrCallBack)
Handles a specific property.
The baseclass for all server plugins.
This node represents a single notification.
The INode interface is the base interface, and the parent class of both ICollection and IFile.
The RequestInterface represents a HTTP request.
This interface represents a HTTP response.