[Bio] / FigWebServices / cv.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/cv.cgi

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

revision 1.11, Wed Oct 26 20:09:56 2005 UTC revision 1.15, Thu Nov 10 20:18:17 2005 UTC
# Line 10  Line 10 
10  use CGI;  use CGI;
11  use Tracer;  use Tracer;
12    
 print STDERR "NEW LOAD of PAGE\n";  
   
13  my $cgi = new CGI;  my $cgi = new CGI;
14    
15  use HTML;  use HTML;
# Line 119  Line 117 
117      if ( $cgi->param('search_term') && $cgi->param('select_cv') ) {      if ( $cgi->param('search_term') && $cgi->param('select_cv') ) {
118          $search_term=$cgi->param('search_term');          $search_term=$cgi->param('search_term');
119          $cv=$cgi->param('select_cv');          $cv=$cgi->param('select_cv');
120          $search_results = &search($fig,$cgi,$html,$peg,$cv,$search_term);          $search_results = $fig->search_cv_file($cv,$search_term);
121      }      }
122  }  }
123  elsif ($cgi->param('request') eq "Add New Terms")  elsif ($cgi->param('request') eq "Add New Terms")
# Line 163  Line 161 
161      }      }
162  }  }
163    
164  elsif ($cgi->param('request') eq "Add Manual Term")  elsif ($cgi->param('request') eq "Add Term Manually")
165  {  {
166      if (!$cgi->param('user'))      if (!$cgi->param('user'))
167      {      {
# Line 209  Line 207 
207      }      }
208  }  }
209    
210  sub search  # moved to FIG.pm
211  {  #sub search_cv_file
212      my ($fig,$cgi,$html,$peg,$cv,$search_term) =@_;  #{
213      $file = $FIG_Config::global."/cv_search_".$cv.".txt";  ##    my ($fig,$cgi,$html,$peg,$cv,$search_term) =@_;
214      if (! open(LOOKUP,"$file") ) {  #    my ($cv,$search_term) =@_;
215          $error_message="Search could not find vocabulary file, $file";  #    $file = $FIG_Config::global."/CV/cv_search_".$cv.".txt";
216          return;  #    if (! open(LOOKUP,"$file") ) {
217      }  #       print STDERR "Search could not find vocabulary file, $file";
218      my @lines = <LOOKUP>;  #       return;
219      my @grep_results = grep(/$search_term/i,@lines);  #    }
220       return [@grep_results];  #    my @lines = <LOOKUP>;
221      #my $search_results = [@grep_results];  #    my @grep_results = grep(/$search_term/i,@lines);
222      #&show_search_results($fig,$cgi,$html,$peg,$cv,$search_results);  #     return [@grep_results];
223  }  #}
224    
225  sub add_terms  sub add_terms
226  {  {
227        print STDERR "add_terms called!\n";
228      my ($fig,$cgi,$html,$peg,$id_term_to_source) =@_ ;      my ($fig,$cgi,$html,$peg,$id_term_to_source) =@_ ;
229      my @id_term = keys(%{$id_term_to_source});      my @id_term = keys(%{$id_term_to_source});
230      #my %sources={};   #in case someday we allow adds from >1 vocab at once      #my %sources={};   #in case someday we allow adds from >1 vocab at once
# Line 240  Line 239 
239         my $term = $temp[1];         my $term = $temp[1];
240         my $status = $fig->add_cv_term( $user, $peg, $source, $id, $term);         my $status = $fig->add_cv_term( $user, $peg, $source, $id, $term);
241         if (!$status) {         if (!$status) {
242             print "$peg- Added ($source, $id, $term)\n";             #print STDERR "$peg- Added ($source, $id, $term)\n";
243               #&HTML::show_page($cgi, \@html);
244         }         }
245         else         else
246         {         {
247             print STDERR "$peg- Error for ($source, $id, $term):\t$status\n";             print STDERR "$peg- Error for ($source, $id, $term):\t$status\n";
248             my(@html);             my(@html);
249             push(@html, $cgi->p("$peg- Error for ($source, $id, $term):\t$status\n"));             push(@html, $cgi->p("$peg- Error for ($source, $id, $term):\t$status\n"));
250             #&HTML::show_page($cgi, \@html, 1);             &HTML::show_page($cgi, \@html, 1);
251             #exit;             exit;
252          }          }
253    
254    
# Line 359  Line 359 
359      "<h4>Search for New Terms to Add </h4>\n",      "<h4>Search for New Terms to Add </h4>\n",
360      "<select name=select_cv>      "<select name=select_cv>
361          <option value=GO  >Gene Ontology</option>          <option value=GO  >Gene Ontology</option>
362            <option value=HUGO  >HUGO Gene Nomenclature Committee</option>
363       </select> &nbsp;&nbsp",       </select> &nbsp;&nbsp",
364      $cgi->textfield(-name => 'search_term', -size => 20),      $cgi->textfield(-name => 'search_term', -size => 20),
365      $cgi->submit(-name=>'request', -value=>'Search Selected Controlled Vocabulary'),      $cgi->submit(-name=>'request', -value=>'Search Selected Controlled Vocabulary'),
# Line 374  Line 375 
375      $cgi->hidden(-name=>'prot', -value=>'$peg'),      $cgi->hidden(-name=>'prot', -value=>'$peg'),
376      $cgi->hidden(-name=>'user', -value=>'$user'),      $cgi->hidden(-name=>'user', -value=>'$user'),
377      $cgi->hr,      $cgi->hr,
378      "<h4>Add Terms Manually (WARNING: This is strongly discouraged to avoid data entry errors.)</h5>",      "<h4>Add Term Manually (WARNING: This is strongly discouraged to avoid data entry errors.)</h5>",
379      "<h5>Vocabulary Name (single word, no spaces or punctuation), e.g., MyVocab </h5>\n",      "<h5>Vocabulary Name (single word, no spaces or punctuation), e.g., MyVocab </h5>\n",
380      $cgi->textfield(-name => 'manual_source', -size => 48, -default=>'', -override=>1 ),      $cgi->textfield(-name => 'manual_source', -size => 48, -default=>'', -override=>1 ),
381      "<h5>Term ID (single word, no spaces or punctuation), e.g., A147</h5>\n",      "<h5>Term ID (single word, no spaces or punctuation), e.g., A147</h5>\n",

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.15

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3