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
return result\n
# The cache duration must not be too long, 300 is the maximum\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
currency_exchange_type=currency_exchange_type,\n
from_currency=from_currency,to_currency=to_currency)\n
......
......@@ -89,7 +89,7 @@ from Products.ERP5Type.Cache import CachingMethod\n
getCurrencyItemList = CachingMethod(\n
getCurrencyItemList,\n
id=\'CurrencyModule_getCurrencyItemList\',\n
cache_factory = \'erp5_user_interface_short\')\n
cache_factory = \'erp5_ui_short\')\n
\n
return getCurrencyItemList( include_empty=include_empty,\n
portal_path=portal.getPath() )\n
......
87
\ No newline at end of file
89
\ No newline at end of file
......@@ -180,7 +180,7 @@ class Person(XMLObject):
self._setReference(value)
self.reindexObject()
# invalid the cache for ERP5Security
clearCache(cache_factory_list=('erp5_core_short', ))
clearCache(cache_factory_list=('erp5_content_short', ))
security.declareProtected(Permissions.SetOwnPassword, 'setPassword')
def setPassword(self, value) :
......
......@@ -398,7 +398,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getTypeList = CachingMethod(getTypeList,
id=('_getPortalGroupedTypeList', group),
cache_factory='erp5_core_medium')
cache_factory='erp5_content_medium')
return getTypeList(group)
def _getPortalGroupedCategoryList(self, group):
......@@ -415,7 +415,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getCategoryList = CachingMethod(
getCategoryList,
id=('_getPortalGroupedCategoryList', group),
cache_factory='erp5_core_medium')
cache_factory='erp5_content_medium')
return getCategoryList(group)
def _getPortalGroupedStateList(self, group):
......@@ -433,7 +433,7 @@ class ERP5Site(FolderMixIn, CMFSite):
getStateList = CachingMethod(getStateList,
id=('_getPortalGroupedStateList', group),
cache_factory='erp5_core_medium')
cache_factory='erp5_content_medium')
return getStateList(group)
security.declareProtected(Permissions.AccessContentsInformation,
......
......@@ -137,7 +137,7 @@ class CategoryTool(CopyContainer, CMFCategoryTool, BaseTool):
"""
def getBaseCategoryDict(self):
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,
previous_category_url, new_category_url):
......
......@@ -87,7 +87,7 @@ def getFieldDescription():\n
return desc\n
\n
getFieldDescription = CachingMethod(getFieldDescription, (\'getFieldDescription\', form_id, field_id), \\\n
cache_factory=\'erp5_user_interface_long\')\n
cache_factory=\'erp5_ui_long\')\n
\n
return getFieldDescription()\n
</string> </value>
......
......@@ -74,7 +74,7 @@ navigation_box_render = CachingMethod(navigation_box_render,\n
("ERP5Site_renderCachedNavigationBox",\n
context.portal_membership.getAuthenticatedMember().getUserName(),\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
</string> </value>
</item>
......
......@@ -122,7 +122,7 @@ def getFormGroupTitleAndId():\n
\n
getFormGroupTitleAndId = CachingMethod(getFormGroupTitleAndId,\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
</string> </value>
</item>
......
345
\ No newline at end of file
347
\ No newline at end of file
......@@ -68,7 +68,7 @@ class Preference( Folder ):
"""Clear caches used by methods of this preference
# TODO: clear different caches according to the preference priority
"""
clearCache()
clearCache(cache_factory_list='erp5_ui_short')
def _edit(self, **kw):
"""edit and clear all caches"""
......
......@@ -141,7 +141,7 @@ class PreferenceMethod(Method) :
return value
_getPreference = CachingMethod( _getPreference,
id='PreferenceTool.CachingMethod.%s' % self._preference_name,
cache_factory='erp5_user_interface_short')
cache_factory='erp5_ui_short')
user_name = getSecurityManager().getUser().getId()
return _getPreference(user_name=user_name)
......@@ -237,7 +237,7 @@ class PreferenceTool(BaseTool):
return acceptable_templates
_getDocumentTemplateList = CachingMethod(_getDocumentTemplateList,
'portal_preferences.getDocumentTemplateList',
cache_factory='erp5_user_interface_medium')
cache_factory='erp5_ui_medium')
allowed_content_types = map(lambda pti: pti.id,
folder.allowedContentTypes())
......
......@@ -234,7 +234,7 @@ class OOoDocument(File, ConversionCacheMixin):
cached_getTargetFormatItemList = CachingMethod(cached_getTargetFormatItemList,
id = "OOoDocument_getTargetFormatItemList",
cache_factory='erp5_user_interface_short')
cache_factory='erp5_ui_short')
return cached_getTargetFormatItemList(self.getContentType())
security.declareProtected(Permissions.AccessContentsInformation, 'getTargetFormatList')
......
......@@ -180,7 +180,7 @@ class ERP5GroupManager(BasePlugin):
if not NO_CACHE_MODE:
_getGroupsForPrincipal = CachingMethod(_getGroupsForPrincipal,
id='ERP5GroupManager_getGroupsForPrincipal',
cache_factory='erp5_core_short')
cache_factory='erp5_content_short')
return _getGroupsForPrincipal(
user_name=principal.getId(),
......
......@@ -109,7 +109,7 @@ class ERP5UserManager(BasePlugin):
_authenticateCredentials = CachingMethod(_authenticateCredentials,
id='ERP5UserManager_authenticateCredentials',
cache_factory='erp5_core_short')
cache_factory='erp5_content_short')
return _authenticateCredentials(
login=credentials.get('login'),
password=credentials.get('password'),
......@@ -154,7 +154,7 @@ class ERP5UserManager(BasePlugin):
_enumerateUsers = CachingMethod(_enumerateUsers,
id='ERP5UserManager_enumerateUsers',
cache_factory='erp5_core_short')
cache_factory='erp5_content_short')
if id is None:
id = login
......
......@@ -104,7 +104,7 @@ def _evaluateTales(instance=None, value=None):
econtext = createExpressionContext(instance)
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):
"""
......
......@@ -2316,7 +2316,7 @@ class Base( CopyContainer,
cached_getAcquireLocalRoles = CachingMethod(cached_getAcquireLocalRoles,
id='Base__getAcquireLocalRoles',
cache_factory='erp5_core_short')
cache_factory='erp5_content_short')
return cached_getAcquireLocalRoles(portal_type=self.getPortalType())
security.declareProtected(Permissions.View, 'get_local_permissions')
......@@ -2591,7 +2591,7 @@ class Base( CopyContainer,
cached_getQuantityPrecisionFromResource = CachingMethod(
cached_getQuantityPrecisionFromResource,
id='Base_getQuantityPrecisionFromResource',
cache_factory='erp5_core_short')
cache_factory='erp5_content_short')
return cached_getQuantityPrecisionFromResource(resource)
......
......@@ -91,7 +91,7 @@ class PortalTypeClass(Constraint):
_getClassForPortalTypeCache = CachingMethod(
_getClassForPortalTypeCache,
"PortalTypeClass._getClassForPortalTypeCache",
cache_factory = 'erp5_core_medium'
cache_factory = 'erp5_content_medium'
)
return _getClassForPortalTypeCache(obj.getPortalType())
......@@ -700,7 +700,7 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn):
_getVisibleAllowedContentTypeList = CachingMethod(
_getVisibleAllowedContentTypeList,
id=("_getAllowedContentTypeTitleList", user, portal_path, portal_type),
cache_factory='erp5_core_long')
cache_factory='erp5_content_long')
return _getVisibleAllowedContentTypeList()
security.declarePublic('allowedContentTypes')
......@@ -741,7 +741,7 @@ class Folder( CopyContainer, CMFBTreeFolder, Base, FolderMixIn):
_allowedContentTypes = CachingMethod( _allowedContentTypes,
id = 'allowedContentTypes',
cache_duration = None)
cache_factory = 'erp5_content_long')
user = str(_getAuthenticatedUser(self))
portal_type = self.getPortalType()
portal = self.getPortalObject()
......
......@@ -1024,7 +1024,7 @@ class Catalog( Folder,
keys = keys.keys()
keys.sort()
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):
"""
......@@ -1043,7 +1043,7 @@ class Catalog( Folder,
if not keys.has_key(key): keys[key] = []
keys[key].append(table) # Is this inconsistent ?
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):
"""
......@@ -1710,7 +1710,7 @@ class Catalog( Folder,
%(table_index, table))
return table_index
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):
......@@ -1743,7 +1743,7 @@ class Catalog( Folder,
LOG("SQLCatalog.getIndex", INFO, "index = %s for table %s and columns %s" \
%(possible_index, table, column_list))
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)
......
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