[Checkins] SVN: zopyx.versioning/trunk/zopyx/versioning/ updated
Andreas Jung
andreas at andreas-jung.com
Mon Jun 28 23:37:30 EDT 2010
Log message for revision 113964:
updated
Changed:
U zopyx.versioning/trunk/zopyx/versioning/README.txt
U zopyx.versioning/trunk/zopyx/versioning/interfaces.py
-=-
Modified: zopyx.versioning/trunk/zopyx/versioning/README.txt
===================================================================
--- zopyx.versioning/trunk/zopyx/versioning/README.txt 2010-06-28 21:06:38 UTC (rev 113963)
+++ zopyx.versioning/trunk/zopyx/versioning/README.txt 2010-06-29 03:37:28 UTC (rev 113964)
@@ -37,6 +37,8 @@
Basic concepts
--------------
+- golden rule #1: keep it simple, keep it small
+
- pluggable storage API (storing the versioned data)
- using JSON as data exchange format between objects to be versioned
@@ -49,9 +51,27 @@
- the solution does not claim to store and restore the complete state of
an content object. Instead we focus on dealing with the metadata and
- the content itself. If an object uses a complex internal data model then it is
- in responsible to serialize and deserialize the data to JSON.
+ the content itself. If an object uses a complex internal data model then it
+ is in responsible to serialize and deserialize the data to JSON.
+- leave complex functionality (likely handling of references, object relations
+ etc.) out of the core versioning engine - this might be handled through
+ adapters implementing IVersionSupport.
+
+
+
+Open points
+-----------
+
+- should deduplication be handled on the storage layer or the versioning layer
+ (I assume on the storage layer as an optional feature in order to keep the
+ overall complexity low)
+
+- all versionable objects must provide a unique ID (``UID`` for
+ Archetypes-backed content). How about Dexterity? How about
+ ZTK/zope.schema-based content?
+
+
Author
------
Modified: zopyx.versioning/trunk/zopyx/versioning/interfaces.py
===================================================================
--- zopyx.versioning/trunk/zopyx/versioning/interfaces.py 2010-06-28 21:06:38 UTC (rev 113963)
+++ zopyx.versioning/trunk/zopyx/versioning/interfaces.py 2010-06-29 03:37:28 UTC (rev 113964)
@@ -23,9 +23,21 @@
def restoreFromVersion(version_data):
""" Restore object based on 'version_data' (JSON format) """
+class ICollectionVersionSupport(Interface):
+ """ API for retrieving the objects of a collection
+ (a folder, a site, ...) to be versioned.
+ """
+ def getVersionableItems():
+ """ Returns a sequence of objects IDs to be versioned """
+
+ # XXX - no need for a getRestorableItems() method since the information
+ # about items to be restored are part of the information stored in the
+ # storage backend.
+
class IVersionStorage(Interface):
+ # methods used for IVersionSupport
def store(id, version_data, creator_id, comment):
""" Store 'version_data' for a given 'id'.
Returns revision number.
@@ -47,3 +59,14 @@
""" Return all revisions stored for a particular
content piece by its 'id'.
"""
+
+ # methods used for ICollectionVersionSupport
+ # XXX to be written#
+
+
+class ILookup(Interface):
+
+ def getObjectById(id):
+ """ Retrieve an object by its ids from a collection or
+ "site" (whatever that means).
+ """
More information about the checkins
mailing list