4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.26 2003/12/14 01:50:30 jonen |
8 |
|
## implemented 'SELECT' mode for selecting existing object-refereneces as child-nodes |
9 |
|
## |
10 |
|
## Revision 1.25 2003/11/22 18:47:49 udo |
11 |
|
## update for expand data item |
12 |
|
## |
13 |
## Revision 1.24 2003/07/02 11:39:16 jonen |
## Revision 1.24 2003/07/02 11:39:16 jonen |
14 |
## fixed bugs |
## fixed bugs |
15 |
## |
## |
170 |
$this->set_e_state(); |
$this->set_e_state(); |
171 |
|
|
172 |
//debug |
//debug |
173 |
//print "State: " . Dumper($this->_state) ."<br>"; |
// print "State: " . Dumper($this->_state) ."<br>"; |
174 |
|
//print "_data_locators: " . Dumper($this->_data_locators) ."<br>"; |
175 |
$div = html_div(); |
$div = html_div(); |
176 |
$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)); |
177 |
$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;'); |
211 |
|
|
212 |
function get_page_state() { |
function get_page_state() { |
213 |
$requestTracker = mkObject("Application::Request::Tracker"); |
$requestTracker = mkObject("Application::Request::Tracker"); |
|
//print Dumper($this->_state); |
|
214 |
$this->_state = $requestTracker->getPointer(); |
$this->_state = $requestTracker->getPointer(); |
215 |
} |
} |
216 |
|
|
220 |
// 2. (was) get page state from request tracker |
// 2. (was) get page state from request tracker |
221 |
if ($state) { |
if ($state) { |
222 |
$this->_e_state = $state; |
$this->_e_state = $state; |
223 |
|
|
224 |
} else { |
} else { |
225 |
$this->get_page_state(); |
$this->get_page_state(); |
226 |
$this->_e_state = $this->_state[options][options]; |
$this->_e_state = $this->_state[options][options]; |
227 |
|
|
228 |
} |
} |
229 |
// print "Setting Explorer state:" . Dumper($this->_e_state); |
// print "Setting Explorer state:" . Dumper($this->_e_state); |
230 |
} |
} |
231 |
|
|
232 |
function set_page_state() { |
function set_page_state() { |
281 |
|
|
282 |
// that's better ... |
// that's better ... |
283 |
$this->_load_ecom($label, $args); |
$this->_load_ecom($label, $args); |
284 |
|
|
285 |
|
//print "getEcom_args: " .Dumper($args). "<br>"; |
286 |
|
|
287 |
return $this->_ecom[$label]; |
return $this->_ecom[$label]; |
288 |
|
|
289 |
} |
} |
409 |
} |
} |
410 |
} |
} |
411 |
// add page idents |
// add page idents |
412 |
|
|
413 |
|
//print "-e-state-idents: " .Dumper($this->_e_state[idents]). "<br>"; |
414 |
|
|
415 |
foreach($this->_e_state[idents] as $label => $value) { |
foreach($this->_e_state[idents] as $label => $value) { |
416 |
$hidden_items[$label] = $value; |
$hidden_items[$label] = $value; |
417 |
} |
} |
422 |
|
|
423 |
function _prepare_component_args($label, $args = array()) { |
function _prepare_component_args($label, $args = array()) { |
424 |
$val = $this->_e_state['ecoms'][$label]; |
$val = $this->_e_state['ecoms'][$label]; |
425 |
|
//print "val: " .Dumper($val). "<br>"; |
426 |
// pre-flight checks |
// pre-flight checks |
427 |
if (!$val['ecom_data_locator_key']) { |
if (!$val['ecom_data_locator_key']) { |
428 |
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'."); |
440 |
|
|
441 |
// trace |
// trace |
442 |
//print "YAI1<br/>"; |
//print "YAI1<br/>"; |
443 |
//print Dumper($val); |
|
444 |
|
|
445 |
$this->set_data_locator($val['ecom_data_locator_key']); |
$this->set_data_locator($val['ecom_data_locator_key']); |
446 |
|
|
458 |
if($val['ecom_type'] == "data") { |
if($val['ecom_type'] == "data") { |
459 |
// switch abstract type |
// switch abstract type |
460 |
if($val['ecom_abstract_type'] == "list") { |
if($val['ecom_abstract_type'] == "list") { |
461 |
|
// debugging |
462 |
|
//print "Mode: $val[ecom_mode], type: list<br>"; |
463 |
|
//print "val: " .Dumper($val). "<br>"; |
464 |
|
|
465 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_data_locator_key'] == "rpc") { |
466 |
//$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']); |
467 |
$data_locator_meta = array( |
|
468 |
transport => 'rpc', |
$data_locator_meta = array( |
469 |
metatype => 'data', |
transport => 'rpc', |
470 |
abstract_type => 'list', |
metatype => 'data', |
471 |
nodename => $val['ecom_data_ident'], |
abstract_type => 'list', |
472 |
list_meta => $val['ecom_data_meta'] |
nodename => $val['ecom_data_ident'], |
473 |
); |
list_meta => $val['ecom_data_meta'] |
474 |
|
); |
475 |
} else { |
} else { |
476 |
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] !"); |
477 |
} |
} |
478 |
|
|
479 |
|
if($val['ecom_mode'] == 'select') { |
480 |
|
$actionbar = array( |
481 |
|
'buttons' => array( |
482 |
|
array( |
483 |
|
'name' => "ecdfsel", |
484 |
|
'value' => "Select" |
485 |
|
), |
486 |
|
), |
487 |
|
); |
488 |
|
} else { |
489 |
|
$actionbar = array( |
490 |
|
'name' => "ecdfa", |
491 |
|
'list' => array( |
492 |
|
"View" => 'view', |
493 |
|
"Edit" => 'edit', |
494 |
|
"Delete" => 'delete', |
495 |
|
"Expand" => 'expand', |
496 |
|
"Expandedit" => 'expandedit', |
497 |
|
), |
498 |
|
'selected' => 'view', |
499 |
|
'buttons' => array( |
500 |
|
array( |
501 |
|
'name' => "ecdfcr", |
502 |
|
'value' => "Add new" |
503 |
|
), |
504 |
|
), |
505 |
|
); |
506 |
|
} |
507 |
|
|
508 |
$args = array( |
$args = array( |
509 |
'caption' => $val['ecom_data_ident'], |
'caption' => $val['ecom_data_ident'], |
510 |
'orderby' => "Guid", |
'orderby' => "Guid", |
515 |
'seperator' => "_", |
'seperator' => "_", |
516 |
//'form' => 1, |
//'form' => 1, |
517 |
), |
), |
518 |
'actionbar' => array( |
'actionbar' => $actionbar, |
|
'name' => "ecdfa", |
|
|
'list' => array( |
|
|
"View" => 'view', |
|
|
"Edit" => 'edit', |
|
|
"Delete" => 'delete', |
|
|
), |
|
|
'selected' => 'view', |
|
|
'create' => array( |
|
|
'name' => "ecdfcr", |
|
|
'value' => "Add new" |
|
|
), |
|
|
), |
|
519 |
'parent' => array( |
'parent' => array( |
520 |
'class' => $val['ecom_data_ident'], |
'class' => $val['ecom_data_ident'], |
521 |
), |
), |
522 |
), |
), |
523 |
); |
); |
524 |
|
if($val['ecom_data_meta_x']) { |
525 |
|
//unset($args['options']['data_locator_meta']['nodename']); |
526 |
|
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta']; |
527 |
|
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
528 |
|
} |
529 |
|
|
530 |
// switch abstract type |
// switch abstract type |
531 |
} elseif ($val['ecom_abstract_type'] == "item") { |
} elseif ($val['ecom_abstract_type'] == "item") { |
554 |
// NEW [2003-04-22]: append some more meta information to the caption |
// NEW [2003-04-22]: append some more meta information to the caption |
555 |
//$caption_addendum = ' {' . $val['ecom_data_meta'] . '}'; |
//$caption_addendum = ' {' . $val['ecom_data_meta'] . '}'; |
556 |
$caption_addendum = ' {' . $val['ecom_data_meta'] . ':' . $val['ecom_data_filter'] . '}'; |
$caption_addendum = ' {' . $val['ecom_data_meta'] . ':' . $val['ecom_data_filter'] . '}'; |
557 |
|
|
558 |
// prepare some arguments... |
// prepare some arguments... |
559 |
$args = array( |
$args = array( |
560 |
'caption' => $val['ecom_data_ident'] . $caption_addendum, |
'caption' => $val['ecom_data_ident'] . $caption_addendum, |
583 |
$args['adapter'] = 'FormProcessor'; |
$args['adapter'] = 'FormProcessor'; |
584 |
$args['options']['caption'] = $val['ecom_data_ident']; |
$args['options']['caption'] = $val['ecom_data_ident']; |
585 |
$args['options']['data_locator_meta']['action'] = 'create'; |
$args['options']['data_locator_meta']['action'] = 'create'; |
586 |
print "debug 'create': " . Dumper($val); |
//print "debug 'create': " . Dumper($val); |
|
} |
|
|
|
|
587 |
if($val['ecom_data_meta_x']) { |
if($val['ecom_data_meta_x']) { |
588 |
unset($args['options']['data_locator_meta']['nodename']); |
unset($args['options']['data_locator_meta']['nodename']); |
589 |
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta']; |
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta']; |
590 |
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
591 |
} |
} |
592 |
|
} |
593 |
|
if ($val['ecom_mode'] == "select") { |
594 |
|
$args['adapter'] = 'FormProcessor'; |
595 |
|
$args['caption'] = $val['ecom_data_meta_xe'] . " {". $val['ecom_data_meta_x'] . ":}"; |
596 |
|
$args['options']['data_locator_meta']['action'] = 'select'; |
597 |
|
//print "debug 'select': " . Dumper($val); |
598 |
|
if($val['ecom_data_meta_x']) { |
599 |
|
$args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta_xe']; |
600 |
|
$args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x']; |
601 |
|
} |
602 |
|
} |
603 |
|
|
604 |
|
//print "debug 'args' : " . Dumper($args); |
605 |
|
|
606 |
// switch abstract type |
// switch abstract type |
607 |
} elseif ($val['ecom_abstract_type'] == "tree") { |
} elseif ($val['ecom_abstract_type'] == "tree") { |
621 |
); |
); |
622 |
} |
} |
623 |
|
|
624 |
|
// NEW [2003-09-26]: transparent content - argument pass-through mode |
625 |
|
} elseif ($val['ecom_abstract_type'] == "transparent") { |
626 |
|
|
627 |
|
// You are responsible for all arguments passed through. |
628 |
|
// Where are these arguments from? |
629 |
|
// They are propagated transparently to this place from a new optional |
630 |
|
// parameter ($args) introduced for the methods 'get_com', 'load_com' |
631 |
|
// and '_prepare_component_args' (this one). |
632 |
|
// This means full control over ecoms from outside. |
633 |
|
|
634 |
|
// TODO: maybe add some additional pre-flight checks here!? |
635 |
|
|
636 |
|
// croak |
637 |
} else { |
} else { |
638 |
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]'."); |
639 |
|
|
685 |
|
|
686 |
// NEW [2003-04-18]: transparent nav - argument pass-through mode |
// NEW [2003-04-18]: transparent nav - argument pass-through mode |
687 |
} elseif ($val['ecom_abstract_type'] == "transparent") { |
} elseif ($val['ecom_abstract_type'] == "transparent") { |
|
|
|
688 |
// You are responsible for all arguments passed through. |
// You are responsible for all arguments passed through. |
689 |
// Where are these arguments from? |
// Where are these arguments from? |
690 |
// They are propagated transparently to this place from a new optional |
// They are propagated transparently to this place from a new optional |
693 |
// This means full control over ecoms from outside. |
// This means full control over ecoms from outside. |
694 |
|
|
695 |
// TODO: maybe add some additional pre-flight checks here!? |
// TODO: maybe add some additional pre-flight checks here!? |
|
|
|
696 |
// croak |
// croak |
697 |
} else { |
} else { |
698 |
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]'."); |
728 |
|
|
729 |
// NEW[2003-04-18]: add hidden items to args |
// NEW[2003-04-18]: add hidden items to args |
730 |
$args['hidden_elements'] = $this->_get_hidden_items($label); |
$args['hidden_elements'] = $this->_get_hidden_items($label); |
731 |
|
//print "args_hidden: " .Dumper($args['hidden_elements']). "<br>"; |
732 |
return $args; |
return $args; |
733 |
} |
} |
734 |
|
|
795 |
} |
} |
796 |
|
|
797 |
|
|
|
?> |
|
798 |
|
?> |