--- loncom/interface/lonsearchcat.pm 2004/04/19 17:44:47 1.211 +++ loncom/interface/lonsearchcat.pm 2004/04/19 21:46:50 1.212 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.211 2004/04/19 17:44:47 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.212 2004/04/19 21:46:50 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -74,6 +74,7 @@ use Apache::lonmeta; use Apache::lonhtmlcommon; use Apache::lonlocal; use LONCAPA::lonmetadata(); +use HTML::Entities(); ###################################################################### ###################################################################### @@ -1061,7 +1062,7 @@ sub parse_advanced_search { $fillflag++; } } - unless ($fillflag) { + if (! $fillflag) { &output_blank_field_error($r,$closebutton, 'phase=disp_adv',$hidden_fields); return ; @@ -1717,12 +1718,13 @@ Returns: the identifier of the table on sub set_up_table_structure { my ($datatypes,$fullindicies) = &LONCAPA::lonmetadata::describe_metadata_storage(); - unshift(@$datatypes,{name => 'id', + # Copy the table description before modifying it... + @Datatypes = @{$datatypes}; + unshift(@Datatypes,{name => 'id', type => 'MEDIUMINT', restrictions => 'UNSIGNED NOT NULL', primary_key => 'yes', auto_inc => 'yes' }); - @Datatypes = @{$datatypes}; @Fullindicies = @{$fullindicies}; return; } @@ -1926,6 +1928,7 @@ END &update_status($r,'contacting '.$Servers_to_contact[0]); while (($time_remaining > 0) && ((@Servers_to_contact) || keys(%Server_status))) { + $time_remaining = $max_time - (time - $starttime) ; &update_seconds($r,$time_remaining); # Send out a search request if it needs to be done. if (@Servers_to_contact) { @@ -2201,6 +2204,7 @@ sub display_results { } my $prefix=&catalogmode_output($Fields{'title'},$Fields{'url'}, $Fields{'id'},$checkbox_num++); + # Render the result into html $output.= &$viewfunction($prefix,%Fields); # Print them out as they come in. @@ -2716,34 +2720,38 @@ END ###################################################################### sub xml_sgml_view { my ($prefix,%values) = @_; + my $xml = < +$values{'url'} +$values{'title'} +$values{'author'} +$values{'subject'} +$values{'keywords'} +$values{'notes'} + +$values{'mime'} +$values{'mimetag'} + + +$values{'language'} +$values{'languagetag'} + +$values{'creationdate'} +$values{'lastrevisiondate'} +$values{'owner'} + +$values{'copyright'} +$values{'copyrighttag'} + +$values{'hostname'} +$values{'shortabstract'} + +END + $xml = &HTML::Entities::encode($xml,'<>&'); my $result=< -<LonCapaResource> -<url>$values{'url'}</url> -<title>$values{'title'}</title> -<author>$values{'author'}</author> -<subject>$values{'subject'}</subject> -<keywords>$values{'keywords'}</keywords> -<notes>$values{'notes'}</notes> -<mimeInfo> -<mime>$values{'mime'}</mime> -<mimetag>$values{'mimetag'}</mimetag> -</mimeInfo> -<languageInfo> -<language>$values{'language'}</language> -<languagetag>$values{'languagetag'}</languagetag> -</languageInfo> -<creationdate>$values{'creationdate'}</creationdate> -<lastrevisiondate>$values{'lastrevisiondate'}</lastrevisiondate> -<owner>$values{'owner'}</owner> -<copyrightInfo> -<copyright>$values{'copyright'}</copyright> -<copyrighttag>$values{'copyrighttag'}</copyrighttag> -</copyrightInfo> -<repositoryLocation>$values{'hostname'}</repositoryLocation> -<shortabstract>$values{'shortabstract'}</shortabstract> -</LonCapaResource> +$xml $values{'extrashow'}