Code Repositories xandikos / a41216e
Implement max-instances and max-attendees-per-instance. Jelmer Vernooń≥ 3 years ago
3 changed file(s) with 51 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1616
1717 ## HTTP Headers
1818 - (9.1) Dav [supported]
19 - (9.2) Depth ['0 and '1' supported, 'infinity' is not]
19 - (9.2) Depth ['0, '1' and 'infinity' are supported]
2020 - (9.3) Destination [only used with COPY/MOVE, which are not supported]
2121 - (9.4) If [not supported]
2222 - (9.5) Lock-Token [not supported]
124124 - CALDAV:max-resource-size [supported]
125125 - CALDAV:min-date-time [supported]
126126 - CALDAV:max-date-time [supported]
127 - CALDAV:max-instances [not supported]
128 - CALDAV:max-attendees-per-instance [not supported]
127 - CALDAV:max-instances [supported]
128 - CALDAV:max-attendees-per-instance [supported]
129129
130130 ## HTTP Methods
131131 - MKCALENDAR [not supported]
100100 """Return maximum datetime property.
101101 """
102102 raise NotImplementedError(self.get_min_date_time)
103
104 def get_max_instances(self):
105 """Return maximum number of instances.
106 """
107 raise NotImplementedError(self.get_max_instances)
108
109 def get_max_attendees_per_instance(self):
110 """Return maximum number of attendees per instance.
111 """
112 raise NotImplementedError(self.get_max_attendees_per_instance)
103113
104114
105115 class PrincipalExtensions:
587597 el.text = resource.get_max_date_time()
588598
589599
600 class MaxInstancesProperty(webdav.Property):
601 """max-instances property.
602
603 See https://tools.ietf.org/html/rfc4791, section 5.2.8
604 """
605
606 name = '{urn:ietf:params:xml:ns:caldav}max-instances'
607 resource_type = CALENDAR_RESOURCE_TYPE
608 in_allprops = False
609 live = True
610
611 def get_value(self, href, resource, el):
612 el.text = str(resource.get_max_instances())
613
614
615 class MaxAttendeesPerInstanceProperty(webdav.Property):
616 """max-instances property.
617
618 See https://tools.ietf.org/html/rfc4791, section 5.2.9
619 """
620
621 name = '{urn:ietf:params:xml:ns:caldav}max-attendees-per-instance'
622 resource_type = CALENDAR_RESOURCE_TYPE
623 in_allprops = False
624 live = True
625
626 def get_value(self, href, resource, el):
627 el.text = str(resource.get_max_attendees_per_instance())
628
629
590630 def map_freebusy(comp):
591631 transp = comp.get('TRANSP', 'OPAQUE')
592632 if transp == 'TRANSPARENT':
278278
279279 def get_min_date_time(self):
280280 return "00010101T000000Z"
281
282 def get_max_instances(self):
283 raise KeyError
284
285 def get_max_attendees_per_instance(self):
286 raise KeyError
281287
282288
283289 class AddressbookResource(StoreBasedCollection,carddav.Addressbook):
533539 webdav.GetLastModifiedProperty(),
534540 timezones.TimezoneServiceSetProperty([]),
535541 webdav.AddMemberProperty(),
542 webdav.MaxInstancesProperty(),
543 webdav.MaxAttendeesPerInstanceProperty(),
536544 ])
537545 self.register_reporters([
538546 caldav.CalendarMultiGetReporter(),