/[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.20 by jonen, Sat Apr 19 16:07:15 2003 UTC revision 1.26 by jonen, Sun Dec 14 01:53:42 2003 UTC
# Line 14  Line 14 
14   * $Id$   * $Id$
15   *   *
16   * $Log$   * $Log$
17     * Revision 1.26  2003/12/14 01:53:42  jonen
18     * implemented 'SELECT' mode for selecting existing object-refereneces as child-nodes
19     *
20     * Revision 1.25  2003/11/17 18:01:03  jonen
21     * bugfix: php cannot use perl-syntax!! ;-)
22     *
23     * Revision 1.23  2003/07/14 10:02:32  jonen
24     * removed debug dumper
25     *
26     * Revision 1.22  2003/06/06 04:25:45  joko
27     * fix: query args get encapsulated once more
28     *
29     * Revision 1.21  2003/05/10 18:14:50  jonen
30     * + implements 'create' of item (query mapping part)
31     *
32   * Revision 1.20  2003/04/19 16:07:15  jonen   * Revision 1.20  2003/04/19 16:07:15  jonen
33   * + added '_query[list_meta]' at 'queryData' needed for meta query args   * + added '_query[list_meta]' at 'queryData' needed for meta query args
34   *    (e.g. at UserManagment)   *    (e.g. at UserManagment)
# Line 736  class DataSource_Generic extends DesignP Line 751  class DataSource_Generic extends DesignP
751               $msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: ";               $msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: ";
752               switch ($this->_query[abstract_type]) {               switch ($this->_query[abstract_type]) {
753                case 'item':                case 'item':
754                  if (!$this->_query[nodename]) {                  if (!$this->_query[nodename] && $this->_query[action] != 'create') {
755                    $msg = "_query[vartype] == 'objects' requires _query[nodename]";                    $msg = "_query[vartype] == 'objects' requires _query[nodename]";
756                    user_error($msg_prefix . $msg);                    user_error($msg_prefix . $msg);
757                    } elseif($this->_query[action] == 'create' && $this->_query[parent]) {
758                      if($this->_query[nodename]) { $query_args[node_class] = $this->_query[nodename]; }
759                      if($this->_query['hash_key']) { $query_args['hash_key'] = $this->_query['hash_key']; }
760                      $query_args[nodename] = $this->_query[ident];
761                      $query_args[parent][guid] = $this->_query[parent][guid];
762                      $query_args[parent][nodename] = $this->_query[parent][nodename];
763                    } elseif($this->_query[parent]) {
764                      $query_args[guid] = $this->_query[ident];
765                      $query_args[nodename] = $this->_query[nodename];
766                      $query_args[parent][guid] = $this->_query[parent][guid];
767                      $query_args[parent][nodename] = $this->_query[parent][nodename];
768                    } else {
769                      $query_args[guid] = $this->_query[ident];
770                      $query_args[nodename] = $this->_query[nodename];
771                      // 2003-11-17 NEW: use expand flag for real obj expand at backend
772                      if ($this->_query[expand]) {$query_args[expand] = 1; }
773                  }                  }
774                  $query_args[guid] = $this->_query[ident];                  //print "generic_source->debug: args " . Dumper($query_args) . "<br>";
                 $query_args[nodename] = $this->_query[nodename];  
775                  break;                  break;
776                case 'list':                case 'list':
777                  if (!$this->_query[nodename]) {                  if (!$this->_query[nodename]) {
778                    $msg = "_query[vartype] == 'objects' requires _query[nodename]";                    $msg = "_query[vartype] == 'objects' requires _query[nodename]";
779                    user_error($msg_prefix . $msg);                    user_error($msg_prefix . $msg);
780                    } elseif($this->_query[parent]) {
781                      //if($this->_query[nodename]) { $query_args[node_class] = $this->_query[nodename]; }
782                      //if($this->_query['hash_key']) { $query_args['hash_key'] = $this->_query['hash_key']; }
783                      //$query_args[nodename] = $this->_query[ident];
784                      $query_args[parent][guid] = $this->_query[parent][guid];
785                      $query_args[parent][nodename] = $this->_query[parent][nodename];
786                  }                  }
787                  //array_push($query_args, $this->_query[nodename]);                  //array_push($query_args, $this->_query[nodename]);
788                  $query_args[nodename] = $this->_query[nodename];                  $query_args[nodename] = $this->_query[nodename];
# Line 769  class DataSource_Generic extends DesignP Line 805  class DataSource_Generic extends DesignP
805              }              }
806                            
807              // filter???              // filter???
808                //print "Filter: " . Dumper($this->_query[filter]) . "<br>";
809              if ($this->_query[filter]) {              if ($this->_query[filter]) {
810                $query_args[filter] = $this->_query[filter];                $query_args[filter] = $this->_query[filter];
811              }              }
812                            
813              // dispatch action              // dispatch action
814                //print "Action: " . $this->_query[action] . "<br>";
815              if ($this->_query[action] == 'write') {              if ($this->_query[action] == 'write') {
816               $query_args[action] = $this->_query[action];               $query_args[action] = $this->_query[action];
817               $query_args[data] = $this->_query[data];               $query_args[data] = $this->_query[data];
818              } elseif ($this->_query[action] == 'delete') {              } elseif ($this->_query[action] == 'delete') {
819               $query_args[action] = $this->_query[action];               $query_args[action] = $this->_query[action];
820                } elseif ($this->_query[action] == 'create') {
821                   $query_args[action] = $this->_query[action];
822                } elseif ($this->_query[action] == 'select') {
823                   $query_args[action] = $this->_query[action];
824              }              }
825                            
826              $args = array(              $args = array(
# Line 797  class DataSource_Generic extends DesignP Line 839  class DataSource_Generic extends DesignP
839            // remoteMethod            // remoteMethod
840            case 'method':            case 'method':
841              $command = $this->_query[method];              $command = $this->_query[method];
842              $args = $this->_query[args];              //$args = $this->_query[args];
843                // FIX
844                $args = array( $this->_query[args] );
845              break;              break;
846    
847          }          }
# Line 806  class DataSource_Generic extends DesignP Line 850  class DataSource_Generic extends DesignP
850          // FIXME: bad behaviour?          // FIXME: bad behaviour?
851          if (!is_array($args)) { $args = array( $args ); }          if (!is_array($args)) { $args = array( $args ); }
852                    
853            //print Dumper($args);
854            
855          /*          /*
856          $this->_query[rpc_command] = $command;          $this->_query[rpc_command] = $command;
857          $this->_query[rpc_args] = $command;          $this->_query[rpc_args] = $command;

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.26

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