version 1.135, 2002/07/03 20:10:14
|
version 1.137, 2002/07/08 14:28:10
|
Line 1107 sub output_results {
|
Line 1107 sub output_results {
|
my $elapsetime=0; |
my $elapsetime=0; |
my $resultflag=0; |
my $resultflag=0; |
my $tflag=1; |
my $tflag=1; |
my $viewselect=$ENV{'form.viewselect'}; |
## |
|
## Set viewing function |
|
## |
|
my $viewfunction = undef; |
|
if ($ENV{'form.viewselect'} eq 'Detailed Citation View') { |
|
$viewfunction = \&detailed_citation_view; |
|
} elsif ($ENV{'form.viewselect'} eq 'Summary View') { |
|
$viewfunction = \&summary_view; |
|
} elsif ($ENV{'form.viewselect'} eq 'Fielded Format') { |
|
$viewfunction = \&fielded_format_view; |
|
} elsif ($ENV{'form.viewselect'} eq 'XML/SGML') { |
|
$viewfunction = \&xml_sgml_view; |
|
} |
|
if (!defined($viewfunction)) { |
|
$r->print("Internal Error - Bad view selected.\n"); |
|
$r->rflush(); |
|
return; |
|
} |
# |
# |
# make query information persistent to allow for subsequent revision |
# make query information persistent to allow for subsequent revision |
my $persistent=&make_persistent(\%ENV); |
my $persistent=&make_persistent(\%ENV); |
# spit out the results header |
# |
|
# Begin producing output |
$r->print(&search_results_header($mode)); |
$r->print(&search_results_header($mode)); |
$r->rflush(); |
$r->rflush(); |
|
# |
# begin showing the cataloged results |
# begin showing the cataloged results |
my $action = "/adm/searchcat"; |
my $action = "/adm/searchcat"; |
if ($mode eq 'Basic') { |
if ($mode eq 'Basic') { |
Line 1134 $persistent
|
Line 1153 $persistent
|
CATALOGCONTROLS |
CATALOGCONTROLS |
# |
# |
# make the pop-up window for status |
# make the pop-up window for status |
# |
|
$r->print(&make_popwin(%rhash)); |
$r->print(&make_popwin(%rhash)); |
$r->rflush(); |
$r->rflush(); |
## |
## |
Line 1211 CATALOGCONTROLS
|
Line 1229 CATALOGCONTROLS
|
} # end of if ($reply eq 'con_lost') else statement |
} # end of if ($reply eq 'con_lost') else statement |
my %Fields = undef; # Holds the data to be sent to the various |
my %Fields = undef; # Holds the data to be sent to the various |
# *_view routines. |
# *_view routines. |
my ($extrashow,$customfields,$customhash) = &handle_custom_fields(\@results); |
my ($extrashow,$customfields,$customhash) = |
|
&handle_custom_fields(\@results); |
my @customfields = @$customfields; |
my @customfields = @$customfields; |
my %customhash = %$customhash; |
my %customhash = %$customhash; |
untie %hash if (keys %hash); |
untie %hash if (keys %hash); |
Line 1228 CATALOGCONTROLS
|
Line 1247 CATALOGCONTROLS
|
chomp $result; |
chomp $result; |
next unless $result; |
next unless $result; |
%Fields = &parse_raw_result($result,$rkey); |
%Fields = &parse_raw_result($result,$rkey); |
|
# |
|
# Check copyright tags and skip results the user cannot use |
|
my (undef,undef,$resdom,$resname) = split('/',$Fields{'url'}); |
|
# Check for priv |
|
if (($Fields{'copyright'} eq 'priv') && |
|
(($ENV{'user.name'} ne $resname) && |
|
($ENV{'user.domain'} ne $resdom))) { |
|
$r->print("<pre>copyright = 'priv' -> Skipping $Fields{'url'}</pre>\n"); |
|
next; |
|
} |
|
# Check for domain |
|
if (($Fields{'copyright'} eq 'domain') && |
|
($ENV{'user.domain'} ne $resdom)) { |
|
$r->print("<pre>copyright = 'domain' -> Skipping $Fields{'url'}</pre>\n"); |
|
next; |
|
} |
|
# |
$Fields{'extrashow'}=$extrashow; |
$Fields{'extrashow'}=$extrashow; |
if ($extrashow) { |
if ($extrashow) { |
foreach my $field (@customfields) { |
foreach my $field (@customfields) { |
Line 1262 END
|
Line 1298 END
|
# <input type="hidden" name="url$fnum" value="$url" /> |
# <input type="hidden" name="url$fnum" value="$url" /> |
$fnum++; |
$fnum++; |
} |
} |
if ($viewselect eq 'Detailed Citation View') { |
# Render the result into html |
$compiledresult.=&detailed_citation_view |
$compiledresult.= &$viewfunction(%Fields, hostname => $rkey ); |
(%Fields, hostname => $rkey ); |
|
} |
|
elsif ($viewselect eq 'Summary View') { |
|
$compiledresult.=&summary_view |
|
(%Fields, hostname => $rkey ); |
|
} |
|
elsif ($viewselect eq 'Fielded Format') { |
|
$compiledresult.=&fielded_format_view |
|
(%Fields, hostname => $rkey ); |
|
} |
|
elsif ($viewselect eq 'XML/SGML') { |
|
$compiledresult.=&xml_sgml_view |
|
(%Fields, hostname => $rkey ); |
|
} |
|
if ($compiledresult or $servercount!=$servernum) { |
if ($compiledresult or $servercount!=$servernum) { |
$compiledresult.="<hr align='left' width='200' noshade />"; |
$compiledresult.="<hr align='left' width='200' noshade />"; |
} |
} |
Line 1288 END
|
Line 1310 END
|
$resultflag=1; |
$resultflag=1; |
$r->print($compiledresult); |
$r->print($compiledresult); |
} |
} |
my $percent=sprintf('%3.0f',($servercount/$servernum*100)); |
|
} # End of foreach loop over servers remaining |
} # End of foreach loop over servers remaining |
} # End of big loop - while($serversleft && $timeremain) |
} # End of big loop - while($serversleft && $timeremain) |
unless ($resultflag) { |
unless ($resultflag) { |