--- nfo/perl/libs/Data/Storage/Handler/Tangram.pm 2003/04/11 01:18:53 1.34 +++ nfo/perl/libs/Data/Storage/Handler/Tangram.pm 2003/04/19 16:09:48 1.35 @@ -1,8 +1,11 @@ ############################################ # -# $Id: Tangram.pm,v 1.34 2003/04/11 01:18:53 joko Exp $ +# $Id: Tangram.pm,v 1.35 2003/04/19 16:09:48 jonen Exp $ # # $Log: Tangram.pm,v $ +# Revision 1.35 2003/04/19 16:09:48 jonen +# + added operator dispatching (currently for getting ref-type) at 'getListFiltered' +# # Revision 1.34 2003/04/11 01:18:53 joko # sendQuery: # + introduced crud action 'DELETE' @@ -506,8 +509,14 @@ # objects => $objects, # ); - # HACK: build eval-string (sorry) to get filtered list - please give advice here - push @tfilters, '$remote->{' . $filter->{key} . '}' . " $filter->{op} '$filter->{val}'"; + # TODO: is_op? + # dispatch un-common operators if exists + if($filter->{op} eq "ref") { + push @tfilters, 'ref($remote->{' . $filter->{key} . '})' . " eq '$filter->{val}'"; + } else { + # HACK: build eval-string (sorry) to get filtered list - please give advice here + push @tfilters, '$remote->{' . $filter->{key} . '}' . " $filter->{op} '$filter->{val}'"; + } } @@ -590,8 +599,13 @@ } elsif (my $guid = $query->{options}->{GUID}) { $type = 'TRANSPARENT'; - $query->{criterias} = [ { key => 'guid', op => 'eq', val => $guid } ]; - + $query->{criterias} = [ { key => 'guid', op => 'eq', val => $guid } ]; + + # if operator is different (dispatcher for 'getListFiltered') + } elsif (my $op = $query->{options}->{op}) { + $type = 'TRANSPARENT'; + $query->{criterias} = [ { key => $query->{options}->{meta_label}, op => $op, val => $query->{options}->{meta_value} } ]; + } # HACK: special case: querying by id does not translate into a common tangram query