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

Diff of /FigWebServices/link.cgi

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

revision 1.5, Tue Apr 10 04:00:31 2007 UTC revision 1.6, Wed Feb 27 02:05:39 2008 UTC
# Line 32  Line 32 
32  my $cgi = CGI->new();  my $cgi = CGI->new();
33  ETracing($cgi);  ETracing($cgi);
34  eval {  eval {
35      #check for SOP      # Get the possible IDs.
36      my $sopID = $cgi->param('sop');      my $sopID = $cgi->param('sop');
37        my $genomeID = $cgi->param('genome');
38        my $pegID = $cgi->param('id');
39      if ($sopID) {      if ($sopID) {
40            # This is for the annotation SOP.
41          if ($sopID =~ /SOP010/i) {          if ($sopID =~ /SOP010/i) {
42                  $url = "http://www.theseed.org/w/images/2/23/Annotation_sop.pdf";                  $url = "http://www.theseed.org/w/images/2/23/Annotation_sop.pdf";
                 print $cgi->redirect(-uri => $url);  
43          } else {          } else {
44                  Confess("Invalid SOP number");                  Confess("Invalid SOP number");
45          }          }
46      } else {      } elsif ($genomeID) {
47          # Get the protein ID.          # Here we have an organism ID.
48          my $pegID = $cgi->param('id');          my $escapedID = uri_escape($genomeID);
49          if (! $pegID) {          $url = "$FIG_Config::nmpdr_site_url/FIG/seedviewer.cgi?page=BrowseGenome&organism=$escapedID";
50              # No protein ID, so we fail.      } elsif ($pegID) {
51              Confess("No ID specified.");          # Here we have a PEG ID.
         } else {  
             # The code will compute a redirection URL and put it in the variable below.  
             # Check for an NMPDR or SEED viewer ID.  
             if ($pegID =~ /^nmpdr\|(.+)$/) {  
                 # Escape the PEG found.  
52                  my $escapedID = uri_escape($1);                  my $escapedID = uri_escape($1);
53                  # If we have an NMPDR defined, use it.          $url = "$FIG_Config::nmpdr_site_url/FIG/seedviewer.cgi?page=Annotation&feature=$escapedID"
                 if ($FIG_Config::nmpdr_site_url) {  
                     $url = "$FIG_Config::nmpdr_site_url/FIG/protein.cgi?SPROUT=1;prot=$escapedID";  
54                  } else {                  } else {
55                      # No NMPDR, so we ask for a protein page.          Confess("Unrecognized identifier.");
                     $url = "protein.cgi?prot=$escapedID";  
                 }  
             } else {  
                 # Go to a protein page, but try to decide whether we should be SEED or Sprout.  
                 my $mode = $cgi->param('SPROUT');  
                 if (! defined $mode) {  
                     $mode = ($FIG_Config::nmpdr_site_url ? 1 : 0);  
                 }  
                 my $escapedID = uri_escape($pegID);  
                 $url = "protein.cgi?prot=$escapedID;SPROUT=$mode";  
56              }              }
57              print $cgi->redirect(-uri => $url);              print $cgi->redirect(-uri => $url);
         }  
     }  
58  };  };
59  if ($@) {  if ($@) {
60      # Get the error message.      # Get the error message.

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3