| 14 |
* $Id$ |
* $Id$ |
| 15 |
* |
* |
| 16 |
* $Log$ |
* $Log$ |
| 17 |
|
* Revision 1.21 2003/05/10 18:14:50 jonen |
| 18 |
|
* + implements 'create' of item (query mapping part) |
| 19 |
|
* |
| 20 |
|
* Revision 1.20 2003/04/19 16:07:15 jonen |
| 21 |
|
* + added '_query[list_meta]' at 'queryData' needed for meta query args |
| 22 |
|
* (e.g. at UserManagment) |
| 23 |
|
* |
| 24 |
* Revision 1.19 2003/04/18 15:40:51 joko |
* Revision 1.19 2003/04/18 15:40:51 joko |
| 25 |
* NEW: tree data handling |
* NEW: tree data handling |
| 26 |
* introduced new adapter: DataSource::Adapter::Free |
* introduced new adapter: DataSource::Adapter::Free |
| 739 |
$msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: "; |
$msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: "; |
| 740 |
switch ($this->_query[abstract_type]) { |
switch ($this->_query[abstract_type]) { |
| 741 |
case 'item': |
case 'item': |
| 742 |
if (!$this->_query[nodename]) { |
if (!$this->_query[nodename] && $this->_query[action] != 'create') { |
| 743 |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
$msg = "_query[vartype] == 'objects' requires _query[nodename]"; |
| 744 |
user_error($msg_prefix . $msg); |
user_error($msg_prefix . $msg); |
| 745 |
|
} elseif($this->_query[action] == 'create' && $this->_query[parent]) { |
| 746 |
|
if($this->_query[nodename]) { $query_args[node_class] = $this->_query[nodename]; } |
| 747 |
|
if($this->_query['hash_key']) { $query_args['hash_key'] = $this->_query['hash_key']; } |
| 748 |
|
$query_args[nodename] = $this->_query[ident]; |
| 749 |
|
$query_args[parent][guid] = $this->_query[parent][guid]; |
| 750 |
|
$query_args[parent][nodename] = $this->_query[parent][nodename]; |
| 751 |
|
} else { |
| 752 |
|
$query_args[guid] = $this->_query[ident]; |
| 753 |
|
$query_args[nodename] = $this->_query[nodename]; |
| 754 |
} |
} |
|
$query_args[guid] = $this->_query[ident]; |
|
|
$query_args[nodename] = $this->_query[nodename]; |
|
| 755 |
break; |
break; |
| 756 |
case 'list': |
case 'list': |
| 757 |
if (!$this->_query[nodename]) { |
if (!$this->_query[nodename]) { |
| 760 |
} |
} |
| 761 |
//array_push($query_args, $this->_query[nodename]); |
//array_push($query_args, $this->_query[nodename]); |
| 762 |
$query_args[nodename] = $this->_query[nodename]; |
$query_args[nodename] = $this->_query[nodename]; |
| 763 |
|
if($this->_query[list_meta]) { $query_args[list_meta] = $this->_query[list_meta]; } |
| 764 |
break; |
break; |
| 765 |
case 'tree': |
case 'tree': |
| 766 |
/* |
/* |
| 779 |
} |
} |
| 780 |
|
|
| 781 |
// filter??? |
// filter??? |
| 782 |
|
print "Filter: " . Dumper($this->_query[filter]) . "<br>"; |
| 783 |
if ($this->_query[filter]) { |
if ($this->_query[filter]) { |
| 784 |
$query_args[filter] = $this->_query[filter]; |
$query_args[filter] = $this->_query[filter]; |
| 785 |
} |
} |
| 786 |
|
|
| 787 |
// dispatch action |
// dispatch action |
| 788 |
|
print "Action: " . $this->_query[action] . "<br>"; |
| 789 |
if ($this->_query[action] == 'write') { |
if ($this->_query[action] == 'write') { |
| 790 |
$query_args[action] = $this->_query[action]; |
$query_args[action] = $this->_query[action]; |
| 791 |
$query_args[data] = $this->_query[data]; |
$query_args[data] = $this->_query[data]; |
| 792 |
} elseif ($this->_query[action] == 'delete') { |
} elseif ($this->_query[action] == 'delete') { |
| 793 |
$query_args[action] = $this->_query[action]; |
$query_args[action] = $this->_query[action]; |
| 794 |
|
} elseif ($this->_query[action] == 'create') { |
| 795 |
|
$query_args[action] = $this->_query[action]; |
| 796 |
} |
} |
| 797 |
|
|
| 798 |
$args = array( |
$args = array( |