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

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

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

revision 1.11 by jonen, Mon Apr 7 22:31:51 2003 UTC revision 1.14 by jonen, Wed Apr 9 00:31:27 2003 UTC
# Line 4  Line 4 
4  ##    $Id$  ##    $Id$
5  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
6  ##    $Log$  ##    $Log$
7    ##    Revision 1.14  2003/04/09 00:31:27  jonen
8    ##    + added arguments for data list ecom
9    ##
10    ##    Revision 1.13  2003/04/09 00:03:11  jonen
11    ##    disabled form rendering for inheritanced items at 'list'
12    ##
13    ##    Revision 1.12  2003/04/08 17:52:12  joko
14    ##    CHANGE: renamed property 'datasource' to 'transport'
15    ##    NEW: Module 'RemoteAction'
16    ##
17  ##    Revision 1.11  2003/04/07 22:31:51  jonen  ##    Revision 1.11  2003/04/07 22:31:51  jonen
18  ##    + added switch of ecom label (e.g. nav, chooser) at ecom type switch 'nav'  ##    + added switch of ecom label (e.g. nav, chooser) at ecom type switch 'nav'
19  ##    - removed recent added ecom type chooser  ##    - removed recent added ecom type chooser
# Line 150  class WebExplorer_AbstractExplorer { Line 160  class WebExplorer_AbstractExplorer {
160        
161    
162    function init_default_gui_modules() {    function init_default_gui_modules() {
163        
164        // format of parameters: label, ecom_type, abstract_type, module_name
165        
166      //$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") );      //$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") );
167      $this->register_gui_module("nav", "nav", "list", "WebExplorer::Module::NavigationList" );      $this->register_gui_module("nav", "nav", "list", "WebExplorer::Module::NavigationList" );
168      $this->register_gui_module("content", "data", "list", "WebExplorer::Module::DataList" );      $this->register_gui_module("content", "data", "list", "WebExplorer::Module::DataList" );
169      $this->register_gui_module("content", "data", "item", "WebExplorer::Module::DataItem" );      $this->register_gui_module("content", "data", "item", "WebExplorer::Module::DataItem" );
170      // 2003-04-05 - Chooser      // 2003-04-05 - Chooser
171      $this->register_gui_module("chooser", "nav", "list", "WebExplorer::Module::Chooser");          $this->register_gui_module("chooser", "nav", "list", "WebExplorer::Module::Chooser");    
172        // 2003-04-07 - RemoteAction
173        $this->register_gui_module("phase_startup", "call", "auto", "WebExplorer::Module::RemoteAction");    
174    }    }
175    
176    function register_source_module($label, $args) {    function register_source_module($label, $args) {
# Line 204  class WebExplorer_AbstractExplorer { Line 219  class WebExplorer_AbstractExplorer {
219      //print Dumper($args);      //print Dumper($args);
220            
221      // get ecom GUI module      // get ecom GUI module
222      $ecom = php::mkComponent($gui_module, $args);      if (!$ecom = php::mkComponent($gui_module, $args)) {
223          return;
224        }
225      //print Dumper($ecom);      //print Dumper($ecom);
226                    
227      // load phphtmllib GUI object      // load phphtmllib GUI object
# Line 277  class WebExplorer_AbstractExplorer { Line 294  class WebExplorer_AbstractExplorer {
294        // switch abstract type        // switch abstract type
295        if($val['ecom_abstract_type'] == "list") {        if($val['ecom_abstract_type'] == "list") {
296          if($val['ecom_data_locator_key'] == "rpc") {          if($val['ecom_data_locator_key'] == "rpc") {
297            //$data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']);            //$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']);
298            $data_locator_meta = array( datasource => 'rpc', metatype => 'data', abstract_type => 'list', classname => $val['ecom_data_ident']);            $data_locator_meta = array( transport => 'rpc', metatype => 'data', abstract_type => 'list', classname => $val['ecom_data_ident']);
299          } else {          } else {
300            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 query for data_locator_key $val[ecom_data_locator_key] !");
301          }          }
# Line 290  class WebExplorer_AbstractExplorer { Line 307  class WebExplorer_AbstractExplorer {
307                                            'decode' => 1,                                            'decode' => 1,
308                                            'decode_args' => array(                                            'decode_args' => array(
309                                                'seperator' => "_",                                                'seperator' => "_",
310                                                'form' => 1,                                                //'form' => 1,
311                                                  ),
312                                              'actionbar' => array(
313                                                  'name' => "ecdfa",
314                                                  'list' => array(
315                                                      "View" => 'view',
316                                                      "Edit" => 'edit',
317                                                      "Delete" => 'delete',
318                                                      "Add new" => 'add',
319                                                      ),
320                                                ),                                                ),
321                                            ),                                            ),
322                        );                        );
323        // switch abstract type        // switch abstract type
324        } elseif ($val['ecom_abstract_type'] == "item") {        } elseif ($val['ecom_abstract_type'] == "item") {
325          if($val['ecom_data_locator_key'] == "rpc") {          if($val['ecom_data_locator_key'] == "rpc") {
326            //$data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']);            //$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']);
327            $data_locator_meta = array( datasource => 'rpc', metatype => 'data', abstract_type => 'item', ident => $val['ecom_data_ident'], classname => $val['ecom_data_meta']);            $data_locator_meta = array( transport => 'rpc', metatype => 'data', abstract_type => 'item', ident => $val['ecom_data_ident'], classname => $val['ecom_data_meta']);
328          } else {          } else {
329            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 query for data_locator_key $val[ecom_data_locator_key] !");
330          }          }
# Line 326  class WebExplorer_AbstractExplorer { Line 352  class WebExplorer_AbstractExplorer {
352          if($val['ecom_data_locator_key'] == "rpc") {          if($val['ecom_data_locator_key'] == "rpc") {
353            // switch component label            // switch component label
354            if($label == "nav") {            if($label == "nav") {
355              $data_locator_meta = array( datasource => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' );              $data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' );
356              $args['caption'] = "Objekt Typen";              $args['caption'] = "Objekt Typen";
357            }            }
358            // NEW [2003-04-05]: DataSource.Chooser            // NEW [2003-04-05]: DataSource.Chooser
359            elseif ($label == "chooser") {            elseif ($label == "chooser") {
360              $data_locator_meta = array( datasource => 'rpc', metatype => 'schema', filter => 'sources.all' );              $data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'sources.all' );
361              $args['caption'] = "Datenquellen";              $args['caption'] = "Datenquellen";
362            }            }
363            $args['options']['data_locator_meta'] = $data_locator_meta;            $args['options']['data_locator_meta'] = $data_locator_meta;
# Line 342  class WebExplorer_AbstractExplorer { Line 368  class WebExplorer_AbstractExplorer {
368          $args = array();          $args = array();
369        }        }
370    
371        // NEW [2003-04-08]: RemoteAction (e.g.: result of a selection inside a Chooser)
372        // switch component type
373        } elseif ($val['ecom_type'] == "call") {
374    
375          // responses of RemoteActions are not predictable!
376          if ($val['ecom_abstract_type'] == "auto") {
377            
378            // Dispatching by $label is not done here. RemoteAction-ecoms can appear anywhere!
379    
380            // Just define the RemoteQuery using a declaration to use DataSource::Generic most transparently.
381            // Really - just a remote call is issued, no data-/schema-structures or similar are expected.
382            
383            // The RemoteMethod 'method' is called directly with arguments in 'args'!
384            // As response (important for widget assignement!) you may expect an arbitrary payload.
385            $args['options']['data_locator_meta'] = array(
386              transport => 'rpc',
387              metatype => 'method',
388              method => $val['ecom_call_method'],
389              args => $val['ecom_call_args']
390            );
391            
392          } else {
393            // FIXME: implement automatic re-dispatching to available ecoms here!
394            user_error("WebExplorer::AbstractExplorer: results of RemoteActions can only be handled automatically. Who knows what comes back?");
395          }      
396    
397      }      }
398      return $args;      return $args;

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.14

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