4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
|
## Revision 1.7 2003/03/29 07:49:55 joko |
8 |
|
## show boxes in DEBUG-mode only! |
9 |
|
## |
10 |
|
## Revision 1.6 2003/03/28 06:42:37 joko |
11 |
|
## fix: propagating rpc-debugging-options to constants here |
12 |
|
## |
13 |
|
## Revision 1.5 2003/03/27 01:24:29 jonen |
14 |
|
## + enabled navigation ecom (only list yet) |
15 |
|
## |
16 |
|
## Revision 1.4 2003/03/20 08:02:11 jonen |
17 |
|
## + purged code |
18 |
|
## |
19 |
|
## Revision 1.3 2003/03/20 07:54:52 jonen |
20 |
|
## + added docu |
21 |
|
## |
22 |
|
## Revision 1.2 2003/03/20 07:44:31 jonen |
23 |
|
## + removed dumper |
24 |
|
## |
25 |
## Revision 1.1 2003/03/20 03:48:46 jonen |
## Revision 1.1 2003/03/20 03:48:46 jonen |
26 |
## + initial commit |
## + initial commit |
27 |
## |
## |
44 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
45 |
*/ |
*/ |
46 |
|
|
47 |
|
/** |
48 |
|
* WebExplorer::AbstractExplorer - this can be simple compared to a container, |
49 |
|
* which modular GUI classes can be register, manipulated and rendered... |
50 |
|
* |
51 |
|
* @author Sebastian Utz <seut@tunemedia.de> |
52 |
|
* @package org.netfrag.app |
53 |
|
* @name WebExplorer::AbstractExplorer |
54 |
|
*/ |
55 |
|
|
56 |
|
|
57 |
class WebExplorer_AbstractExplorer { |
class WebExplorer_AbstractExplorer { |
58 |
|
|
81 |
*/ |
*/ |
82 |
var $_e_state = array(); |
var $_e_state = array(); |
83 |
|
|
|
// needed (old)? |
|
|
var $_control = array(); |
|
|
var $_hidden_elements = array(); |
|
|
|
|
84 |
|
|
85 |
function WebExplorer_AbstractExplorer($data_locators=array()) { |
function WebExplorer_AbstractExplorer($data_locators=array()) { |
86 |
$this->_data_locators = $data_locators; |
$this->_data_locators = $data_locators; |
87 |
$this->init_default_gui_modules(); |
$this->init_default_gui_modules(); |
88 |
|
|
89 |
$this->set_e_state(); |
$this->set_e_state(); |
90 |
print "State: " . Dumper($this->_state) ."<br>"; |
//print "State: " . Dumper($this->_state) ."<br>"; |
91 |
print "E_State: " . Dumper($this->_e_state) ."<br>"; |
$div = html_div(); |
92 |
|
$div->add( html_b(get_class($this)), html_hr(), "Explorer_State: " . Dumper($this->_e_state)); |
93 |
|
$div->set_style('background: #adadad; border: 2px black groove; width:640px; padding:10px; margin:40px;'); |
94 |
|
if (constants::get('DEBUG')) { |
95 |
|
print $div->render(); |
96 |
|
} |
97 |
//$this->init_state(); |
//$this->init_state(); |
98 |
} |
} |
99 |
|
|
109 |
$rpcinfo = $app->getConfig("rpcinfo"); |
$rpcinfo = $app->getConfig("rpcinfo"); |
110 |
define('RPC_HOSTNAME', $rpcinfo[Host]); |
define('RPC_HOSTNAME', $rpcinfo[Host]); |
111 |
define('RPC_PORT', $rpcinfo[Port]); |
define('RPC_PORT', $rpcinfo[Port]); |
112 |
|
define('RPC_DEBUG', $rpcinfo[DEBUG]); |
113 |
|
define('RPC_TRACE', $rpcinfo[TRACE]); |
114 |
|
define('RPC_DISCONNECT_ON_ERROR', $rpcinfo[DISCONNECT_ON_ERROR]); |
115 |
} else { |
} else { |
116 |
user_error("AbstractExplorer::set_data_locator - data_locator_key label $label not found!"); |
user_error("AbstractExplorer::set_data_locator - data_locator_key label $label not found!"); |
117 |
} |
} |
138 |
|
|
139 |
function init_default_gui_modules() { |
function init_default_gui_modules() { |
140 |
//$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") ); |
//$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") ); |
141 |
$this->register_gui_module("list", "nav", array( 'name' => "NavigationList", 'type' => "list") ); |
$this->register_gui_module("list", "nav", array( 'name' => "WebExplorer::Module::NavigationList", 'type' => "list") ); |
142 |
$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") ); |
143 |
$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") ); |
144 |
} |
} |
186 |
|
|
187 |
// add hidden vars, needed for explorer control |
// add hidden vars, needed for explorer control |
188 |
$hidden_items = $this->_get_hidden_items($label); |
$hidden_items = $this->_get_hidden_items($label); |
189 |
$ecom->add_hidden_items($hidden_items); |
if(is_array($hidden_items) ) { $ecom->add_hidden_items($hidden_items); } |
190 |
//print "Hidden: " . Dumper($gui_ecom->_hidden_items); |
//print "Hidden: " . Dumper($gui_ecom->_hidden_items); |
191 |
|
|
192 |
$this->_ecom[$label] = &$gui_ecom; |
$this->_ecom[$label] = &$gui_ecom; |
194 |
|
|
195 |
function _get_hidden_items($label) { |
function _get_hidden_items($label) { |
196 |
$ecom_state = $this->_e_state['ecoms'][$label]; |
$ecom_state = $this->_e_state['ecoms'][$label]; |
197 |
if($ecom_state['ecom_abstract_type'] == "list") { |
if($ecom_state['ecom_type'] == "data") { |
198 |
$hidden_items = array( |
if($ecom_state['ecom_abstract_type'] == "list") { |
199 |
|
$hidden_items = array( |
200 |
'ecl' => $label, |
'ecl' => $label, |
201 |
); |
); |
202 |
|
} |
203 |
|
// set default hidden item for whole explorer |
204 |
|
$hidden_items['ap'] = "explorer"; |
205 |
} |
} |
|
// set default hidden item for whole explorer |
|
|
$hidden_items['ap'] = "explorer"; |
|
206 |
return $hidden_items; |
return $hidden_items; |
207 |
} |
} |
208 |
|
|
209 |
function _prepare_component_args($label) { |
function _prepare_component_args($label) { |
210 |
$val = $this->_e_state['ecoms'][$label]; |
$val = $this->_e_state['ecoms'][$label]; |
211 |
$this->set_data_locator($val['ecom_data_locator_key']); |
$this->set_data_locator($val['ecom_data_locator_key']); |
212 |
if($val['ecom_abstract_type'] == "list") { |
// switch component type |
213 |
if($val['ecom_data_locator_key'] == "rpc") { |
if($val['ecom_type'] == "data") { |
214 |
$data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']); |
// switch abstract type |
215 |
} else { |
if($val['ecom_abstract_type'] == "list") { |
216 |
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
if($val['ecom_data_locator_key'] == "rpc") { |
217 |
} |
//$data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']); |
218 |
$args = array( |
$data_locator_meta = array( datasource => 'rpc', metatype => 'data', abstract_type => 'list', classname => $val['ecom_data_ident']); |
219 |
|
} else { |
220 |
|
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
221 |
|
} |
222 |
|
$args = array( |
223 |
'caption' => "Liste", |
'caption' => "Liste", |
224 |
'orderby' => "Guid", |
'orderby' => "Guid", |
225 |
'options' => array( |
'options' => array( |
231 |
), |
), |
232 |
), |
), |
233 |
); |
); |
234 |
} elseif ($ecom_type == "item") { |
// switch abstract type |
235 |
$args = array(); |
} elseif ($val['ecom_abstract_type'] == "item") { |
236 |
} elseif ($ecom_type == "nav") { |
$args = array(); |
237 |
$args = array(); |
} |
238 |
|
// switch component type |
239 |
|
} elseif ($val['ecom_type'] == "nav") { |
240 |
|
// switch abstract type |
241 |
|
if($val['ecom_abstract_type'] == "list") { |
242 |
|
if($val['ecom_data_locator_key'] == "rpc") { |
243 |
|
$data_locator_meta = array( datasource => 'rpc', metatype => 'schema' ); |
244 |
|
} else { |
245 |
|
user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !"); |
246 |
|
} |
247 |
|
$args = array( |
248 |
|
'caption' => "Objekt Typen", |
249 |
|
'options' => array( |
250 |
|
'data_locator_meta' => $data_locator_meta, |
251 |
|
), |
252 |
|
); |
253 |
|
} elseif ($val['ecom_abstract_type'] == "tree") { |
254 |
|
$args = array(); |
255 |
|
} |
256 |
} |
} |
257 |
return $args; |
return $args; |
258 |
} |
} |