/[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.19 by joko, Fri Apr 18 16:21:37 2003 UTC revision 1.28 by jonen, Tue Aug 31 14:15:49 2004 UTC
# Line 4  Line 4 
4  ##    $Id$  ##    $Id$
5  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
6  ##    $Log$  ##    $Log$
7    ##    Revision 1.28  2004/08/31 14:15:49  jonen
8    ##    + added function to clear 'ecom' state
9    ##       (specially needed to refresh the 'content' block)
10    ##
11    ##    Revision 1.27  2004/03/11 21:01:35  jonen
12    ##    minor change
13    ##
14    ##    Revision 1.26  2003/12/14 01:50:30  jonen
15    ##    implemented 'SELECT' mode for selecting existing object-refereneces as child-nodes
16    ##
17    ##    Revision 1.25  2003/11/22 18:47:49  udo
18    ##    update for expand data item
19    ##
20    ##    Revision 1.24  2003/07/02 11:39:16  jonen
21    ##    fixed bugs
22    ##
23    ##    Revision 1.23  2003/06/06 11:57:20  joko
24    ##    minor update: cosmetic changes
25    ##
26    ##    Revision 1.22  2003/05/13 14:50:27  joko
27    ##    HACKed compatibility for config-type data sources
28    ##    + function get_data_filter
29    ##
30    ##    Revision 1.21  2003/05/10 18:23:21  jonen
31    ##    + added stuff relating to 'create/add new' links/buttons
32    ##
33    ##    Revision 1.20  2003/04/19 16:24:49  jonen
34    ##    + added two more GUI modules to default registry initiation,
35    ##       relating to new navigation module 'NavigationTree'
36    ##    + added prepartion of needed args for abstract navigation tree
37    ##       and concret UserManagment 'UMnav' tree
38    ##
39  ##    Revision 1.19  2003/04/18 16:21:37  joko  ##    Revision 1.19  2003/04/18 16:21:37  joko
40  ##    fixed commit comment - the last one caused a syntax error!!!  ##    fixed commit comment - the last one caused a syntax error!!!
41  ##  ##
# Line 145  class WebExplorer_AbstractExplorer { Line 177  class WebExplorer_AbstractExplorer {
177      $this->set_e_state();      $this->set_e_state();
178    
179      //debug      //debug
180      //print "State: " . Dumper($this->_state) ."<br>";  //    print "State: " . Dumper($this->_state) ."<br>";
181        //print "_data_locators: " . Dumper($this->_data_locators) ."<br>";
182      $div = html_div();      $div = html_div();
183      $div->add( html_b(get_class($this)), html_hr(), "Explorer_State: " . Dumper($this->_e_state));      $div->add( html_b(get_class($this)), html_hr(), "Explorer_State: " . Dumper($this->_e_state));
184      $div->set_style('background: #adadad; border: 2px black groove; width:640px; padding:10px; margin:40px;');      $div->set_style('background: #adadad; border: 2px black groove; width:640px; padding:10px; margin:40px;');
# Line 185  class WebExplorer_AbstractExplorer { Line 218  class WebExplorer_AbstractExplorer {
218    
219    function get_page_state() {    function get_page_state() {
220      $requestTracker = mkObject("Application::Request::Tracker");      $requestTracker = mkObject("Application::Request::Tracker");
     //print Dumper($this->_state);  
221      $this->_state = $requestTracker->getPointer();      $this->_state = $requestTracker->getPointer();
222        //print "state: " . Dumper($this->_state) . "<br>";
223      }
224      
225      function clear_comp_state($comp = NULL) {
226        if($comp) {
227          $this->_e_state[ecoms][$comp] = array();
228        }
229    }    }
230        
231    function set_e_state($state = null) {    function set_e_state($state = null) {
# Line 195  class WebExplorer_AbstractExplorer { Line 234  class WebExplorer_AbstractExplorer {
234      // 2. (was) get page state from request tracker      // 2. (was) get page state from request tracker
235      if ($state) {      if ($state) {
236        $this->_e_state = $state;        $this->_e_state = $state;
237    
238      } else {      } else {
239        $this->get_page_state();        $this->get_page_state();
240        $this->_e_state = $this->_state[options][options];        $this->_e_state = $this->_state[options][options];
241    
242      }      }
243      //  print "Setting Explorer state:" . Dumper($this->_e_state);       // print "Setting Explorer state:" . Dumper($this->_e_state);
244    }    }
245    
246    function set_page_state() {    function set_page_state() {
# Line 230  class WebExplorer_AbstractExplorer { Line 271  class WebExplorer_AbstractExplorer {
271      // 2003-04-12 - Data.Tree      // 2003-04-12 - Data.Tree
272      $this->register_gui_module("content", "data", "tree", "WebExplorer::Module::DataTree" );      $this->register_gui_module("content", "data", "tree", "WebExplorer::Module::DataTree" );
273            
274            // 2003-04-18 - Nav.Tree
275        $this->register_gui_module("nav", "nav", "tree", "WebExplorer::Module::NavigationTree" );
276    
277        // 2003-04-18 - UserManagment Nav.Tree (we need only a different 'label' as Nav.Tree yet..)
278        $this->register_gui_module("UMnav", "nav", "tree", "WebExplorer::Module::NavigationTree" );
279    
280    }    }
281    
282    function register_source_module($label, $args) {    function register_source_module($label, $args) {
# Line 249  class WebExplorer_AbstractExplorer { Line 295  class WebExplorer_AbstractExplorer {
295            
296      // that's better ...      // that's better ...
297      $this->_load_ecom($label, $args);      $this->_load_ecom($label, $args);
298            
299            //print "getEcom_args: " .Dumper($args). "<br>";
300            
301      return $this->_ecom[$label];      return $this->_ecom[$label];
302            
303    }    }
# Line 298  class WebExplorer_AbstractExplorer { Line 347  class WebExplorer_AbstractExplorer {
347      }      }
348      //print Dumper($ecom);      //print Dumper($ecom);
349            
350      // NOW[2003-18-04] done at via args(prepare args!) to pass at constructor      // NEW[2003-04-18] done via args(prepare args!) passed at constructor
351      //  (needed for non-real objects instanced at some child of AbstractGUIModule, eg. NavigationList)      //  (needed for non-real objects instanced at some child of AbstractGUIModule, eg. NavigationList)
352  /*  /*
353      // add hidden vars, needed for explorer control      // add hidden vars, needed for explorer control
# Line 327  class WebExplorer_AbstractExplorer { Line 376  class WebExplorer_AbstractExplorer {
376        if($ecom_state['ecom_abstract_type'] == "list") {        if($ecom_state['ecom_abstract_type'] == "list") {
377          $hidden_items = array(          $hidden_items = array(
378                                    'ecl' => $label,                                    'ecl' => $label,
379                                    'ecat' => "item",                                    'ecat' => "list",
380                                    'ecmod' => "view",                                    'ecmod' => "view",
381                                      'ecdid' => $ecom_state['ecom_data_ident'],
382                                    );                                    );
383        }        }
384        elseif($ecom_state['ecom_abstract_type'] == "item") {        elseif($ecom_state['ecom_abstract_type'] == "item") {
# Line 345  class WebExplorer_AbstractExplorer { Line 395  class WebExplorer_AbstractExplorer {
395        // are more label specified!!        // are more label specified!!
396        // OLD:        // OLD:
397        //if($ecom_state['ecom_abstract_type'] == "list") {        //if($ecom_state['ecom_abstract_type'] == "list") {
398          
399          // decide whether to link to items or to a list
400          $abstract_type = 'list';
401          // FIXME: HACK
402          if ($this->_e_state[main][ecom_data_source_key] == 'config') {
403            $abstract_type = 'item';
404          }
405          
406        // NEW:        // NEW:
407        if($label == "nav") {        if ($label == "nav") {
408          $hidden_items = array(          $hidden_items = array(
409                                    'ecl' => "content",                                    'ecl' => "content",
410                                    'ecat' => "list",                                    'ecat' => $abstract_type,
411                                    'ecmod' => "view",                                    'ecmod' => "view",
412                                    'ect' => "data",                                    'ect' => "data",
413                                    'ecdlk' => "rpc",                                    'ecdlk' => "rpc",
414                                   );                                   );
415    
416        }        }
417        elseif($label == "chooser") {        elseif ($label == "chooser") {
418          $hidden_items = array(          $hidden_items = array(
419                                    'ecl' => "phase_startup",                                    'ecl' => "phase_startup",
420                                    'ecdlk' => "rpc",                                    'ecdlk' => "rpc",
# Line 365  class WebExplorer_AbstractExplorer { Line 423  class WebExplorer_AbstractExplorer {
423        }        }
424      }      }
425        // add page idents        // add page idents
426              
427              //print "-e-state-idents: " .Dumper($this->_e_state[idents]). "<br>";
428              
429        foreach($this->_e_state[idents] as $label => $value) {        foreach($this->_e_state[idents] as $label => $value) {
430          $hidden_items[$label] = $value;          $hidden_items[$label] = $value;
431        }        }
# Line 375  class WebExplorer_AbstractExplorer { Line 436  class WebExplorer_AbstractExplorer {
436    
437    function _prepare_component_args($label, $args = array()) {        function _prepare_component_args($label, $args = array()) {    
438      $val = $this->_e_state['ecoms'][$label];      $val = $this->_e_state['ecoms'][$label];
439    //print "val: " .Dumper($val). "<br>";
440      // pre-flight checks      // pre-flight checks
441      if (!$val['ecom_data_locator_key']) {      if (!$val['ecom_data_locator_key']) {
442        user_error("_prepare_component_args: Key 'ecom_data_locator_key' was empty, should be one of 'rpc'.");        user_error("_prepare_component_args: Key 'ecom_data_locator_key' was empty, should be one of 'rpc'.");
# Line 393  class WebExplorer_AbstractExplorer { Line 454  class WebExplorer_AbstractExplorer {
454    
455      // trace      // trace
456      //print "YAI1<br/>";      //print "YAI1<br/>";
457      //print Dumper($val);      
458            
459      $this->set_data_locator($val['ecom_data_locator_key']);      $this->set_data_locator($val['ecom_data_locator_key']);
460    
# Line 411  class WebExplorer_AbstractExplorer { Line 472  class WebExplorer_AbstractExplorer {
472      if($val['ecom_type'] == "data") {      if($val['ecom_type'] == "data") {
473        // switch abstract type        // switch abstract type
474        if($val['ecom_abstract_type'] == "list") {        if($val['ecom_abstract_type'] == "list") {
475                    // debugging
476            //print "Mode: $val[ecom_mode], type: list<br>";
477            //print "val: " .Dumper($val). "<br>";
478            
479          if($val['ecom_data_locator_key'] == "rpc") {          if($val['ecom_data_locator_key'] == "rpc") {
480            //$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']);            //$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']);
481            $data_locator_meta = array( transport => 'rpc', metatype => 'data', abstract_type => 'list', nodename => $val['ecom_data_ident']);  
482                $data_locator_meta = array(
483                  transport => 'rpc',
484                  metatype => 'data',
485                  abstract_type => 'list',
486                  nodename => $val['ecom_data_ident'],
487                  list_meta => $val['ecom_data_meta']
488                );
489          } else {          } else {
490            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] !");
491          }          }
492            
493            if($val['ecom_mode'] == 'select') {        
494              $actionbar = array(
495                     'buttons' => array(
496                                   array(
497                                     'name' => "ecdfsel",
498                                     'value' => "Select"
499                                   ),
500                                 ),
501                         );
502            } else {        
503              $actionbar = array(
504                     'name' => "ecdfa",
505                     'list' => array(
506                                                                                                   "View" => 'view',
507                                                                                                   "Edit" => 'edit',
508                                 "Delete" => 'delete',
509                                 "Expand" => 'expand',
510                                 "Expandedit" => 'expandedit',                                                
511                               ),
512                     'selected' => 'view',
513                     'buttons' => array(
514                                   array(
515                                     'name' => "ecdfcr",
516                                     'value' => "Add new"
517                                   ),
518                                 ),
519                         );
520            }
521            
522          $args = array(          $args = array(
523                        'caption' => $val['ecom_data_ident'],                        'caption' => $val['ecom_data_ident'],
524                        'orderby' => "Guid",                        'orderby' => "Guid",
# Line 427  class WebExplorer_AbstractExplorer { Line 529  class WebExplorer_AbstractExplorer {
529                                                'seperator' => "_",                                                'seperator' => "_",
530                                                //'form' => 1,                                                //'form' => 1,
531                                                ),                                                ),
532                                            'actionbar' => array(                                            'actionbar' => $actionbar,
533                                                'name' => "ecdfa",                                            'parent' => array(
534                                                'list' => array(                                                'class' => $val['ecom_data_ident'],
                                                   "View" => 'view',  
                                                   "Edit" => 'edit',  
                                                   "Delete" => 'delete',  
                                                   "Add new" => 'add',  
                                                   ),  
535                                                ),                                                ),
536                                            ),                                            ),
537                        );                        );
538               if($val['ecom_data_meta_x']) {
539                 //unset($args['options']['data_locator_meta']['nodename']);
540                 $args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta'];
541                 $args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x'];
542               }
543                
544        // switch abstract type        // switch abstract type
545        } elseif ($val['ecom_abstract_type'] == "item") {        } elseif ($val['ecom_abstract_type'] == "item") {
# Line 445  class WebExplorer_AbstractExplorer { Line 547  class WebExplorer_AbstractExplorer {
547            //$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']);            //$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']);
548                        
549            // NEW: 'filter' - 2003-04-14 - required for filtering xml-nodes            // NEW: 'filter' - 2003-04-14 - required for filtering xml-nodes
550            // this propagates the full identifier to reach through all parent nodes            $filter = $this->get_data_filter($val);
551            $filter = array(            
             dotted => $val['ecom_data_filter'],  
             ident => $val['ecom_data_ident'],  
             //xpq => '*/*[@name="cli"]',  
             //xpq => '*/*',  
           );  
           // lift filter from dotted format to xpq format  
           $lift = mkObject('Data::Lift', $filter, array( metatype => 'filter' ) );  
           $filter = $lift->to('XPath');  
   
552            $data_locator_meta = array(            $data_locator_meta = array(
553              transport => 'rpc', metatype => 'data', abstract_type => 'item',              transport => 'rpc', metatype => 'data', abstract_type => 'item',
554              ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta'], filter => $filter,              ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta'], filter => $filter,
# Line 471  class WebExplorer_AbstractExplorer { Line 564  class WebExplorer_AbstractExplorer {
564          // debugging          // debugging
565          print "Mode: $val[ecom_mode]<br>";          print "Mode: $val[ecom_mode]<br>";
566                    
567            //print Dumper($val);
568            // NEW [2003-04-22]: append some more meta information to the caption
569            //$caption_addendum = ' {' . $val['ecom_data_meta'] . '}';
570            $caption_addendum = ' {' . $val['ecom_data_meta'] . ':' . $val['ecom_data_filter'] . '}';
571                    
572          // prepare some arguments...          // prepare some arguments...
573          $args = array(          $args = array(
574                        'caption' => $val['ecom_data_meta'],                        'caption' => $val['ecom_data_ident'] . $caption_addendum,
575                        'mode' => $val['ecom_mode'],                        'mode' => $val['ecom_mode'],
576                        'options' => array(                        'options' => array(
577                                              'data_locator_meta' => $data_locator_meta,                                              'data_locator_meta' => $data_locator_meta,
578                                              'decode' => 1,                                              'decode' => 1,
579                                              'decode_args' => array(                                              'decode_args' => array(
580                                                'seperator' => "_",                                                'seperator' => "_",
581                                                  ),
582                                                'parent' => array(
583                                                    'guid' => $val['ecom_data_ident'],
584                                                    'class' => $val['ecom_data_meta'],
585                                                    ),
586                                              ),                                              ),
                                         ),  
587                        );                        );
588           if ($val['ecom_mode'] == "edit") { $args['adapter'] = 'FormProcessor'; }           if ($val['ecom_mode'] == "edit") { $args['adapter'] = 'FormProcessor'; }
589                    
590           // FIXME: (see WebExplorer::Module::AbstractGUIModule)           // FIXME: (see WebExplorer::Module::AbstractGUIModule)
591           //if ($val['ecom_mode'] == "delete") { $args['adapter'] = 'GenericNegotiation'; }           //if ($val['ecom_mode'] == "delete") { $args['adapter'] = 'GenericNegotiation'; }
592           if ($val['ecom_mode'] == "delete") { $args['adapter'] = 'NonValidatingFormProcessor'; }           if ($val['ecom_mode'] == "delete") {
593               $args['adapter'] = 'NonValidatingFormProcessor';
594               $args['options']['data_locator_meta']['action'] = 'delete';
595             }
596    
597             if ($val['ecom_mode'] == "create") {
598               $args['adapter'] = 'FormProcessor';
599               $args['options']['caption'] = $val['ecom_data_ident'];
600               $args['options']['data_locator_meta']['action'] = 'create';
601               //print "debug 'create': " . Dumper($val);
602               if($val['ecom_data_meta_x']) {
603                 unset($args['options']['data_locator_meta']['nodename']);
604                 $args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta'];
605                 $args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x'];
606               }
607             }
608             if ($val['ecom_mode'] == "select") {
609               $args['adapter'] = 'FormProcessor';
610               $args['caption'] = $val['ecom_data_meta_xe'] . " {". $val['ecom_data_meta_x'] . ":}";
611               $args['options']['data_locator_meta']['action'] = 'select';
612               //print "debug 'select': " . Dumper($val);
613               if($val['ecom_data_meta_x']) {
614                 $args['options']['data_locator_meta']['parent'][guid] = $val['ecom_data_meta_xe'];
615                 $args['options']['data_locator_meta']['parent'][nodename] = $val['ecom_data_meta_x'];
616               }
617             }
618    
619             //print "debug 'args' : " . Dumper($args);
620                    
621        // switch abstract type        // switch abstract type
622        } elseif ($val['ecom_abstract_type'] == "tree") {        } elseif ($val['ecom_abstract_type'] == "tree") {
623          //print "TREE!<br/>";  
624            // NEW: 'filter' - 2003-04-14 - required for filtering xml-nodes
625            $filter = $this->get_data_filter($val);
626                    
627          // FIXME: shouldn't this (dispatching by transport-key) be done very *outside* of this scope?          // FIXME: shouldn't this (dispatching by transport-key) be done very *outside* of this scope?
628          // or: do it outside per default, let a possibility to modify it inside the lower levels of the dispatcher (here)          // or: do it outside per default, let a possibility to modify it inside the lower levels of the dispatcher (here)
629          if ($val['ecom_data_locator_key'] == "rpc") {          if ($val['ecom_data_locator_key'] == "rpc") {
630            //$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']);            //$data_locator_meta = array( transport => 'rpc', metatype => 'data', vartype => 'objects', nodename => $val['ecom_data_ident']);
631            $args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'data', abstract_type => 'tree', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']);            $args[options][data_locator_meta] = array(
632                transport => 'rpc', metatype => 'data', abstract_type => 'tree',
633                ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta'],
634                // NEW [2003-04-22]: Full tree node filtering established.
635                filter => $filter
636              );
637          }          }
638    
639          // NEW [2003-09-26]: transparent content - argument pass-through mode
640          } elseif ($val['ecom_abstract_type'] == "transparent") {
641            
642            // You are responsible for all arguments passed through.
643            // Where are these arguments from?
644            // They are propagated transparently to this place from a new optional
645            // parameter ($args) introduced for the methods 'get_com', 'load_com'
646            // and '_prepare_component_args' (this one).
647            // This means full control over ecoms from outside.
648            
649            // TODO: maybe add some additional pre-flight checks here!?
650          
651          // croak
652        } else {        } else {
653          user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'.");          user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'.");
654                    
# Line 536  class WebExplorer_AbstractExplorer { Line 685  class WebExplorer_AbstractExplorer {
685            user_error("AbstractExplorer::_prepare_component_args - Cannot build schema query for data_locator_key $val[ecom_data_locator_key] !");            user_error("AbstractExplorer::_prepare_component_args - Cannot build schema query for data_locator_key $val[ecom_data_locator_key] !");
686          }          }
687                
688        // tree        // NEW [2003-04-18]: Abstract navigation tree
689        } elseif ($val['ecom_abstract_type'] == "tree") {        } elseif ($val['ecom_abstract_type'] == "tree") {
690          $args = array();          $args = array();
691          print "TREE!<br/>";          if($label == "nav") {
692              //$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'schema', abstract_type => 'tree', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']);
693              $args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'schema', filter => 'nodes.root:concrete' );
694              $args['caption'] = $val['ecom_data_source_key'];
695            } elseif($label == "UMnav") {
696              //$args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'schema', abstract_type => 'tree', ident => $val['ecom_data_ident'], nodename => $val['ecom_data_meta']);
697              $args[options][data_locator_meta] = array( transport => 'rpc', metatype => 'method', method => 'UserManagmentSchema' );
698              $args['caption'] = "Benutzerverwaltung";
699            }
700    
701        // NEW [2003-04-18]: transparent nav - argument pass-through mode        // NEW [2003-04-18]: transparent nav - argument pass-through mode
702        } elseif ($val['ecom_abstract_type'] == "transparent") {        } elseif ($val['ecom_abstract_type'] == "transparent") {
           
703          // You are responsible for all arguments passed through.          // You are responsible for all arguments passed through.
704          // Where are these arguments from?          // Where are these arguments from?
705          // They are propagated transparently to this place from a new optional          // They are propagated transparently to this place from a new optional
# Line 552  class WebExplorer_AbstractExplorer { Line 708  class WebExplorer_AbstractExplorer {
708          // This means full control over ecoms from outside.          // This means full control over ecoms from outside.
709                    
710          // TODO: maybe add some additional pre-flight checks here!?          // TODO: maybe add some additional pre-flight checks here!?
         
711        // croak        // croak
712        } else {        } else {
713          user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'.");          user_error("_prepare_component_args: Could not dispatch ecom_abstract_type='$val[ecom_abstract_type]'.");
# Line 586  class WebExplorer_AbstractExplorer { Line 741  class WebExplorer_AbstractExplorer {
741            
742      }      }
743    
744      // add hidden items to args      // NEW[2003-04-18]: add hidden items to args
745      $args['hidden_elements'] = $this->_get_hidden_items($label);      $args['hidden_elements'] = $this->_get_hidden_items($label);
746            //print "args_hidden: " .Dumper($args['hidden_elements']). "<br>";
747      return $args;      return $args;
748    }    }
749    
# Line 607  class WebExplorer_AbstractExplorer { Line 762  class WebExplorer_AbstractExplorer {
762      user_error("AbstractExplorer::render - please implement me....");      user_error("AbstractExplorer::render - please implement me....");
763    }    }
764    
765    
766      function get_data_filter($state = array()) {
767    
768        // NEW: 'filter' - 2003-04-14 - required for filtering xml-nodes
769        // V1: this was inside ecom_abstract_type == item && ecom_data_locator_key == rpc, but ...
770        // V2: ... it should be considered / work independent of these both criterias
771        //       since it is required for showing xml nodes in items (editing) *and* trees again (browsing).
772        
773        if ($filter_expression = $state[ecom_data_filter]) {
774    
775          // new of 2003-05-13: Apply "Node navigation" in tree mode only.
776          // Lock context when switching to item mode.
777          //print Dumper($state);
778          if ($state[ecom_abstract_type] == "tree") {
779            if ($parent_xpq = $state[ecom_data_meta]) {
780              $filter_expression = $parent_xpq . $filter_expression;
781            }
782          }
783    
784          // This propagates a XPath filter expression which fully identifies
785          // a single node in a document. It reaches through all parent nodes.
786          $filter = array(
787            //dotted => $val['ecom_data_filter'],
788            //ident => $val['ecom_data_ident'],
789            //xpq => '*/*[@name="cli"]',
790            //xpq => '*/*',
791            // NEW [2003-04-21]: An xpq is already ready now inside
792            // 'ecdf' since it already has been built by the revamped tree lift.
793            xpq => '*' . $filter_expression
794          );
795    
796        } else {
797          $filter = '';
798        
799        }
800        
801        // lift filter from dotted format to xpq format
802        // NEW [2003-04-21]: not required any more (see above)
803        //$lift = mkObject('Data::Lift', $filter, array( metatype => 'filter' ) );
804        //$filter = $lift->to('XPath');
805        
806        return $filter;
807    
808      }
809    
810  }  }
811    
812    
 ?>  
813    ?>

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.28

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