14 |
* $Id$ |
* $Id$ |
15 |
* |
* |
16 |
* $Log$ |
* $Log$ |
17 |
|
* Revision 1.24 2003/11/17 17:34:23 jonen |
18 |
|
* added flag 'expand' at case 'item' for full expanded objects from backend |
19 |
|
* |
20 |
|
* Revision 1.23 2003/07/14 10:02:32 jonen |
21 |
|
* removed debug dumper |
22 |
|
* |
23 |
|
* Revision 1.22 2003/06/06 04:25:45 joko |
24 |
|
* fix: query args get encapsulated once more |
25 |
|
* |
26 |
|
* Revision 1.21 2003/05/10 18:14:50 jonen |
27 |
|
* + implements 'create' of item (query mapping part) |
28 |
|
* |
29 |
* Revision 1.20 2003/04/19 16:07:15 jonen |
* Revision 1.20 2003/04/19 16:07:15 jonen |
30 |
* + added '_query[list_meta]' at 'queryData' needed for meta query args |
* + added '_query[list_meta]' at 'queryData' needed for meta query args |
31 |
* (e.g. at UserManagment) |
* (e.g. at UserManagment) |
748 |
$msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: "; |
$msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: "; |
749 |
switch ($this->_query[abstract_type]) { |
switch ($this->_query[abstract_type]) { |
750 |
case 'item': |
case 'item': |
751 |
if (!$this->_query[nodename]) { |
if (!$this->_query[nodename] && $this->_query[action] != 'create') { |
752 |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
753 |
user_error($msg_prefix . $msg); |
user_error($msg_prefix . $msg); |
754 |
|
} elseif($this->_query[action] == 'create' && $this->_query[parent]) { |
755 |
|
if($this->_query[nodename]) { $query_args[node_class] = $this->_query[nodename]; } |
756 |
|
if($this->_query['hash_key']) { $query_args['hash_key'] = $this->_query['hash_key']; } |
757 |
|
$query_args[nodename] = $this->_query[ident]; |
758 |
|
$query_args[parent][guid] = $this->_query[parent][guid]; |
759 |
|
$query_args[parent][nodename] = $this->_query[parent][nodename]; |
760 |
|
} else { |
761 |
|
$query_args[guid] = $this->_query[ident]; |
762 |
|
$query_args[nodename] = $this->_query[nodename]; |
763 |
|
// 2003-11-17 NEW: use expand flag for real obj expand at backend |
764 |
|
$query_args[expand] = 1 if $this->_query[expand]; |
765 |
} |
} |
|
$query_args[guid] = $this->_query[ident]; |
|
|
$query_args[nodename] = $this->_query[nodename]; |
|
766 |
break; |
break; |
767 |
case 'list': |
case 'list': |
768 |
if (!$this->_query[nodename]) { |
if (!$this->_query[nodename]) { |
790 |
} |
} |
791 |
|
|
792 |
// filter??? |
// filter??? |
793 |
|
//print "Filter: " . Dumper($this->_query[filter]) . "<br>"; |
794 |
if ($this->_query[filter]) { |
if ($this->_query[filter]) { |
795 |
$query_args[filter] = $this->_query[filter]; |
$query_args[filter] = $this->_query[filter]; |
796 |
} |
} |
797 |
|
|
798 |
// dispatch action |
// dispatch action |
799 |
|
//print "Action: " . $this->_query[action] . "<br>"; |
800 |
if ($this->_query[action] == 'write') { |
if ($this->_query[action] == 'write') { |
801 |
$query_args[action] = $this->_query[action]; |
$query_args[action] = $this->_query[action]; |
802 |
$query_args[data] = $this->_query[data]; |
$query_args[data] = $this->_query[data]; |
803 |
} elseif ($this->_query[action] == 'delete') { |
} elseif ($this->_query[action] == 'delete') { |
804 |
$query_args[action] = $this->_query[action]; |
$query_args[action] = $this->_query[action]; |
805 |
|
} elseif ($this->_query[action] == 'create') { |
806 |
|
$query_args[action] = $this->_query[action]; |
807 |
} |
} |
808 |
|
|
809 |
$args = array( |
$args = array( |
822 |
// remoteMethod |
// remoteMethod |
823 |
case 'method': |
case 'method': |
824 |
$command = $this->_query[method]; |
$command = $this->_query[method]; |
825 |
$args = $this->_query[args]; |
//$args = $this->_query[args]; |
826 |
|
// FIX |
827 |
|
$args = array( $this->_query[args] ); |
828 |
break; |
break; |
829 |
|
|
830 |
} |
} |
833 |
// FIXME: bad behaviour? |
// FIXME: bad behaviour? |
834 |
if (!is_array($args)) { $args = array( $args ); } |
if (!is_array($args)) { $args = array( $args ); } |
835 |
|
|
836 |
|
//print Dumper($args); |
837 |
|
|
838 |
/* |
/* |
839 |
$this->_query[rpc_command] = $command; |
$this->_query[rpc_command] = $command; |
840 |
$this->_query[rpc_args] = $command; |
$this->_query[rpc_args] = $command; |