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

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

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