Back to index

plone3  3.1.7
Static Public Attributes | Private Member Functions | Static Private Attributes
CMFCore.exportimport.cachingpolicymgr.CachingPolicyManagerXMLAdapter Class Reference
Inheritance diagram for CMFCore.exportimport.cachingpolicymgr.CachingPolicyManagerXMLAdapter:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.exportimport.cachingpolicymgr.CachingPolicyManagerXMLAdapter:
Collaboration graph
[legend]

List of all members.

Static Public Attributes

string name = 'cachingpolicymgr'

Private Member Functions

def _exportNode
def _importNode
def _extractCachingPolicies
def _purgeCachingPolicies
def _initCachingPolicies

Static Private Attributes

string _LOGGER_ID = 'cachingpolicies'

Detailed Description

XML im- and exporter for CachingPolicyManager.

Definition at line 114 of file cachingpolicymgr.py.


Member Function Documentation

Export the object as a DOM node.

Definition at line 125 of file cachingpolicymgr.py.

00125 
00126     def _exportNode(self):
00127         """Export the object as a DOM node.
00128         """
00129         node = self._getObjectNode('object')
00130         node.appendChild(self._extractCachingPolicies())
00131 
00132         self._logger.info('Caching policy manager exported.')
00133         return node

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 144 of file cachingpolicymgr.py.

00144 
00145     def _extractCachingPolicies(self):
00146         fragment = self._doc.createDocumentFragment()
00147         for policy_id, policy in self.context.listPolicies():
00148             exporter = queryMultiAdapter((policy, self.environ), INode)
00149             if exporter:
00150                 fragment.appendChild(exporter.node)
00151         return fragment

Here is the caller graph for this function:

Import the object from the DOM node.

Definition at line 134 of file cachingpolicymgr.py.

00134 
00135     def _importNode(self, node):
00136         """Import the object from the DOM node.
00137         """
00138         if self.environ.shouldPurge():
00139             self._purgeCachingPolicies()
00140 
00141         self._initCachingPolicies(node)
00142 
00143         self._logger.info('Caching policy manager imported.')

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 155 of file cachingpolicymgr.py.

00155 
00156     def _initCachingPolicies(self, node):
00157         for child in node.childNodes:
00158             if child.nodeName != 'caching-policy':
00159                 continue
00160             parent = self.context
00161 
00162             policy_id = str(child.getAttribute('name'))
00163             if policy_id not in parent._policy_ids:
00164                 parent.addPolicy(policy_id, 'python:1', 'object/modified',
00165                                  0, 0, 0, 0, '', '')
00166 
00167             policy = self.context._policies[policy_id]
00168             importer = queryMultiAdapter((policy, self.environ), INode)
00169             if importer:
00170                 importer.node = child
00171 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 152 of file cachingpolicymgr.py.

00152 
00153     def _purgeCachingPolicies(self):
00154         self.context.__init__()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 121 of file cachingpolicymgr.py.

Definition at line 123 of file cachingpolicymgr.py.


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