/[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.22 by joko, Fri Jun 6 04:25:45 2003 UTC
# Line 14  Line 14 
14   * $Id$   * $Id$
15   *   *
16   * $Log$   * $Log$
17     * Revision 1.22  2003/06/06 04:25:45  joko
18     * fix: query args get encapsulated once more
19     *
20     * Revision 1.21  2003/05/10 18:14:50  jonen
21     * + implements 'create' of item (query mapping part)
22     *
23     * Revision 1.20  2003/04/19 16:07:15  jonen
24     * + added '_query[list_meta]' at 'queryData' needed for meta query args
25     *    (e.g. at UserManagment)
26     *
27   * Revision 1.19  2003/04/18 15:40:51  joko   * Revision 1.19  2003/04/18 15:40:51  joko
28   * NEW: tree data handling   * NEW: tree data handling
29   *   introduced new adapter: DataSource::Adapter::Free   *   introduced new adapter: DataSource::Adapter::Free
# Line 732  class DataSource_Generic extends DesignP Line 742  class DataSource_Generic extends DesignP
742               $msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: ";               $msg_prefix = "DataSource::Generic::datasource_handler_buildoptions failed: ";
743               switch ($this->_query[abstract_type]) {               switch ($this->_query[abstract_type]) {
744                case 'item':                case 'item':
745                  if (!$this->_query[nodename]) {                  if (!$this->_query[nodename] && $this->_query[action] != 'create') {
746                    $msg = "_query[vartype] == 'objects' requires _query[nodename]";                    $msg = "_query[vartype] == 'objects' requires _query[nodename]";
747                    user_error($msg_prefix . $msg);                    user_error($msg_prefix . $msg);
748                    } elseif($this->_query[action] == 'create' && $this->_query[parent]) {
749                      if($this->_query[nodename]) { $query_args[node_class] = $this->_query[nodename]; }
750                      if($this->_query['hash_key']) { $query_args['hash_key'] = $this->_query['hash_key']; }
751                      $query_args[nodename] = $this->_query[ident];
752                      $query_args[parent][guid] = $this->_query[parent][guid];
753                      $query_args[parent][nodename] = $this->_query[parent][nodename];
754                    } else {
755                      $query_args[guid] = $this->_query[ident];
756                      $query_args[nodename] = $this->_query[nodename];
757                  }                  }
                 $query_args[guid] = $this->_query[ident];  
                 $query_args[nodename] = $this->_query[nodename];  
758                  break;                  break;
759                case 'list':                case 'list':
760                  if (!$this->_query[nodename]) {                  if (!$this->_query[nodename]) {
# Line 746  class DataSource_Generic extends DesignP Line 763  class DataSource_Generic extends DesignP
763                  }                  }
764                  //array_push($query_args, $this->_query[nodename]);                  //array_push($query_args, $this->_query[nodename]);
765                  $query_args[nodename] = $this->_query[nodename];                  $query_args[nodename] = $this->_query[nodename];
766                    if($this->_query[list_meta]) { $query_args[list_meta] = $this->_query[list_meta]; }
767                  break;                  break;
768                case 'tree':                case 'tree':
769                  /*                  /*
# Line 764  class DataSource_Generic extends DesignP Line 782  class DataSource_Generic extends DesignP
782              }              }
783                            
784              // filter???              // filter???
785                print "Filter: " . Dumper($this->_query[filter]) . "<br>";
786              if ($this->_query[filter]) {              if ($this->_query[filter]) {
787                $query_args[filter] = $this->_query[filter];                $query_args[filter] = $this->_query[filter];
788              }              }
789                            
790              // dispatch action              // dispatch action
791                print "Action: " . $this->_query[action] . "<br>";
792              if ($this->_query[action] == 'write') {              if ($this->_query[action] == 'write') {
793               $query_args[action] = $this->_query[action];               $query_args[action] = $this->_query[action];
794               $query_args[data] = $this->_query[data];               $query_args[data] = $this->_query[data];
795              } elseif ($this->_query[action] == 'delete') {              } elseif ($this->_query[action] == 'delete') {
796               $query_args[action] = $this->_query[action];               $query_args[action] = $this->_query[action];
797                } elseif ($this->_query[action] == 'create') {
798                   $query_args[action] = $this->_query[action];
799              }              }
800                            
801              $args = array(              $args = array(
# Line 792  class DataSource_Generic extends DesignP Line 814  class DataSource_Generic extends DesignP
814            // remoteMethod            // remoteMethod
815            case 'method':            case 'method':
816              $command = $this->_query[method];              $command = $this->_query[method];
817              $args = $this->_query[args];              //$args = $this->_query[args];
818                // FIX
819                $args = array( $this->_query[args] );
820              break;              break;
821    
822          }          }
# Line 801  class DataSource_Generic extends DesignP Line 825  class DataSource_Generic extends DesignP
825          // FIXME: bad behaviour?          // FIXME: bad behaviour?
826          if (!is_array($args)) { $args = array( $args ); }          if (!is_array($args)) { $args = array( $args ); }
827                    
828            //print Dumper($args);
829            
830          /*          /*
831          $this->_query[rpc_command] = $command;          $this->_query[rpc_command] = $command;
832          $this->_query[rpc_args] = $command;          $this->_query[rpc_args] = $command;

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

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