/[cvs]/nfo/php/libs/org.netfrag.glib/DataSource/Generic.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.glib/DataSource/Generic.php

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

revision 1.19 by joko, Fri Apr 18 15:40:51 2003 UTC revision 1.25 by jonen, Mon Nov 17 18:01:03 2003 UTC
# Line 14  Line 14 
14   * $Id$   * $Id$
15   *   *
16   * $Log$   * $Log$
17     * Revision 1.25  2003/11/17 18:01:03  jonen
18     * bugfix: php cannot use perl-syntax!! ;-)
19     *
20     * Revision 1.23  2003/07/14 10:02:32  jonen
21     * removed debug dumper
22     *
23     * Revision 1.22  2003/06/06 04:25:45  joko
24     * fix: query args get encapsulated once more
25     *
26     * Revision 1.21  2003/05/10 18:14:50  jonen
27     * + implements 'create' of item (query mapping part)
28     *
29     * Revision 1.20  2003/04/19 16:07:15  jonen
30     * + added '_query[list_meta]' at 'queryData' needed for meta query args
31     *    (e.g. at UserManagment)
32     *
33   * Revision 1.19  2003/04/18 15:40:51  joko   * Revision 1.19  2003/04/18 15:40:51  joko
34   * NEW: tree data handling   * NEW: tree data handling
35   *   introduced new adapter: DataSource::Adapter::Free   *   introduced new adapter: DataSource::Adapter::Free
# Line 732  class DataSource_Generic extends DesignP Line 748  class DataSource_Generic extends DesignP
748               $msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: ";               $msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: ";
749               switch ($this->_query[abstract_type]) {               switch ($this->_query[abstract_type]) {
750                case 'item':                case 'item':
751                  if (!$this->_query[nodename]) {                  if (!$this->_query[nodename] && $this->_query[action] != 'create') {
752                    $msg = "_query[vartype] == 'objects' requires _query[nodename]";                    $msg = "_query[vartype] == 'objects' requires _query[nodename]";
753                    user_error($msg_prefix . $msg);                    user_error($msg_prefix . $msg);
754                    } elseif($this->_query[action] == 'create' && $this->_query[parent]) {
755                      if($this->_query[nodename]) { $query_args[node_class] = $this->_query[nodename]; }
756                      if($this->_query['hash_key']) { $query_args['hash_key'] = $this->_query['hash_key']; }
757                      $query_args[nodename] = $this->_query[ident];
758                      $query_args[parent][guid] = $this->_query[parent][guid];
759                      $query_args[parent][nodename] = $this->_query[parent][nodename];
760                    } else {
761                      $query_args[guid] = $this->_query[ident];
762                      $query_args[nodename] = $this->_query[nodename];
763                      // 2003-11-17 NEW: use expand flag for real obj expand at backend
764                      if ($this->_query[expand]) {$query_args[expand] = 1; }
765                  }                  }
                 $query_args[guid] = $this->_query[ident];  
                 $query_args[nodename] = $this->_query[nodename];  
766                  break;                  break;
767                case 'list':                case 'list':
768                  if (!$this->_query[nodename]) {                  if (!$this->_query[nodename]) {
# Line 746  class DataSource_Generic extends DesignP Line 771  class DataSource_Generic extends DesignP
771                  }                  }
772                  //array_push($query_args, $this->_query[nodename]);                  //array_push($query_args, $this->_query[nodename]);
773                  $query_args[nodename] = $this->_query[nodename];                  $query_args[nodename] = $this->_query[nodename];
774                    if($this->_query[list_meta]) { $query_args[list_meta] = $this->_query[list_meta]; }
775                  break;                  break;
776                case 'tree':                case 'tree':
777                  /*                  /*
# Line 764  class DataSource_Generic extends DesignP Line 790  class DataSource_Generic extends DesignP
790              }              }
791                            
792              // filter???              // filter???
793                //print "Filter: " . Dumper($this->_query[filter]) . "<br>";
794              if ($this->_query[filter]) {              if ($this->_query[filter]) {
795                $query_args[filter] = $this->_query[filter];                $query_args[filter] = $this->_query[filter];
796              }              }
797                            
798              // dispatch action              // dispatch action
799                //print "Action: " . $this->_query[action] . "<br>";
800              if ($this->_query[action] == 'write') {              if ($this->_query[action] == 'write') {
801               $query_args[action] = $this->_query[action];               $query_args[action] = $this->_query[action];
802               $query_args[data] = $this->_query[data];               $query_args[data] = $this->_query[data];
803              } elseif ($this->_query[action] == 'delete') {              } elseif ($this->_query[action] == 'delete') {
804               $query_args[action] = $this->_query[action];               $query_args[action] = $this->_query[action];
805                } elseif ($this->_query[action] == 'create') {
806                   $query_args[action] = $this->_query[action];
807              }              }
808                            
809              $args = array(              $args = array(
# Line 792  class DataSource_Generic extends DesignP Line 822  class DataSource_Generic extends DesignP
822            // remoteMethod            // remoteMethod
823            case 'method':            case 'method':
824              $command = $this->_query[method];              $command = $this->_query[method];
825              $args = $this->_query[args];              //$args = $this->_query[args];
826                // FIX
827                $args = array( $this->_query[args] );
828              break;              break;
829    
830          }          }
# Line 801  class DataSource_Generic extends DesignP Line 833  class DataSource_Generic extends DesignP
833          // FIXME: bad behaviour?          // FIXME: bad behaviour?
834          if (!is_array($args)) { $args = array( $args ); }          if (!is_array($args)) { $args = array( $args ); }
835                    
836            //print Dumper($args);
837            
838          /*          /*
839          $this->_query[rpc_command] = $command;          $this->_query[rpc_command] = $command;
840          $this->_query[rpc_args] = $command;          $this->_query[rpc_args] = $command;

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

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