Commit 1206344a authored by Aurel's avatar Aurel

rename cache

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13147 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c2fdc0b2
...@@ -109,7 +109,7 @@ if to_currency is not None:\n ...@@ -109,7 +109,7 @@ if to_currency is not None:\n
return result\n return result\n
# The cache duration must not be too long, 300 is the maximum\n # The cache duration must not be too long, 300 is the maximum\n
calculateExchangeFromParameters = CachingMethod(calculateExchangeFromParameters, \n calculateExchangeFromParameters = CachingMethod(calculateExchangeFromParameters, \n
id = \'calculateExchangeFromParameterss\', cache_factory = \'erp5_user_interface_short\')\n id = \'calculateExchangeFromParameterss\', cache_factory = \'erp5_ui_short\')\n
result = calculateExchangeFromParameters(start_date=start_date,\n result = calculateExchangeFromParameters(start_date=start_date,\n
currency_exchange_type=currency_exchange_type,\n currency_exchange_type=currency_exchange_type,\n
from_currency=from_currency,to_currency=to_currency)\n from_currency=from_currency,to_currency=to_currency)\n
......
...@@ -89,7 +89,7 @@ from Products.ERP5Type.Cache import CachingMethod\n ...@@ -89,7 +89,7 @@ from Products.ERP5Type.Cache import CachingMethod\n
getCurrencyItemList = CachingMethod(\n getCurrencyItemList = CachingMethod(\n
getCurrencyItemList,\n getCurrencyItemList,\n
id=\'CurrencyModule_getCurrencyItemList\',\n id=\'CurrencyModule_getCurrencyItemList\',\n
cache_factory = \'erp5_user_interface_short\')\n cache_factory = \'erp5_ui_short\')\n
\n \n
return getCurrencyItemList( include_empty=include_empty,\n return getCurrencyItemList( include_empty=include_empty,\n
portal_path=portal.getPath() )\n portal_path=portal.getPath() )\n
......
87 89
\ No newline at end of file \ No newline at end of file
...@@ -180,7 +180,7 @@ class Person(XMLObject): ...@@ -180,7 +180,7 @@ class Person(XMLObject):
self._setReference(value) self._setReference(value)
self.reindexObject() self.reindexObject()
# invalid the cache for ERP5Security # invalid the cache for ERP5Security
clearCache(cache_factory_list=('erp5_core_short', )) clearCache(cache_factory_list=('erp5_content_short', ))
security.declareProtected(Permissions.SetOwnPassword, 'setPassword') security.declareProtected(Permissions.SetOwnPassword, 'setPassword')
def setPassword(self, value) : def setPassword(self, value) :
......
...@@ -398,7 +398,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -398,7 +398,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getTypeList = CachingMethod(getTypeList, getTypeList = CachingMethod(getTypeList,
id=('_getPortalGroupedTypeList', group), id=('_getPortalGroupedTypeList', group),
cache_factory='erp5_core_medium') cache_factory='erp5_content_medium')
return getTypeList(group) return getTypeList(group)
def _getPortalGroupedCategoryList(self, group): def _getPortalGroupedCategoryList(self, group):
...@@ -415,7 +415,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -415,7 +415,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getCategoryList = CachingMethod( getCategoryList = CachingMethod(
getCategoryList, getCategoryList,
id=('_getPortalGroupedCategoryList', group), id=('_getPortalGroupedCategoryList', group),
cache_factory='erp5_core_medium') cache_factory='erp5_content_medium')
return getCategoryList(group) return getCategoryList(group)
def _getPortalGroupedStateList(self, group): def _getPortalGroupedStateList(self, group):
...@@ -433,7 +433,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -433,7 +433,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getStateList = CachingMethod(getStateList, getStateList = CachingMethod(getStateList,
id=('_getPortalGroupedStateList', group), id=('_getPortalGroupedStateList', group),
cache_factory='erp5_core_medium') cache_factory='erp5_content_medium')
return getStateList(group) return getStateList(group)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
......
...@@ -137,7 +137,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool): ...@@ -137,7 +137,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
""" """
def getBaseCategoryDict(self): def getBaseCategoryDict(self):
return dict.fromkeys(self.getBaseCategoryList(), None) return dict.fromkeys(self.getBaseCategoryList(), None)
return CachingMethod(getBaseCategoryDict, 'portal_categories.getBaseCategoryDict', cache_factory='erp5_core_long')(self) return CachingMethod(getBaseCategoryDict, 'portal_categories.getBaseCategoryDict', cache_factory='erp5_content_long')(self)
def updateRelatedContent(self, context, def updateRelatedContent(self, context,
previous_category_url, new_category_url): previous_category_url, new_category_url):
......
...@@ -87,7 +87,7 @@ def getFieldDescription():\n ...@@ -87,7 +87,7 @@ def getFieldDescription():\n
return desc\n return desc\n
\n \n
getFieldDescription = CachingMethod(getFieldDescription, (\'getFieldDescription\', form_id, field_id), \\\n getFieldDescription = CachingMethod(getFieldDescription, (\'getFieldDescription\', form_id, field_id), \\\n
cache_factory=\'erp5_user_interface_long\')\n cache_factory=\'erp5_ui_long\')\n
\n \n
return getFieldDescription()\n return getFieldDescription()\n
</string> </value> </string> </value>
......
...@@ -74,7 +74,7 @@ navigation_box_render = CachingMethod(navigation_box_render,\n ...@@ -74,7 +74,7 @@ navigation_box_render = CachingMethod(navigation_box_render,\n
("ERP5Site_renderCachedNavigationBox",\n ("ERP5Site_renderCachedNavigationBox",\n
context.portal_membership.getAuthenticatedMember().getUserName(),\n context.portal_membership.getAuthenticatedMember().getUserName(),\n
context.Localizer.get_selected_language()\n context.Localizer.get_selected_language()\n
),cache_factory=\'erp5_user_interface_short\')\n ),cache_factory=\'erp5_ui_short\')\n
return navigation_box_render()\n return navigation_box_render()\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -122,7 +122,7 @@ def getFormGroupTitleAndId():\n ...@@ -122,7 +122,7 @@ def getFormGroupTitleAndId():\n
\n \n
getFormGroupTitleAndId = CachingMethod(getFormGroupTitleAndId,\n getFormGroupTitleAndId = CachingMethod(getFormGroupTitleAndId,\n
("ERP5Site_getFormGroupTitleAndId", form.id, form.get_groups(include_empty=0)),\n ("ERP5Site_getFormGroupTitleAndId", form.id, form.get_groups(include_empty=0)),\n
cache_factory=\'erp5_user_interface_long\')\n cache_factory=\'erp5_ui_long\')\n
return getFormGroupTitleAndId()\n return getFormGroupTitleAndId()\n
</string> </value> </string> </value>
</item> </item>
......
345 347
\ No newline at end of file \ No newline at end of file
...@@ -68,7 +68,7 @@ class Preference( Folder ): ...@@ -68,7 +68,7 @@ class Preference( Folder ):
"""Clear caches used by methods of this preference """Clear caches used by methods of this preference
# TODO: clear different caches according to the preference priority # TODO: clear different caches according to the preference priority
""" """
clearCache() clearCache(cache_factory_list='erp5_ui_short')
def _edit(self, **kw): def _edit(self, **kw):
"""edit and clear all caches""" """edit and clear all caches"""
......
...@@ -141,7 +141,7 @@ class PreferenceMethod(Method) : ...@@ -141,7 +141,7 @@ class PreferenceMethod(Method) :
return value return value
_getPreference = CachingMethod( _getPreference, _getPreference = CachingMethod( _getPreference,
id='PreferenceTool.CachingMethod.%s' % self._preference_name, id='PreferenceTool.CachingMethod.%s' % self._preference_name,
cache_factory='erp5_user_interface_short') cache_factory='erp5_ui_short')
user_name = getSecurityManager().getUser().getId() user_name = getSecurityManager().getUser().getId()
return _getPreference(user_name=user_name) return _getPreference(user_name=user_name)
...@@ -237,7 +237,7 @@ class PreferenceTool(BaseTool): ...@@ -237,7 +237,7 @@ class PreferenceTool(BaseTool):
return acceptable_templates return acceptable_templates
_getDocumentTemplateList = CachingMethod(_getDocumentTemplateList, _getDocumentTemplateList = CachingMethod(_getDocumentTemplateList,
'portal_preferences.getDocumentTemplateList', 'portal_preferences.getDocumentTemplateList',
cache_factory='erp5_user_interface_medium') cache_factory='erp5_ui_medium')
allowed_content_types = map(lambda pti: pti.id, allowed_content_types = map(lambda pti: pti.id,
folder.allowedContentTypes()) folder.allowedContentTypes())
......
...@@ -234,7 +234,7 @@ class OOoDocument(File, ConversionCacheMixin): ...@@ -234,7 +234,7 @@ class OOoDocument(File, ConversionCacheMixin):
cached_getTargetFormatItemList = CachingMethod(cached_getTargetFormatItemList, cached_getTargetFormatItemList = CachingMethod(cached_getTargetFormatItemList,
id = "OOoDocument_getTargetFormatItemList", id = "OOoDocument_getTargetFormatItemList",
cache_factory='erp5_user_interface_short') cache_factory='erp5_ui_short')
return cached_getTargetFormatItemList(self.getContentType()) return cached_getTargetFormatItemList(self.getContentType())
security.declareProtected(Permissions.AccessContentsInformation, 'getTargetFormatList') security.declareProtected(Permissions.AccessContentsInformation, 'getTargetFormatList')
......
...@@ -180,7 +180,7 @@ class ERP5GroupManager(BasePlugin): ...@@ -180,7 +180,7 @@ class ERP5GroupManager(BasePlugin):
if not NO_CACHE_MODE: if not NO_CACHE_MODE:
_getGroupsForPrincipal = CachingMethod(_getGroupsForPrincipal, _getGroupsForPrincipal = CachingMethod(_getGroupsForPrincipal,
id='ERP5GroupManager_getGroupsForPrincipal', id='ERP5GroupManager_getGroupsForPrincipal',
cache_factory='erp5_core_short') cache_factory='erp5_content_short')
return _getGroupsForPrincipal( return _getGroupsForPrincipal(
user_name=principal.getId(), user_name=principal.getId(),
......
...@@ -109,7 +109,7 @@ class ERP5UserManager(BasePlugin): ...@@ -109,7 +109,7 @@ class ERP5UserManager(BasePlugin):
_authenticateCredentials = CachingMethod(_authenticateCredentials, _authenticateCredentials = CachingMethod(_authenticateCredentials,
id='ERP5UserManager_authenticateCredentials', id='ERP5UserManager_authenticateCredentials',
cache_factory='erp5_core_short') cache_factory='erp5_content_short')
return _authenticateCredentials( return _authenticateCredentials(
login=credentials.get('login'), login=credentials.get('login'),
password=credentials.get('password'), password=credentials.get('password'),
...@@ -154,7 +154,7 @@ class ERP5UserManager(BasePlugin): ...@@ -154,7 +154,7 @@ class ERP5UserManager(BasePlugin):
_enumerateUsers = CachingMethod(_enumerateUsers, _enumerateUsers = CachingMethod(_enumerateUsers,
id='ERP5UserManager_enumerateUsers', id='ERP5UserManager_enumerateUsers',
cache_factory='erp5_core_short') cache_factory='erp5_content_short')
if id is None: if id is None:
id = login id = login
......
...@@ -104,7 +104,7 @@ def _evaluateTales(instance=None, value=None): ...@@ -104,7 +104,7 @@ def _evaluateTales(instance=None, value=None):
econtext = createExpressionContext(instance) econtext = createExpressionContext(instance)
return expression(econtext) return expression(econtext)
evaluateTales = CachingMethod(_evaluateTales, id = 'evaluateTales', cache_factory='erp5_core_short') evaluateTales = CachingMethod(_evaluateTales, id = 'evaluateTales', cache_factory='erp5_content_short')
class Getter(Method): class Getter(Method):
""" """
......
...@@ -2316,7 +2316,7 @@ class Base( CopyContainer, ...@@ -2316,7 +2316,7 @@ class Base( CopyContainer,
cached_getAcquireLocalRoles = CachingMethod(cached_getAcquireLocalRoles, cached_getAcquireLocalRoles = CachingMethod(cached_getAcquireLocalRoles,
id='Base__getAcquireLocalRoles', id='Base__getAcquireLocalRoles',
cache_factory='erp5_core_short') cache_factory='erp5_content_short')
return cached_getAcquireLocalRoles(portal_type=self.getPortalType()) return cached_getAcquireLocalRoles(portal_type=self.getPortalType())
security.declareProtected(Permissions.View, 'get_local_permissions') security.declareProtected(Permissions.View, 'get_local_permissions')
...@@ -2591,7 +2591,7 @@ class Base( CopyContainer, ...@@ -2591,7 +2591,7 @@ class Base( CopyContainer,
cached_getQuantityPrecisionFromResource = CachingMethod( cached_getQuantityPrecisionFromResource = CachingMethod(
cached_getQuantityPrecisionFromResource, cached_getQuantityPrecisionFromResource,
id='Base_getQuantityPrecisionFromResource', id='Base_getQuantityPrecisionFromResource',
cache_factory='erp5_core_short') cache_factory='erp5_content_short')
return cached_getQuantityPrecisionFromResource(resource) return cached_getQuantityPrecisionFromResource(resource)
......
...@@ -91,7 +91,7 @@ class PortalTypeClass(Constraint): ...@@ -91,7 +91,7 @@ class PortalTypeClass(Constraint):
_getClassForPortalTypeCache = CachingMethod( _getClassForPortalTypeCache = CachingMethod(
_getClassForPortalTypeCache, _getClassForPortalTypeCache,
"PortalTypeClass._getClassForPortalTypeCache", "PortalTypeClass._getClassForPortalTypeCache",
cache_factory = 'erp5_core_medium' cache_factory = 'erp5_content_medium'
) )
return _getClassForPortalTypeCache(obj.getPortalType()) return _getClassForPortalTypeCache(obj.getPortalType())
...@@ -700,7 +700,7 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn): ...@@ -700,7 +700,7 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn):
_getVisibleAllowedContentTypeList = CachingMethod( _getVisibleAllowedContentTypeList = CachingMethod(
_getVisibleAllowedContentTypeList, _getVisibleAllowedContentTypeList,
id=("_getAllowedContentTypeTitleList", user, portal_path, portal_type), id=("_getAllowedContentTypeTitleList", user, portal_path, portal_type),
cache_factory='erp5_core_long') cache_factory='erp5_content_long')
return _getVisibleAllowedContentTypeList() return _getVisibleAllowedContentTypeList()
security.declarePublic('allowedContentTypes') security.declarePublic('allowedContentTypes')
...@@ -741,7 +741,7 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn): ...@@ -741,7 +741,7 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn):
_allowedContentTypes = CachingMethod( _allowedContentTypes, _allowedContentTypes = CachingMethod( _allowedContentTypes,
id = 'allowedContentTypes', id = 'allowedContentTypes',
cache_duration = None) cache_factory = 'erp5_content_long')
user = str(_getAuthenticatedUser(self)) user = str(_getAuthenticatedUser(self))
portal_type = self.getPortalType() portal_type = self.getPortalType()
portal = self.getPortalObject() portal = self.getPortalObject()
......
...@@ -1024,7 +1024,7 @@ class Catalog( Folder, ...@@ -1024,7 +1024,7 @@ class Catalog( Folder,
keys = keys.keys() keys = keys.keys()
keys.sort() keys.sort()
return keys return keys
return CachingMethod(_getColumnIds, id='SQLCatalog.getColumnIds', cache_factory='erp5_core_long')() return CachingMethod(_getColumnIds, id='SQLCatalog.getColumnIds', cache_factory='erp5_content_long')()
def getColumnMap(self): def getColumnMap(self):
""" """
...@@ -1043,7 +1043,7 @@ class Catalog( Folder, ...@@ -1043,7 +1043,7 @@ class Catalog( Folder,
if not keys.has_key(key): keys[key] = [] if not keys.has_key(key): keys[key] = []
keys[key].append(table) # Is this inconsistent ? keys[key].append(table) # Is this inconsistent ?
return keys return keys
return CachingMethod(_getColumnMap, id='SQLCatalog.getColumnMap', cache_factory='erp5_core_long')() return CachingMethod(_getColumnMap, id='SQLCatalog.getColumnMap', cache_factory='erp5_content_long')()
def getResultColumnIds(self): def getResultColumnIds(self):
""" """
...@@ -1710,7 +1710,7 @@ class Catalog( Folder, ...@@ -1710,7 +1710,7 @@ class Catalog( Folder,
%(table_index, table)) %(table_index, table))
return table_index return table_index
return CachingMethod(_getTableIndex, id='SQLCatalog.getTableIndex', \ return CachingMethod(_getTableIndex, id='SQLCatalog.getTableIndex', \
cache_factory='erp5_core_long')(table=table) cache_factory='erp5_content_long')(table=table)
def getIndex(self, table, column_list, all_column_list): def getIndex(self, table, column_list, all_column_list):
...@@ -1743,7 +1743,7 @@ class Catalog( Folder, ...@@ -1743,7 +1743,7 @@ class Catalog( Folder,
LOG("SQLCatalog.getIndex", INFO, "index = %s for table %s and columns %s" \ LOG("SQLCatalog.getIndex", INFO, "index = %s for table %s and columns %s" \
%(possible_index, table, column_list)) %(possible_index, table, column_list))
return possible_index return possible_index
return CachingMethod(_getIndex, id='SQLCatalog.getIndex', cache_factory='erp5_core_long')\ return CachingMethod(_getIndex, id='SQLCatalog.getIndex', cache_factory='erp5_content_long')\
(table=table, column_list=column_list, all_column_list=all_column_list) (table=table, column_list=column_list, all_column_list=all_column_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment