Back to index

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

List of all members.

Public Member Functions

def purge
def isUpToDate
def retrieve
def getHistory
def queryHistory

Detailed Description

Repository Purge Support

Purging a version removes that version irrevocably.

Adds ``purge`` method and extends the signature of the ``isUpToDate``, 
``retrieve``, ``getHistory`` and ``queryHistory`` 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 storage 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 130 of file IArchivist.py.


Member Function Documentation

def CMFEditions.interfaces.IArchivist.IPurgeSupport.getHistory (   obj = None,
  history_id = None,
  preserve = (),
  countPurged = True 
)
Return the history of an object.

The history is a 'IHistory' object.

Requires either an object which is the working copy, or a history_id
for an object if no history_id is provided the history_id will be 
obtained from the working copy object.

Raises an 'ArchivistError' exception if the given object doesn't
have a history.

Modifiers may overwrite some aspects of the retrieved version by
the equivalent aspects of the working copy. Sometimes the 
overwritten information is from interest. Attributes (and 
subattributes) beeing from interest can be passed with the
'preserve' argument. 
E.g. preserve=('family_name', 'nick_name', 'real_name')

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

Definition at line 221 of file IArchivist.py.

00221 
00222     def getHistory(obj=None, history_id=None, preserve=(), countPurged=True):
00223         """Return the history of an object.
00224         
00225         The history is a 'IHistory' object.
00226         
00227         Requires either an object which is the working copy, or a history_id
00228         for an object if no history_id is provided the history_id will be 
00229         obtained from the working copy object.
00230         
00231         Raises an 'ArchivistError' exception if the given object doesn't
00232         have a history.
00233         
00234         Modifiers may overwrite some aspects of the retrieved version by
00235         the equivalent aspects of the working copy. Sometimes the 
00236         overwritten information is from interest. Attributes (and 
00237         subattributes) beeing from interest can be passed with the
00238         'preserve' argument. 
00239         E.g. preserve=('family_name', 'nick_name', 'real_name')
00240         
00241         Also counts purged versions if ``True`` is passed to ``countPurged``
00242         (see interface documentation for details).
00243         """

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFEditions.interfaces.IArchivist.IPurgeSupport.isUpToDate (   obj = None,
  history_id = None,
  selector = None,
  countPurged = True 
)
Check if the corking copy is up to date.

Returns True if the working copy has changed since the last save
or revert compared to the selected version. If selector is None,
the comparison is done with the HEAD.

The working copy is up to date if the modification date is the
identical to the selected version.

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

Definition at line 183 of file IArchivist.py.

00183 
00184                    countPurged=True):
00185         """Check if the corking copy is up to date.
00186         
00187         Returns True if the working copy has changed since the last save
00188         or revert compared to the selected version. If selector is None,
00189         the comparison is done with the HEAD.
00190         
00191         The working copy is up to date if the modification date is the
00192         identical to the selected version.
00193         
00194         Also counts purged versions if ``True`` is passed to ``countPurged``
00195         (see interface documentation for details).
00196         """

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFEditions.interfaces.IArchivist.IPurgeSupport.purge (   obj = None,
  history_id = None,
  selector = None,
  metadata = {},
  countPurged = True 
)
Repository Purge Support

Purging a version removes that version irrevocably.

Adds ``purge`` method and extends the signature of the ``isUpToDate``, 
``retrieve``, ``getHistory`` and ``queryHistory`` 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 storage 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 object.

Requires either an object which is the working copy, or a history_id
for an object if no history_id is provided the history_id will be 
obtained from the working copy object.

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

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

Definition at line 168 of file IArchivist.py.

00168 
00169               countPurged=True):
00170         """Purge a version of a content object.
00171         
00172         Requires either an object which is the working copy, or a history_id
00173         for an object if no history_id is provided the history_id will be 
00174         obtained from the working copy object.
00175         
00176         The comment and metadata passed may be used to store informations 
00177         about the reasons of the purging.
00178         
00179         Also counts purged versions if ``True`` is passed to ``countPurged``
00180         (see interface documentation for details).
00181         """

Here is the call graph for this function:

def CMFEditions.interfaces.IArchivist.IPurgeSupport.queryHistory (   obj = None,
  history_id = None,
  preserve = (),
  default = [],
  countPurged = True 
)
Return the history of an object.

Does the same as ``getHistory`` with the difference of returning
the value supplied with ``default`` instead of raising an exception.

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

Definition at line 245 of file IArchivist.py.

00245 
00246                      countPurged=True):
00247         """Return the history of an object.
00248         
00249         Does the same as ``getHistory`` with the difference of returning
00250         the value supplied with ``default`` instead of raising an exception.
00251         
00252         Also counts purged versions if ``True`` is passed to ``countPurged``
00253         (see interface documentation for details).
00254         """
00255 

Here is the caller graph for this function:

def CMFEditions.interfaces.IArchivist.IPurgeSupport.retrieve (   obj = None,
  history_id = None,
  selector = None,
  preserve = (),
  countPurged = True 
)
Retrieve a former state of an object.

Requires either an object which is the working copy, or a history_id
for an object if no history_id is provided the history_id will be 
obtained from the working copy object.

Returns an 'IVersionData' object.

Set the selector to None if you like to retrieve the most actual
version.

Modifiers may overwrite some aspects of the retrieved version by
the equivalent aspects of the working copy. Sometimes the 
overwritten information is from interest. Attributes (and 
subattributes) beeing from interest can be passed with the
'preserve' argument. 
E.g. preserve=('family_name', 'nick_name', 'real_name')

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

Definition at line 198 of file IArchivist.py.

00198 
00199                  countPurged=True):
00200         """Retrieve a former state of an object.
00201         
00202         Requires either an object which is the working copy, or a history_id
00203         for an object if no history_id is provided the history_id will be 
00204         obtained from the working copy object.
00205         
00206         Returns an 'IVersionData' object.
00207         
00208         Set the selector to None if you like to retrieve the most actual
00209         version.
00210         
00211         Modifiers may overwrite some aspects of the retrieved version by
00212         the equivalent aspects of the working copy. Sometimes the 
00213         overwritten information is from interest. Attributes (and 
00214         subattributes) beeing from interest can be passed with the
00215         'preserve' argument. 
00216         E.g. preserve=('family_name', 'nick_name', 'real_name')
00217         
00218         Also counts purged versions if ``True`` is passed to ``countPurged``
00219         (see interface documentation for details).
00220         """

Here is the caller graph for this function:


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