[Zope-CVS] SVN: zversioning/trunk/src/versioning/ added interfaces
for IVersion
Uwe Oestermeier
uwe_oestermeier at iwm-kmrc.de
Wed Oct 13 19:33:52 EDT 2004
Log message for revision 28144:
added interfaces for IVersion
Changed:
U zversioning/trunk/src/versioning/README.txt
U zversioning/trunk/src/versioning/interfaces.py
-=-
Modified: zversioning/trunk/src/versioning/README.txt
===================================================================
--- zversioning/trunk/src/versioning/README.txt 2004-10-13 23:26:32 UTC (rev 28143)
+++ zversioning/trunk/src/versioning/README.txt 2004-10-13 23:33:52 UTC (rev 28144)
@@ -6,7 +6,9 @@
solution for all the problems that are related to the history of evolving data.
Therefore we want to provide a flexible framework that is pluggable in its
most important parts and reduces the problem of different versioning schemes
-to a few reusable patterns. These patterns are implemented in versioning.repository.
+to a few reusable patterns. These patterns as we conceive them are implemented
+in versioning.repository.
+
The main API is defined in versioning.interfaces.IVersionControl.
The pattern common to all implementation variants is roughly as follows:
Modified: zversioning/trunk/src/versioning/interfaces.py
===================================================================
--- zversioning/trunk/src/versioning/interfaces.py 2004-10-13 23:26:32 UTC (rev 28143)
+++ zversioning/trunk/src/versioning/interfaces.py 2004-10-13 23:33:52 UTC (rev 28144)
@@ -223,6 +223,65 @@
"""
+
+class IVersionableData(Interface) :
+ """ An adapter for versionable data. """
+
+ def getData() :
+ """ A copy method that allows to move of versionable data from workspace to workspace.
+ Implementations must ensure that the copy is independent from its original
+ database.
+ """
+
+ def getTicket() :
+ """ Must return the ticket that is associated with this kind of data. """
+
+ def getWhen() :
+ """ Must return a datetime or None in which case the current system time is used as time stamp. """
+
+ def getWho() :
+ """ Must return a user id or None in which case the version is assigned to the current user. """
+
+ def getPredecessors() :
+ """ Returns a list of guid of predecessing versions. Should return None for the current version as a default predecessor. """
+
+
+class IVersion(IVersionableData):
+ """ Versions are snapshots of data that change over time.
+ In group situations there can be parallel versions that must be synchronized or merged.
+ This interface defines some basic methods each version, whether on server or client side,
+ should fullfill. It makes no assumptions about attributes or other
+ implementation specific details besides the use of global unique ids.
+ """
+
+ def getDescriptor() :
+ """ Returns the descriptor that created the version."""
+
+ def getVersionLabel() :
+ """ Returns a string that encodes the version sequence and parallel versions, e.g. '2a'"""
+
+ def getName() :
+ """ Returns a more describptive name that describes the version, e.g. 'Version2a'"""
+
+ def setPredecessors(guids) :
+ """ Sets the predecessors of a version. Accepts a list of guid as input. """
+
+ def getPredecessors() :
+ """ Returns a list of guid of predecessing versions. """
+
+ def isVersionable() :
+ """ Returns False, because versions are not themselves versionable. """
+
+ def getPredecessorNodes() :
+ """ Return the direct predecessors as a list of nodes """
+
+ def isPredecessorOf(version) :
+ """ Returns a boolean that indicates whether this node is a predecessor of another version. """
+
+ def isCurrent() :
+ """ Returns a boolean that indicates whether this node is the current version. """
+
+
class IVersionHistory(INameChooser) :
""" A version history of a single object should be able to
generate unique names for each version within the version history.
More information about the Zope-CVS
mailing list