9 |
*/ |
*/ |
10 |
|
|
11 |
/** |
/** |
12 |
* <b>Cvs-Log:</b> |
* Cvs-Log: |
13 |
* |
* |
|
* <pre> |
|
14 |
* $Id$ |
* $Id$ |
15 |
* |
* |
16 |
* $Log$ |
* $Log$ |
17 |
|
* Revision 1.20 2003/04/19 16:07:15 jonen |
18 |
|
* + added '_query[list_meta]' at 'queryData' needed for meta query args |
19 |
|
* (e.g. at UserManagment) |
20 |
|
* |
21 |
|
* Revision 1.19 2003/04/18 15:40:51 joko |
22 |
|
* NEW: tree data handling |
23 |
|
* introduced new adapter: DataSource::Adapter::Free |
24 |
|
* enhanced datasource_handler_buildoptions: now handles a) case 'tree' b) _query[filter] |
25 |
|
* |
26 |
|
* Revision 1.18 2003/04/11 00:55:49 joko |
27 |
|
* updated 'datasource_handler_buildoptions': action dispatcher now aware of 'delete' |
28 |
|
* |
29 |
* Revision 1.17 2003/04/09 02:07:33 joko |
* Revision 1.17 2003/04/09 02:07:33 joko |
30 |
* CHANGE: renamed key 'classname' through 'nodename' |
* CHANGE: renamed key 'classname' through 'nodename' |
31 |
* |
* |
105 |
* |
* |
106 |
* Revision 1.1 2003/03/01 03:10:40 joko |
* Revision 1.1 2003/03/01 03:10:40 joko |
107 |
* + initial commit |
* + initial commit |
|
* </pre> |
|
108 |
* |
* |
109 |
*/ |
*/ |
110 |
|
|
500 |
// ... resolves this._modules.adapter._id to this._modules.adapter._module |
// ... resolves this._modules.adapter._id to this._modules.adapter._module |
501 |
|
|
502 |
switch ($locator->_adapter_type) { |
switch ($locator->_adapter_type) { |
503 |
|
|
504 |
case 'phpHtmlLib': |
case 'phpHtmlLib': |
505 |
//$adapter_arguments = $args[title]; |
//$adapter_arguments = $args[title]; |
|
|
|
506 |
$this->set_adapter_module('DataSource::Adapter::phpHtmlLib::DataSource'); |
$this->set_adapter_module('DataSource::Adapter::phpHtmlLib::DataSource'); |
507 |
|
|
508 |
// in order to let the Adapter communicate with the Proxy, |
// in order to let the Adapter communicate with the Proxy, |
509 |
// instantiate a wrapper method in a third namespace via |
// instantiate a wrapper method in a third namespace via |
510 |
// Exporter::export_symbol(from, to) |
// Exporter::export_symbol(from, to) |
511 |
$this->set_adapter_options($this); |
$this->set_adapter_options($this); |
512 |
|
break; |
513 |
|
|
514 |
|
// NEW [2003-04-17]: Freedom for the adapter! |
515 |
|
// phpHtmlLib didn't have a tree widget, but PEAR does. |
516 |
|
// So: Free us from the phpHtmlLib-adapter in this case. |
517 |
|
case 'free': |
518 |
|
$this->set_adapter_module('DataSource::Adapter::Free'); |
519 |
|
$this->set_adapter_options($this); |
520 |
break; |
break; |
521 |
|
|
522 |
default: |
default: |
523 |
user_error("DataSource::Generic: no Adapter could be selected!"); |
user_error("DataSource::Generic: no Adapter could be selected: \$locator->_adapter_type='$locator->_adapter_type'"); |
524 |
break; |
break; |
525 |
} |
} |
526 |
|
|
732 |
} |
} |
733 |
*/ |
*/ |
734 |
$query_args = array(); |
$query_args = array(); |
735 |
|
|
736 |
|
$msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: "; |
737 |
switch ($this->_query[abstract_type]) { |
switch ($this->_query[abstract_type]) { |
738 |
|
case 'item': |
739 |
|
if (!$this->_query[nodename]) { |
740 |
|
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
741 |
|
user_error($msg_prefix . $msg); |
742 |
|
} |
743 |
|
$query_args[guid] = $this->_query[ident]; |
744 |
|
$query_args[nodename] = $this->_query[nodename]; |
745 |
|
break; |
746 |
case 'list': |
case 'list': |
747 |
if (!$this->_query[nodename]) { |
if (!$this->_query[nodename]) { |
748 |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
749 |
user_error("DataSource::Generic: query_data() - failed: " . $msg); |
user_error($msg_prefix . $msg); |
750 |
} |
} |
751 |
//array_push($query_args, $this->_query[nodename]); |
//array_push($query_args, $this->_query[nodename]); |
752 |
$query_args[nodename] = $this->_query[nodename]; |
$query_args[nodename] = $this->_query[nodename]; |
753 |
|
if($this->_query[list_meta]) { $query_args[list_meta] = $this->_query[list_meta]; } |
754 |
break; |
break; |
755 |
case 'item': |
case 'tree': |
756 |
|
/* |
757 |
if (!$this->_query[nodename]) { |
if (!$this->_query[nodename]) { |
758 |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
759 |
user_error("DataSource::Generic: query_data() - failed: " . $msg); |
user_error($msg_prefix . $msg); |
760 |
} |
} |
761 |
|
*/ |
762 |
$query_args[guid] = $this->_query[ident]; |
$query_args[guid] = $this->_query[ident]; |
763 |
$query_args[nodename] = $this->_query[nodename]; |
//$query_args[nodename] = $this->_query[nodename]; |
764 |
break; |
break; |
765 |
|
default: |
766 |
|
$msg = "\$this->_query[abstract_type] could not be dispatched as 'item', 'list' or 'tree'."; |
767 |
|
user_error($msg_prefix . $msg); |
768 |
|
break; |
769 |
} |
} |
770 |
if($this->_query[action] == 'write') { |
|
771 |
|
// filter??? |
772 |
|
if ($this->_query[filter]) { |
773 |
|
$query_args[filter] = $this->_query[filter]; |
774 |
|
} |
775 |
|
|
776 |
|
// dispatch action |
777 |
|
if ($this->_query[action] == 'write') { |
778 |
$query_args[action] = $this->_query[action]; |
$query_args[action] = $this->_query[action]; |
779 |
$query_args[data] = $this->_query[data]; |
$query_args[data] = $this->_query[data]; |
780 |
|
} elseif ($this->_query[action] == 'delete') { |
781 |
|
$query_args[action] = $this->_query[action]; |
782 |
} |
} |
783 |
|
|
784 |
$args = array( |
$args = array( |
785 |
'data_type' => $this->_query[abstract_type], |
'data_type' => $this->_query[abstract_type], |
786 |
'query_args' => $query_args |
'query_args' => $query_args |
840 |
|
|
841 |
|
|
842 |
function &fetch_result() { |
function &fetch_result() { |
843 |
|
|
844 |
|
//print Dumper($this); |
845 |
|
|
846 |
$this->datasource_handler_buildoptions(); |
$this->datasource_handler_buildoptions(); |
847 |
|
|
848 |
$call = $this->_locator->get_call(); |
$call = $this->_locator->get_call(); |
849 |
|
|
850 |
//print Dumper($call); |
//print Dumper($call); |
851 |
|
//return; |
852 |
|
|
853 |
// pre-flight checks |
// pre-flight checks |
854 |
if (!$call[method]) { |
if (!$call[method]) { |