14 |
* $Id$ |
* $Id$ |
15 |
* |
* |
16 |
* $Log$ |
* $Log$ |
17 |
|
* Revision 1.23 2003/07/14 10:02:32 jonen |
18 |
|
* removed debug dumper |
19 |
|
* |
20 |
|
* Revision 1.22 2003/06/06 04:25:45 joko |
21 |
|
* fix: query args get encapsulated once more |
22 |
|
* |
23 |
|
* Revision 1.21 2003/05/10 18:14:50 jonen |
24 |
|
* + implements 'create' of item (query mapping part) |
25 |
|
* |
26 |
* Revision 1.20 2003/04/19 16:07:15 jonen |
* Revision 1.20 2003/04/19 16:07:15 jonen |
27 |
* + added '_query[list_meta]' at 'queryData' needed for meta query args |
* + added '_query[list_meta]' at 'queryData' needed for meta query args |
28 |
* (e.g. at UserManagment) |
* (e.g. at UserManagment) |
745 |
$msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: "; |
$msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: "; |
746 |
switch ($this->_query[abstract_type]) { |
switch ($this->_query[abstract_type]) { |
747 |
case 'item': |
case 'item': |
748 |
if (!$this->_query[nodename]) { |
if (!$this->_query[nodename] && $this->_query[action] != 'create') { |
749 |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
750 |
user_error($msg_prefix . $msg); |
user_error($msg_prefix . $msg); |
751 |
|
} elseif($this->_query[action] == 'create' && $this->_query[parent]) { |
752 |
|
if($this->_query[nodename]) { $query_args[node_class] = $this->_query[nodename]; } |
753 |
|
if($this->_query['hash_key']) { $query_args['hash_key'] = $this->_query['hash_key']; } |
754 |
|
$query_args[nodename] = $this->_query[ident]; |
755 |
|
$query_args[parent][guid] = $this->_query[parent][guid]; |
756 |
|
$query_args[parent][nodename] = $this->_query[parent][nodename]; |
757 |
|
} else { |
758 |
|
$query_args[guid] = $this->_query[ident]; |
759 |
|
$query_args[nodename] = $this->_query[nodename]; |
760 |
} |
} |
|
$query_args[guid] = $this->_query[ident]; |
|
|
$query_args[nodename] = $this->_query[nodename]; |
|
761 |
break; |
break; |
762 |
case 'list': |
case 'list': |
763 |
if (!$this->_query[nodename]) { |
if (!$this->_query[nodename]) { |
785 |
} |
} |
786 |
|
|
787 |
// filter??? |
// filter??? |
788 |
|
//print "Filter: " . Dumper($this->_query[filter]) . "<br>"; |
789 |
if ($this->_query[filter]) { |
if ($this->_query[filter]) { |
790 |
$query_args[filter] = $this->_query[filter]; |
$query_args[filter] = $this->_query[filter]; |
791 |
} |
} |
792 |
|
|
793 |
// dispatch action |
// dispatch action |
794 |
|
//print "Action: " . $this->_query[action] . "<br>"; |
795 |
if ($this->_query[action] == 'write') { |
if ($this->_query[action] == 'write') { |
796 |
$query_args[action] = $this->_query[action]; |
$query_args[action] = $this->_query[action]; |
797 |
$query_args[data] = $this->_query[data]; |
$query_args[data] = $this->_query[data]; |
798 |
} elseif ($this->_query[action] == 'delete') { |
} elseif ($this->_query[action] == 'delete') { |
799 |
$query_args[action] = $this->_query[action]; |
$query_args[action] = $this->_query[action]; |
800 |
|
} elseif ($this->_query[action] == 'create') { |
801 |
|
$query_args[action] = $this->_query[action]; |
802 |
} |
} |
803 |
|
|
804 |
$args = array( |
$args = array( |
817 |
// remoteMethod |
// remoteMethod |
818 |
case 'method': |
case 'method': |
819 |
$command = $this->_query[method]; |
$command = $this->_query[method]; |
820 |
$args = $this->_query[args]; |
//$args = $this->_query[args]; |
821 |
|
// FIX |
822 |
|
$args = array( $this->_query[args] ); |
823 |
break; |
break; |
824 |
|
|
825 |
} |
} |
828 |
// FIXME: bad behaviour? |
// FIXME: bad behaviour? |
829 |
if (!is_array($args)) { $args = array( $args ); } |
if (!is_array($args)) { $args = array( $args ); } |
830 |
|
|
831 |
|
//print Dumper($args); |
832 |
|
|
833 |
/* |
/* |
834 |
$this->_query[rpc_command] = $command; |
$this->_query[rpc_command] = $command; |
835 |
$this->_query[rpc_args] = $command; |
$this->_query[rpc_args] = $command; |