/[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.4 by jonen, Fri Apr 4 23:59:19 2003 UTC revision 1.6 by jonen, Sun Apr 6 01:32:57 2003 UTC
# Line 4  Line 4 
4   * $Id$   * $Id$
5   *   *
6   * $Log$   * $Log$
7     * Revision 1.6  2003/04/06 01:32:57  jonen
8     * + minor changes
9     *
10     * Revision 1.5  2003/04/05 21:18:29  joko
11     * added Chooser and associated 'ecds'-parameter
12     * new rule (at bottom) to dispatch datasource-keys to each ecom-component
13     *
14   * Revision 1.4  2003/04/04 23:59:19  jonen   * Revision 1.4  2003/04/04 23:59:19  jonen
15   * + minor changes according to data form submits   * + minor changes according to data form submits
16   *   *
# Line 71  class WebExplorer_MVC extends Site_WebAp Line 78  class WebExplorer_MVC extends Site_WebAp
78    
79      $this->add_model( array(      $this->add_model( array(
80        //args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ),        //args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ),
81        request_args => array( 'ap', 'ecom_label', 'ecom_type', 'ecom_abstract_type', 'ecom_mode', 'ecom_data_locator_key',        request_args => array(
82                                           'ecom_data_ident', 'ecom_data_meta', 'ecom_data_form_edit', 'ecom_data_form_cancel' ),          // ApplicationPage
83            'ap',
84            // important/required parameters for valid ecom-components
85            'ecom_label', 'ecom_type', 'ecom_abstract_type', 'ecom_mode',
86            // parameters about data identifiers, locations, sources and associated meta-information
87            'ecom_data_locator_key',
88            'ecom_data_ident',
89            'ecom_data_meta',
90            'ecom_data_form_edit', 'ecom_data_form_cancel',
91            'ecom_data_source_key'
92          ),
93        request_arg => array(        request_arg => array(
94          'ap' => array( query_arg => 'ap' ),          'ap' => array( query_arg => 'ap' ),
95          'ecom_label' => array( query_arg => 'ecl' ),          'ecom_label' => array( query_arg => 'ecl' ),
# Line 84  class WebExplorer_MVC extends Site_WebAp Line 101  class WebExplorer_MVC extends Site_WebAp
101          'ecom_data_meta' => array( query_arg => 'ecdm' ),          'ecom_data_meta' => array( query_arg => 'ecdm' ),
102          'ecom_data_form_edit' => array( query_arg => 'ecdfe' ),          'ecom_data_form_edit' => array( query_arg => 'ecdfe' ),
103          'ecom_data_form_cancel' => array( query_arg => 'ecdfc' ),          'ecom_data_form_cancel' => array( query_arg => 'ecdfc' ),
104            'ecom_data_source_key' => array( query_arg => 'ecds' ),
105        ),        ),
106    
107  /*  /*
# Line 127  class WebExplorer_MVC extends Site_WebAp Line 145  class WebExplorer_MVC extends Site_WebAp
145        // COID => '123',        // COID => '123',
146        caption => "Explorer - ExplorerDataItem",        caption => "Explorer - ExplorerDataItem",
147      ));      ));
148                      
149      // FIXME!!! enhance!?!?      // FIXME!!! enhance!?!?
150      // AIM: "dispatch a Request to a View by using rules..."      // AIM: "dispatch a Request to a View by using rules..."
151      // Todo:      // Todo:
# Line 136  class WebExplorer_MVC extends Site_WebAp Line 154  class WebExplorer_MVC extends Site_WebAp
154      //    Enhance this backend and introduce a mechanism to trigger      //    Enhance this backend and introduce a mechanism to trigger
155      //    a true callback to process a rule (or: "as a rule") on top of that.      //    a true callback to process a rule (or: "as a rule") on top of that.
156      $this->add_controller( array(      $this->add_controller( array(
157          
158        // 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
159        module => 'Application::Request::HttpController',        module => 'Application::Request::HttpController',
160          //module_options => blah
161    
162        rules => array(        rules => array(
163                    
164          // get last page state          // get last page state
# Line 156  class WebExplorer_MVC extends Site_WebAp Line 177  class WebExplorer_MVC extends Site_WebAp
177            $_out = $pre_out;            $_out = $pre_out;
178          '),          '),
179    
   
180          // rewrite idents          // rewrite idents
181          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
182            $idents = array ( ap, );            $idents = array ( ap, );
# Line 166  class WebExplorer_MVC extends Site_WebAp Line 186  class WebExplorer_MVC extends Site_WebAp
186          '),          '),
187                    
188          // check right $_GET[ap]          // check right $_GET[ap]
189          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;'),
190    
191          // write components variables to out          // write components variables to out
192          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
# Line 183  class WebExplorer_MVC extends Site_WebAp Line 203  class WebExplorer_MVC extends Site_WebAp
203            return;            return;
204          '),          '),
205    
206          // create default ecoms (navigation, etc.)          // create default ecoms (navigation, chooser [as of 2003-04-05] etc.)
207          create_function('&$_in, &$_out', '          create_function('&$_in, &$_out', '
208            if(!$_out[options][ecoms] || !is_array($_out[options][ecoms])) {            if(!$_out[options][ecoms] || !is_array($_out[options][ecoms])) {
209              $_out[options][ecoms] = array(              $_out[options][ecoms] = array(
# Line 193  class WebExplorer_MVC extends Site_WebAp Line 213  class WebExplorer_MVC extends Site_WebAp
213                                ecom_mode => "nav",                                ecom_mode => "nav",
214                                ecom_data_locator_key => "rpc",                                ecom_data_locator_key => "rpc",
215                                ),                                ),
216                        chooser => array(
217                                  ecom_type => "chooser",
218                                  ecom_abstract_type => "list",
219                                  ecom_mode => "nav",
220                                  ecom_data_locator_key => "rpc",
221                                  ),
222                    );                    );
223            }            }
224            //$_out[options][components] = $_in[components];            //$_out[options][components] = $_in[components];
# Line 206  class WebExplorer_MVC extends Site_WebAp Line 232  class WebExplorer_MVC extends Site_WebAp
232            if($_in[ecom_data_form_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; }            if($_in[ecom_data_form_cancel]) { $_out[options][ecoms][$label][ecom_mode] = "view"; }
233          '),          '),
234    
235            // propagate datasources to ecoms
236            // datasource-change requested? enhance logic here!
237            // by now each ecom-component gets injected the very same
238            // datasource if requested - otherwise everything will fall back to defaults
239            create_function('&$_in, &$_out', '
240              if ($_in[ecom_data_source_key]) {
241                //print Dumper($_out[options][ecoms]);
242                //print "ds: " . $_in[ecom_data_source_key] . "<br/>";
243                /*
244                foreach ($_out[options][ecoms] as $name => $ecom) {
245                  print "name: $name<br/>";
246                  //$_out[options][sources][selected] = $_in[ecom_data_source];
247                  $_out[options][ecoms][$name][ecom_data_source_key] = $_in[ecom_data_source_key];
248                }
249                */
250                $_out[options][main][ecom_data_source_key] = $_in[ecom_data_source_key];
251              }
252            '),
253            
254    
255  /*  /*
256          // translate value of argument "action" (olist => list.view, oedit => item.edit)          // translate value of argument "action" (olist => list.view, oedit => item.edit)
257          // action dispatcher          // action dispatcher

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

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