/[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.1 by jonen, Thu Mar 20 03:48:46 2003 UTC revision 1.6 by joko, Fri Mar 28 06:42:37 2003 UTC
# Line 4  Line 4 
4  ##    $Id$  ##    $Id$
5  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
6  ##    $Log$  ##    $Log$
7    ##    Revision 1.6  2003/03/28 06:42:37  joko
8    ##    fix: propagating rpc-debugging-options to constants here
9    ##
10    ##    Revision 1.5  2003/03/27 01:24:29  jonen
11    ##    + enabled navigation ecom (only list yet)
12    ##
13    ##    Revision 1.4  2003/03/20 08:02:11  jonen
14    ##    + purged code
15    ##
16    ##    Revision 1.3  2003/03/20 07:54:52  jonen
17    ##    + added docu
18    ##
19    ##    Revision 1.2  2003/03/20 07:44:31  jonen
20    ##    + removed dumper
21    ##
22  ##    Revision 1.1  2003/03/20 03:48:46  jonen  ##    Revision 1.1  2003/03/20 03:48:46  jonen
23  ##    + initial commit  ##    + initial commit
24  ##  ##
# Line 26  Line 41 
41  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
42  */  */
43    
44    /**
45     * WebExplorer::AbstractExplorer - this can be simple compared to a container,
46     *  which modular GUI classes can be register, manipulated and rendered...
47     *
48     * @author Sebastian Utz <seut@tunemedia.de>
49     * @package org.netfrag.app
50     * @name WebExplorer::AbstractExplorer
51     */
52    
53    
54  class WebExplorer_AbstractExplorer {  class WebExplorer_AbstractExplorer {
55    
# Line 54  class WebExplorer_AbstractExplorer { Line 78  class WebExplorer_AbstractExplorer {
78    */    */
79   var $_e_state = array();   var $_e_state = array();
80    
  // needed (old)?  
  var $_control = array();  
  var $_hidden_elements = array();  
   
81    
82    function WebExplorer_AbstractExplorer($data_locators=array()) {    function WebExplorer_AbstractExplorer($data_locators=array()) {
83      $this->_data_locators = $data_locators;      $this->_data_locators = $data_locators;
84      $this->init_default_gui_modules();      $this->init_default_gui_modules();
85            
86      $this->set_e_state();      $this->set_e_state();
87      print "State: " . Dumper($this->_state) ."<br>";      //print "State: " . Dumper($this->_state) ."<br>";
88      print "E_State: " . Dumper($this->_e_state) ."<br>";      $div = html_div();
89        $div->add( html_b(get_class($this)), html_hr(), "Explorer_State: " . Dumper($this->_e_state));
90        $div->set_style('background: #adadad; border: 2px black groove; width:640px; padding:10px; margin:40px;');
91        print $div->render();
92      //$this->init_state();      //$this->init_state();
93    }    }
94    
# Line 81  class WebExplorer_AbstractExplorer { Line 104  class WebExplorer_AbstractExplorer {
104        $rpcinfo = $app->getConfig("rpcinfo");        $rpcinfo = $app->getConfig("rpcinfo");
105        define('RPC_HOSTNAME', $rpcinfo[Host]);        define('RPC_HOSTNAME', $rpcinfo[Host]);
106        define('RPC_PORT', $rpcinfo[Port]);        define('RPC_PORT', $rpcinfo[Port]);
107          define('RPC_DEBUG', $rpcinfo[DEBUG]);
108          define('RPC_TRACE', $rpcinfo[TRACE]);
109          define('RPC_DISCONNECT_ON_ERROR', $rpcinfo[DISCONNECT_ON_ERROR]);
110      } else {      } else {
111        user_error("AbstractExplorer::set_data_locator - data_locator_key label $label not found!");        user_error("AbstractExplorer::set_data_locator - data_locator_key label $label not found!");
112      }      }
# Line 107  class WebExplorer_AbstractExplorer { Line 133  class WebExplorer_AbstractExplorer {
133    
134    function init_default_gui_modules() {    function init_default_gui_modules() {
135      //$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") );      //$this->register_gui_module("n_tree", "nav", array( 'name' => "NavigationTree", 'type' => "tree") );
136      $this->register_gui_module("list", "nav", array( 'name' => "NavigationList", 'type' => "list") );      $this->register_gui_module("list", "nav", array( 'name' => "WebExplorer::Module::NavigationList", 'type' => "list") );
137      $this->register_gui_module("list", "data", array( 'name' => "WebExplorer::Module::DataList", 'type' => "list") );      $this->register_gui_module("list", "data", array( 'name' => "WebExplorer::Module::DataList", 'type' => "list") );
138      $this->register_gui_module("item", "data", array( 'name' => "WebExplorer::Module::DataItem", 'type' => "item") );      $this->register_gui_module("item", "data", array( 'name' => "WebExplorer::Module::DataItem", 'type' => "item") );
139    }    }
# Line 155  class WebExplorer_AbstractExplorer { Line 181  class WebExplorer_AbstractExplorer {
181    
182      // add hidden vars, needed for explorer control      // add hidden vars, needed for explorer control
183      $hidden_items = $this->_get_hidden_items($label);      $hidden_items = $this->_get_hidden_items($label);
184      $ecom->add_hidden_items($hidden_items);      if(is_array($hidden_items) ) { $ecom->add_hidden_items($hidden_items); }
185      //print "Hidden: " . Dumper($gui_ecom->_hidden_items);      //print "Hidden: " . Dumper($gui_ecom->_hidden_items);
186    
187      $this->_ecom[$label] = &$gui_ecom;      $this->_ecom[$label] = &$gui_ecom;
# Line 163  class WebExplorer_AbstractExplorer { Line 189  class WebExplorer_AbstractExplorer {
189    
190    function _get_hidden_items($label) {    function _get_hidden_items($label) {
191      $ecom_state = $this->_e_state['ecoms'][$label];      $ecom_state = $this->_e_state['ecoms'][$label];
192      if($ecom_state['ecom_abstract_type'] == "list") {      if($ecom_state['ecom_type'] == "data") {
193        $hidden_items = array(        if($ecom_state['ecom_abstract_type'] == "list") {
194            $hidden_items = array(
195                                    'ecl' => $label,                                    'ecl' => $label,
196                                    );                                    );
197          }
198          // set default hidden item for whole explorer
199          $hidden_items['ap'] = "explorer";
200      }      }
     // set default hidden item for whole explorer  
     $hidden_items['ap'] = "explorer";  
201      return $hidden_items;      return $hidden_items;
202    }    }
203    
204    function _prepare_component_args($label) {        function _prepare_component_args($label) {    
205      $val = $this->_e_state['ecoms'][$label];      $val = $this->_e_state['ecoms'][$label];
206      $this->set_data_locator($val['ecom_data_locator_key']);      $this->set_data_locator($val['ecom_data_locator_key']);
207      if($val['ecom_abstract_type'] == "list") {      // switch component type
208        if($val['ecom_data_locator_key'] == "rpc") {      if($val['ecom_type'] == "data") {
209          $data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']);        // switch abstract type
210        } else {        if($val['ecom_abstract_type'] == "list") {
211          user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !");          if($val['ecom_data_locator_key'] == "rpc") {
212        }            //$data_locator_meta = array( datasource => 'rpc', metatype => 'data', vartype => 'objects', classname => $val['ecom_data_ident']);
213        $args = array(            $data_locator_meta = array( datasource => 'rpc', metatype => 'data', abstract_type => 'list', classname => $val['ecom_data_ident']);
214            } else {
215              user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !");
216            }
217            $args = array(
218                        'caption' => "Liste",                        'caption' => "Liste",
219                        'orderby' => "Guid",                        'orderby' => "Guid",
220                        'options' => array(                        'options' => array(
# Line 194  class WebExplorer_AbstractExplorer { Line 226  class WebExplorer_AbstractExplorer {
226                                                ),                                                ),
227                                            ),                                            ),
228                        );                        );
229      } elseif ($ecom_type == "item") {        // switch abstract type
230        $args = array();        } elseif ($val['ecom_abstract_type'] == "item") {
231      } elseif ($ecom_type == "nav") {          $args = array();
232        $args = array();        }
233        // switch component type
234        } elseif ($val['ecom_type'] == "nav") {
235          // switch abstract type
236          if($val['ecom_abstract_type'] == "list") {
237            if($val['ecom_data_locator_key'] == "rpc") {
238              $data_locator_meta = array( datasource => 'rpc', metatype => 'schema' );
239            } else {
240              user_error("AbstractExplorer::_prepare_component_args - Cannot build query for data_locator_key $val[ecom_data_locator_key] !");
241            }
242            $args = array(
243                          'caption' => "Objekt Typen",
244                          'options' => array(
245                                              'data_locator_meta' => $data_locator_meta,
246                                              ),
247                          );
248          } elseif ($val['ecom_abstract_type'] == "tree") {
249            $args = array();
250          }
251      }      }
252      return $args;      return $args;
253    }    }

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

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