indexing description: "[ Provides facilities to propagate backend changes to the frontend to ensure system consistency. Currently it is just an xml-rpc client for the internal drupal xml-rpc interface which encapsulates xml-rpc specific functionality. ]" author: "Dennis Rietmann " date: "$Date$" revision: "$Revision$" class O_FRONTEND_INTERACTOR inherit O_CONSTANTS create make feature {NONE} -- Initialization make (a_project_name: STRING) is -- Create a frontend synchronizer for the given project (frontend calls are project-centric) local l_config_parser: ORIGO_CONF_PARSER do create xrpc_factory.make -- TODO Use a shared instance create l_config_parser.make_default xrpc_host := a_project_name + "." + l_config_parser.get ("origo_domain") xrpc_port := l_config_parser.get_default ("drupal_xrpc_port", default_drupal_xrpc_port).to_integer xrpc_path := l_config_parser.get_default ("drupal_xrpc_path", default_drupal_xrpc_path) end feature -- Access invoke(a_method: STRING; a_parameters: DS_ARRAYED_LIST[ANY]) is -- Executes an xml-rpc call on the drupal xml-rpc interface -- Returns the client used to make the call which can be used to retrieve the status and in case of -- an error the fault object. local l_xrpc_call: GOA_XRPC_CALL l_xrpc_param: GOA_XRPC_PARAM do create xrpc_client.make (xrpc_host, xrpc_port, xrpc_path) -- we use a fresh client instance for each call create l_xrpc_call.make (a_method) -- add parameters to the call from a_parameters.start until a_parameters.after loop create l_xrpc_param.make (xrpc_factory.build (a_parameters.item_for_iteration)) l_xrpc_call.add_param (l_xrpc_param) a_parameters.forth end xrpc_client.invoke (l_xrpc_call) last_error := Void invocation_ok := xrpc_client.invocation_ok if invocation_ok then last_result := xrpc_client.response.value.value.as_object else last_error := xrpc_client.fault.string end end invocation_ok: BOOLEAN -- Was the last call successful? last_result: ANY -- Last call response. Only available if 'invocation_ok'. last_error: STRING -- Last error message. Only available if not 'invocation_ok'. feature {NONE} -- Implementation xrpc_factory: GOA_XRPC_VALUE_FACTORY -- XML-RPC factory used to marshall arguments for the drupal xml-rpc callbacks xrpc_client: GOA_XRPC_LITE_CLIENT xrpc_host: STRING xrpc_port: INTEGER xrpc_path: STRING end