Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Private Attributes
ZopeVersionControl.nonversioned.ObjectManagerNonVersionedDataAdapter Class Reference
Inheritance diagram for ZopeVersionControl.nonversioned.ObjectManagerNonVersionedDataAdapter:
Inheritance graph
[legend]
Collaboration diagram for ZopeVersionControl.nonversioned.ObjectManagerNonVersionedDataAdapter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def listNonVersionedObjects
def removeNonVersionedData
def getNonVersionedData
def restoreNonVersionedData

Public Attributes

 obj
 attrs

Static Private Attributes

 __implements__ = INonVersionedData

Detailed Description

Non-versioned data adapter for object managers.

Definition at line 114 of file nonversioned.py.


Member Function Documentation

Reimplemented from ZopeVersionControl.nonversioned.StandardNonVersionedDataAdapter.

Definition at line 135 of file nonversioned.py.

00135 
00136     def getNonVersionedData(self):
00137         contents = {}
00138         attributes = StandardNonVersionedDataAdapter.getNonVersionedData(self)
00139         for name, value in self.obj.objectItems():
00140             if not isAVersionableResource(value):
00141                 # This object should include the state of subobjects
00142                 # that won't be versioned independently.
00143                 continue
00144             if isProxyOrReference is not None:
00145                 if isProxyOrReference(value):
00146                     # This object should include the state of
00147                     # subobjects that are references.
00148                     continue
00149             contents[name] = aq_base(value)
00150         return {'contents': contents, 'attributes': attributes}

Here is the call graph for this function:

Reimplemented from ZopeVersionControl.nonversioned.StandardNonVersionedDataAdapter.

Definition at line 119 of file nonversioned.py.

00119 
00120     def listNonVersionedObjects(self):
00121         contents = self.getNonVersionedData()['contents']
00122         return contents.values()

Here is the call graph for this function:

Reimplemented from ZopeVersionControl.nonversioned.StandardNonVersionedDataAdapter.

Definition at line 123 of file nonversioned.py.

00123 
00124     def removeNonVersionedData(self):
00125         StandardNonVersionedDataAdapter.removeNonVersionedData(self)
00126         obj = self.obj
00127         removed = {}
00128         contents = self.getNonVersionedData()['contents']
00129         for name, value in contents.items():
00130             obj._delOb(name)
00131             removed[name] = 1
00132         if obj._objects:
00133             obj._objects = tuple([info for info in obj._objects
00134                                   if not removed.has_key(info['id'])])

Here is the call graph for this function:

Reimplemented from ZopeVersionControl.nonversioned.StandardNonVersionedDataAdapter.

Definition at line 151 of file nonversioned.py.

00151 
00152     def restoreNonVersionedData(self, data):
00153         StandardNonVersionedDataAdapter.restoreNonVersionedData(
00154             self, data['attributes'])
00155         # First build "ignore", a dictionary that lists which
00156         # items were stored in the repository.
00157         # Don't restore over those.
00158         obj = self.obj
00159         ignore = {}
00160         for name in obj.objectIds():
00161             ignore[name] = 1
00162         # Restore the items of the container.
00163         for name, value in data['contents'].items():
00164             if not ignore.has_key(name):
00165                 obj._setOb(name, aq_base(value))
00166                 if not hasattr(obj, '_tree'):
00167                     # Avoid generating events, since nothing was ever really
00168                     # removed or added.
00169                     obj._objects += ({'meta_type': value.meta_type,
00170                                       'id': name},)
00171                 # If there is a _tree attribute, it's very likely
00172                 # a BTreeFolder2, which doesn't need or want the
00173                 # _objects attribute.
00174                 # XXX This is a hackish way to check for BTreeFolder2s.

Member Data Documentation

Definition at line 87 of file nonversioned.py.

Definition at line 84 of file nonversioned.py.


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