4 |
* $Id$ |
* $Id$ |
5 |
* |
* |
6 |
* $Log$ |
* $Log$ |
7 |
|
* Revision 1.14 2003/04/19 16:20:47 jonen |
8 |
|
* + added handle of ecom 'UMnav' according to page 'Benutzverwaltung' |
9 |
|
* |
10 |
|
* Revision 1.13 2003/04/18 15:30:24 joko |
11 |
|
* NEW: parameter 'ecom_data_filter' - used for 'items' |
12 |
|
* (introduced to filter xml-payload at backend side via xpath queries) |
13 |
|
* documented global state parameters |
14 |
|
* some comments |
15 |
|
* |
16 |
|
* Revision 1.12 2003/04/18 13:40:54 jonen |
17 |
|
* + added 'topic' to requested vars which will currently be merged with the 'ap' var |
18 |
|
* |
19 |
* Revision 1.11 2003/04/11 00:51:10 joko |
* Revision 1.11 2003/04/11 00:51:10 joko |
20 |
* minor update: just testing stuff... |
* minor update: just testing stuff... |
21 |
* |
* |
108 |
$this->add_model( array( |
$this->add_model( array( |
109 |
//args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), |
//args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), |
110 |
request_args => array( |
request_args => array( |
111 |
|
// ApplicationTopic |
112 |
|
'topic', |
113 |
// ApplicationPage |
// ApplicationPage |
114 |
'ap', |
'ap', |
115 |
// important/required parameters for valid ecom-components |
// important/required parameters for valid ecom-components |
120 |
'ecom_data_meta', |
'ecom_data_meta', |
121 |
'ecom_data_action_edit', 'ecom_data_action_cancel', 'ecom_data_action_delete', |
'ecom_data_action_edit', 'ecom_data_action_cancel', 'ecom_data_action_delete', |
122 |
'ecom_data_form_checkbox', 'ecom_data_form_action', |
'ecom_data_form_checkbox', 'ecom_data_form_action', |
123 |
'ecom_data_source_key' |
'ecom_data_source_key', |
124 |
|
'ecom_data_filter', |
125 |
), |
), |
126 |
request_arg => array( |
request_arg => array( |
127 |
'ap' => array( query_arg => 'ap' ), |
|
128 |
'ecom_label' => array( query_arg => 'ecl' ), |
// a key identifying the current topic |
129 |
'ecom_type' => array( query_arg => 'ect' ), |
'topic' => array( query_arg => 't' ), |
130 |
'ecom_abstract_type' => array( query_arg => 'ecat' ), |
|
131 |
'ecom_mode' => array( query_arg => 'ecmod' ), |
// a key identifying the current page |
132 |
'ecom_data_locator_key' => array( query_arg => 'ecdlk' ), |
'ap' => array( query_arg => 'ap' ), |
133 |
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
|
134 |
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
// ecom, ecom, ecom |
135 |
'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), |
|
136 |
'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), |
// component specific arguments (important for the main dispatcher, etc.) |
137 |
'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), |
// a label identifying a component |
138 |
'ecom_data_form_action' => array( query_arg => 'ecdfa' ), |
'ecom_label' => array( query_arg => 'ecl' ), |
139 |
'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), |
// data or schema |
140 |
'ecom_data_source_key' => array( query_arg => 'ecds' ), |
'ecom_type' => array( query_arg => 'ect' ), |
141 |
|
// item, list or tree |
142 |
|
'ecom_abstract_type' => array( query_arg => 'ecat' ), |
143 |
|
|
144 |
|
|
145 |
|
// data, data, data |
146 |
|
|
147 |
|
// e.g. view, edit |
148 |
|
'ecom_mode' => array( query_arg => 'ecmod' ), |
149 |
|
// This should be renamed to 'ecom_data_transport_key'. |
150 |
|
'ecom_data_locator_key' => array( query_arg => 'ecdlk' ), |
151 |
|
|
152 |
|
// This should be enough to identify data Xyz. |
153 |
|
// e.g. an OID, a GUID, a filename or similar stuff |
154 |
|
'ecom_data_ident' => array( query_arg => 'ecdid' ), |
155 |
|
// e.g. a classname or a filename |
156 |
|
'ecom_data_meta' => array( query_arg => 'ecdm' ), |
157 |
|
// filter the data: e.g. |
158 |
|
// - an xpath-query (xpq), |
159 |
|
// - an abstract/custom filter string or |
160 |
|
// - a parent node identifier (maybe revamp as 'ecdpnid')? |
161 |
|
'ecom_data_filter' => array( query_arg => 'ecdf' ), |
162 |
|
|
163 |
|
// Some actions ... |
164 |
|
// ... required for data items. |
165 |
|
'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), |
166 |
|
'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), |
167 |
|
'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), |
168 |
|
// ... required for data lists. |
169 |
|
'ecom_data_form_action' => array( query_arg => 'ecdfa' ), |
170 |
|
'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), |
171 |
|
|
172 |
|
// Special argument (should become a non-data-action). |
173 |
|
// Triggers 'selectSource' at backend api (remote api) which causes a database handle switch. |
174 |
|
'ecom_data_source_key' => array( query_arg => 'ecds' ), |
175 |
|
|
176 |
), |
), |
177 |
|
|
178 |
/* |
/* |
179 |
// block model (what is used for each block) |
// block model (what is used for each block) |
180 |
|
// is this deprecated??? |
181 |
block => array( |
block => array( |
182 |
'ident' => array( query_arg => 'ident' ), |
'ident' => array( query_arg => 'ident' ), |
183 |
'meta' => array( query_arg => 'meta' ), |
'meta' => array( query_arg => 'meta' ), |
190 |
|
|
191 |
)); |
)); |
192 |
|
|
193 |
|
|
194 |
|
// TODO: activate MVC-Views!!! |
195 |
|
// - Here: Picture a ecom-component as a MVC-View. |
196 |
|
// - Assign a GUID to each ecom-component! |
197 |
|
// - Build WebExplorer-Introspection-Module to show stuff like this... (->WebExplorer::Designer) |
198 |
|
|
199 |
|
|
200 |
//$this->setup_views( &$this->_registry ); |
//$this->setup_views( &$this->_registry ); |
201 |
|
|
202 |
// associate behaviour with "View"-components |
// associate behaviour with "View"-components |
246 |
$page_state = $requestTracker->getPointer(); |
$page_state = $requestTracker->getPointer(); |
247 |
$pre_out = $page_state[options]; |
$pre_out = $page_state[options]; |
248 |
//print Dumper($pre_out); |
//print Dumper($pre_out); |
249 |
|
|
250 |
// clean-up unwanted variables |
// clean-up unwanted variables |
251 |
$label = $_in[ecom_label]; |
$label = $_in[ecom_label]; |
252 |
switch ($_in[ecom_abstract_type]) { |
switch ($_in[ecom_abstract_type]) { |
253 |
case "list": |
case "list": |
254 |
if($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } |
if ($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } |
255 |
|
break; |
256 |
|
// 2003-04-16: required for xmltree-to-item transition |
257 |
|
// if we dont do this the "dotted" filter expression would persist across views |
258 |
|
case "item": |
259 |
|
if ($pre_out[options][ecoms][$label][ecom_data_filter]) { unset($pre_out[options][ecoms][$label][ecom_data_filter]); } |
260 |
break; |
break; |
261 |
} |
} |
262 |
$_out = $pre_out; |
$_out = $pre_out; |
267 |
// HACK!!! |
// HACK!!! |
268 |
// FIXME: review and implement in a more clean way? |
// FIXME: review and implement in a more clean way? |
269 |
//print "RESET!<br/>"; |
//print "RESET!<br/>"; |
|
|
|
270 |
$_out[options][ecoms][phase_startup] = "RESET"; |
$_out[options][ecoms][phase_startup] = "RESET"; |
271 |
'), |
'), |
272 |
|
|
273 |
// rewrite idents |
// rewrite idents |
274 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
275 |
|
// map Topic to Page if exists |
276 |
|
if($_in[topic]) { |
277 |
|
$_in[ap] = $_in[topic]; |
278 |
|
} |
279 |
$idents = array ( ap, ); |
$idents = array ( ap, ); |
280 |
foreach($idents as $key) { |
foreach($idents as $key) { |
281 |
$_out[options][idents][$key] = $_in[$key]; |
$_out[options][idents][$key] = $_in[$key]; |
283 |
'), |
'), |
284 |
|
|
285 |
// check right $_GET[ap] |
// check right $_GET[ap] |
286 |
create_function('&$_in, &$_out', 'return ($_in[ap] != "explorer") ? print "Wrong application value: $_in[ap], sure this is right here?<br>" : null;'), |
create_function('&$_in, &$_out', 'return ($_in[ap] != "explorer") ? print "Wrong application value [ap]: $_in[ap], sure this is right here?<br>" : null;'), |
287 |
|
|
288 |
// write components variables to out |
// write components variables to out |
289 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |
290 |
$vars = array( |
$vars = array( |
291 |
ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, ecom_data_ident, ecom_data_meta |
ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, |
292 |
|
ecom_data_ident, ecom_data_meta, ecom_data_filter |
293 |
); |
); |
294 |
// ecom_call_method, ecom_call_args |
// ecom_call_method, ecom_call_args |
295 |
if($_in[ecom_label]) { |
if($_in[ecom_label]) { |
326 |
return; |
return; |
327 |
'), |
'), |
328 |
|
|
329 |
|
// handle data form action(button) |
330 |
|
create_function('&$_in, &$_out', ' |
331 |
|
if($_in[ap] == "Benutzerverwaltung" || $_in[topic] == "Benutzerverwaltung") { |
332 |
|
if(!$_out[options][ecoms][UMnav]) { |
333 |
|
$_out[options][ecoms][UMnav] = array( |
334 |
|
ecom_type => "nav", |
335 |
|
ecom_abstract_type => "tree", |
336 |
|
ecom_mode => "link", |
337 |
|
ecom_data_locator_key => "rpc", |
338 |
|
); |
339 |
|
} |
340 |
|
} |
341 |
|
'), |
342 |
|
|
343 |
// handle data form action(button) |
// handle data form action(button) |
344 |
create_function('&$_in, &$_out', ' |
create_function('&$_in, &$_out', ' |