[CalendarServer-changes] [4920] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Jan 12 12:56:32 PST 2010


Revision: 4920
          http://trac.macosforge.org/projects/calendarserver/changeset/4920
Author:   wsanchez at apple.com
Date:     2010-01-12 12:56:31 -0800 (Tue, 12 Jan 2010)
Log Message:
-----------
First pass at data store interfaces

Added Paths:
-----------
    CalendarServer/trunk/txcaldav/
    CalendarServer/trunk/txcaldav/__init__.py
    CalendarServer/trunk/txcaldav/icalendarstore.py
    CalendarServer/trunk/txcarddav/
    CalendarServer/trunk/txcarddav/__init__.py
    CalendarServer/trunk/txcarddav/iaddressbookstore.py
    CalendarServer/trunk/txdav/
    CalendarServer/trunk/txdav/__init__.py
    CalendarServer/trunk/txdav/idav.py

Added: CalendarServer/trunk/txcaldav/__init__.py
===================================================================
--- CalendarServer/trunk/txcaldav/__init__.py	                        (rev 0)
+++ CalendarServer/trunk/txcaldav/__init__.py	2010-01-12 20:56:31 UTC (rev 4920)
@@ -0,0 +1,19 @@
+##
+# Copyright (c) 2010 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+CalDAV support for Twisted.
+"""

Added: CalendarServer/trunk/txcaldav/icalendarstore.py
===================================================================
--- CalendarServer/trunk/txcaldav/icalendarstore.py	                        (rev 0)
+++ CalendarServer/trunk/txcaldav/icalendarstore.py	2010-01-12 20:56:31 UTC (rev 4920)
@@ -0,0 +1,122 @@
+##
+# Copyright (c) 2010 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+Calendar store interfaces
+"""
+
+__all__ = [
+    "ICalendarHome",
+    "ICalendar",
+    "ICalendarObject",
+]
+
+from zope.interface import Interface #, Attribute
+
+from txdav.idav import IPropertyStore
+
+class ICalendarHome(Interface):
+    """
+    Calendar home
+    """
+    def calendars(self):
+        """
+        Retrieve calendars contained in this calendar home.
+        @return: an iterable of L{ICalendar}s.
+        """
+
+    def calendarWithName(self, name):
+        """
+        Retrieve the calendar with the given C{name} contained in this
+        calendar home.
+        @return: an L{ICalendar}.
+        """
+
+    def createCalendarWithName(self, name):
+        """
+        Create a calendar with the given C{name} in this calendar
+        home.
+        """
+
+    def properties(self):
+        """
+        Retrieve the property store for this calendar home.
+        @return: an L{IPropertyStore}.
+        """
+
+class ICalendar(Interface):
+    """
+    Calendar
+    """
+    def calendarObjects(self):
+        """
+        Retrieve the calendar objects contained in this calendar.
+        @return: an iterable of L{ICalendarObject}s.
+        """
+
+    def calendarObjectWithName(self, name):
+        """
+        Retrieve the calendar object with the given C{name} contained
+        in this calendar.
+        @return: an L{ICalendarObject} or C{None} if no such calendar
+        object exists.
+        """
+
+    def calendarObjectWithUID(self, uid):
+        """
+        Retrieve the calendar object with the given C{uid} contained
+        in this calendar.
+        @return: an L{ICalendarObject} or C{None} if no such calendar
+        object exists.
+        """
+
+    def syncToken(self):
+        """
+        Retrieve the current sync token for this calendar.
+        @return: a string containing a sync token.
+        """
+
+    def calendarObjectsSinceToken(self, token):
+        """
+        Retrieve all calendar objects in this calendar that have
+        changed since the given C{token} was last valid.
+        @return: a 3-tuple containing an iterable of
+        L{ICalendarObject}s that have changed, an iterable of uids
+        that have been removed, and the current sync token.
+        """
+
+    def properties(self):
+        """
+        Retrieve the property store for this calendar.
+        @return: an L{IPropertyStore}.
+        """
+
+class ICalendarObject(Interface):
+    """
+    Calendar object (event, to-do, etc.).
+    """
+    def iCalendarText(self):
+        """
+        Retrieve the iCalendar text data for this calendar object.
+        @return: a string containing iCalendar data for a single
+        calendar object.
+        """
+
+    def properties(self):
+        """
+        Retrieve the property store for this calendar object.
+        @return: an L{IPropertyStore}.
+        """

Added: CalendarServer/trunk/txcarddav/__init__.py
===================================================================
--- CalendarServer/trunk/txcarddav/__init__.py	                        (rev 0)
+++ CalendarServer/trunk/txcarddav/__init__.py	2010-01-12 20:56:31 UTC (rev 4920)
@@ -0,0 +1,19 @@
+##
+# Copyright (c) 2010 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+CardDAV support for Twisted.
+"""

Added: CalendarServer/trunk/txcarddav/iaddressbookstore.py
===================================================================
--- CalendarServer/trunk/txcarddav/iaddressbookstore.py	                        (rev 0)
+++ CalendarServer/trunk/txcarddav/iaddressbookstore.py	2010-01-12 20:56:31 UTC (rev 4920)
@@ -0,0 +1,120 @@
+##
+# Copyright (c) 2010 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+Address book store interfaces
+"""
+
+__all__ = [
+]
+
+from zope.interface import Interface #, Attribute
+
+from txdav.idav import IPropertyStore
+
+class IAddressBookHome(Interface):
+    """
+    Address book home
+    """
+    def addressBooks(self):
+        """
+        Retrieve address books contained in this address book home.
+        @return: an iterable of L{IAddressBook}s.
+        """
+
+    def addressBookWithName(self, name):
+        """
+        Retrieve the address book with the given C{name} contained in
+        this address book home.
+        @return: an L{IAddressBook} or C{None} if no such address book
+        exists.
+        """
+
+    def createAddressBookWithName(self, name):
+        """
+        Create an address book with the given C{name} in this address
+        book home.
+        """
+
+    def properties(self):
+        """
+        Retrieve the property store for this address book home.
+        @return: an L{IPropertyStore}.
+        """
+
+class IAddressBook(Interface):
+    """
+    Address book
+    """
+    def contactCards(self):
+        """
+        Retrieve the contact cards contains in this address book.
+        @return: an iterable of L{IContactCard}s.
+        """
+
+    def contactCardWithName(self, name):
+        """
+        Retrieve the contact card with the given C{name} in this
+        address book.
+        @return: an L{IContactCard} or C{None} is no such contact card
+        exists.
+        """
+
+    def contactCardWithUID(self, uid):
+        """
+        Retrieve the contact card with the given C{uid} in this
+        address book.
+        @return: an L{IContactCard} or C{None} is no such contact card
+        exists.
+        """
+
+    def syncToken(self):
+        """
+        Retrieve the current sync token for this address book.
+        @return: a string containing a sync token.
+        """
+
+    def contactCardsSinceToken(self, token):
+        """
+        Retrieve all contact cards in this address book that have
+        changed since the given C{token} was last valid.
+        @return: a 3-tuple containing an iterable of L{IContactCard}s
+        that have changed, an iterable of uids that have been removed,
+        and the current sync token.
+        """
+
+    def properties(self):
+        """
+        Retrieve the property store for this address book.
+        @return: an L{IPropertyStore}.
+        """
+
+class IContactCard(Interface):
+    """
+    Contact card
+    """
+    def vCardText(self):
+        """
+        Retrieve the vCard text data for this contact card.
+        @return: a string containing vCard data for a single vCard
+        contact.
+        """
+
+    def properties(self):
+        """
+        Retrieve the property store for this contact card.
+        @return: an L{IPropertyStore}.
+        """

Added: CalendarServer/trunk/txdav/__init__.py
===================================================================
--- CalendarServer/trunk/txdav/__init__.py	                        (rev 0)
+++ CalendarServer/trunk/txdav/__init__.py	2010-01-12 20:56:31 UTC (rev 4920)
@@ -0,0 +1,19 @@
+##
+# Copyright (c) 2010 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+WebDAV support for Twisted.
+"""

Added: CalendarServer/trunk/txdav/idav.py
===================================================================
--- CalendarServer/trunk/txdav/idav.py	                        (rev 0)
+++ CalendarServer/trunk/txdav/idav.py	2010-01-12 20:56:31 UTC (rev 4920)
@@ -0,0 +1,45 @@
+##
+# Copyright (c) 2010 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+"""
+WebDAV interfaces
+"""
+
+__all__ = [
+    "IPropertyStore",
+]
+
+#from zope.interface import Attribute, Interface
+
+from zope.interface.common.mapping import IMapping
+
+class IPropertyStore(IMapping):
+    """
+    WebDAV property store
+
+    This interface is based on L{IMapping}, but any changed to data
+    are not persisted until C{flush()} is called, and can be undone
+    using C{abort()}.
+    """
+    def flush(self):
+        """
+        Write out any pending changes.
+        """
+
+    def abort(self):
+        """
+        Abort any pending changes.
+        """
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100112/56c35d5f/attachment-0001.html>


More information about the calendarserver-changes mailing list