Back to index

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

List of all members.

Public Member Functions

def beforeSaveHook
def retrieveSubstitute

Detailed Description

Purge Policy

Purge versions in a history according a policy. The methods declared
are called by a ``IStorage`` implementation.

Definition at line 32 of file IPurgePolicy.py.


Member Function Documentation

def CMFEditions.interfaces.IPurgePolicy.IPurgePolicy.beforeSaveHook (   history_id,
  obj,
  metadata = {} 
)
Purge Versions from the History According a Policy

The Policy has full control over the whole history of the resource 
and may decide to purge or alter versions in the history.

Called before the current version is saved to the storage.
The metadata passed is the metadata that was passed to the 
``save`` method.

Return True if ``obj`` has to be saved by the ``IStorage`` 
implementation. Return ``False`` if the object has to be discared.

Definition at line 39 of file IPurgePolicy.py.

00039 
00040     def beforeSaveHook(history_id, obj, metadata={}):
00041         """Purge Versions from the History According a Policy
00042         
00043         The Policy has full control over the whole history of the resource 
00044         and may decide to purge or alter versions in the history.
00045         
00046         Called before the current version is saved to the storage.
00047         The metadata passed is the metadata that was passed to the 
00048         ``save`` method.
00049         
00050         Return True if ``obj`` has to be saved by the ``IStorage`` 
00051         implementation. Return ``False`` if the object has to be discared.
00052         """

def CMFEditions.interfaces.IPurgePolicy.IPurgePolicy.retrieveSubstitute (   history_id,
  selector,
  default = None 
)
Return a selected version of an object or a substitute

Called by the storage if the object to be retrieved was purged.
Implement the policy in case a client tries to retrieve a purged
version.

Return a substitute of ``IVersionData`` type.

Definition at line 53 of file IPurgePolicy.py.

00053 
00054     def retrieveSubstitute(history_id, selector, default=None):
00055         """Return a selected version of an object or a substitute
00056         
00057         Called by the storage if the object to be retrieved was purged.
00058         Implement the policy in case a client tries to retrieve a purged
00059         version.
00060         
00061         Return a substitute of ``IVersionData`` type.
00062         """

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