Commit 0f9b595c authored by Ivan Tyagov's avatar Ivan Tyagov

Extedn remote method invokation and make it possible to pass kw.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25318 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 51ae574e
...@@ -383,23 +383,23 @@ class WizardTool(BaseTool): ...@@ -383,23 +383,23 @@ class WizardTool(BaseTool):
witch_tool = server.portal_witch witch_tool = server.portal_witch
return witch_tool return witch_tool
def callRemoteProxyMethod(self, distant_method, server_url=None, use_cache=1): def callRemoteProxyMethod(self, distant_method, server_url=None, use_cache=1, **kw):
""" Call proxy method on server. """ """ Call proxy method on server. """
# set real method_id # set real method_id
form = self.REQUEST.form form = self.REQUEST.form
configurator_user_preferred_language = self.getConfiguratorUserPreferredLanguage() configurator_user_preferred_language = self.getConfiguratorUserPreferredLanguage()
def wrapper(distant_method): def wrapper(distant_method, **kw):
form['method_id'] = distant_method form['method_id'] = distant_method
return self._callRemoteMethod('proxyMethodHandler')['data'] return self._callRemoteMethod('proxyMethodHandler', **kw)['data']
if use_cache: if use_cache:
wrapper = CachingMethod(wrapper, wrapper = CachingMethod(wrapper,
id = 'callRemoteProxyMethod_%s_%s' id = 'callRemoteProxyMethod_%s_%s'
%(distant_method, configurator_user_preferred_language), %(distant_method, configurator_user_preferred_language),
cache_factory = 'erp5_ui_medium') cache_factory = 'erp5_ui_medium')
rc = wrapper(distant_method) rc = wrapper(distant_method, **kw)
return rc return rc
def _callRemoteMethod(self, distant_method, server_url=None, wrap_result=1): def _callRemoteMethod(self, distant_method, server_url=None, wrap_result=1, **kw):
""" Call remote method on server and get result. """ """ Call remote method on server and get result. """
result_call = GeneratorCall() result_call = GeneratorCall()
if server_url is None: if server_url is None:
...@@ -407,6 +407,8 @@ class WizardTool(BaseTool): ...@@ -407,6 +407,8 @@ class WizardTool(BaseTool):
server_url = self.getServerUrl() + self.getServerRoot() server_url = self.getServerUrl() + self.getServerRoot()
witch_tool = self._getRemoteWitchTool(server_url) witch_tool = self._getRemoteWitchTool(server_url)
parameter_dict = self.REQUEST.form parameter_dict = self.REQUEST.form
# add remote method arguments
parameter_dict['method_kw'] = kw
## add client arguments ## add client arguments
self._updateParameterDictWithServerInfo(parameter_dict) self._updateParameterDictWithServerInfo(parameter_dict)
## handle file upload ## 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