diff --git a/product/ERP5Cache/CacheTool.py b/product/ERP5Cache/CacheTool.py index d9d330a001515490263c21470412de44a62c0d9c..83c5911d394554a8ddd73d20c9d28adc96ed58ef 100644 --- a/product/ERP5Cache/CacheTool.py +++ b/product/ERP5Cache/CacheTool.py @@ -140,21 +140,20 @@ class CacheTool(BaseTool): security.declareProtected(Permissions.AccessContentsInformation, 'getRamCacheRoot') def getRamCacheRoot(self): """ Return RAM based cache root """ - erp5_site_id = self.getPortalObject().getId() - return CachingMethod.factories[erp5_site_id] + return CachingMethod.factories security.declareProtected(Permissions.ModifyPortalContent, 'updateCache') def updateCache(self, REQUEST=None): """ Clear and update cache structure """ - erp5_site_id = self.getPortalObject().getId() - for cf in CachingMethod.factories[erp5_site_id]: - for cp in CachingMethod.factories[erp5_site_id][cf].getCachePluginList(): + #erp5_site_id = self.getPortalObject().getId() + for cf in CachingMethod.factories: + for cp in CachingMethod.factories[cf].getCachePluginList(): del cp - CachingMethod.factories[erp5_site_id] = {} + CachingMethod.factories = {} ## read configuration from ZODB for key,item in self.getCacheFactoryList().items(): if len(item['cache_plugins'])!=0: - CachingMethod.factories[erp5_site_id][key] = CacheFactory(item['cache_plugins'], item['cache_params']) + CachingMethod.factories[key] = CacheFactory(item['cache_plugins'], item['cache_params']) if REQUEST: self.REQUEST.RESPONSE.redirect('cache_tool_configure?portal_status_message=Cache updated.') diff --git a/product/ERP5Cache/__init__.py b/product/ERP5Cache/__init__.py index 90e72ec9fb8a81f8e47da94af25166f9db83ef0b..68d5dea9631f0a14f5df47fafca4b13534f27726 100644 --- a/product/ERP5Cache/__init__.py +++ b/product/ERP5Cache/__init__.py @@ -6,18 +6,19 @@ this_module = sys.modules[ __name__ ] product_path = package_home( globals() ) this_module._dtmldir = os.path.join( product_path, 'dtml' ) from Products.ERP5Type.Utils import initializeProduct, updateGlobals + import CacheTool -#import CacheTool - object_classes = () -portal_tools = () #(CacheTool.CacheTool,) +portal_tools = () content_classes = () content_constructors = () document_classes = updateGlobals( this_module, globals(), permissions_module = Permissions) portal_tools = ( CacheTool.CacheTool, ) + + def initialize( context ): import Document initializeProduct(context, this_module, globals(), @@ -27,3 +28,4 @@ def initialize( context ): portal_tools = portal_tools, content_constructors = content_constructors, content_classes = content_classes) +