/[cvs]/nfo/perl/libs/Data/Storage/Handler/Tangram.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Storage/Handler/Tangram.pm

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

revision 1.45 by jonen, Sun Dec 14 01:48:36 2003 UTC revision 1.48 by jonen, Thu Oct 28 11:35:51 2004 UTC
# Line 3  Line 3 
3  #  $Id$  #  $Id$
4  #  #
5  #  $Log$  #  $Log$
6    #  Revision 1.48  2004/10/28 11:35:51  jonen
7    #  + bugfix related to select-criterias(filter)
8    #
9    #  Revision 1.47  2004/08/31 14:26:08  jonen
10    #  updated
11    #
12    #  Revision 1.46  2004/05/06 12:54:34  jonen
13    #  + bugfix related to multiple select-'filter'
14    #
15  #  Revision 1.45  2003/12/14 01:48:36  jonen  #  Revision 1.45  2003/12/14 01:48:36  jonen
16  #  small HACK at _insertChildNode: some special Childnodes should not be created because existing objects have to be selected!  #  small HACK at _insertChildNode: some special Childnodes should not be created because existing objects have to be selected!
17  #  TODO: make this more generic, e.g. implement a special flag at Schema  #  TODO: make this more generic, e.g. implement a special flag at Schema
# Line 529  sub getListFiltered { Line 538  sub getListFiltered {
538    my @results;    my @results;
539    $logger->debug( __PACKAGE__ . "->getListFiltered( nodename => '" . $in->{nodename} . "' )" );    $logger->debug( __PACKAGE__ . "->getListFiltered( nodename => '" . $in->{nodename} . "' )" );
540    
541    #print Dumper($filters);    #print "Filter_payload: " . Dumper($in->{filters}) . "\n";
542    
543    # 1. "Remote Object Handle" - get set of objects from odbms by object name    # 1. "Remote Object Handle" - get set of objects from odbms by object name
544    my $remote = $self->{_COREHANDLE}->remote($in->{nodename});    my $remote = $self->{_COREHANDLE}->remote($in->{nodename});
# Line 585  sub getListFiltered { Line 594  sub getListFiltered {
594        $orm_filter_tmp = $left->$op($right);        $orm_filter_tmp = $left->$op($right);
595      }      }
596    
597      if (not $orm_filter) {      if (!ref($orm_filter)) {
598        $orm_filter = $orm_filter_tmp;        $orm_filter = $orm_filter_tmp;
599      } else {      } else {
600        $orm_filter = $orm_filter->and($orm_filter_tmp);        $orm_filter = $orm_filter->and($orm_filter_tmp);
# Line 594  sub getListFiltered { Line 603  sub getListFiltered {
603    }    }
604    
605    $orm_query->{filter} = $orm_filter;    $orm_query->{filter} = $orm_filter;
606      
607      # debug point:
608      #print "Filter: " . Dumper($orm_query->{filter}) . "\n";
609    
610    # was:    # was:
611    
# Line 715  sub sendQuery { Line 727  sub sendQuery {
727            
728      } elsif (my $guid = $query->{options}->{GUID}) {      } elsif (my $guid = $query->{options}->{GUID}) {
729        $type = 'TRANSPARENT';        $type = 'TRANSPARENT';
730        $query->{criterias} = [ { key => 'guid', op => 'eq', val => $guid } ];            if(ref($query->{criterias}) eq 'ARRAY') {
731            push @{$query->{criterias}}, { key => 'guid', op => 'eq', val => $guid };
732          } else {
733            $query->{criterias} = [ { key => 'guid', op => 'eq', val => $guid } ];
734          }
735        }
736      # if operator is different (dispatcher for 'getListFiltered')      # if operator is different (dispatcher for 'getListFiltered')
737      } elsif (my $op = $query->{options}->{op}) {      if (my $op = $query->{options}->{op}) {
738        $type = 'TRANSPARENT';        $type = 'TRANSPARENT';
739        $query->{criterias} = [ { key => $query->{options}->{meta_label}, op => $op, val => $query->{options}->{meta_value} } ];            if(ref($query->{criterias}) eq 'ARRAY') {
740            push @{$query->{criterias}}, { key => $query->{options}->{meta_label}, op => $op, val => $query->{options}->{meta_value} };
741          } else {
742            $query->{criterias} = [ { key => $query->{options}->{meta_label}, op => $op, val => $query->{options}->{meta_value} } ];    
743          }
744      }      }
745        
746      # HACK: special case: querying by id does not translate into a common tangram query      # HACK: special case: querying by id does not translate into a common tangram query
# Line 835  sub sendQuery { Line 854  sub sendQuery {
854        my $object = $cursor->getNextEntry();        my $object = $cursor->getNextEntry();
855    
856        $self->erase($object);        $self->erase($object);
857          $self->unload($object);
858    
859      } elsif ($crud eq 'CREATE') {      } elsif ($crud eq 'CREATE') {
860                
# Line 1029  sub createNode { Line 1049  sub createNode {
1049          # because they maybe exists and should only be SETTED not CREATED!          # because they maybe exists and should only be SETTED not CREATED!
1050          # TODO: Create a flag at the scheme for that reason!          # TODO: Create a flag at the scheme for that reason!
1051          #   (e.g child_node => 1 for child-nodes only like e.g. UserData)          #   (e.g child_node => 1 for child-nodes only like e.g. UserData)
1052          if($attr_options->{$_}->{class} eq 'NetPerson' || $attr_options->{$_}->{class} eq 'Event') {          if($attr_options->{$_}->{class} eq 'NetPerson' || $attr_options->{$_}->{class} eq 'Event' || $attr_options->{$_}->{class} eq 'BetRule') {
1053            #$obj->{$_} = undef();            #$obj->{$_} = undef();
1054          } else {          } else {
1055            $obj->{$_} = $self->createNode($attr_options->{$_}->{class});            $obj->{$_} = $self->createNode($attr_options->{$_}->{class});

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.48

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