Commit 91796c04 authored by Ivan Tyagov's avatar Ivan Tyagov

Do not work directly with REQUEST.form rather use a copy of it.

Clean up API.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25323 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b32c82f8
......@@ -385,12 +385,9 @@ class WizardTool(BaseTool):
def callRemoteProxyMethod(self, distant_method, server_url=None, use_cache=1, **kw):
""" Call proxy method on server. """
# set real method_id
form = self.REQUEST.form
configurator_user_preferred_language = self.getConfiguratorUserPreferredLanguage()
def wrapper(distant_method, **kw):
form['method_id'] = distant_method
return self._callRemoteMethod('proxyMethodHandler', **kw)['data']
return self._callRemoteMethod(distant_method, use_proxy=1, **kw)['data']
if use_cache:
wrapper = CachingMethod(wrapper,
id = 'callRemoteProxyMethod_%s_%s'
......@@ -399,16 +396,19 @@ class WizardTool(BaseTool):
rc = wrapper(distant_method, **kw)
return rc
def _callRemoteMethod(self, distant_method, server_url=None, wrap_result=1, **kw):
def _callRemoteMethod(self, distant_method, server_url=None, wrap_result=1, use_proxy=0, **kw):
""" Call remote method on server and get result. """
result_call = GeneratorCall()
if server_url is None:
# calculate it
server_url = self.getServerUrl() + self.getServerRoot()
witch_tool = self._getRemoteWitchTool(server_url)
parameter_dict = self.REQUEST.form
# add remote method arguments
parameter_dict['method_kw'] = kw
parameter_dict = self.REQUEST.form.copy()
if use_proxy:
# add remote method arguments
parameter_dict['method_id'] = distant_method
parameter_dict['method_kw'] = kw
distant_method = 'proxyMethodHandler'
## add client arguments
self._updateParameterDictWithServerInfo(parameter_dict)
## handle file upload
......
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