--- loncom/interface/lonsearchcat.pm 2001/10/16 17:12:51 1.101 +++ loncom/interface/lonsearchcat.pm 2001/11/28 14:02:31 1.104 @@ -3,11 +3,13 @@ # Search Catalog # # YEAR=2001 -# 03/08/2001 Scott Harrison -# Scott Harrison: 03/12/2001, 03/13/2001, 03/14/2001, 03/15/2001, 03/19/2001 -# Scott Harrison: 03/20/2001, 03/21/2001, 03/22/2001, 03/26/2001, 03/27/2001 -# Scott Harrison: 04/02/2001, 08/15/2001, 08/24/2001, 08/25/2001 -# 10/12,10/14,10/15 Scott Harrison +# 3/8, 3/12, 3/13, 3/14, 3/15, 3/19 Scott Harrison +# 3/20, 3/21, 3/22, 3/26, 3/27, 4/2, 8/15, 8/24, 8/25 Scott Harrison +# 10/12,10/14,10/15,10/16,11/28 Scott Harrison +# +# $Id: lonsearchcat.pm,v 1.104 2001/11/28 14:02:31 harris41 Exp $ +# +### ############################################################################### ## ## @@ -203,7 +205,7 @@ my $domain = ""; # ----------------------------- Handling routine called via Apache and mod_perl sub handler { my $r = shift; - + untie %hash; &get_unprocessed_cgi(); $r->content_type('text/html'); @@ -212,7 +214,7 @@ sub handler { $domain = $r->dir_config('lonDefDomain'); - $diropendb = "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db"; + $diropendb= "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_searchcat.db"; if ($ENV{'form.launch'} eq '1') { if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) { @@ -917,7 +919,7 @@ sub output_results { my %ENV=%{$envhash}; my %rhash=%{$replyref}; my $compiledresult=''; - my $timeremain=30; + my $timeremain=300; my $elapsetime=0; my $resultflag=0; my $tflag=1; @@ -982,6 +984,11 @@ SCRIPT 'scrollbars=1,width=400,height=300'); openhelpwin.focus(); } + function abortsearch(val) { + openhelpwin=open('/adm/help/searchcat.html','helpscreen', + 'scrollbars=1,width=400,height=300'); + openhelpwin.focus(); + } SCRIPT $r->rflush(); @@ -1090,7 +1097,7 @@ RESULTS '<'+'br />'+ ' <'+'input type="button" name="button"'+ ' value="abort search and view current results" '+ - ' />'+ + ' onClick="javascript:opener.abortsearch()" />'+ ' <'+'input type="button" name="button"'+ ' value="help" onClick="javascript:opener.openhelp()" />'+ '<'+'/tt>'+ @@ -1102,10 +1109,15 @@ ENDPOP $r->rflush(); my $servercount=0; - $sn=0; my $hitcountsum=0; - foreach my $rkey (sort keys %rhash) { + my $bloop=$servernum; + my %orkey; + BLOOP: while(1) { + my $sn=0; + last BLOOP unless $bloop; + RLOOP: foreach my $rkey (sort keys %rhash) { $sn++; + next RLOOP if $orkey{$rkey}; $servercount++; $tflag=1; $compiledresult=''; @@ -1121,6 +1133,8 @@ ENDPOP 'src="/adm/lonIcons/srvbad.gif";'. "\n"); $r->rflush(); + $bloop--; + $orkey{$rkey}=1; } else { $reply=~/^([\.\w]+)$/; # must do since 'use strict' checks for tainting @@ -1142,8 +1156,10 @@ ENDPOP $r->rflush(); $tflag=0; } - last WLOOP if $temp>5; + last WLOOP if $temp>1; if (-e "$replyfile.end") { + $bloop--; + $orkey{$rkey}=1; if (-s $replyfile) { $r->print('