Back to index

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

List of all members.

Public Member Functions

def beforeSaveModifier
def afterRetrieveModifier

Detailed Description

Modifies an object on save to or retrieval from a repository storage.

A modifier knows how to manipulate an object being under version control
on save to and on retrieval from the repositories storage.

Definition at line 75 of file IModifier.py.


Member Function Documentation

def CMFEditions.interfaces.IModifier.ISaveRetrieveModifier.afterRetrieveModifier (   obj,
  repo_clone,
  preserve = () 
)
Modifies the object after being retrieved from the repos storage.

Postprocesses the copy of an objects version after it has been
retrieved from the repositories storage. The repository copy is a
reference to an unwrapped deep copy of a version previously
saved to the repositories storage.

Usually this hook is used to do one or more of the following
tasks:

    - readd data that was removed by the 'beforeSaveHook'
    - manipulate data before it get restored
    - return data that gets overwritte in this process

It does kind of the inverse of the method ``beforeSaveModifier``.

'obj' may be None. This signifies there is no working copy object.

Returns:

- a list of references to be deleted on revert (providing
  ``IReferenceAdapter``) 
- a list of attribute names beeing in charge of holding reference
  information (e.g. an ObjectManager with ``doc1`` and ``doc2`` 
  as childrens: ['_objects', 'doc1', 'doc2'])
- a dictionary of the data having been preserved from beeing 
  overwritten.

Definition at line 106 of file IModifier.py.

00106 
00107     def afterRetrieveModifier(obj, repo_clone, preserve=()):
00108         """Modifies the object after being retrieved from the repos storage.
00109 
00110         Postprocesses the copy of an objects version after it has been
00111         retrieved from the repositories storage. The repository copy is a
00112         reference to an unwrapped deep copy of a version previously
00113         saved to the repositories storage.
00114 
00115         Usually this hook is used to do one or more of the following
00116         tasks:
00117 
00118             - readd data that was removed by the 'beforeSaveHook'
00119             - manipulate data before it get restored
00120             - return data that gets overwritte in this process
00121 
00122         It does kind of the inverse of the method ``beforeSaveModifier``.
00123 
00124         'obj' may be None. This signifies there is no working copy object.
00125 
00126         Returns:
00127         
00128         - a list of references to be deleted on revert (providing
00129           ``IReferenceAdapter``) 
00130         - a list of attribute names beeing in charge of holding reference
00131           information (e.g. an ObjectManager with ``doc1`` and ``doc2`` 
00132           as childrens: ['_objects', 'doc1', 'doc2'])
00133         - a dictionary of the data having been preserved from beeing 
00134           overwritten.
00135         """

Modifies an object on save to or retrieval from a repository storage.

A modifier knows how to manipulate an object being under version control
on save to and on retrieval from the repositories storage.
Modifies the object before being saved to the repos storage.

Preprocesses the objects clone before it gets saved to
the repositories storage. The copy is an unwrapped deep copy
of the original object ('obj').

Usually this hook is used to do one or more of the following
tasks:

    - manipulate data before it get versioned
    - remove data that should not be versioned (or aren't
      versionable at all) and wasn't removed already by the
      'getOnCloneModifiers'.

Returns a dict with metadata to be added to the sys_metadata dict
and two lists of 'IAttributeAdapter' objects adapting to a
'IVersionAwareReference' objects (inside references and outside
references).

XXX Argh, this description is shit!

Definition at line 83 of file IModifier.py.

00083 
00084     def beforeSaveModifier(obj, obj_clone):
00085         """Modifies the object before being saved to the repos storage.
00086 
00087         Preprocesses the objects clone before it gets saved to
00088         the repositories storage. The copy is an unwrapped deep copy
00089         of the original object ('obj').
00090 
00091         Usually this hook is used to do one or more of the following
00092         tasks:
00093 
00094             - manipulate data before it get versioned
00095             - remove data that should not be versioned (or aren't
00096               versionable at all) and wasn't removed already by the
00097               'getOnCloneModifiers'.
00098 
00099         Returns a dict with metadata to be added to the sys_metadata dict
00100         and two lists of 'IAttributeAdapter' objects adapting to a
00101         'IVersionAwareReference' objects (inside references and outside
00102         references).
00103 
00104         XXX Argh, this description is shit!
00105         """


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