Commit 8df5408e authored by Ivan Tyagov's avatar Ivan Tyagov

Cache server address, user/password as this data is fixed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24148 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c3dc1395
...@@ -46,6 +46,7 @@ from base64 import encodestring, decodestring ...@@ -46,6 +46,7 @@ from base64 import encodestring, decodestring
from urllib import quote, unquote from urllib import quote, unquote
from DateTime import DateTime from DateTime import DateTime
from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlugin
from Products.ERP5Type.Cache import CachingMethod
# global (RAM) cookie storage # global (RAM) cookie storage
cookiejar = cookielib.CookieJar() cookiejar = cookielib.CookieJar()
...@@ -241,8 +242,12 @@ class WizardTool(BaseTool): ...@@ -241,8 +242,12 @@ class WizardTool(BaseTool):
def _getSubsribedUserAndPassword(self): def _getSubsribedUserAndPassword(self):
"""Retrieve the username and password for the subscription from """Retrieve the username and password for the subscription from
the system.""" the system."""
user = self.getExpressConfigurationPreference('preferred_express_user_id', '') user = CachingMethod(self.getExpressConfigurationPreference, \
pw = self.getExpressConfigurationPreference('preferred_express_password', '') 'WizardTool_preferred_express_user_id', \
cache_factory='erp5_content_long')('preferred_express_user_id', '')
pw = CachingMethod(self.getExpressConfigurationPreference, \
'WizardTool_preferred_express_password', \
cache_factory='erp5_content_long')('preferred_express_password', '')
return (user, pw) return (user, pw)
# This is a custom opener director for not handling redirections # This is a custom opener director for not handling redirections
...@@ -797,11 +802,15 @@ class WizardTool(BaseTool): ...@@ -797,11 +802,15 @@ class WizardTool(BaseTool):
security.declareProtected(Permissions.View, 'getServerUrl') security.declareProtected(Permissions.View, 'getServerUrl')
def getServerUrl(self): def getServerUrl(self):
return self.getExpressConfigurationPreference('preferred_witch_tool_server_url', '') return CachingMethod(self.getExpressConfigurationPreference, \
'WizardTool_preferred_witch_tool_server_url', \
cache_factory='erp5_content_long')('preferred_witch_tool_server_url', '')
security.declareProtected(Permissions.View, 'getServerRoot') security.declareProtected(Permissions.View, 'getServerRoot')
def getServerRoot(self): def getServerRoot(self):
return self.getExpressConfigurationPreference('preferred_witch_tool_server_root', '') return CachingMethod(self.getExpressConfigurationPreference, \
'WizardTool_preferred_witch_tool_server_root', \
cache_factory='erp5_content_long')('preferred_witch_tool_server_root', '')
security.declareProtected(Permissions.View, 'getExpressConfigurationPreference') security.declareProtected(Permissions.View, 'getExpressConfigurationPreference')
def getExpressConfigurationPreference(self, preference_id, default = None): def getExpressConfigurationPreference(self, preference_id, default = None):
......
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