/[cvs]/nfo/php/libs/org.netfrag.app/WebExplorer/MVC.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.app/WebExplorer/MVC.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by joko, Sat Apr 5 21:18:29 2003 UTC revision 1.10 by joko, Thu Apr 10 06:03:26 2003 UTC
# Line 4  Line 4 
4   * $Id$   * $Id$
5   *   *
6   * $Log$   * $Log$
7     * Revision 1.10  2003/04/10 06:03:26  joko
8     * ++ renamed keys: 'ecom_data_form_edit', 'ecom_data_form_cancel' through 'ecom_data_action_edit', 'ecom_data_action_cancel'
9     * + new key: 'ecom_data_action_delete'
10     * + Action.Delete: not really, since it's inside component in fact (self-contained ecom)
11     *
12     * Revision 1.9  2003/04/09 00:05:50  jonen
13     * added request values and functions needed for extended form handling
14     *
15     * Revision 1.8  2003/04/08 17:53:08  joko
16     * NEW: Module 'RemoteAction' in 'phase_startup'
17     *
18     * Revision 1.7  2003/04/07 22:32:27  jonen
19     * + minor changes related to new ecom 'chooser'
20     *
21     * Revision 1.6  2003/04/06 01:32:57  jonen
22     * + minor changes
23     *
24   * Revision 1.5  2003/04/05 21:18:29  joko   * Revision 1.5  2003/04/05 21:18:29  joko
25   * added Chooser and associated 'ecds'-parameter   * added Chooser and associated 'ecds'-parameter
26   * new rule (at bottom) to dispatch datasource-keys to each ecom-component   * new rule (at bottom) to dispatch datasource-keys to each ecom-component
# Line 84  class WebExplorer_MVC extends Site_WebAp Line 101  class WebExplorer_MVC extends Site_WebAp
101          'ecom_data_locator_key',          'ecom_data_locator_key',
102          'ecom_data_ident',          'ecom_data_ident',
103          'ecom_data_meta',          'ecom_data_meta',
104          'ecom_data_form_edit', 'ecom_data_form_cancel',          'ecom_data_action_edit', 'ecom_data_action_cancel', 'ecom_data_action_delete',
105            'ecom_data_form_checkbox', 'ecom_data_form_action',
106          'ecom_data_source_key'          'ecom_data_source_key'
107        ),        ),
108        request_arg => array(        request_arg => array(
# Line 96  class WebExplorer_MVC extends Site_WebAp Line 114  class WebExplorer_MVC extends Site_WebAp
114          'ecom_data_locator_key' => array( query_arg => 'ecdlk' ),          'ecom_data_locator_key' => array( query_arg => 'ecdlk' ),
115          'ecom_data_ident' => array( query_arg => 'ecdid' ),          'ecom_data_ident' => array( query_arg => 'ecdid' ),
116          'ecom_data_meta' => array( query_arg => 'ecdm' ),          'ecom_data_meta' => array( query_arg => 'ecdm' ),
117          'ecom_data_form_edit' => array( query_arg => 'ecdfe' ),          'ecom_data_action_edit' => array( query_arg => 'ecdfe' ),
118          'ecom_data_form_cancel' => array( query_arg => 'ecdfc' ),          'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ),
119            'ecom_data_action_delete' => array( query_arg => 'ecdfd' ),
120            'ecom_data_form_action' => array( query_arg => 'ecdfa' ),
121            'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ),
122          'ecom_data_source_key' => array( query_arg => 'ecds' ),          'ecom_data_source_key' => array( query_arg => 'ecds' ),
123        ),        ),
124    
# Line 142  class WebExplorer_MVC extends Site_WebAp Line 163  class WebExplorer_MVC extends Site_WebAp
163        // COID => '123',        // COID => '123',
164        caption => "Explorer - ExplorerDataItem",        caption => "Explorer - ExplorerDataItem",
165      ));      ));
166                      
167      // FIXME!!! enhance!?!?      // FIXME!!! enhance!?!?
168      // AIM: "dispatch a Request to a View by using rules..."      // AIM: "dispatch a Request to a View by using rules..."
169      // Todo:      // Todo:
# Line 154  class WebExplorer_MVC extends Site_WebAp Line 175  class WebExplorer_MVC extends Site_WebAp
175                
176        // for "module", no component registry is required, just does 'mkObject' under the hood        // for "module", no component registry is required, just does 'mkObject' under the hood
177        module => 'Application::Request::HttpController',        module => 'Application::Request::HttpController',
178          //module_options => blah
179    
180        rules => array(        rules => array(
181                    
182          // get last page state          // get last page state
# Line 172  class WebExplorer_MVC extends Site_WebAp Line 195  class WebExplorer_MVC extends Site_WebAp
195            $_out = $pre_out;            $_out = $pre_out;
196          '),          '),
197    
198            // reset machine
199            create_function('&$_in, &$_out', '
200                // HACK!!!
201                // FIXME: review and implement in a more clean way?
202                //print "RESET!<br/>";
203                
204                $_out[options][ecoms][phase_startup] = "RESET";
205            '),
206    
207          // rewrite idents          // rewrite idents
208          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
209            $idents = array ( ap, );            $idents = array ( ap, );
# Line 181  class WebExplorer_MVC extends Site_WebAp Line 213  class WebExplorer_MVC extends Site_WebAp
213          '),          '),
214                    
215          // check right $_GET[ap]          // check right $_GET[ap]
216          create_function('&$_in, &$_out', 'return ($_in[ap] != "explorer") ? print "Wrong application value $_in[ap], sure this is right here?" : null;'),          create_function('&$_in, &$_out', 'return ($_in[ap] != "explorer") ? print "Wrong application value: $_in[ap], sure this is right here?<br>" : null;'),
217    
218          // write components variables to out          // write components variables to out
219          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
220            $vars = array( ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, ecom_data_ident, ecom_data_meta );            $vars = array(
221                ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, ecom_data_ident, ecom_data_meta
222              );
223              //  ecom_call_method, ecom_call_args
224            if($_in[ecom_label]) {            if($_in[ecom_label]) {
225              foreach($vars as $key) {              foreach($vars as $key) {
226                if($_in[$key]) {                if($_in[$key]) {
# Line 205  class WebExplorer_MVC extends Site_WebAp Line 240  class WebExplorer_MVC extends Site_WebAp
240                      nav => array(                      nav => array(
241                                ecom_type => "nav",                                ecom_type => "nav",
242                                ecom_abstract_type => "list",                                ecom_abstract_type => "list",
243                                ecom_mode => "nav",                                ecom_mode => "link",
244                                ecom_data_locator_key => "rpc",                                ecom_data_locator_key => "rpc",
245                                ),                                ),
246                      chooser => array(                      chooser => array(
247                                ecom_type => "chooser",                                ecom_type => "nav",
248                                ecom_abstract_type => "list",                                ecom_abstract_type => "list",
249                                ecom_mode => "nav",                                ecom_mode => "link",
250                                ecom_data_locator_key => "rpc",                                ecom_data_locator_key => "rpc",
251                                ),                                ),
252                    );                    );
# Line 220  class WebExplorer_MVC extends Site_WebAp Line 255  class WebExplorer_MVC extends Site_WebAp
255            return;            return;
256          '),          '),
257    
258    
259            // handle data form action(button)
260            create_function('&$_in, &$_out', '
261              $label = $_in[ecom_label];
262              if($_in[ecom_data_form_action] && is_array($_in[ecom_data_form_checkbox])) {
263                $cnt = sizeof($_in[ecom_data_form_checkbox]);
264                if($cnt == 1) {
265                  foreach($_in[ecom_data_form_checkbox] as $ident) {
266                    $_out[options][ecoms][$label][ecom_data_ident] = $ident;
267                  }
268                  $_out[options][ecoms][$label][ecom_data_meta] = $_in[ecom_data_ident];
269                  $_out[options][ecoms][$label][ecom_mode] = $_in[ecom_data_form_action];
270                  $_out[options][ecoms][$label][ecom_abstract_type] = "item";
271                } else {
272                  // TODO: implement multi-selection actions on rows(items) here!!
273                }
274              }
275            '),
276    
277    
278          // handle data form buttons          // handle data form buttons
279          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
280            $label = $_in[ecom_label];            $label = $_in[ecom_label];
281            if($_in[ecom_data_form_edit]) { $_out[options][ecoms][$label][ecom_mode] = "edit"; }            if($_in[ecom_data_action_edit]) { $_out[options][ecoms][$label][ecom_mode] = "edit"; }
282            if($_in[ecom_data_form_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; }            if($_in[ecom_data_action_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; }
283              
284              // Action.Delete [new of 2003-04-09]
285              if ($_in[ecom_data_action_delete]) {
286                
287                // the code here vanished to the component itself!
288                // could/should we do this for "edit" and/or "view" actions as well?
289                // look at ecom/FlexibleDataItem!
290    
291              }
292            
293          '),          '),
294    
295          // propagate datasources to ecoms          // propagate datasources to ecoms
# Line 233  class WebExplorer_MVC extends Site_WebAp Line 298  class WebExplorer_MVC extends Site_WebAp
298          // datasource if requested - otherwise everything will fall back to defaults          // datasource if requested - otherwise everything will fall back to defaults
299          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
300            if ($_in[ecom_data_source_key]) {            if ($_in[ecom_data_source_key]) {
301                
302                print "YAI: ecom_data_source_key<br/>";
303                
304              //print Dumper($_out[options][ecoms]);              //print Dumper($_out[options][ecoms]);
305              //print "ds: " . $_in[ecom_data_source_key] . "<br/>";              //print "ds: " . $_in[ecom_data_source_key] . "<br/>";
306              /*              /*
# Line 243  class WebExplorer_MVC extends Site_WebAp Line 311  class WebExplorer_MVC extends Site_WebAp
311              }              }
312              */              */
313              $_out[options][main][ecom_data_source_key] = $_in[ecom_data_source_key];              $_out[options][main][ecom_data_source_key] = $_in[ecom_data_source_key];
314    
315    
316                // 2003-04-07 - enhanced
317                // now activates a special ecom-component - a "RemoteAction" - replacing
318                // the "content"-ecom instead of displaying an empty page / overriding any
319                // view reached by "normal dispatching"
320    
321                $_out[options][ecoms][phase_startup] = array(
322                  ecom_type => "call",
323                  ecom_abstract_type => "auto",
324                  ecom_mode => "link",
325                  ecom_data_locator_key => "rpc",
326                  // new attributes/properties/arguments that control further / trigger different DataFlow:
327                  // FIXME: add these to declaration at top!
328                  ecom_call_method => "selectSource",
329                  ecom_call_args => $_in[ecom_data_source_key]
330                );
331    
332            }            }
333          '),          '),
334                    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.10

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed