[Bio] / Clearinghouse / clearinghouse_register.pl Repository:
ViewVC logotype

Annotation of /Clearinghouse/clearinghouse_register.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download) (as text)

1 : disz 1.1 #!/usr/bin/perl
2 :    
3 :     use CH_Config;
4 :     use CGI qw/:standard/;
5 :     use File::Temp qw/ :mktemp /;
6 :    
7 :     use SOAP::Lite;
8 :    
9 : olson 1.3 use Clearinghouse::utils;
10 :    
11 : disz 1.1 print header,
12 :     start_html('Clearinghouse Genome and Feature Registration'),
13 : olson 1.3 get_page_header(),
14 : disz 1.1 h1('Clearinghouse Genome and Feature Registration');
15 :    
16 :     if (param('registergenome')) {
17 :     print_genome_results();
18 : disz 1.2 print_returns();
19 : disz 1.1 } elsif (param('registerfeature')) {
20 :     print_feature_results();
21 : disz 1.2 print_returns();
22 : disz 1.1 } else{
23 :     print_start();
24 :     }
25 :     print end_html;
26 :     exit;
27 :    
28 :    
29 :     sub print_start {
30 :     print start_multipart_form();
31 :     if (param('TYPE') eq 'genome') {
32 :     print h1("Genome Registration"),
33 : olson 1.4 "Your Genome Taxon: ", textfield(-name=>'taxon', -size=>30), br,br,
34 : disz 1.1 submit(-label=>'Register Genome', -name=>'registergenome');
35 :     } else {
36 :     print h1("Feature Registration"),
37 :     "Genome ID for your feature: ", textfield(-name=>'genomeid', -size=>20),
38 :     "Type of your feature: ", textfield(-name=>'type', -size=>10),br,br,
39 :     "Number of id's:", textfield(-name=>'number_of_ids', -size=>10),br,br,
40 :     submit(-label=>'Register Feature', -name=>'registerfeature');
41 :     }
42 :     print end_form;
43 :     }
44 :    
45 :     sub print_genome_results {
46 :     #here, make the web service calls to register this genome
47 :     my $taxon = param('taxon');
48 :    
49 :     my $proxy = SOAP::Lite-> uri('http://www.soaplite.com/Scripts')-> proxy($CH_Config::service_url);
50 :    
51 :     $response = $proxy->register_genome($taxon);
52 :     if ($response->fault) {
53 :     print "Failed to deposit: ", $response->faultcode, " ", $response->faultstring, br;
54 :     }
55 :     print "Your Genome id is $taxon.", $response->result, "   Remember to put this in your GFF3 file", br, br;
56 :    
57 :     }
58 :    
59 :     sub print_feature_results {
60 :     #here, make the web service calls to register this genome
61 :     my $genome = param('genomeid');
62 :     my $type = param('type');
63 :     my $number = param('number_of_ids');
64 :    
65 :     my $proxy = SOAP::Lite-> uri('http://www.soaplite.com/Scripts')-> proxy($CH_Config::service_url);
66 :    
67 :     $response = $proxy->register_feature($genome, $type, $number);
68 :     if ($response->fault) {
69 :     print "Failed to deposit: ", $response->faultcode, " ", $response->faultstring, br;
70 :     }
71 :     print "Your first id of $number id's is ", $response->result, "   Remember to put these in your GFF3 file", br, br;
72 :    
73 :     }
74 :    
75 : disz 1.2 sub print_returns() {
76 : disz 1.1 print a({href=>'clearinghouse_upload.cgi'}, "Go to Clearinghouse Home Page"), p;
77 :     print a({href=>"clearinghouse_browser.cgi"}, "Go to clearing house browser"), p;
78 :     print a({href=>'clearinghouse_register.cgi?TYPE=genome'}, "Go to Genome registration page"), p;
79 :     print a({href=>'clearinghouse_register.cgi?TYPE=feature'}, "Go Feature registration page");
80 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3