Back to index

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

List of all members.

Public Member Functions

def prepare
def register
def save
def isUpToDate
def retrieve
def getHistory
def queryHistory

Detailed Description

The archivist knows how to handle saving and retrieving versionable 
   aspects.

It decides which aspects to save to a histories storage and which
aspects have to be overridden by the working copies ones on retrieve.

As object ``obj`` may be passed a python reference to the object or
any other kind of reference that allows the archivist dereferencing
the object meant.

Definition at line 30 of file IArchivist.py.


Member Function Documentation

def CMFEditions.interfaces.IArchivist.IArchivist.getHistory (   obj = None,
  history_id = None,
  preserve = () 
)
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')

Definition at line 102 of file IArchivist.py.

00102 
00103     def getHistory(obj=None, history_id=None, preserve=()):
00104         """Return the history of an object.
00105         
00106         The history is a 'IHistory' object.
00107         
00108         Requires either an object which is the working copy, or a history_id
00109         for an object if no history_id is provided the history_id will be 
00110         obtained from the working copy object.
00111         
00112         Raises an 'ArchivistError' exception if the given object doesn't
00113         have a history.
00114         
00115         Modifiers may overwrite some aspects of the retrieved version by
00116         the equivalent aspects of the working copy. Sometimes the 
00117         overwritten information is from interest. Attributes (and 
00118         subattributes) beeing from interest can be passed with the
00119         'preserve' argument. 
00120         E.g. preserve=('family_name', 'nick_name', 'real_name')
00121         """

Here is the caller graph for this function:

def CMFEditions.interfaces.IArchivist.IArchivist.isUpToDate (   obj = None,
  history_id = None,
  selector = None 
)
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.

Definition at line 71 of file IArchivist.py.

00071 
00072     def isUpToDate(obj=None, history_id=None, selector=None):
00073         """Check if the corking copy is up to date.
00074         
00075         Returns True if the working copy has changed since the last save
00076         or revert compared to the selected version. If selector is None,
00077         the comparison is done with the HEAD.
00078         
00079         The working copy is up to date if the modification date is the
00080         identical to the selected version.
00081         """

def CMFEditions.interfaces.IArchivist.IArchivist.prepare (   obj,
  app_metadata = None,
  sys_metadata = {} 
)
Prepares saving and registering of versionable aspects.

The archivist decides which aspects of the objects are prepared
to be saved and which not.

Doesn't do any save operation, just returns information
to allow recursively save the object.

Returns an 'IPreparedObject' object.

Definition at line 42 of file IArchivist.py.

00042 
00043     def prepare(obj, app_metadata=None, sys_metadata={}):
00044         """Prepares saving and registering of versionable aspects.
00045         
00046         The archivist decides which aspects of the objects are prepared
00047         to be saved and which not.
00048         
00049         Doesn't do any save operation, just returns information
00050         to allow recursively save the object.
00051         
00052         Returns an 'IPreparedObject' object.
00053         """

def CMFEditions.interfaces.IArchivist.IArchivist.queryHistory (   obj = None,
  history_id = None,
  preserve = (),
  default = [] 
)
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.

Definition at line 122 of file IArchivist.py.

00122 
00123     def queryHistory(obj=None, history_id=None, preserve=(), default=[]):
00124         """Return the history of an object.
00125         
00126         Does the same as ``getHistory`` with the difference of returning
00127         the value supplied with ``default`` instead of raising an exception.
00128         """
00129 

Here is the caller graph for this function:

Register the object saving the initial state.

Prior to a register the object has to prepared. Pass the
return value of the 'prepare' method to 'prepared_obj'.

Definition at line 54 of file IArchivist.py.

00054 
00055     def register(prepared_obj):
00056         """Register the object saving the initial state.
00057         
00058         Prior to a register the object has to prepared. Pass the
00059         return value of the 'prepare' method to 'prepared_obj'.
00060         """

Here is the caller graph for this function:

def CMFEditions.interfaces.IArchivist.IArchivist.retrieve (   obj = None,
  history_id = None,
  selector = None,
  preserve = () 
)
Retrieves 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')

Definition at line 82 of file IArchivist.py.

00082 
00083     def retrieve(obj=None, history_id=None, selector=None, preserve=()):
00084         """Retrieves a former state of an object.
00085         
00086         Requires either an object which is the working copy, or a history_id
00087         for an object if no history_id is provided the history_id will be 
00088         obtained from the working copy object.
00089         
00090         Returns an 'IVersionData' object.
00091         
00092         Set the selector to None if you like to retrieve the most actual
00093         version.
00094         
00095         Modifiers may overwrite some aspects of the retrieved version by
00096         the equivalent aspects of the working copy. Sometimes the 
00097         overwritten information is from interest. Attributes (and 
00098         subattributes) beeing from interest can be passed with the
00099         'preserve' argument. 
00100         E.g. preserve=('family_name', 'nick_name', 'real_name')
00101         """

Here is the caller graph for this function:

def CMFEditions.interfaces.IArchivist.IArchivist.save (   prepared_obj,
  autoregister = None 
)
Saves versionable aspects of the objects current state.

Set 'autoregister' to True if the object shall be registered
automatically at the first save ever.

Prior to a save the object has to be prepared. Pass the
return value of the 'prepare' method to 'prepared_obj'.

Definition at line 61 of file IArchivist.py.

00061 
00062     def save(prepared_obj, autoregister=None):
00063         """Saves versionable aspects of the objects current state.
00064         
00065         Set 'autoregister' to True if the object shall be registered
00066         automatically at the first save ever.
00067         
00068         Prior to a save the object has to be prepared. Pass the
00069         return value of the 'prepare' method to 'prepared_obj'.
00070         """

Here is the caller graph for this function:


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