4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.29 2005/08/11 14:11:28 jonen |
8 |
|
## + changes relating to new web-interface for TerminalOwner |
9 |
|
## |
10 |
|
## Revision 1.28 2004/08/31 14:15:49 jonen |
11 |
|
## + added function to clear 'ecom' state |
12 |
|
## (specially needed to refresh the 'content' block) |
13 |
|
## |
14 |
|
## Revision 1.27 2004/03/11 21:01:35 jonen |
15 |
|
## minor change |
16 |
|
## |
17 |
|
## Revision 1.26 2003/12/14 01:50:30 jonen |
18 |
|
## implemented 'SELECT' mode for selecting existing object-refereneces as child-nodes |
19 |
|
## |
20 |
|
## Revision 1.25 2003/11/22 18:47:49 udo |
21 |
|
## update for expand data item |
22 |
|
## |
23 |
|
## Revision 1.24 2003/07/02 11:39:16 jonen |
24 |
|
## fixed bugs |
25 |
|
## |
26 |
|
## Revision 1.23 2003/06/06 11:57:20 joko |
27 |
|
## minor update: cosmetic changes |
28 |
|
## |
29 |
|
## Revision 1.22 2003/05/13 14:50:27 joko |
30 |
|
## HACKed compatibility for config-type data sources |
31 |
|
## + function get_data_filter |
32 |
|
## |
33 |
|
## Revision 1.21 2003/05/10 18:23:21 jonen |
34 |
|
## + added stuff relating to 'create/add new' links/buttons |
35 |
|
## |
36 |
|
## Revision 1.20 2003/04/19 16:24:49 jonen |
37 |
|
## + added two more GUI modules to default registry initiation, |
38 |
|
## relating to new navigation module 'NavigationTree' |
39 |
|
## + added prepartion of needed args for abstract navigation tree |
40 |
|
## and concret UserManagment 'UMnav' tree |
41 |
|
## |
42 |
## Revision 1.19 2003/04/18 16:21:37 joko |
## Revision 1.19 2003/04/18 16:21:37 joko |
43 |
## fixed commit comment - the last one caused a syntax error!!! |
## fixed commit comment - the last one caused a syntax error!!! |
44 |
## |
## |
180 |
$this->set_e_state(); |
$this->set_e_state(); |
181 |
|
|
182 |
//debug |
//debug |
183 |
//print "State: " . Dumper($this->_state) ."<br>"; |
// print "State: " . Dumper($this->_state) ."<br>"; |
184 |
|
//print "_data_locators: " . Dumper($this->_data_locators) ."<br>"; |
185 |
$div = html_div(); |
$div = html_div(); |
186 |
$div->add( html_b(get_class($this)), html_hr(), "Explorer_State: " . Dumper($this->_e_state)); |
$div->add( html_b(get_class($this)), html_hr(), "Explorer_State: " . Dumper($this->_e_state)); |
187 |
$div->set_style('background: #adadad; border: 2px black groove; width:640px; padding:10px; margin:40px;'); |
$div->set_style('background: #adadad; border: 2px black groove; width:640px; padding:10px; margin:40px;'); |
221 |
|
|
222 |
function get_page_state() { |
function get_page_state() { |
223 |
$requestTracker = mkObject("Application::Request::Tracker"); |
$requestTracker = mkObject("Application::Request::Tracker"); |
|
//print Dumper($this->_state); |
|
224 |
$this->_state = $requestTracker->getPointer(); |
$this->_state = $requestTracker->getPointer(); |
225 |
|
//print "state: " . Dumper($this->_state) . "<br>"; |
226 |
|
} |
227 |
|
|
228 |
|
function clear_comp_state($comp = NULL) { |
229 |
|
if($comp) { |
230 |
|
$this->_e_state[ecoms][$comp] = array(); |
231 |
|
} |
232 |
} |
} |
233 |
|
|
234 |
function set_e_state($state = null) { |
function set_e_state($state = null) { |
237 |
// 2. (was) get page state from request tracker |
// 2. (was) get page state from request tracker |
238 |
if ($state) { |
if ($state) { |
239 |
$this->_e_state = $state; |
$this->_e_state = $state; |
240 |
|
|
241 |
} else { |
} else { |
242 |
$this->get_page_state(); |
$this->get_page_state(); |
243 |
$this->_e_state = $this->_state[options][options]; |
$this->_e_state = $this->_state[options][options]; |
244 |
|
|
245 |
} |
} |
246 |
// print "Setting Explorer state:" . Dumper($this->_e_state); |
// print "Setting Explorer state:" . Dumper($this->_e_state); |
247 |
} |
} |
248 |
|
|
249 |
function set_page_state() { |
function set_page_state() { |
274 |
// 2003-04-12 - Data.Tree |
// 2003-04-12 - Data.Tree |
275 |
$this->register_gui_module("content", "data", "tree", "WebExplorer::Module::DataTree" ); |
$this->register_gui_module("content", "data", "tree", "WebExplorer::Module::DataTree" ); |
276 |
|
|
277 |
|
// 2003-04-18 - Nav.Tree |
278 |
|
$this->register_gui_module("nav", "nav", "tree", "WebExplorer::Module::NavigationTree" ); |
279 |
|
|
280 |
|
// 2003-04-18 - UserManagment Nav.Tree (we need only a different 'label' as Nav.Tree yet..) |
281 |
|
$this->register_gui_module("UMnav", "nav", "tree", "WebExplorer::Module::NavigationTree" ); |
282 |
|
|
283 |
} |
} |
284 |
|
|
285 |
function register_source_module($label, $args) { |
function register_source_module($label, $args) { |
298 |
|
|
299 |
// that's better ... |
// that's better ... |
300 |
$this->_load_ecom($label, $args); |
$this->_load_ecom($label, $args); |
301 |
|
|
302 |
|
//print "getEcom_args: " .Dumper($args). "<br>"; |
303 |
|
|
304 |
return $this->_ecom[$label]; |
return $this->_ecom[$label]; |
305 |
|
|
306 |
} |
} |
350 |
} |
} |
351 |
//print Dumper($ecom); |
//print Dumper($ecom); |
352 |
|
|
353 |
// NOW[2003-18-04] done at via args(prepare args!) to pass at constructor |
// NEW[2003-04-18] done via args(prepare args!) passed at constructor |
354 |
// (needed for non-real objects instanced at some child of AbstractGUIModule, eg. NavigationList) |
// (needed for non-real objects instanced at some child of AbstractGUIModule, eg. NavigationList) |
355 |
/* |
/* |
356 |
// add hidden vars, needed for explorer control |
// add hidden vars, needed for explorer control |
379 |
if($ecom_state['ecom_abstract_type'] == "list") { |
if($ecom_state['ecom_abstract_type'] == "list") { |
380 |
$hidden_items = array( |
$hidden_items = array( |
381 |
'ecl' => $label, |
'ecl' => $label, |
382 |
'ecat' => "item", |
'ecat' => "list", |
383 |
'ecmod' => "view", |
'ecmod' => "view", |
384 |
|
'ecdid' => $ecom_state['ecom_data_ident'], |
385 |
); |
); |
386 |
} |
} |
387 |
elseif($ecom_state['ecom_abstract_type'] == "item") { |
elseif($ecom_state['ecom_abstract_type'] == "item") { |
398 |
// are more label specified!! |
// are more label specified!! |
399 |
// OLD: |
// OLD: |
400 |
//if($ecom_state['ecom_abstract_type'] == "list") { |
//if($ecom_state['ecom_abstract_type'] == "list") { |
401 |
|
|
402 |
|
// decide whether to link to items or to a list |
403 |
|
$abstract_type = 'list'; |
404 |
|
// FIXME: HACK |
405 |
|
if ($this->_e_state[main][ecom_data_source_key] == 'config') { |
406 |
|
$abstract_type = 'item'; |
407 |
|
} |
408 |
|
|
409 |
// NEW: |
// NEW: |
410 |
if($label == "nav") { |
if ($label == "nav") { |
411 |
$hidden_items = array( |
$hidden_items = array( |
412 |
'ecl' => "content", |
'ecl' => "content", |
413 |
'ecat' => "list", |
'ecat' => $abstract_type, |
414 |
'ecmod' => "view", |
'ecmod' => "view", |
415 |
'ect' => "data", |
'ect' => "data", |
416 |
'ecdlk' => "rpc", |
'ecdlk' => "rpc", |
417 |
); |
); |
418 |
|
|
419 |
} |
} |
420 |
elseif($label == "chooser") { |
elseif ($label == "chooser") { |
421 |
$hidden_items = array( |
$hidden_items = array( |
422 |
'ecl' => "phase_startup", |
'ecl' => "phase_startup", |
423 |
'ecdlk' => "rpc", |
'ecdlk' => "rpc", |
426 |
} |
} |
427 |
} |
} |
428 |
// add page idents |
// add page idents |
429 |
|
|
430 |
|
//print "-e-state-idents: " .Dumper($this->_e_state[idents]). "<br>"; |
431 |
|
|
432 |
foreach($this->_e_state[idents] as $label => $value) { |
foreach($this->_e_state[idents] as $label => $value) { |
433 |
$hidden_items[$label] = $value; |
$hidden_items[$label] = $value; |
434 |
} |
} |
439 |
|
|
440 |
function _prepare_component_args($label, $args = array()) { |
function _prepare_component_args($label, $args = array()) { |
441 |
$val = $this->_e_state['ecoms'][$label]; |
$val = $this->_e_state['ecoms'][$label]; |
442 |
|
//print "val: " .Dumper($val). "<br>"; |
443 |
// pre-flight checks |
// pre-flight checks |
444 |
if (!$val['ecom_data_locator_key']) { |
if (!$val['ecom_data_locator_key']) { |
445 |
user_error("_prepare_component_args: Key 'ecom_data_locator_key' was empty, should be one of 'rpc'."); |
user_error("_prepare_component_args: Key 'ecom_data_locator_key' was empty, should be one of 'rpc'."); |
457 |
|
|
458 |
// trace |
// trace |
459 |
//print "YAI1<br/>"; |
//print "YAI1<br/>"; |
460 |
//print Dumper($val); |
|
461 |
|
|
462 |
$this->set_data_locator($val['ecom_data_locator_key']); |
$this->set_data_locator($val['ecom_data_locator_key']); |
463 |
|
|
475 |
if($val['ecom_type'] == "data") { |
if($val['ecom_type'] == "data") { |
476 |
// switch abstract type |
// switch abstract type |
477 |
if($val['ecom_abstract_type'] == "list") { |
if($val['ecom_abstract_type'] == "list") { |
478 |
|
// debugging |
479 |
|
//print "Mode: $val[ecom_mode], type: list<br>"; |
480 |
|
//print "val: " .Dumper($val). "<br>"; |
481 |
|
|
482 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_data_locator_key'] == "rpc") { |
483 |
//$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']); |
484 |
$data_locator_meta = array( transport => 'rpc', metatype => 'data', abstract_type => 'list', nodename => $val['ecom_data_ident']); |
|
485 |
|
$data_locator_meta = array( |
486 |
|
transport => 'rpc', |
487 |
|
metatype => 'data', |
488 |
|
abstract_type => 'list', |
489 |
|
nodename => $val['ecom_data_ident'], |
490 |
|
list_meta => $val['ecom_data_meta'] |
491 |
|
); |
492 |
} else { |
} else { |
493 |
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] !"); |
494 |
} |
} |
495 |
|
|
496 |
|
if($val['ecom_mode'] == 'select') { |
497 |
|
$actionbar = array( |
498 |
|
'buttons' => array( |
499 |
|
array( |
500 |
|
'name' => "ecdfsel", |
501 |
|
'value' => "Select" |
502 |
|
), |
503 |
|
), |
504 |
|
); |
505 |
|
} else { |
506 |
|
if(is_array($_SESSION[user]) && $_SESSION[user][loggedIn]) { |
507 |
|
$actionbar = array( |
508 |
|
'name' => "ecdfa", |
509 |
|
'list' => array( |
510 |
|
"View" => 'view', |
511 |
|
"Edit" => 'edit', |
512 |
|
), |
513 |
|
'selected' => 'view', |
514 |
|
'buttons' => array( |
515 |
|
), |
516 |
|
); |
517 |
|
} else { |
518 |
|
$actionbar = array( |
519 |
|
'name' => "ecdfa", |
520 |
|
'list' => array( |
521 |
|
"View" => 'view', |
522 |
|
"Edit" => 'edit', |
523 |
|
"Delete" => 'delete', |
524 |
|
"Expand" => 'expand', |
525 |
|
"Expandedit" => 'expandedit', |
526 |
|
), |
527 |
|
'selected' => 'view', |
528 |
|
'buttons' => array( |
529 |
|
array( |
530 |
|
'name' => "ecdfcr", |
531 |
|
'value' => "Add new" |
532 |
|
), |
533 |
|
), |
534 |
|
); |
535 |
|
} |
536 |
|
} |
537 |
|
|
538 |
$args = array( |
$args = array( |
539 |
'caption' => $val['ecom_data_ident'], |
'caption' => $val['ecom_data_ident'], |
540 |
'orderby' => "Guid", |
'orderby' => "Guid", |
545 |
'seperator' => "_", |
'seperator' => "_", |
546 |
//'form' => 1, |
//'form' => 1, |
547 |
), |
), |
548 |
'actionbar' => array( |
'actionbar' => $actionbar, |
549 |
'name' => "ecdfa", |
'parent' => array( |
550 |
'list' => array( |
'class' => $val['ecom_data_ident'], |
|
"View" => 'view', |
|
|
"Edit" => 'edit', |
|
|
"Delete" => 'delete', |
|
|
"Add new" => 'add', |
|
|
), |
|
551 |
), |
), |
552 |
), |
), |
553 |
); |
); |
554 |
|
if($val['ecom_data_meta_x']) { |
555 |
|
//unset($args['options']['data_locator_meta']['nodename']); |
556 |
|
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta']; |
557 |
|
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
558 |
|
} |
559 |
|
if(is_array($_SESSION[user]) && $_SESSION[user][loggedIn]) { |
560 |
|
$args['options']['data_locator_meta']['owner'][guid] = $_SESSION[user][guid]; |
561 |
|
$args['options']['data_locator_meta']['owner']['class'] = $_SESSION[user]['class']; |
562 |
|
} |
563 |
|
|
564 |
// switch abstract type |
// switch abstract type |
565 |
} elseif ($val['ecom_abstract_type'] == "item") { |
} elseif ($val['ecom_abstract_type'] == "item") { |
567 |
//$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']); |
568 |
|
|
569 |
// NEW: 'filter' - 2003-04-14 - required for filtering xml-nodes |
// NEW: 'filter' - 2003-04-14 - required for filtering xml-nodes |
570 |
// this propagates the full identifier to reach through all parent nodes |
$filter = $this->get_data_filter($val); |
571 |
$filter = array( |
|
|
dotted => $val['ecom_data_filter'], |
|
|
ident => $val['ecom_data_ident'], |
|
|
//xpq => '*/*[@name="cli"]', |
|
|
//xpq => '*/*', |
|
|
); |
|
|
// lift filter from dotted format to xpq format |
|
|
$lift = mkObject('Data::Lift', $filter, array( metatype => 'filter' ) ); |
|
|
$filter = $lift->to('XPath'); |
|
|
|
|
572 |
$data_locator_meta = array( |
$data_locator_meta = array( |
573 |
transport => 'rpc', metatype => 'data', abstract_type => 'item', |
transport => 'rpc', metatype => 'data', abstract_type => 'item', |
574 |
ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta'], filter => $filter, |
ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta'], filter => $filter, |
584 |
// debugging |
// debugging |
585 |
print "Mode: $val[ecom_mode]<br>"; |
print "Mode: $val[ecom_mode]<br>"; |
586 |
|
|
587 |
|
//print Dumper($val); |
588 |
|
// NEW [2003-04-22]: append some more meta information to the caption |
589 |
|
//$caption_addendum = ' {' . $val['ecom_data_meta'] . '}'; |
590 |
|
$caption_addendum = ' {' . $val['ecom_data_meta'] . ':' . $val['ecom_data_filter'] . '}'; |
591 |
|
|
592 |
// prepare some arguments... |
// prepare some arguments... |
593 |
$args = array( |
$args = array( |
594 |
'caption' => $val['ecom_data_meta'], |
'caption' => $val['ecom_data_ident'] . $caption_addendum, |
595 |
'mode' => $val['ecom_mode'], |
'mode' => $val['ecom_mode'], |
596 |
'options' => array( |
'options' => array( |
597 |
'data_locator_meta' => $data_locator_meta, |
'data_locator_meta' => $data_locator_meta, |
598 |
'decode' => 1, |
'decode' => 1, |
599 |
'decode_args' => array( |
'decode_args' => array( |
600 |
'seperator' => "_", |
'seperator' => "_", |
601 |
|
), |
602 |
|
'parent' => array( |
603 |
|
'guid' => $val['ecom_data_ident'], |
604 |
|
'class' => $val['ecom_data_meta'], |
605 |
|
), |
606 |
), |
), |
|
), |
|
607 |
); |
); |
608 |
if ($val['ecom_mode'] == "edit") { $args['adapter'] = 'FormProcessor'; } |
if ($val['ecom_mode'] == "edit") { $args['adapter'] = 'FormProcessor'; } |
609 |
|
|
610 |
// FIXME: (see WebExplorer::Module::AbstractGUIModule) |
// FIXME: (see WebExplorer::Module::AbstractGUIModule) |
611 |
//if ($val['ecom_mode'] == "delete") { $args['adapter'] = 'GenericNegotiation'; } |
//if ($val['ecom_mode'] == "delete") { $args['adapter'] = 'GenericNegotiation'; } |
612 |
if ($val['ecom_mode'] == "delete") { $args['adapter'] = 'NonValidatingFormProcessor'; } |
if ($val['ecom_mode'] == "delete") { |
613 |
|
$args['adapter'] = 'NonValidatingFormProcessor'; |
614 |
|
$args['options']['data_locator_meta']['action'] = 'delete'; |
615 |
|
} |
616 |
|
|
617 |
|
if ($val['ecom_mode'] == "create") { |
618 |
|
$args['adapter'] = 'FormProcessor'; |
619 |
|
$args['options']['caption'] = $val['ecom_data_ident']; |
620 |
|
$args['options']['data_locator_meta']['action'] = 'create'; |
621 |
|
//print "debug 'create': " . Dumper($val); |
622 |
|
if($val['ecom_data_meta_x']) { |
623 |
|
unset($args['options']['data_locator_meta']['nodename']); |
624 |
|
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta']; |
625 |
|
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
626 |
|
} |
627 |
|
} |
628 |
|
if ($val['ecom_mode'] == "select") { |
629 |
|
$args['adapter'] = 'FormProcessor'; |
630 |
|
$args['caption'] = $val['ecom_data_meta_xe'] . " {". $val['ecom_data_meta_x'] . ":}"; |
631 |
|
$args['options']['data_locator_meta']['action'] = 'select'; |
632 |
|
//print "debug 'select': " . Dumper($val); |
633 |
|
if($val['ecom_data_meta_x']) { |
634 |
|
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta_xe']; |
635 |
|
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
636 |
|
} |
637 |
|
} |
638 |
|
|
639 |
|
//print "debug 'args' : " . Dumper($args); |
640 |
|
|
641 |
// switch abstract type |
// switch abstract type |
642 |
} elseif ($val['ecom_abstract_type'] == "tree") { |
} elseif ($val['ecom_abstract_type'] == "tree") { |
643 |
//print "TREE!<br/>"; |
|
644 |
|
// NEW: 'filter' - 2003-04-14 - required for filtering xml-nodes |
645 |
|
$filter = $this->get_data_filter($val); |
646 |
|
|
647 |
// FIXME: shouldn't this (dispatching by transport-key) be done very *outside* of this scope? |
// FIXME: shouldn't this (dispatching by transport-key) be done very *outside* of this scope? |
648 |
// or: do it outside per default, let a possibility to modify it inside the lower levels of the dispatcher (here) |
// or: do it outside per default, let a possibility to modify it inside the lower levels of the dispatcher (here) |
649 |
if ($val['ecom_data_locator_key'] == "rpc") { |
if ($val['ecom_data_locator_key'] == "rpc") { |
650 |
//$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']); |
651 |
$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'data', abstract_type => 'tree', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']); |
$args[options][data_locator_meta] = array( |
652 |
|
transport => 'rpc', metatype => 'data', abstract_type => 'tree', |
653 |
|
ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta'], |
654 |
|
// NEW [2003-04-22]: Full tree node filtering established. |
655 |
|
filter => $filter |
656 |
|
); |
657 |
} |
} |
658 |
|
|
659 |
|
// NEW [2003-09-26]: transparent content - argument pass-through mode |
660 |
|
} elseif ($val['ecom_abstract_type'] == "transparent") { |
661 |
|
|
662 |
|
// You are responsible for all arguments passed through. |
663 |
|
// Where are these arguments from? |
664 |
|
// They are propagated transparently to this place from a new optional |
665 |
|
// parameter ($args) introduced for the methods 'get_com', 'load_com' |
666 |
|
// and '_prepare_component_args' (this one). |
667 |
|
// This means full control over ecoms from outside. |
668 |
|
|
669 |
|
// TODO: maybe add some additional pre-flight checks here!? |
670 |
|
|
671 |
|
// croak |
672 |
} else { |
} else { |
673 |
user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'."); |
user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'."); |
674 |
|
|
705 |
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] !"); |
706 |
} |
} |
707 |
|
|
708 |
// tree |
// NEW [2003-04-18]: Abstract navigation tree |
709 |
} elseif ($val['ecom_abstract_type'] == "tree") { |
} elseif ($val['ecom_abstract_type'] == "tree") { |
710 |
$args = array(); |
$args = array(); |
711 |
print "TREE!<br/>"; |
if($label == "nav") { |
712 |
|
//$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'schema', abstract_type => 'tree', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']); |
713 |
|
$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' ); |
714 |
|
$args['caption'] = $val['ecom_data_source_key']; |
715 |
|
} elseif($label == "UMnav") { |
716 |
|
//$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'schema', abstract_type => 'tree', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']); |
717 |
|
$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'method', method => 'UserManagmentSchema' ); |
718 |
|
$args['caption'] = "Benutzerverwaltung"; |
719 |
|
} |
720 |
|
|
721 |
// NEW [2003-04-18]: transparent nav - argument pass-through mode |
// NEW [2003-04-18]: transparent nav - argument pass-through mode |
722 |
} elseif ($val['ecom_abstract_type'] == "transparent") { |
} elseif ($val['ecom_abstract_type'] == "transparent") { |
|
|
|
723 |
// You are responsible for all arguments passed through. |
// You are responsible for all arguments passed through. |
724 |
// Where are these arguments from? |
// Where are these arguments from? |
725 |
// They are propagated transparently to this place from a new optional |
// They are propagated transparently to this place from a new optional |
728 |
// This means full control over ecoms from outside. |
// This means full control over ecoms from outside. |
729 |
|
|
730 |
// TODO: maybe add some additional pre-flight checks here!? |
// TODO: maybe add some additional pre-flight checks here!? |
|
|
|
731 |
// croak |
// croak |
732 |
} else { |
} else { |
733 |
user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'."); |
user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'."); |
761 |
|
|
762 |
} |
} |
763 |
|
|
764 |
// add hidden items to args |
if(is_array($_SESSION[user]) && $_SESSION[user][loggedIn]) { |
765 |
$args['hidden_elements'] = $this->_get_hidden_items($label); |
$args['options']['userclass'] = $_SESSION[user]['class']; |
766 |
|
} |
767 |
|
|
768 |
|
// NEW[2003-04-18]: add hidden items to args |
769 |
|
$args['hidden_elements'] = $this->_get_hidden_items($label); |
770 |
|
//print "args_hidden: " .Dumper($args['hidden_elements']). "<br>"; |
771 |
return $args; |
return $args; |
772 |
} |
} |
773 |
|
|
786 |
user_error("AbstractExplorer::render - please implement me...."); |
user_error("AbstractExplorer::render - please implement me...."); |
787 |
} |
} |
788 |
|
|
789 |
|
|
790 |
|
function get_data_filter($state = array()) { |
791 |
|
|
792 |
|
// NEW: 'filter' - 2003-04-14 - required for filtering xml-nodes |
793 |
|
// V1: this was inside ecom_abstract_type == item && ecom_data_locator_key == rpc, but ... |
794 |
|
// V2: ... it should be considered / work independent of these both criterias |
795 |
|
// since it is required for showing xml nodes in items (editing) *and* trees again (browsing). |
796 |
|
|
797 |
|
if ($filter_expression = $state[ecom_data_filter]) { |
798 |
|
|
799 |
|
// new of 2003-05-13: Apply "Node navigation" in tree mode only. |
800 |
|
// Lock context when switching to item mode. |
801 |
|
//print Dumper($state); |
802 |
|
if ($state[ecom_abstract_type] == "tree") { |
803 |
|
if ($parent_xpq = $state[ecom_data_meta]) { |
804 |
|
$filter_expression = $parent_xpq . $filter_expression; |
805 |
|
} |
806 |
|
} |
807 |
|
|
808 |
|
// This propagates a XPath filter expression which fully identifies |
809 |
|
// a single node in a document. It reaches through all parent nodes. |
810 |
|
$filter = array( |
811 |
|
//dotted => $val['ecom_data_filter'], |
812 |
|
//ident => $val['ecom_data_ident'], |
813 |
|
//xpq => '*/*[@name="cli"]', |
814 |
|
//xpq => '*/*', |
815 |
|
// NEW [2003-04-21]: An xpq is already ready now inside |
816 |
|
// 'ecdf' since it already has been built by the revamped tree lift. |
817 |
|
xpq => '*' . $filter_expression |
818 |
|
); |
819 |
|
|
820 |
|
} else { |
821 |
|
$filter = ''; |
822 |
|
|
823 |
|
} |
824 |
|
|
825 |
|
// lift filter from dotted format to xpq format |
826 |
|
// NEW [2003-04-21]: not required any more (see above) |
827 |
|
//$lift = mkObject('Data::Lift', $filter, array( metatype => 'filter' ) ); |
828 |
|
//$filter = $lift->to('XPath'); |
829 |
|
|
830 |
|
return $filter; |
831 |
|
|
832 |
|
} |
833 |
|
|
834 |
} |
} |
835 |
|
|
836 |
|
|
|
?> |
|
837 |
|
?> |