4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.12 2003/04/08 17:52:12 joko |
8 |
|
## CHANGE: renamed property 'datasource' to 'transport' |
9 |
|
## NEW: Module 'RemoteAction' |
10 |
|
## |
11 |
## Revision 1.11 2003/04/07 22:31:51 jonen |
## Revision 1.11 2003/04/07 22:31:51 jonen |
12 |
## + added switch of ecom label (e.g. nav, chooser) at ecom type switch 'nav' |
## + added switch of ecom label (e.g. nav, chooser) at ecom type switch 'nav' |
13 |
## - removed recent added ecom type chooser |
## - removed recent added ecom type chooser |
154 |
|
|
155 |
|
|
156 |
function init_default_gui_modules() { |
function init_default_gui_modules() { |
157 |
|
|
158 |
|
// format of parameters: label, ecom_type, abstract_type, module_name |
159 |
|
|
160 |
//$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") ); |
//$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") ); |
161 |
$this->register_gui_module("nav", "nav", "list", "WebExplorer::Module::NavigationList" ); |
$this->register_gui_module("nav", "nav", "list", "WebExplorer::Module::NavigationList" ); |
162 |
$this->register_gui_module("content", "data", "list", "WebExplorer::Module::DataList" ); |
$this->register_gui_module("content", "data", "list", "WebExplorer::Module::DataList" ); |
163 |
$this->register_gui_module("content", "data", "item", "WebExplorer::Module::DataItem" ); |
$this->register_gui_module("content", "data", "item", "WebExplorer::Module::DataItem" ); |
164 |
// 2003-04-05 - Chooser |
// 2003-04-05 - Chooser |
165 |
$this->register_gui_module("chooser", "nav", "list", "WebExplorer::Module::Chooser"); |
$this->register_gui_module("chooser", "nav", "list", "WebExplorer::Module::Chooser"); |
166 |
|
// 2003-04-07 - RemoteAction |
167 |
|
$this->register_gui_module("phase_startup", "call", "auto", "WebExplorer::Module::RemoteAction"); |
168 |
} |
} |
169 |
|
|
170 |
function register_source_module($label, $args) { |
function register_source_module($label, $args) { |
213 |
//print Dumper($args); |
//print Dumper($args); |
214 |
|
|
215 |
// get ecom GUI module |
// get ecom GUI module |
216 |
$ecom = php::mkComponent($gui_module, $args); |
if (!$ecom = php::mkComponent($gui_module, $args)) { |
217 |
|
return; |
218 |
|
} |
219 |
//print Dumper($ecom); |
//print Dumper($ecom); |
220 |
|
|
221 |
// load phphtmllib GUI object |
// load phphtmllib GUI object |
288 |
// switch abstract type |
// switch abstract type |
289 |
if($val['ecom_abstract_type'] == "list") { |
if($val['ecom_abstract_type'] == "list") { |
290 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_data_locator_key'] == "rpc") { |
291 |
//$data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']); |
//$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']); |
292 |
$data_locator_meta = array( datasource => 'rpc', metatype => 'data', abstract_type => 'list', classname => $val['ecom_data_ident']); |
$data_locator_meta = array( transport => 'rpc', metatype => 'data', abstract_type => 'list', classname => $val['ecom_data_ident']); |
293 |
} else { |
} else { |
294 |
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
295 |
} |
} |
308 |
// switch abstract type |
// switch abstract type |
309 |
} elseif ($val['ecom_abstract_type'] == "item") { |
} elseif ($val['ecom_abstract_type'] == "item") { |
310 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_data_locator_key'] == "rpc") { |
311 |
//$data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']); |
//$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']); |
312 |
$data_locator_meta = array( datasource => 'rpc', metatype => 'data', abstract_type => 'item', ident => $val['ecom_data_ident'], classname => $val['ecom_data_meta']); |
$data_locator_meta = array( transport => 'rpc', metatype => 'data', abstract_type => 'item', ident => $val['ecom_data_ident'], classname => $val['ecom_data_meta']); |
313 |
} else { |
} else { |
314 |
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
315 |
} |
} |
337 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_data_locator_key'] == "rpc") { |
338 |
// switch component label |
// switch component label |
339 |
if($label == "nav") { |
if($label == "nav") { |
340 |
$data_locator_meta = array( datasource => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' ); |
$data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' ); |
341 |
$args['caption'] = "Objekt Typen"; |
$args['caption'] = "Objekt Typen"; |
342 |
} |
} |
343 |
// NEW [2003-04-05]: DataSource.Chooser |
// NEW [2003-04-05]: DataSource.Chooser |
344 |
elseif ($label == "chooser") { |
elseif ($label == "chooser") { |
345 |
$data_locator_meta = array( datasource => 'rpc', metatype => 'schema', filter => 'sources.all' ); |
$data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'sources.all' ); |
346 |
$args['caption'] = "Datenquellen"; |
$args['caption'] = "Datenquellen"; |
347 |
} |
} |
348 |
$args['options']['data_locator_meta'] = $data_locator_meta; |
$args['options']['data_locator_meta'] = $data_locator_meta; |
353 |
$args = array(); |
$args = array(); |
354 |
} |
} |
355 |
|
|
356 |
|
// NEW [2003-04-08]: RemoteAction (e.g.: result of a selection inside a Chooser) |
357 |
|
// switch component type |
358 |
|
} elseif ($val['ecom_type'] == "call") { |
359 |
|
|
360 |
|
// responses of RemoteActions are not predictable! |
361 |
|
if ($val['ecom_abstract_type'] == "auto") { |
362 |
|
|
363 |
|
// Dispatching by $label is not done here. RemoteAction-ecoms can appear anywhere! |
364 |
|
|
365 |
|
// Just define the RemoteQuery using a declaration to use DataSource::Generic most transparently. |
366 |
|
// Really - just a remote call is issued, no data-/schema-structures or similar are expected. |
367 |
|
|
368 |
|
// The RemoteMethod 'method' is called directly with arguments in 'args'! |
369 |
|
// As response (important for widget assignement!) you may expect an arbitrary payload. |
370 |
|
$args['options']['data_locator_meta'] = array( |
371 |
|
transport => 'rpc', |
372 |
|
metatype => 'method', |
373 |
|
method => $val['ecom_call_method'], |
374 |
|
args => $val['ecom_call_args'] |
375 |
|
); |
376 |
|
|
377 |
|
} else { |
378 |
|
// FIXME: implement automatic re-dispatching to available ecoms here! |
379 |
|
user_error("WebExplorer::AbstractExplorer: results of RemoteActions can only be handled automatically. Who knows what comes back?"); |
380 |
|
} |
381 |
|
|
382 |
} |
} |
383 |
return $args; |
return $args; |