~ubuntu-branches/ubuntu/raring/bioperl/raring

« back to all changes in this revision

Viewing changes to doc/Deobfuscator/cgi-bin/deob_detail.cgi

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2008-03-18 14:44:57 UTC
  • mfrom: (4 hardy)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080318144457-1jjoztrvqwf0gruk
* debian/control:
  - Removed MIA Matt Hope (dopey) from the Uploaders field.
    Thank you for your work, Matt. I hope you are doing well.
  - Downgraded some recommended package to the 'Suggests' priority,
    according to the following discussion on Upstream's mail list.
    http://bioperl.org/pipermail/bioperl-l/2008-March/027379.html
    (Closes: #448890)
* debian/copyright converted to machine-readable format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
 
 
3
# Deob_detail.cgi
 
4
# part of the Deobfuscator package
 
5
# by Laura Kavanaugh and Dave Messina
 
6
#
 
7
# cared for by Dave Messina <dave-pause@davemessina.net>
 
8
#
 
9
# POD documentation - main docs before the code
 
10
 
 
11
=head1 NAME
 
12
 
 
13
deob_detail.cgi - displays a web page of detailed information about a BioPerl method
 
14
 
 
15
=head1 VERSION
 
16
 
 
17
This document describes deob_detail.cgi version 0.0.2
 
18
 
 
19
 
 
20
=head1 SYNOPSIS
 
21
 
 
22
This program is designed to be called by deob_interface.cgi. See
 
23
L</"DESCRIPTION"> for details.
 
24
 
 
25
To install deob_detail.cgi and the rest of the Deobfuscator package, see the
 
26
README.
 
27
 
 
28
 
 
29
=head1 DESCRIPTION
 
30
 
 
31
Deob_detail.cgi is called by deob_interface.cgi when a user clicks on a
 
32
method name. This program extracts the documentation about that method from
 
33
the Deobfuscator Berkeley DBs and returns it in some simple HTML formatting.
 
34
 
 
35
 
 
36
=head1 DIAGNOSTICS
 
37
 
 
38
None.
 
39
 
 
40
 
 
41
=head1 CONFIGURATION AND ENVIRONMENT
 
42
 
 
43
This program expects to have the 'methods.db' and 'packages.db' files in the
 
44
same directory as itself. These two files are automatically generated when
 
45
L<deob_index.pl> is run. If your installation requires that they be in a
 
46
different location, change the $BerkeleyDB_packages and $BerkeleyDB_methods
 
47
variables below to be fully qualified paths to the db files.
 
48
 
 
49
 
 
50
=head1 DEPENDENCIES
 
51
 
 
52
L<version>, L<CGI>, L<Deobfuscator>
 
53
 
 
54
 
 
55
=head1 INCOMPATIBILITIES
 
56
 
 
57
None reported.
 
58
 
 
59
 
 
60
=head1 BUGS AND LIMITATIONS
 
61
 
 
62
No bugs have been reported.
 
63
 
 
64
 
 
65
=head1 FEEDBACK
 
66
 
 
67
=head2 Mailing Lists
 
68
 
 
69
User feedback is an integral part of the evolution of this and other
 
70
Bioperl modules. Send your comments and suggestions preferably to one
 
71
of the Bioperl mailing lists.  Your participation is much appreciated.
 
72
 
 
73
  bioperl-l@bioperl.org                  - General discussion
 
74
  http://www.bioperl.org/wiki/Mailing_lists   - About the mailing lists
 
75
 
 
76
=head2 Reporting Bugs
 
77
 
 
78
Report bugs to the Bioperl bug tracking system to help us keep track
 
79
the bugs and their resolution.  Bug reports can be submitted via the
 
80
web:
 
81
 
 
82
  http://bugzilla.open-bio.org/
 
83
 
 
84
 
 
85
=head1 SEE ALSO
 
86
 
 
87
L<Deobfuscator>, L<deob_interface.cgi>, L<deob_index.pl>
 
88
 
 
89
 
 
90
=head1 AUTHOR
 
91
 
 
92
Laura Kavanaugh
 
93
 
 
94
 
 
95
=head1 CONTRIBUTORS
 
96
 
 
97
=over
 
98
 
 
99
=item Dave Messina C<< <dave-pause@davemessina.net> >>
 
100
 
 
101
=item David Curiel
 
102
 
 
103
=back
 
104
 
 
105
 
 
106
=head1 ACKNOWLEDGMENTS
 
107
 
 
108
This software was developed originally at the Cold Spring Harbor Laboratory's
 
109
Advanced Bioinformatics Course between Oct 12-25, 2005. Many thanks to David
 
110
Curiel, who provided much-needed guidance and assistance on this project.
 
111
 
 
112
 
 
113
=head1 LICENSE AND COPYRIGHT
 
114
 
 
115
Copyright (C) 2005-6 Laura Kavanaugh and Dave Messina. All Rights Reserved.
 
116
 
 
117
This module is free software; you may redistribute it and/or modify it under the same terms as Perl itself. See L<perlartistic>.
 
118
 
 
119
 
 
120
=head1 DISCLAIMER
 
121
 
 
122
This software is provided "as is" without warranty of any kind.
 
123
 
 
124
=cut
 
125
 
 
126
 
 
127
# Let the code begin...
 
128
 
 
129
## HARDCODED VALUES ##
 
130
# Change these to fit your installation.
 
131
use lib './lib';
 
132
my $BerkeleyDB_packages = './packages.db';
 
133
my $BerkeleyDB_methods  = './methods.db';
 
134
 
 
135
## You shouldn't need to change anything below here ##
 
136
 
 
137
use version; $VERSION = qv('0.0.2');
 
138
use warnings;
 
139
use strict;
 
140
use CGI ':standard';
 
141
use Deobfuscator;
 
142
 
 
143
# Open BerkeleyDBs
 
144
my $packages_ref = Deobfuscator::open_db($BerkeleyDB_packages);
 
145
my $methods_ref  = Deobfuscator::open_db($BerkeleyDB_methods);
 
146
 
 
147
# 'method' is the name of the method passed in from deob_interface.cgi
 
148
my $class_method = param('method');
 
149
 
 
150
# Get all of the documentation fields out of the db
 
151
my $title
 
152
    = Deobfuscator::get_method_docs( $methods_ref, $class_method, "title" );
 
153
if ( $title eq "0" ) { $title = "not documented"; }
 
154
 
 
155
my $usage
 
156
    = Deobfuscator::get_method_docs( $methods_ref, $class_method, "usage" );
 
157
if ( $usage eq "0" ) { $usage = "not documented"; }
 
158
 
 
159
my $function = Deobfuscator::get_method_docs( $methods_ref, $class_method,
 
160
    "function" );
 
161
if ( $function eq "0" ) { $function = "not documented"; }
 
162
 
 
163
my $returns
 
164
    = Deobfuscator::get_method_docs( $methods_ref, $class_method, "returns" );
 
165
if ( $returns eq "0" ) { $returns = "not documented"; }
 
166
 
 
167
my $args
 
168
    = Deobfuscator::get_method_docs( $methods_ref, $class_method, "args" );
 
169
if ( $args eq "0" ) { $args = "not documented"; }
 
170
 
 
171
### Make the output page
 
172
 
 
173
# Start the page
 
174
print header;
 
175
print start_html($class_method);
 
176
 
 
177
# Define some styles
 
178
my $style1
 
179
    = qq{style="border-collapse:collapse;border:solid black 1px;font-family:verdana;font-size:10px;background-color:lightgrey"};
 
180
my $style2
 
181
    = qq{style="border-collapse:collapse;border:solid black 1px;font-family:verdana;font-size:10px"};
 
182
my $style3
 
183
    = qq{style="border-collapse:collapse;border:solid black 1px;font-family:verdana;font-size:14px"};
 
184
 
 
185
# open the table
 
186
print '<div style="border:solid black 1px; width:100%; height:200; overflow:auto">';
 
187
print '<table width="100%" $style3>';
 
188
print "<tr><td colspan=4><center>$class_method</center></td></tr>";
 
189
 
 
190
my @sections = ('Usage', 'Function', 'Returns', 'Args');
 
191
my $sec_ndx = 0;
 
192
 
 
193
foreach my $section ($usage, $function, $returns, $args) {
 
194
 
 
195
        my $section_html = Deobfuscator::htmlify($section);
 
196
        print "<tr><td $style1>$sections[$sec_ndx++]</td><td $style2>$section_html</td></tr>\n";
 
197
}
 
198
 
 
199
# close the table
 
200
print "</table></div>";
 
201
 
 
202
# finish the page
 
203
print end_html;
 
204
 
 
205
# close BerkeleyDB
 
206
Deobfuscator::close_db($BerkeleyDB_packages);
 
207
Deobfuscator::close_db($BerkeleyDB_methods);
 
208
 
 
209
__END__
 
 
b'\\ No newline at end of file'