--- loncom/interface/lonsearchcat.pm 2001/03/21 03:06:50 1.56 +++ loncom/interface/lonsearchcat.pm 2001/03/21 03:40:39 1.59 @@ -107,7 +107,7 @@ END { my $fh=Apache::File->new($r->dir_config('lonTabDir').'/language.tab'); map { - $_=~/(\w+)\s+([\w\s\-]+)/; + $_=~/(\w+)\s+([\w\s\-]+)/; chomp; $language{$1}=$2; } <$fh>; } @@ -117,7 +117,7 @@ END { my $fh=Apache::File->new($r->dir_config('lonIncludes').'/copyright.tab'); map { - $_=~/(\w+)\s+([\w\s\-]+)/; + $_=~/(\w+)\s+([\w\s\-]+)/; chomp; $cprtag{$1}=$2; } <$fh>; } @@ -127,7 +127,7 @@ END { my $fh=Apache::File->new($r->dir_config('lonTabDir').'/filetypes.tab'); map { - $_=~/(\w+)\s+(\w+)\s+([\w\s\-]+)/; + $_=~/(\w+)\s+(\w+)\s+([\w\s\-]+)/; chomp; $mimetag{$1}=".$1 $3"; } <$fh>; } @@ -494,13 +494,24 @@ sub advancedsearch { my @queries; # Go through logical expression AND/OR/NOT phrase fields. - foreach my $field ('title','author','subject','notes','abstract') { + + foreach my $field ('title','author','subject','notes','abstract','url', + 'keywords','version','owner') { if ($ENV{'form.'.$field}) { push @queries,&build_SQL_query($field,$ENV{'form.'.$field}); } } + if ($ENV{'form.language'} and $ENV{'form.language'} ne 'any') { + push @queries,"(language like \"\%$ENV{'form.language'}\%\")"; + } + if ($ENV{'form.mime'} and $ENV{'form.mime'} ne 'any') { + push @queries,"(mime like \"\%$ENV{'form.mime'}\%\")"; + } + if ($ENV{'form.copyright'} and $ENV{'form.copyright'} ne 'any') { + push @queries,"(copyright like \"\%$ENV{'form.copyright'}\%\")"; + } if (@queries) { - $query=join(" and ",@queries); + $query=join(" AND ",@queries); $query="select * from metadata where $query"; my $reply=&Apache::lonnet::metadata_query($query); &output_results('Advanced',$r,$envhash,$query,$reply); @@ -784,7 +795,6 @@ sub detailed_citation_view { $notes,$shortabstract,$mime,$lang, $creationdate,$lastrevisiondate,$owner,$copyright, $hostname,$httphost)=@_; - return 'abc'; my $result=<$owner, last revised $lastrevisiondate

$title

@@ -855,7 +865,7 @@ sub xml_sgml_view { my $result=< <LonCapaResource> -<url>http://$httphost$url</url> +<url>$url</url> <title>$title</title> <author>$author</author> <subject>$subject</subject> @@ -878,6 +888,7 @@ sub xml_sgml_view { </copyrightInfo> <repositoryLocation>$hostname</repositoryLocation> <shortabstract>$shortabstract</shortabstract> +</LonCapaResource> END return $result;