Back to index

plone3  3.1.7
Properties | Private Member Functions
CMFCore.exportimport.cachingpolicymgr.CachingPolicyNodeAdapter Class Reference
Inheritance diagram for CMFCore.exportimport.cachingpolicymgr.CachingPolicyNodeAdapter:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.exportimport.cachingpolicymgr.CachingPolicyNodeAdapter:
Collaboration graph
[legend]

List of all members.

Properties

 node = property(_exportNode, _importNode)

Private Member Functions

def _exportNode
def _importNode

Detailed Description

Node im- and exporter for CachingPolicy.

Definition at line 33 of file cachingpolicymgr.py.


Member Function Documentation

Export the object as a DOM node.

Definition at line 40 of file cachingpolicymgr.py.

00040 
00041     def _exportNode(self):
00042         """Export the object as a DOM node.
00043         """
00044         obj = self.context
00045         node = self._doc.createElement('caching-policy')
00046         node.setAttribute('name', obj.getPolicyId())
00047         node.setAttribute('predicate', obj.getPredicate())
00048         node.setAttribute('mtime_func', obj.getMTimeFunc())
00049         node.setAttribute('max_age_secs', str(obj.getMaxAgeSecs()))
00050         node.setAttribute('no_cache', str(bool(obj.getNoCache())))
00051         node.setAttribute('no_store', str(bool(obj.getNoStore())))
00052         node.setAttribute('must_revalidate',
00053                           str(bool(obj.getMustRevalidate())))
00054         node.setAttribute('vary', obj.getVary())
00055         node.setAttribute('etag_func', obj.getETagFunc())
00056         s_max_age_secs = obj.getSMaxAgeSecs()
00057         if s_max_age_secs is not None:
00058             node.setAttribute('s_max_age_secs', str(s_max_age_secs))
00059         node.setAttribute('proxy_revalidate',
00060                           str(bool(obj.getProxyRevalidate())))
00061         node.setAttribute('public', str(bool(obj.getPublic())))
00062         node.setAttribute('private', str(bool(obj.getPrivate())))
00063         node.setAttribute('no_transform', str(bool(obj.getNoTransform())))
00064         node.setAttribute('enable_304s', str(bool(obj.getEnable304s())))
00065         node.setAttribute('last_modified', str(bool(obj.getLastModified())))
00066         pre_check = obj.getPreCheck()
00067         if pre_check is not None:
00068             node.setAttribute('pre_check', str(pre_check))
00069         post_check = obj.getPostCheck()
00070         if post_check is not None:
00071             node.setAttribute('post_check', str(post_check))
00072         return node

Here is the call graph for this function:

Here is the caller graph for this function:

Import the object from the DOM node.

Definition at line 73 of file cachingpolicymgr.py.

00073 
00074     def _importNode(self, node):
00075         """Import the object from the DOM node.
00076         """
00077         info = {}
00078         policy_id = node.getAttribute('name')
00079         info['policy_id'] = str(policy_id)
00080         info['predicate'] = str(node.getAttribute('predicate'))
00081         info['mtime_func'] = str(node.getAttribute('mtime_func'))
00082         info['max_age_secs'] = int(node.getAttribute('max_age_secs'))
00083         no_cache = node.getAttribute('no_cache')
00084         info['no_cache'] = self._convertToBoolean(no_cache)
00085         no_store = node.getAttribute('no_store')
00086         info['no_store'] = self._convertToBoolean(no_store)
00087         must_revalidate = node.getAttribute('must_revalidate')
00088         info['must_revalidate'] = self._convertToBoolean(must_revalidate)
00089         info['vary'] = str(node.getAttribute('vary'))
00090         info['etag_func'] = str(node.getAttribute('etag_func'))
00091         s_max_age_secs = node.getAttribute('s_max_age_secs')
00092         if s_max_age_secs != '':
00093             info['s_max_age_secs'] = int(s_max_age_secs)
00094         proxy_revalidate = node.getAttribute('proxy_revalidate')
00095         info['proxy_revalidate'] = self._convertToBoolean(proxy_revalidate)
00096         info['public'] = self._convertToBoolean(node.getAttribute('public'))
00097         info['private'] = self._convertToBoolean(node.getAttribute('private'))
00098         no_transform = node.getAttribute('no_transform')
00099         info['no_transform'] = self._convertToBoolean(no_transform)
00100         enable_304s = node.getAttribute('enable_304s')
00101         info['enable_304s'] = self._convertToBoolean(enable_304s)
00102         last_modified = node.getAttribute('last_modified')
00103         info['last_modified'] = self._convertToBoolean(last_modified)
00104         pre_check = node.getAttribute('pre_check')
00105         if pre_check != '':
00106             info['pre_check'] = int(pre_check)
00107         post_check = node.getAttribute('post_check')
00108         if post_check != '':
00109             info['post_check'] = int(post_check)
00110         self.context.__init__(**info)

Here is the call graph for this function:

Here is the caller graph for this function:


Property Documentation

Definition at line 111 of file cachingpolicymgr.py.


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