4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.10 2003/04/05 20:32:04 joko |
8 |
|
## added Chooser |
9 |
|
## |
10 |
## Revision 1.9 2003/04/04 02:22:37 joko |
## Revision 1.9 2003/04/04 02:22:37 joko |
11 |
## minor fix: querySchema now issues argument |
## minor fix: querySchema now issues argument |
12 |
## |
## |
150 |
$this->register_gui_module("list", "nav", array( 'name' => "WebExplorer::Module::NavigationList", 'type' => "list") ); |
$this->register_gui_module("list", "nav", array( 'name' => "WebExplorer::Module::NavigationList", 'type' => "list") ); |
151 |
$this->register_gui_module("list", "data", array( 'name' => "WebExplorer::Module::DataList", 'type' => "list") ); |
$this->register_gui_module("list", "data", array( 'name' => "WebExplorer::Module::DataList", 'type' => "list") ); |
152 |
$this->register_gui_module("item", "data", array( 'name' => "WebExplorer::Module::DataItem", 'type' => "item") ); |
$this->register_gui_module("item", "data", array( 'name' => "WebExplorer::Module::DataItem", 'type' => "item") ); |
153 |
|
// 2003-04-05 - Chooser |
154 |
|
$this->register_gui_module("list", "chooser", array( 'name' => "WebExplorer::Module::Chooser", 'type' => "list") ); |
155 |
} |
} |
156 |
|
|
157 |
function register_source_module($label, $args) { |
function register_source_module($label, $args) { |
169 |
} |
} |
170 |
|
|
171 |
function _load_ecoms() { |
function _load_ecoms() { |
172 |
|
//trace("_load_ecoms: " . Dumper($this->_e_state[ecoms]) . "<br/>"); |
173 |
foreach($this->_e_state[ecoms] as $label => $val) { |
foreach($this->_e_state[ecoms] as $label => $val) { |
174 |
$this->_load_ecom($label); |
$this->_load_ecom($label); |
175 |
} |
} |
176 |
} |
} |
177 |
|
|
178 |
function _load_ecom($label) { |
function _load_ecom($label) { |
179 |
|
|
180 |
$val = $this->_e_state['ecoms'][$label]; |
$val = $this->_e_state['ecoms'][$label]; |
181 |
|
debug::info("_load_ecom: " . Dumper($val) . "<br/>"); |
182 |
// find right gui module |
// find right gui module |
183 |
$com_type = $val['ecom_type']; |
$com_type = $val['ecom_type']; |
184 |
$abstract_type = $val['ecom_abstract_type']; |
$abstract_type = $val['ecom_abstract_type']; |
185 |
$gui_module = $this->_module['gui'][$com_type][$abstract_type]['name']; |
$gui_module = $this->_module['gui'][$com_type][$abstract_type]['name']; |
186 |
if(!$gui_module) { |
if(!$gui_module) { |
187 |
user_error("AbstractExplorer::_load_component - No GUI module found for abstract type $val[ecom_abstract_type] ecom type $val[ecom_type] !"); |
user_error("AbstractExplorer::_load_component - No GUI module found. [label='$label', abstract type='$val[ecom_abstract_type]', ecom type='$val[ecom_type]']"); |
188 |
return; |
return; |
189 |
} |
} |
190 |
// get arguments needed for gui module |
// get arguments needed for gui module |
241 |
function _prepare_component_args($label) { |
function _prepare_component_args($label) { |
242 |
$val = $this->_e_state['ecoms'][$label]; |
$val = $this->_e_state['ecoms'][$label]; |
243 |
$this->set_data_locator($val['ecom_data_locator_key']); |
$this->set_data_locator($val['ecom_data_locator_key']); |
244 |
|
|
245 |
|
// detect and execute 'selectSource' action |
246 |
|
// FIXME: this is a HACK!!! move to a module 'BackendAction' or s.th.l.th. |
247 |
|
//print Dumper($this->_e_state['sources']); |
248 |
|
if ($source = $this->_e_state['main']['ecom_data_source_key']) { |
249 |
|
//print "selectSource: $source<br/>"; |
250 |
|
//global $app; |
251 |
|
//print Dumper($backend); |
252 |
|
//$app->backend->do(); |
253 |
|
} |
254 |
|
|
255 |
// switch component type |
// switch component type |
256 |
if($val['ecom_type'] == "data") { |
if($val['ecom_type'] == "data") { |
257 |
// switch abstract type |
// switch abstract type |
297 |
); |
); |
298 |
if($val['ecom_mode'] == "edit") { $args['adapter'] = 'FormProcessor'; } |
if($val['ecom_mode'] == "edit") { $args['adapter'] = 'FormProcessor'; } |
299 |
} |
} |
300 |
|
|
301 |
// switch component type |
// switch component type |
302 |
} elseif ($val['ecom_type'] == "nav") { |
} elseif ($val['ecom_type'] == "nav") { |
303 |
// switch abstract type |
// switch abstract type |
304 |
if($val['ecom_abstract_type'] == "list") { |
if($val['ecom_abstract_type'] == "list") { |
305 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_data_locator_key'] == "rpc") { |
306 |
$data_locator_meta = array( datasource => 'rpc', metatype => 'schema', filter => 'concrete' ); |
$data_locator_meta = array( datasource => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' ); |
307 |
} else { |
} else { |
308 |
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 schema query for data_locator_key $val[ecom_data_locator_key] !"); |
309 |
} |
} |
310 |
$args = array( |
$args = array( |
311 |
'caption' => "Objekt Typen", |
'caption' => "Objekt Typen", |
316 |
} elseif ($val['ecom_abstract_type'] == "tree") { |
} elseif ($val['ecom_abstract_type'] == "tree") { |
317 |
$args = array(); |
$args = array(); |
318 |
} |
} |
319 |
|
|
320 |
|
// switch component type |
321 |
|
// NEW [2003-04-05]: DataSource.Chooser |
322 |
|
} elseif ($val['ecom_type'] == "chooser") { |
323 |
|
|
324 |
|
// switch abstract type |
325 |
|
if($val['ecom_abstract_type'] == "list") { |
326 |
|
if ($val['ecom_data_locator_key'] == "rpc") { |
327 |
|
$data_locator_meta = array( datasource => 'rpc', metatype => 'schema', filter => 'sources.all' ); |
328 |
|
} else { |
329 |
|
user_error("AbstractExplorer::_prepare_component_args - Cannot build schema query for data_locator_key $val[ecom_data_locator_key] !"); |
330 |
|
} |
331 |
|
$args = array( |
332 |
|
'caption' => "Datenquellen", |
333 |
|
'options' => array( |
334 |
|
'data_locator_meta' => $data_locator_meta, |
335 |
|
), |
336 |
|
); |
337 |
|
} elseif ($val['ecom_abstract_type'] == "tree") { |
338 |
|
$args = array(); |
339 |
|
} |
340 |
|
|
341 |
} |
} |
342 |
return $args; |
return $args; |
343 |
} |
} |