/[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.13 by jonen, Wed Apr 9 00:03:11 2003 UTC
# Line 4  Line 4 
4  ##    $Id$  ##    $Id$
5  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
6  ##    $Log$  ##    $Log$
7    ##    Revision 1.13  2003/04/09 00:03:11  jonen
8    ##    disabled form rendering for inheritanced items at 'list'
9    ##
10    ##    Revision 1.12  2003/04/08 17:52:12  joko
11    ##    CHANGE: renamed property 'datasource' to 'transport'
12    ##    NEW: Module 'RemoteAction'
13    ##
14  ##    Revision 1.11  2003/04/07 22:31:51  jonen  ##    Revision 1.11  2003/04/07 22:31:51  jonen
15  ##    + 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'
16  ##    - removed recent added ecom type chooser  ##    - removed recent added ecom type chooser
# Line 150  class WebExplorer_AbstractExplorer { Line 157  class WebExplorer_AbstractExplorer {
157        
158    
159    function init_default_gui_modules() {    function init_default_gui_modules() {
160        
161        // format of parameters: label, ecom_type, abstract_type, module_name
162        
163      //$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") );      //$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") );
164      $this->register_gui_module("nav", "nav", "list", "WebExplorer::Module::NavigationList" );      $this->register_gui_module("nav", "nav", "list", "WebExplorer::Module::NavigationList" );
165      $this->register_gui_module("content", "data", "list", "WebExplorer::Module::DataList" );      $this->register_gui_module("content", "data", "list", "WebExplorer::Module::DataList" );
166      $this->register_gui_module("content", "data", "item", "WebExplorer::Module::DataItem" );      $this->register_gui_module("content", "data", "item", "WebExplorer::Module::DataItem" );
167      // 2003-04-05 - Chooser      // 2003-04-05 - Chooser
168      $this->register_gui_module("chooser", "nav", "list", "WebExplorer::Module::Chooser");          $this->register_gui_module("chooser", "nav", "list", "WebExplorer::Module::Chooser");    
169        // 2003-04-07 - RemoteAction
170        $this->register_gui_module("phase_startup", "call", "auto", "WebExplorer::Module::RemoteAction");    
171    }    }
172    
173    function register_source_module($label, $args) {    function register_source_module($label, $args) {
# Line 204  class WebExplorer_AbstractExplorer { Line 216  class WebExplorer_AbstractExplorer {
216      //print Dumper($args);      //print Dumper($args);
217            
218      // get ecom GUI module      // get ecom GUI module
219      $ecom = php::mkComponent($gui_module, $args);      if (!$ecom = php::mkComponent($gui_module, $args)) {
220          return;
221        }
222      //print Dumper($ecom);      //print Dumper($ecom);
223                    
224      // load phphtmllib GUI object      // load phphtmllib GUI object
# Line 277  class WebExplorer_AbstractExplorer { Line 291  class WebExplorer_AbstractExplorer {
291        // switch abstract type        // switch abstract type
292        if($val['ecom_abstract_type'] == "list") {        if($val['ecom_abstract_type'] == "list") {
293          if($val['ecom_data_locator_key'] == "rpc") {          if($val['ecom_data_locator_key'] == "rpc") {
294            //$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']);
295            $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']);
296          } else {          } else {
297            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] !");
298          }          }
# Line 290  class WebExplorer_AbstractExplorer { Line 304  class WebExplorer_AbstractExplorer {
304                                            'decode' => 1,                                            'decode' => 1,
305                                            'decode_args' => array(                                            'decode_args' => array(
306                                                'seperator' => "_",                                                'seperator' => "_",
307                                                'form' => 1,                                                //'form' => 1,
308                                                ),                                                ),
309                                            ),                                            ),
310                        );                        );
311        // switch abstract type        // switch abstract type
312        } elseif ($val['ecom_abstract_type'] == "item") {        } elseif ($val['ecom_abstract_type'] == "item") {
313          if($val['ecom_data_locator_key'] == "rpc") {          if($val['ecom_data_locator_key'] == "rpc") {
314            //$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']);
315            $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']);
316          } else {          } else {
317            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] !");
318          }          }
# Line 326  class WebExplorer_AbstractExplorer { Line 340  class WebExplorer_AbstractExplorer {
340          if($val['ecom_data_locator_key'] == "rpc") {          if($val['ecom_data_locator_key'] == "rpc") {
341            // switch component label            // switch component label
342            if($label == "nav") {            if($label == "nav") {
343              $data_locator_meta = array( datasource => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' );              $data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' );
344              $args['caption'] = "Objekt Typen";              $args['caption'] = "Objekt Typen";
345            }            }
346            // NEW [2003-04-05]: DataSource.Chooser            // NEW [2003-04-05]: DataSource.Chooser
347            elseif ($label == "chooser") {            elseif ($label == "chooser") {
348              $data_locator_meta = array( datasource => 'rpc', metatype => 'schema', filter => 'sources.all' );              $data_locator_meta = array( transport => 'rpc', metatype => 'schema', filter => 'sources.all' );
349              $args['caption'] = "Datenquellen";              $args['caption'] = "Datenquellen";
350            }            }
351            $args['options']['data_locator_meta'] = $data_locator_meta;            $args['options']['data_locator_meta'] = $data_locator_meta;
# Line 342  class WebExplorer_AbstractExplorer { Line 356  class WebExplorer_AbstractExplorer {
356          $args = array();          $args = array();
357        }        }
358    
359        // NEW [2003-04-08]: RemoteAction (e.g.: result of a selection inside a Chooser)
360        // switch component type
361        } elseif ($val['ecom_type'] == "call") {
362    
363          // responses of RemoteActions are not predictable!
364          if ($val['ecom_abstract_type'] == "auto") {
365            
366            // Dispatching by $label is not done here. RemoteAction-ecoms can appear anywhere!
367    
368            // Just define the RemoteQuery using a declaration to use DataSource::Generic most transparently.
369            // Really - just a remote call is issued, no data-/schema-structures or similar are expected.
370            
371            // The RemoteMethod 'method' is called directly with arguments in 'args'!
372            // As response (important for widget assignement!) you may expect an arbitrary payload.
373            $args['options']['data_locator_meta'] = array(
374              transport => 'rpc',
375              metatype => 'method',
376              method => $val['ecom_call_method'],
377              args => $val['ecom_call_args']
378            );
379            
380          } else {
381            // FIXME: implement automatic re-dispatching to available ecoms here!
382            user_error("WebExplorer::AbstractExplorer: results of RemoteActions can only be handled automatically. Who knows what comes back?");
383          }      
384    
385      }      }
386      return $args;      return $args;

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

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