[Erp5-report] r19484 - in /erp5/trunk/products/ERP5Type: Tool/ dtml/
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Feb 25 13:06:17 CET 2008
Author: jerome
Date: Mon Feb 25 13:06:15 2008
New Revision: 19484
URL: http://svn.erp5.org?rev=19484&view=rev
Log:
make clearAllCache and clearCacheFactory public, but without docstring to
prevent calling them from the URL.
add manage_clearCacheFactory and manage_clearAllCache methods for the ZMI
Modified:
erp5/trunk/products/ERP5Type/Tool/CacheTool.py
erp5/trunk/products/ERP5Type/dtml/cache_tool_configure.dtml
Modified: erp5/trunk/products/ERP5Type/Tool/CacheTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Tool/CacheTool.py?rev=19484&r1=19483&r2=19484&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Tool/CacheTool.py (original)
+++ erp5/trunk/products/ERP5Type/Tool/CacheTool.py Mon Feb 25 13:06:15 2008
@@ -187,15 +187,38 @@
if REQUEST is not None:
self.REQUEST.RESPONSE.redirect('cache_tool_configure?manage_tabs_message=Cache updated.')
- security.declareProtected(Permissions.ModifyPortalContent, 'clearAllCache')
- def clearAllCache(self, REQUEST=None):
- """ Clear all cache factories. """
+ security.declarePublic('clearAllCache')
+ def clearAllCache(self):
+ # Clear all cache factories. This method is public to be called from
+ # scripts, but without docstring to prevent calling it from the URL
ram_cache_root = self.getRamCacheRoot()
for cf_key in ram_cache_root.keys():
for cp in ram_cache_root[cf_key].getCachePluginList():
cp.clearCache()
+
+ security.declareProtected(Permissions.ManagePortal, 'manage_clearAllCache')
+ def manage_clearAllCache(self, REQUEST=None):
+ """Clear all cache factories."""
+ self.clearAllCache()
if REQUEST is not None:
self.REQUEST.RESPONSE.redirect('cache_tool_configure?manage_tabs_message=All cache factories cleared.')
+
+ security.declarePublic('clearCacheFactory')
+ def clearCacheFactory(self, cache_factory_id):
+ # Clear cache factory of given ID.
+ # This method is public to be called from scripts, but without docstring to
+ # prevent calling it from the URL
+ ram_cache_root = self.getRamCacheRoot()
+ if ram_cache_root.has_key(cache_factory_id):
+ ram_cache_root[cache_factory_id].clearCache()
+
+ security.declareProtected(Permissions.ManagePortal, 'manage_clearCacheFactory')
+ def manage_clearCacheFactory(self, cache_factory_id, REQUEST=None):
+ """ Clear only cache factory. """
+ self.clearCacheFactory(cache_factory_id)
+ if REQUEST is not None:
+ self.REQUEST.RESPONSE.redirect('cache_tool_configure?manage_tabs_message=Cache factory %s cleared.' %cache_factory_id)
+
security.declareProtected(Permissions.ModifyPortalContent, 'clearCache')
def clearCache(self, cache_factory_list=(DEFAULT_CACHE_FACTORY,), REQUEST=None):
@@ -208,15 +231,6 @@
if REQUEST is not None:
self.REQUEST.RESPONSE.redirect('cache_tool_configure?manage_tabs_message=Cache cleared.')
- security.declareProtected(Permissions.ModifyPortalContent, 'clearCacheFactory')
- def clearCacheFactory(self, cache_factory_id, REQUEST=None):
- """ Clear only cache factory. """
- ram_cache_root = self.getRamCacheRoot()
- if ram_cache_root.has_key(cache_factory_id):
- ram_cache_root[cache_factory_id].clearCache()
- if REQUEST is not None:
- self.REQUEST.RESPONSE.redirect('cache_tool_configure?manage_tabs_message=Cache factory %s cleared.' %cache_factory_id)
-
security.declareProtected(Permissions.ModifyPortalContent, 'clearCacheFactoryScope')
def clearCacheFactoryScope(self, cache_factory_id, scope, REQUEST=None):
""" Clear only cache factory. """
Modified: erp5/trunk/products/ERP5Type/dtml/cache_tool_configure.dtml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dtml/cache_tool_configure.dtml?rev=19484&r1=19483&r2=19484&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dtml/cache_tool_configure.dtml (original)
+++ erp5/trunk/products/ERP5Type/dtml/cache_tool_configure.dtml Mon Feb 25 13:06:15 2008
@@ -2,11 +2,11 @@
<dtml-var manage_tabs>
<h3>Cache invalidation</h3>
- <form action="clearAllCache" method="POST">
+ <form action="manage_clearAllCache" method="POST">
<input type="submit" value="Clear all cache factories"/>
</form>
<dtml-in expr="objectIds('ERP5 Cache Factory')">
- <form action="clearCacheFactory" method="POST">
+ <form action="manage_clearCacheFactory" method="POST">
<input type="hidden" name="cache_factory_id" value="<dtml-var sequence-item>">
<input type="submit" value="Clear <dtml-var sequence-item>"/>
</form>
More information about the Erp5-report
mailing list