/[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.46 by jonen, Thu May 6 12:54:34 2004 UTC revision 1.49 by jonen, Wed Nov 3 14:12:34 2004 UTC
# Line 3  Line 3 
3  #  $Id$  #  $Id$
4  #  #
5  #  $Log$  #  $Log$
6    #  Revision 1.49  2004/11/03 14:12:34  jonen
7    #  replaced print with logger->info
8    #
9    #  Revision 1.48  2004/10/28 11:35:51  jonen
10    #  + bugfix related to select-criterias(filter)
11    #
12    #  Revision 1.47  2004/08/31 14:26:08  jonen
13    #  updated
14    #
15  #  Revision 1.46  2004/05/06 12:54:34  jonen  #  Revision 1.46  2004/05/06 12:54:34  jonen
16  #  + bugfix related to multiple select-'filter'  #  + bugfix related to multiple select-'filter'
17  #  #
# Line 721  sub sendQuery { Line 730  sub sendQuery {
730            
731      } elsif (my $guid = $query->{options}->{GUID}) {      } elsif (my $guid = $query->{options}->{GUID}) {
732        $type = 'TRANSPARENT';        $type = 'TRANSPARENT';
733        $query->{criterias} = [ { key => 'guid', op => 'eq', val => $guid } ];            if(ref($query->{criterias}) eq 'ARRAY') {
734            push @{$query->{criterias}}, { key => 'guid', op => 'eq', val => $guid };
735          } else {
736            $query->{criterias} = [ { key => 'guid', op => 'eq', val => $guid } ];
737          }
738        }
739      # if operator is different (dispatcher for 'getListFiltered')      # if operator is different (dispatcher for 'getListFiltered')
740      } elsif (my $op = $query->{options}->{op}) {      if (my $op = $query->{options}->{op}) {
741        $type = 'TRANSPARENT';        $type = 'TRANSPARENT';
742        $query->{criterias} = [ { key => $query->{options}->{meta_label}, op => $op, val => $query->{options}->{meta_value} } ];            if(ref($query->{criterias}) eq 'ARRAY') {
743            push @{$query->{criterias}}, { key => $query->{options}->{meta_label}, op => $op, val => $query->{options}->{meta_value} };
744          } else {
745            $query->{criterias} = [ { key => $query->{options}->{meta_label}, op => $op, val => $query->{options}->{meta_value} } ];    
746          }
747      }      }
748        
749      # 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 848  sub sendQuery { Line 864  sub sendQuery {
864        my $nodename = $query->{node};              my $nodename = $query->{node};      
865        my $newnode = $self->createNode($nodename);        my $newnode = $self->createNode($nodename);
866        my $id = $self->{_COREHANDLE}->insert($newnode);        my $id = $self->{_COREHANDLE}->insert($newnode);
867            
868        print "Saved new node $nodename with GUID $newnode->{guid}, OID '$id': " . Dumper($newnode) . "\n";        $logger->info( __PACKAGE__ . "->sendQuery: Saved new node $nodename with GUID $newnode->{guid}, OID '$id'.");
869                
870        return $newnode;        return $newnode;
871    
# Line 1036  sub createNode { Line 1052  sub createNode {
1052          # because they maybe exists and should only be SETTED not CREATED!          # because they maybe exists and should only be SETTED not CREATED!
1053          # TODO: Create a flag at the scheme for that reason!          # TODO: Create a flag at the scheme for that reason!
1054          #   (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)
1055          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') {
1056            #$obj->{$_} = undef();            #$obj->{$_} = undef();
1057          } else {          } else {
1058            $obj->{$_} = $self->createNode($attr_options->{$_}->{class});            $obj->{$_} = $self->createNode($attr_options->{$_}->{class});

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.49

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