If this problem persists, please notify us. Include a copy of this error page with your message. Thanks.
QQ_TROUBLE_QQ 'notify' => <<"QQ_NOTIFY_QQ", Please notify us. Include a copy of this error page with your message. Thanks.
QQ_NOTIFY_QQ 'ourFault' => <<"QQ_FAULT_QQ",
This is our fault! There is apparently a problem with our software that we may not know about. Please notify us! Include a copy of this error page with your message. Thanks.
QQ_FAULT_QQ 'techDiff' => <<"QQ_TECH_QQ",
We are experiencing technical difficulties now.
We will have the problem fixed soon. Sorry for any inconvenience.
QQ_TECH_QQ
);
### Miscellaneous URLs. Configure as desired for your site.
my $Not_found_url = 'http://genome-www.stanford.edu/Sacch3D/notfound.html';
my $Tmp_url = 'http://genome-www.stanford.edu/tmp/';
=head1 APPENDIX
Methods beginning with a leading underscore are considered private
and are intended for internal use by this module. They are
B
(missing HTML for \"$arg\")
";
}
###
### Below are accessors specialized for the Saccharomyces Genome Database
### It is possible that they will be moved to Bio::SGD::WWW.pm in the future.
###
=head2 sgd_url
Usage : $BioWWW->sgd_url(" formatted html.
Argument : n/a
Throws : n/a
Status : Experimental
=cut
#--------
sub pre {
#--------
my $self = shift;
"
\n".shift()."\n
";
}
#----------------
sub html_footer {
#----------------
my( $self, @param ) = @_;
my( $linkTo, $linkText, $modified, $mail, $mailText, $top) =
$self->_rearrange([qw(LINKTO LINKTEXT MODIFIED MAIL MAILTEXT TOP)], @param);
$modified = (scalar $modified)
? qq|
| : '';
$top = qq|Top|; ## Utilizing the HTML bug/feature wherein
## a bogus name anchor defaults to the
## top of the page.
return <<"HTML";
$top | $linkText
$modified
$mailText
HTML
}
=head2 strip_html
Usage : $boolean = &strip_html( string_ref, [fast] );
Purpose : Removes HTML formatting from a supplied string.
Returns : Boolean: true if string was stripped, false if not.
Argument : string_ref = reference to a string containing the whole
: web page to be stripped.
: fast = a non-zero value. Optional. If set, a faster
: but perhaps less thorough procedure is used for
: stripping. Default = not fast.
Throws : Exception if the argument is not a scalar reference.
Comments : Based on code originally written by Alex Dong Li
: (ali@genet.sickkids.on.ca).
: This is a more generic version of the function that appears
: in Bio::Tools::Blast::HTML.pm
: This version does not perform any Blast-specific stripping.
:
: This employs a simple method for removing tags that
: will fail under following conditions:
: 1) if quoted > appears in a tag (does this ever happen?)
: 2) if a tag is split over multiple lines and this method is
: used to process one line at a time.
:
: Without fast mode, large HTML files can take exceedingly long times to
: strip (e.g., 1Meg file with many tags can take 10 minutes versus 5 seconds
: in fast mode. Try the swissprot yeast table). If you know the HTML to be
: well-behaved (i.e., tags are not split across mutiple lines), use fast
: mode for large, dense files.
=cut
#---------------
sub strip_html {
#---------------
my ($self, $string_ref, $fast) = @_;
ref $string_ref eq 'SCALAR' or
$self->throw("Can't strip HTML: ".
"Argument is should be a SCALAR reference not a ${\ref $string_ref}");
my $str = $$string_ref;
my $stripped = 0;
if($fast) {
# MULTI-STRING-MODE: Much faster than single-string mode
# but will miss tags that span multiple lines.
# This is fine if you know the HTML to be "well-behaved".
my @lines = split("\n", $str);
foreach (@lines) {
s/<[^>]+>| //gi and $stripped = 1;
}
# This regexp likely won't work properly in this mode.
foreach (@lines) {
s/(\A|\n)>\s+/\n\n>/gi and $stripped = 1;
}
$$string_ref = join ("\n", @lines);
} else {
# SINGLE-STRING-MODE: Can be very slow for long strings with many substitutions.
# Removing all "<>" tags.
$str =~ s/<[^>]+>| //sgi and $stripped = 1;
# Re-uniting any lone '>' characters. Not really necessary for functional HTML
$str =~ s/(\A|\n)>\s+/\n\n>/sgi and $stripped = 1;
$$string_ref = $str;
}
$stripped;
}
1;
__END__
########################################################################
## END OF CLASS
########################################################################
=head1 FOR DEVELOPERS ONLY
=head2 Data Members
An instance of Bio::Tools::WWW.pm is a blessed reference to a hash containing
all or some of the following fields:
FIELD VALUE
--------------------------------------------------------------
_started_html Defined the on the initial invocation of start_html()
to avoid duplicate printing out the "Content-type..." header.
=cut
1;