4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.21 2003/05/10 18:23:21 jonen |
8 |
|
## + added stuff relating to 'create/add new' links/buttons |
9 |
|
## |
10 |
|
## Revision 1.20 2003/04/19 16:24:49 jonen |
11 |
|
## + added two more GUI modules to default registry initiation, |
12 |
|
## relating to new navigation module 'NavigationTree' |
13 |
|
## + added prepartion of needed args for abstract navigation tree |
14 |
|
## and concret UserManagment 'UMnav' tree |
15 |
|
## |
16 |
|
## Revision 1.19 2003/04/18 16:21:37 joko |
17 |
|
## fixed commit comment - the last one caused a syntax error!!! |
18 |
|
## |
19 |
|
## Revision 1.18 2003/04/18 15:27:06 joko |
20 |
|
## NEW: XML Trees in data area |
21 |
|
## new ecom module: DataTree |
22 |
|
## introduced new query argument: 'filter' (purpose: xml/tree filtering) |
23 |
|
## $filter = array( |
24 |
|
## dotted => $val['ecom_data_filter'], |
25 |
|
## ident => $val['ecom_data_ident'], |
26 |
|
## ); |
27 |
|
## A Data::Lift module translates this filter-query into a XPath-query ... |
28 |
|
## $filter = array( |
29 |
|
## xpq => '*\/*[@name="cli"]', |
30 |
|
## ); |
31 |
|
## ... which finally is propagated to the backend. |
32 |
|
## NEW: AbstractExplorer - standalone version |
33 |
|
## enhanced set_e_state: now can overwrite internal state to arguments from outside |
34 |
|
## enhanced get_com: also capable of propagating additional args through _load_ecom to _prepare_component_args |
35 |
|
## enhanced _prepare_component_args: now able to dispatch to a "transparent navigation ecom" (e.g. YAA::JobGroups) |
36 |
|
## MISC: |
37 |
|
## added some pre-flight checks throughout the module, especially at the core dispatcher inside _prepare_component_args |
38 |
|
## error checking: added some more croaks via 'user_error' |
39 |
|
## cosmetic updates |
40 |
|
## |
41 |
|
## Revision 1.17 2003/04/18 13:46:15 jonen |
42 |
|
## + add hidden elements(items) now to the constructor arguments of each ecom |
43 |
|
## |
44 |
|
## Revision 1.16 2003/04/10 06:00:58 joko |
45 |
|
## ALPHA: Item.Delete |
46 |
|
## |
47 |
## Revision 1.15 2003/04/09 02:08:20 joko |
## Revision 1.15 2003/04/09 02:08:20 joko |
48 |
## CHANGE: renamed key 'classname' through 'nodename' |
## CHANGE: renamed key 'classname' through 'nodename' |
49 |
## |
## |
170 |
|
|
171 |
function set_data_locator($label, $new_args=array() ) { |
function set_data_locator($label, $new_args=array() ) { |
172 |
global $app; |
global $app; |
173 |
//print Dumper($app) . "<br>"; |
|
174 |
if($label == "rpc") { |
// pre-flight checks |
175 |
|
if (!$label) { |
176 |
|
user_error("AbstractExplorer::set_data_locator - label was empty."); |
177 |
|
return; |
178 |
|
} |
179 |
|
|
180 |
|
if ($label == "rpc") { |
181 |
$rpcinfo = $app->getConfig("rpcinfo"); |
$rpcinfo = $app->getConfig("rpcinfo"); |
182 |
define('RPC_HOSTNAME', $rpcinfo[Host]); |
define('RPC_HOSTNAME', $rpcinfo[Host]); |
183 |
define('RPC_PORT', $rpcinfo[Port]); |
define('RPC_PORT', $rpcinfo[Port]); |
185 |
define('RPC_TRACE', $rpcinfo[TRACE]); |
define('RPC_TRACE', $rpcinfo[TRACE]); |
186 |
define('RPC_DISCONNECT_ON_ERROR', $rpcinfo[DISCONNECT_ON_ERROR]); |
define('RPC_DISCONNECT_ON_ERROR', $rpcinfo[DISCONNECT_ON_ERROR]); |
187 |
} else { |
} else { |
188 |
user_error("AbstractExplorer::set_data_locator - data_locator_key label $label not found!"); |
user_error("AbstractExplorer::set_data_locator - Could not dispatch data_locator_key label '$label'!"); |
189 |
} |
} |
190 |
} |
} |
191 |
|
|
194 |
|
|
195 |
function get_page_state() { |
function get_page_state() { |
196 |
$requestTracker = mkObject("Application::Request::Tracker"); |
$requestTracker = mkObject("Application::Request::Tracker"); |
197 |
|
//print Dumper($this->_state); |
198 |
$this->_state = $requestTracker->getPointer(); |
$this->_state = $requestTracker->getPointer(); |
199 |
} |
} |
200 |
|
|
201 |
function set_e_state() { |
function set_e_state($state = null) { |
202 |
$this->get_page_state(); |
// NEW [2003-04-18]: now has two modes |
203 |
$this->_e_state = $this->_state[options][options]; |
// 1. inject page state from argument passed to us |
204 |
|
// 2. (was) get page state from request tracker |
205 |
|
if ($state) { |
206 |
|
$this->_e_state = $state; |
207 |
|
} else { |
208 |
|
$this->get_page_state(); |
209 |
|
$this->_e_state = $this->_state[options][options]; |
210 |
|
} |
211 |
|
// print "Setting Explorer state:" . Dumper($this->_e_state); |
212 |
} |
} |
|
|
|
213 |
|
|
214 |
function set_page_state() { |
function set_page_state() { |
215 |
user_error("AbstractExplorer::set_page_state - please implement me...."); |
user_error("AbstractExplorer::set_page_state - please implement me...."); |
216 |
} |
} |
|
|
|
217 |
|
|
218 |
function init_default_gui_modules() { |
function init_default_gui_modules() { |
219 |
|
|
220 |
// format of parameters: label, ecom_type, abstract_type, module_name |
// format of parameters: label, ecom_type, abstract_type, module_name |
221 |
|
|
222 |
|
// 2003-03-02 - First ecom modules/components |
223 |
//$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") ); |
//$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") ); |
224 |
$this->register_gui_module("nav", "nav", "list", "WebExplorer::Module::NavigationList" ); |
$this->register_gui_module("nav", "nav", "list", "WebExplorer::Module::NavigationList" ); |
225 |
$this->register_gui_module("content", "data", "list", "WebExplorer::Module::DataList" ); |
$this->register_gui_module("content", "data", "list", "WebExplorer::Module::DataList" ); |
226 |
$this->register_gui_module("content", "data", "item", "WebExplorer::Module::DataItem" ); |
$this->register_gui_module("content", "data", "item", "WebExplorer::Module::DataItem" ); |
227 |
// 2003-04-05 - Chooser |
|
228 |
$this->register_gui_module("chooser", "nav", "list", "WebExplorer::Module::Chooser"); |
// 2003-04-05 - Chooser (a Nav.List) |
229 |
|
$this->register_gui_module("chooser", "nav", "list", "WebExplorer::Module::Chooser"); |
230 |
|
|
231 |
// 2003-04-07 - RemoteAction |
// 2003-04-07 - RemoteAction |
232 |
$this->register_gui_module("phase_startup", "call", "auto", "WebExplorer::Module::RemoteAction"); |
$this->register_gui_module("phase_startup", "call", "auto", "WebExplorer::Module::RemoteAction"); |
233 |
|
|
234 |
|
// 2003-04-09 - Data.Item: DeleteAction |
235 |
|
$this->register_gui_module("phase_startup", "data", "item", "WebExplorer::Module::DataItem"); |
236 |
|
//$this->register_gui_module("phase_startup", "data", "auto", "WebExplorer::Module::RemoteAction"); |
237 |
|
//$this->register_gui_module("phase_startup", "data", "auto", "WebExplorer::Module::DataItem"); |
238 |
|
|
239 |
|
// 2003-04-12 - Data.Tree |
240 |
|
$this->register_gui_module("content", "data", "tree", "WebExplorer::Module::DataTree" ); |
241 |
|
|
242 |
|
// 2003-04-18 - Nav.Tree |
243 |
|
$this->register_gui_module("nav", "nav", "tree", "WebExplorer::Module::NavigationTree" ); |
244 |
|
|
245 |
|
// 2003-04-18 - UserManagment Nav.Tree (we need only a different 'label' as Nav.Tree yet..) |
246 |
|
$this->register_gui_module("UMnav", "nav", "tree", "WebExplorer::Module::NavigationTree" ); |
247 |
|
|
248 |
} |
} |
249 |
|
|
250 |
function register_source_module($label, $args) { |
function register_source_module($label, $args) { |
256 |
} |
} |
257 |
|
|
258 |
|
|
259 |
function &get_ecom($label) { |
function &get_ecom($label, $args = array()) { |
260 |
|
|
261 |
|
// the very first - strongly hardcoded - Hello World ecom |
262 |
//return "Hello World"; |
//return "Hello World"; |
263 |
$this->_load_ecom($label); |
|
264 |
|
// that's better ... |
265 |
|
$this->_load_ecom($label, $args); |
266 |
return $this->_ecom[$label]; |
return $this->_ecom[$label]; |
267 |
|
|
268 |
} |
} |
269 |
|
|
|
|
|
270 |
|
|
271 |
function _load_ecoms() { |
function _load_ecoms() { |
272 |
//trace("_load_ecoms: " . Dumper($this->_e_state[ecoms]) . "<br/>"); |
//trace("_load_ecoms: " . Dumper($this->_e_state[ecoms]) . "<br/>"); |
277 |
|
|
278 |
|
|
279 |
|
|
280 |
function _load_ecom($label) { |
function _load_ecom($label, $args = array()) { |
281 |
|
|
282 |
// fetch values from state |
// fetch values from state |
283 |
$val = $this->_e_state['ecoms'][$label]; |
$val = $this->_e_state['ecoms'][$label]; |
284 |
debug::info("_load_ecom($label): " . Dumper($val) . "<br/>"); |
debug::info("_load_ecom($label): " . Dumper($val) . "<br/>"); |
285 |
|
|
286 |
|
// NEW [2003-04-10]: ecom-RESET-condition |
287 |
|
if (!is_array($val) && $val == 'RESET') { |
288 |
|
debug::info("Resetting component: $label"); |
289 |
|
return; |
290 |
|
} |
291 |
|
|
292 |
// find right ecom gui module |
// find right ecom gui module |
293 |
$ecom_type = $val['ecom_type']; |
$ecom_type = $val['ecom_type']; |
294 |
$abstract_type = $val['ecom_abstract_type']; |
$abstract_type = $val['ecom_abstract_type']; |
295 |
$gui_module = $this->_module['gui'][$label][$ecom_type][$abstract_type]; |
$gui_module = $this->_module['gui'][$label][$ecom_type][$abstract_type]; |
296 |
//print Dumper($gui_module); |
//print Dumper($gui_module); |
297 |
if(!$gui_module) { |
if(!$gui_module) { |
298 |
user_error("AbstractExplorer::_load_component - No GUI module found. [label='$label', abstract type='$val[ecom_abstract_type]', ecom type='$val[ecom_type]']"); |
user_error("_load_ecom: No GUI module found for [label='$label', ecom type='$val[ecom_type]', abstract type='$val[ecom_abstract_type]']."); |
299 |
return; |
return; |
300 |
} |
} |
301 |
|
|
302 |
// get arguments needed for ecom gui module |
// get arguments needed for ecom gui module |
303 |
$args = $this->_prepare_component_args($label); |
$args = $this->_prepare_component_args($label, $args); |
304 |
//print Dumper($args); |
|
305 |
|
// trace |
306 |
|
//print "raw-args: " . Dumper($args) . "<br/>"; |
307 |
|
|
308 |
// get ecom GUI module |
// get ecom GUI module |
309 |
if (!$ecom = php::mkComponent($gui_module, $args)) { |
if (!$ecom = php::mkComponent($gui_module, $args)) { |
310 |
|
user_error("AbstractExplorer::_load_component - Error while instantiating ecom gui component. [label='$label', abstract type='$val[ecom_abstract_type]', ecom type='$val[ecom_type]']"); |
311 |
return; |
return; |
312 |
} |
} |
313 |
//print Dumper($ecom); |
//print Dumper($ecom); |
314 |
|
|
315 |
// load phphtmllib GUI object |
// NEW[2003-04-18] done via args(prepare args!) passed at constructor |
316 |
$gui_ecom = &$ecom->get(); |
// (needed for non-real objects instanced at some child of AbstractGUIModule, eg. NavigationList) |
317 |
|
/* |
318 |
// add hidden vars, needed for explorer control |
// add hidden vars, needed for explorer control |
319 |
$hidden_items = $this->_get_hidden_items($label); |
$hidden_items = $this->_get_hidden_items($label); |
320 |
if(is_array($hidden_items) ) { |
if(is_array($hidden_items) ) { |
321 |
$ecom->add_hidden_items($hidden_items); |
$ecom->add_hidden_items($hidden_items); |
322 |
//print "Hidden: " . Dumper($hidden_items); |
print "Hidden: " . Dumper($hidden_items); |
323 |
} |
} |
324 |
|
*/ |
325 |
|
|
326 |
|
// load phphtmllib GUI object |
327 |
|
$gui_ecom = &$ecom->get(); |
328 |
|
|
329 |
// attempt: |
// attempt: |
330 |
//$gui_ecom->make_transparent(); |
//$gui_ecom->make_transparent(); |
343 |
'ecl' => $label, |
'ecl' => $label, |
344 |
'ecat' => "item", |
'ecat' => "item", |
345 |
'ecmod' => "view", |
'ecmod' => "view", |
346 |
|
'ecdm' => $ecom_state['ecom_data_ident'], |
347 |
); |
); |
348 |
} |
} |
349 |
elseif($ecom_state['ecom_abstract_type'] == "item") { |
elseif($ecom_state['ecom_abstract_type'] == "item") { |
352 |
'ecat' => "item", |
'ecat' => "item", |
353 |
'ecmod' => "view", |
'ecmod' => "view", |
354 |
); |
); |
|
/* |
|
|
if($ecom_state['ecom_mode'] == "view") { |
|
|
$hidden_items['ecmod'] = "edit"; |
|
|
} |
|
|
elseif($ecom_state['ecom_mode'] == "edit") { |
|
|
$hidden_items['ecmod'] = "edit"; |
|
|
} |
|
|
*/ |
|
355 |
} |
} |
|
$hidden_items['ap'] = "explorer"; |
|
356 |
} |
} |
357 |
|
elseif($ecom_state['ecom_type'] == "nav") { |
358 |
|
// Switching abstract make no real sense here, |
359 |
|
// because hidden_items(link_vars) for Naviagtion-Ecoms |
360 |
|
// are more label specified!! |
361 |
|
// OLD: |
362 |
|
//if($ecom_state['ecom_abstract_type'] == "list") { |
363 |
|
// NEW: |
364 |
|
if($label == "nav") { |
365 |
|
$hidden_items = array( |
366 |
|
'ecl' => "content", |
367 |
|
'ecat' => "list", |
368 |
|
'ecmod' => "view", |
369 |
|
'ect' => "data", |
370 |
|
'ecdlk' => "rpc", |
371 |
|
); |
372 |
|
|
373 |
|
} |
374 |
|
elseif($label == "chooser") { |
375 |
|
$hidden_items = array( |
376 |
|
'ecl' => "phase_startup", |
377 |
|
'ecdlk' => "rpc", |
378 |
|
); |
379 |
|
|
380 |
|
} |
381 |
|
} |
382 |
|
// add page idents |
383 |
|
foreach($this->_e_state[idents] as $label => $value) { |
384 |
|
$hidden_items[$label] = $value; |
385 |
|
} |
386 |
return $hidden_items; |
return $hidden_items; |
387 |
} |
} |
388 |
|
|
389 |
|
|
390 |
|
|
391 |
function _prepare_component_args($label) { |
function _prepare_component_args($label, $args = array()) { |
392 |
$val = $this->_e_state['ecoms'][$label]; |
$val = $this->_e_state['ecoms'][$label]; |
393 |
|
|
394 |
|
// pre-flight checks |
395 |
|
if (!$val['ecom_data_locator_key']) { |
396 |
|
user_error("_prepare_component_args: Key 'ecom_data_locator_key' was empty, should be one of 'rpc'."); |
397 |
|
return; |
398 |
|
} |
399 |
|
|
400 |
|
if (!$val['ecom_type']) { |
401 |
|
user_error("WebExplorer::AbstractExplorer: Key 'ecom_type' was empty, should be one of 'data|nav|call'."); |
402 |
|
} |
403 |
|
|
404 |
|
if (!$val['ecom_abstract_type']) { |
405 |
|
user_error("_prepare_component_args: Key 'ecom_abstract_type' was empty, should be one of 'item|list|tree|auto'."); |
406 |
|
return; |
407 |
|
} |
408 |
|
|
409 |
|
// trace |
410 |
|
//print "YAI1<br/>"; |
411 |
|
//print Dumper($val); |
412 |
|
|
413 |
$this->set_data_locator($val['ecom_data_locator_key']); |
$this->set_data_locator($val['ecom_data_locator_key']); |
414 |
|
|
415 |
// detect and execute 'selectSource' action |
// detect and execute 'selectSource' action |
428 |
if($val['ecom_abstract_type'] == "list") { |
if($val['ecom_abstract_type'] == "list") { |
429 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_data_locator_key'] == "rpc") { |
430 |
//$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']); |
//$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']); |
431 |
$data_locator_meta = array( transport => 'rpc', metatype => 'data', abstract_type => 'list', nodename => $val['ecom_data_ident']); |
$data_locator_meta = array( transport => 'rpc', metatype => 'data', abstract_type => 'list', nodename => $val['ecom_data_ident'], list_meta => $val['ecom_data_meta']); |
432 |
} else { |
} else { |
433 |
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] !"); |
434 |
} |
} |
448 |
"View" => 'view', |
"View" => 'view', |
449 |
"Edit" => 'edit', |
"Edit" => 'edit', |
450 |
"Delete" => 'delete', |
"Delete" => 'delete', |
|
"Add new" => 'add', |
|
451 |
), |
), |
452 |
|
'selected' => 'view', |
453 |
|
'create' => array( |
454 |
|
'name' => "ecdfcr", |
455 |
|
'value' => "Add new" |
456 |
|
), |
457 |
|
), |
458 |
|
'parent' => array( |
459 |
|
'class' => $val['ecom_data_ident'], |
460 |
), |
), |
461 |
), |
), |
462 |
); |
); |
463 |
|
|
464 |
// switch abstract type |
// switch abstract type |
465 |
} elseif ($val['ecom_abstract_type'] == "item") { |
} elseif ($val['ecom_abstract_type'] == "item") { |
466 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_data_locator_key'] == "rpc") { |
467 |
//$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']); |
//$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']); |
468 |
$data_locator_meta = array( transport => 'rpc', metatype => 'data', abstract_type => 'item', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']); |
|
469 |
|
// NEW: 'filter' - 2003-04-14 - required for filtering xml-nodes |
470 |
|
// this propagates the full identifier to reach through all parent nodes |
471 |
|
$filter = array( |
472 |
|
dotted => $val['ecom_data_filter'], |
473 |
|
ident => $val['ecom_data_ident'], |
474 |
|
//xpq => '*/*[@name="cli"]', |
475 |
|
//xpq => '*/*', |
476 |
|
); |
477 |
|
// lift filter from dotted format to xpq format |
478 |
|
$lift = mkObject('Data::Lift', $filter, array( metatype => 'filter' ) ); |
479 |
|
$filter = $lift->to('XPath'); |
480 |
|
|
481 |
|
$data_locator_meta = array( |
482 |
|
transport => 'rpc', metatype => 'data', abstract_type => 'item', |
483 |
|
ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta'], filter => $filter, |
484 |
|
); |
485 |
} else { |
} else { |
486 |
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] !"); |
487 |
} |
} |
488 |
if(!$val['ecom_mode']) { $val['ecom_mode'] = "view"; } |
|
489 |
|
// defaults |
490 |
|
if (!$val['ecom_mode']) { $val['ecom_mode'] = "view"; } |
491 |
|
//$val['ecom_mode'] = "view"; |
492 |
|
|
493 |
|
// debugging |
494 |
print "Mode: $val[ecom_mode]<br>"; |
print "Mode: $val[ecom_mode]<br>"; |
495 |
|
|
496 |
|
// prepare some arguments... |
497 |
$args = array( |
$args = array( |
498 |
'caption' => $val['ecom_data_meta'], |
'caption' => $val['ecom_data_meta'], |
499 |
'mode' => $val['ecom_mode'], |
'mode' => $val['ecom_mode'], |
500 |
'options' => array( |
'options' => array( |
501 |
'data_locator_meta' => $data_locator_meta, |
'data_locator_meta' => $data_locator_meta, |
502 |
'decode' => 1, |
'decode' => 1, |
503 |
'decode_args' => array( |
'decode_args' => array( |
504 |
'seperator' => "_", |
'seperator' => "_", |
505 |
), |
), |
506 |
), |
'parent' => array( |
507 |
|
'guid' => $val['ecom_data_ident'], |
508 |
|
'class' => $val['ecom_data_meta'], |
509 |
|
), |
510 |
|
), |
511 |
); |
); |
512 |
if($val['ecom_mode'] == "edit") { $args['adapter'] = 'FormProcessor'; } |
if ($val['ecom_mode'] == "edit") { $args['adapter'] = 'FormProcessor'; } |
513 |
|
|
514 |
|
// FIXME: (see WebExplorer::Module::AbstractGUIModule) |
515 |
|
//if ($val['ecom_mode'] == "delete") { $args['adapter'] = 'GenericNegotiation'; } |
516 |
|
if ($val['ecom_mode'] == "delete") { |
517 |
|
$args['adapter'] = 'NonValidatingFormProcessor'; |
518 |
|
} |
519 |
|
|
520 |
|
if ($val['ecom_mode'] == "create") { |
521 |
|
$args['adapter'] = 'FormProcessor'; |
522 |
|
$args['options']['caption'] = $val['ecom_data_ident']; |
523 |
|
$args['options']['data_locator_meta']['action'] = 'create'; |
524 |
|
print "debug 'create': " . Dumper($val); |
525 |
|
if($val['ecom_data_meta_x']) { |
526 |
|
unset($args['options']['data_locator_meta']['nodename']); |
527 |
|
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta']; |
528 |
|
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
529 |
|
} |
530 |
|
} |
531 |
|
|
532 |
|
// switch abstract type |
533 |
|
} elseif ($val['ecom_abstract_type'] == "tree") { |
534 |
|
//print "TREE!<br/>"; |
535 |
|
|
536 |
|
// FIXME: shouldn't this (dispatching by transport-key) be done very *outside* of this scope? |
537 |
|
// or: do it outside per default, let a possibility to modify it inside the lower levels of the dispatcher (here) |
538 |
|
if ($val['ecom_data_locator_key'] == "rpc") { |
539 |
|
//$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']); |
540 |
|
$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'data', abstract_type => 'tree', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']); |
541 |
|
} |
542 |
|
|
543 |
|
} else { |
544 |
|
user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'."); |
545 |
|
|
546 |
} |
} |
547 |
|
|
548 |
// switch component type |
// switch component type |
549 |
} elseif ($val['ecom_type'] == "nav") { |
} elseif ($val['ecom_type'] == "nav") { |
550 |
|
|
551 |
// switch abstract type |
// switch abstract type |
552 |
if($val['ecom_abstract_type'] == "list") { |
// list |
553 |
|
if ($val['ecom_abstract_type'] == "list") { |
554 |
$args = array(); |
$args = array(); |
555 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_data_locator_key'] == "rpc") { |
556 |
|
|
557 |
// switch component label |
// switch component label |
558 |
if($label == "nav") { |
// TODO: should we really dispatch by label inside here? |
559 |
|
|
560 |
|
if ($label == "nav") { |
561 |
$data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' ); |
$data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' ); |
562 |
$args['caption'] = "Objekt Typen"; |
$args['caption'] = "Objekt Typen"; |
563 |
} |
} |
566 |
$data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'sources.all' ); |
$data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'sources.all' ); |
567 |
$args['caption'] = "Datenquellen"; |
$args['caption'] = "Datenquellen"; |
568 |
} |
} |
569 |
|
// NEW [2003-04-18]: croak if label empty |
570 |
|
else { |
571 |
|
user_error("_prepare_component_args: Dispatching for nav.list.rpc failed. \$label was empty."); |
572 |
|
} |
573 |
$args['options']['data_locator_meta'] = $data_locator_meta; |
$args['options']['data_locator_meta'] = $data_locator_meta; |
574 |
|
|
575 |
} else { |
} else { |
576 |
user_error("AbstractExplorer::_prepare_component_args - Cannot build schema query for data_locator_key $val[ecom_data_locator_key] !"); |
user_error("AbstractExplorer::_prepare_component_args - Cannot build schema query for data_locator_key $val[ecom_data_locator_key] !"); |
577 |
} |
} |
578 |
|
|
579 |
|
// NEW [2003-04-18]: Abstract navigation tree |
580 |
} elseif ($val['ecom_abstract_type'] == "tree") { |
} elseif ($val['ecom_abstract_type'] == "tree") { |
581 |
$args = array(); |
$args = array(); |
582 |
|
if($label == "nav") { |
583 |
|
//$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'schema', abstract_type => 'tree', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']); |
584 |
|
$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' ); |
585 |
|
$args['caption'] = $val['ecom_data_source_key']; |
586 |
|
} elseif($label == "UMnav") { |
587 |
|
//$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'schema', abstract_type => 'tree', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']); |
588 |
|
$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'method', method => 'UserManagmentSchema' ); |
589 |
|
$args['caption'] = "Benutzerverwaltung"; |
590 |
|
} |
591 |
|
|
592 |
|
// NEW [2003-04-18]: transparent nav - argument pass-through mode |
593 |
|
} elseif ($val['ecom_abstract_type'] == "transparent") { |
594 |
|
|
595 |
|
// You are responsible for all arguments passed through. |
596 |
|
// Where are these arguments from? |
597 |
|
// They are propagated transparently to this place from a new optional |
598 |
|
// parameter ($args) introduced for the methods 'get_com', 'load_com' |
599 |
|
// and '_prepare_component_args' (this one). |
600 |
|
// This means full control over ecoms from outside. |
601 |
|
|
602 |
|
// TODO: maybe add some additional pre-flight checks here!? |
603 |
|
|
604 |
|
// croak |
605 |
|
} else { |
606 |
|
user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'."); |
607 |
} |
} |
608 |
|
|
609 |
// NEW [2003-04-08]: RemoteAction (e.g.: result of a selection inside a Chooser) |
// NEW [2003-04-08]: RemoteAction (e.g.: result of a selection inside a Chooser) |
631 |
// FIXME: implement automatic re-dispatching to available ecoms here! |
// FIXME: implement automatic re-dispatching to available ecoms here! |
632 |
user_error("WebExplorer::AbstractExplorer: results of RemoteActions can only be handled automatically. Who knows what comes back?"); |
user_error("WebExplorer::AbstractExplorer: results of RemoteActions can only be handled automatically. Who knows what comes back?"); |
633 |
} |
} |
634 |
|
|
635 |
} |
} |
636 |
|
|
637 |
|
// NEW[2003-04-18]: add hidden items to args |
638 |
|
$args['hidden_elements'] = $this->_get_hidden_items($label); |
639 |
|
|
640 |
return $args; |
return $args; |
641 |
} |
} |
642 |
|
|