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

Annotation of /Clearinghouse/clearinghouse_register.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3