Back to index

plone3  3.1.7
Public Member Functions
CMFEditions.interfaces.IRepository.IPurgeSupport Class Reference
Inheritance diagram for CMFEditions.interfaces.IRepository.IPurgeSupport:
Inheritance graph
[legend]
Collaboration diagram for CMFEditions.interfaces.IRepository.IPurgeSupport:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def purge
def revert
def retrieve
def restore
def isUpToDate
def getHistory

Detailed Description

Repository Purge Support

Purging a version removes that version irrevocably.

Adds ``purge`` method and extends the signature of the ``isUpToDate``, 
``retrieve``, ``revert``, ``restore`` and ``getHistory`` methods.
The defaults of the extended methods mimique the standard behaviour of 
the original methods.

With the introduction of purging two selection scheme exist for 
retrieving versions. Either purged versions are taken into account 
or not:

- By passing ``countPurged=True`` purged versions are taken into
  account when accessing a version. When a purged version is accessed
  the archivist tool decides what to do.
- By passing ``countPurged=False`` purged versions are **not taken into
  account** when accessing a version.

Example: 

An object got saved ten times. Two versions got purged in earlier 
calls. The history looks like this (``s`` means: depends on storage,
``e`` means: exception raised)::

  countPurged==True:
  
    selector:          0, 1, 2, 3, 4, 5, 6, 7, 8, 9
    version retrieved: 0, 1, 2, s, s, 5, 6, 7, 8, 9
    
  countPurged==False:
   
    selector:          0, 1, 2, 3, 4, 5, 6, 7, 8, 9
    version retrieved: 0, 1, 2, 5, 6, 7, 8, 9, e, e

Definition at line 128 of file IRepository.py.


Member Function Documentation

def CMFEditions.interfaces.IRepository.IPurgeSupport.getHistory (   obj,
  oldestFirst = False,
  preserve = (),
  countPurged = True 
)
Returns the history of a content.

Return the oldest version first  when ``oldestFirst`` set to 
``True``. Default is ``False`` (youngest version first).

Returns a sequence (``IHistory``) of ``IVersionData`` objects.

Also counts purged versions if ``True`` is passed to ``countPurged``
(see interface documentation for details).

Definition at line 232 of file IRepository.py.

00232 
00233     def getHistory(obj, oldestFirst=False, preserve=(), countPurged=True):
00234         """Returns the history of a content.
00235 
00236         Return the oldest version first  when ``oldestFirst`` set to 
00237         ``True``. Default is ``False`` (youngest version first).
00238         
00239         Returns a sequence (``IHistory``) of ``IVersionData`` objects.
00240         
00241         Also counts purged versions if ``True`` is passed to ``countPurged``
00242         (see interface documentation for details).
00243         """
00244 

Here is the caller graph for this function:

def CMFEditions.interfaces.IRepository.IPurgeSupport.isUpToDate (   obj,
  selector = None,
  countPurged = True 
)
Returns True if the working copy is modified.

Comparison is done with the selected version.

Also counts purged versions if ``True`` is passed to ``countPurged``
(see interface documentation for details).

Definition at line 223 of file IRepository.py.

00223 
00224     def isUpToDate(obj, selector=None, countPurged=True):
00225         """Returns True if the working copy is modified.
00226         
00227         Comparison is done with the selected version.
00228         
00229         Also counts purged versions if ``True`` is passed to ``countPurged``
00230         (see interface documentation for details).
00231         """

def CMFEditions.interfaces.IRepository.IPurgeSupport.purge (   obj,
  selector,
  comment = "",
  metadata = {},
  countPurged = True 
)
Repository Purge Support

Purging a version removes that version irrevocably.

Adds ``purge`` method and extends the signature of the ``isUpToDate``, 
``retrieve``, ``revert``, ``restore`` and ``getHistory`` methods.
The defaults of the extended methods mimique the standard behaviour of 
the original methods.

With the introduction of purging two selection scheme exist for 
retrieving versions. Either purged versions are taken into account 
or not:

- By passing ``countPurged=True`` purged versions are taken into
  account when accessing a version. When a purged version is accessed
  the archivist tool decides what to do.
- By passing ``countPurged=False`` purged versions are **not taken into
  account** when accessing a version.

Example: 

An object got saved ten times. Two versions got purged in earlier 
calls. The history looks like this (``s`` means: depends on storage,
``e`` means: exception raised)::

  countPurged==True:
  
selector:          0, 1, 2, 3, 4, 5, 6, 7, 8, 9
version retrieved: 0, 1, 2, s, s, 5, 6, 7, 8, 9

  countPurged==False:
   
selector:          0, 1, 2, 3, 4, 5, 6, 7, 8, 9
version retrieved: 0, 1, 2, 5, 6, 7, 8, 9, e, e
Purge a Version of a Content

Purge the given version of the object. Referenced content objects 
versions aren't purged. No recursive purging takes place.

Also counts purged versions if ``True`` is passed to ``countPurged``
(see interface documentation for details).

Example: 

An object got saved ten times. Two versions got purged in earlier 
calls. The histor looks like this (a ``p`` stands for purged)::

    versions: 0, 1, 2, 3p, 4p, 5, 6, 7, 8, 9
    selector: 0, 1, 2, 3,  4,  5, 6, 7, 8, 9 (countPurged==True)
    selector: 0, 1, 2, -,  -,  3, 4, 5, 6, 7 (countPurged==False)

The comment and metadata passed may be used to store informations 
about the reasons of the purging.

Definition at line 165 of file IRepository.py.

00165 
00166     def purge(obj, selector, comment="", metadata={}, countPurged=True):
00167         """Purge a Version of a Content
00168         
00169         Purge the given version of the object. Referenced content objects 
00170         versions aren't purged. No recursive purging takes place.
00171         
00172         Also counts purged versions if ``True`` is passed to ``countPurged``
00173         (see interface documentation for details).
00174         
00175         Example: 
00176         
00177         An object got saved ten times. Two versions got purged in earlier 
00178         calls. The histor looks like this (a ``p`` stands for purged)::
00179         
00180             versions: 0, 1, 2, 3p, 4p, 5, 6, 7, 8, 9
00181             selector: 0, 1, 2, 3,  4,  5, 6, 7, 8, 9 (countPurged==True)
00182             selector: 0, 1, 2, -,  -,  3, 4, 5, 6, 7 (countPurged==False)
00183         
00184         The comment and metadata passed may be used to store informations 
00185         about the reasons of the purging.
00186         """

def CMFEditions.interfaces.IRepository.IPurgeSupport.restore (   history_id,
  selector,
  container,
  new_id = None,
  countPurged = True 
)
Restore a Specific version of an Object into a Container

Usage Hint:

May be used to restore a deleted object (delted from the tree).
A version having been purged from the storage may never be restored.
A new id may be chosen.

Also counts purged versions if ``True`` is passed to ``countPurged``
(see interface documentation for details).

Definition at line 210 of file IRepository.py.

00210 
00211                 countPurged=True):
00212         """Restore a Specific version of an Object into a Container
00213         
00214         Usage Hint:
00215         
00216         May be used to restore a deleted object (delted from the tree).
00217         A version having been purged from the storage may never be restored.
00218         A new id may be chosen.
00219         
00220         Also counts purged versions if ``True`` is passed to ``countPurged``
00221         (see interface documentation for details).
00222         """

def CMFEditions.interfaces.IRepository.IPurgeSupport.retrieve (   obj,
  selector = None,
  preserve = (),
  countPurged = True 
)
Returns a former version of a content without replacing the working
copy.

It returns an ``IVersionData`` object and doesn't modify the working
copy in any way.

Also counts purged versions if ``True`` is passed to ``countPurged``
(see interface documentation for details).

Definition at line 198 of file IRepository.py.

00198 
00199     def retrieve(obj, selector=None, preserve=(), countPurged=True):
00200         """Returns a former version of a content without replacing the working
00201         copy.
00202 
00203         It returns an ``IVersionData`` object and doesn't modify the working
00204         copy in any way.
00205         
00206         Also counts purged versions if ``True`` is passed to ``countPurged``
00207         (see interface documentation for details).
00208         """

Here is the caller graph for this function:

def CMFEditions.interfaces.IRepository.IPurgeSupport.revert (   obj,
  selector = None,
  countPurged = True 
)
Reverts to a former version of the content by replacing the working
copy.

Reverts to the most recently saved version if no selector
is passed.

Also counts purged versions if ``True`` is passed to ``countPurged``
(see interface documentation for details).

Definition at line 187 of file IRepository.py.

00187 
00188     def revert(obj, selector=None, countPurged=True):
00189         """Reverts to a former version of the content by replacing the working
00190         copy.
00191 
00192         Reverts to the most recently saved version if no selector
00193         is passed.
00194         
00195         Also counts purged versions if ``True`` is passed to ``countPurged``
00196         (see interface documentation for details).
00197         """


The documentation for this class was generated from the following file: