[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

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

revision 1.374, Sat Oct 8 14:14:47 2005 UTC revision 1.375, Tue Oct 11 20:38:38 2005 UTC
# Line 7759  Line 7759 
7759    
7760  =cut  =cut
7761    
7762    sub find_by_attribute {
7763        # search by substrings in attribute values or attribute tags.
7764        # This might replace the present search-for-attributes that works by
7765        # glimpse.  The problem with the present approach is that you can't
7766        # search until you rebuild indices with make_attribute_index
7767        #
7768    
7769        my($self,$searchTerm)=@_;
7770        return unless( $searchTerm);
7771        my $rdbH = $self->db_handle;
7772    
7773        my $relational_db_response=$rdbH->SQL("SELECT fid,tag, val from attribute WHERE tag LIKE '%$searchTerm%' OR val LIKE '%$searchTerm%'");
7774        my @results;
7775    
7776        foreach my $res (@$relational_db_response) {
7777            my ($fid, $tag, $value)=@$res;
7778            $tag =~ s/^\s+//; $tag =~ s/\s+$//;
7779            push (@results, [$fid, $tag, $value]);
7780        }
7781        return @results;
7782    }
7783    
7784    
7785    
7786  sub add_attribute {  sub add_attribute {
7787      my($self,$peg,$k,$v, $url, $notl) = @_;      my($self,$peg,$k,$v, $url, $notl) = @_;
7788      return unless ($peg && $k); # we must have at least a peg and a tag to add (though other things can be undef)      return unless ($peg && $k); # we must have at least a peg and a tag to add (though other things can be undef)

Legend:
Removed from v.1.374  
changed lines
  Added in v.1.375

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3