module Tilia::CalDav::Backend::SubscriptionSupport
Every CalDAV backend must at least implement this interface.
Public Instance Methods
Creates a new subscription for a principal.
If the creation was a success, an id must be returned that can be used to reference this subscription in other methods, such as updateSubscription.
@param string principal_uri @param string uri @param array properties @return mixed
# File lib/tilia/cal_dav/backend/subscription_support.rb, line 50 def create_subscription(principal_uri, uri, properties) end
Deletes a subscription.
@param mixed subscription_id @return void
# File lib/tilia/cal_dav/backend/subscription_support.rb, line 74 def delete_subscription(subscription_id) end
Returns a list of subscriptions for a principal.
Every subscription is an array with the following keys:
* id, a unique id that will be used by other functions to modify the subscription. This can be the same as the uri or a database key. * uri. This is just the 'base uri' or 'filename' of the subscription. * principaluri. The owner of the subscription. Almost always the same as principalUri passed to this method.
Furthermore, all the subscription info must be returned too:
-
{DAV:}displayname
-
{calendarserver.org/ns/}subscribed-strip-todos (omit if todos should not be stripped).
-
{calendarserver.org/ns/}subscribed-strip-alarms (omit if alarms should not be stripped).
-
{calendarserver.org/ns/}subscribed-strip-attachments (omit if attachments should not be stripped).
-
{calendarserver.org/ns/}source (Must be a
Sabre\DAV\Property\Href).
-
{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set (should just be an instance of SabreCalDAVPropertySupportedCalendarComponentSet, with a bunch of default components).
@param string principal_uri @return array
# File lib/tilia/cal_dav/backend/subscription_support.rb, line 38 def subscriptions_for_user(principal_uri) end
Updates a subscription
The list of mutations is stored in a SabreDAVPropPatch object. To do the actual updates, you must tell this object which properties you're going to process with the handle method.
Calling the handle method is like telling the PropPatch object “I promise I can handle updating this property”.
Read the PropPatch documenation for more info and examples.
@param mixed subscription_id @param SabreDAVPropPatch prop_patch @return void
# File lib/tilia/cal_dav/backend/subscription_support.rb, line 67 def update_subscription(subscription_id, prop_patch) end