[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.3, Wed Oct 25 21:06:09 2006 UTC revision 1.5, Tue Apr 10 04:00:31 2007 UTC
# Line 2  Line 2 
2    
3  =head1 Protein Page Link  =head1 Protein Page Link
4    
5  This is a simple redirection script that takes a feature name as input and opens  This is a simple redirection script that takes a string as input and opens
6  the appropriate protein page. The feature name can be a FIG feature ID or  the appropriate page.
 an external alias.  
7    
8  This script supports the following CGI query parameters.  This script supports the following CGI query parameters.
9    
# Line 13  Line 12 
12  =item id  =item id
13    
14  ID of the desired feature. This can be a FIG ID or an alias. If it is preceded  ID of the desired feature. This can be a FIG ID or an alias. If it is preceded
15  by C<nmpdr|>, then we will try to force the Sprout protein page. If it is preceded  by C<nmpdr|>, then we will try to force the Sprout protein page.
16  by C<sv|>, then we will try to force the Seed Viewer.  
17    =item sop
18    
19    ID of a procedure in the SEED wiki.
20    
21  =back  =back
22    
# Line 25  Line 27 
27  use CGI;  use CGI;
28  use URI::Escape;  use URI::Escape;
29    
30    my $url;
31    
32  my $cgi = CGI->new();  my $cgi = CGI->new();
33  ETracing($cgi);  ETracing($cgi);
34  eval {  eval {
35        #check for SOP
36        my $sopID = $cgi->param('sop');
37        if ($sopID) {
38            if ($sopID =~ /SOP010/i) {
39                    $url = "http://www.theseed.org/w/images/2/23/Annotation_sop.pdf";
40                    print $cgi->redirect(-uri => $url);
41            } else {
42                    Confess("Invalid SOP number");
43            }
44        } else {
45      # Get the protein ID.      # Get the protein ID.
46      my $pegID = $cgi->param('id');      my $pegID = $cgi->param('id');
47      if (! $pegID) {      if (! $pegID) {
# Line 35  Line 49 
49          Confess("No ID specified.");          Confess("No ID specified.");
50      } else {      } else {
51          # The code will compute a redirection URL and put it in the variable below.          # The code will compute a redirection URL and put it in the variable below.
         my $url;  
52          # Check for an NMPDR or SEED viewer ID.          # Check for an NMPDR or SEED viewer ID.
53          if ($pegID =~ /^nmpdr\|(.+)$/) {          if ($pegID =~ /^nmpdr\|(.+)$/) {
54              # Escape the PEG found.              # Escape the PEG found.
# Line 58  Line 71 
71          }          }
72          print $cgi->redirect(-uri => $url);          print $cgi->redirect(-uri => $url);
73      }      }
74        }
75  };  };
76  if ($@) {  if ($@) {
77      # Get the error message.      # Get the error message.

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3