version 1.56, 2001/03/21 03:06:50
|
version 1.60, 2001/03/21 12:19:53
|
Line 107 END
|
Line 107 END
|
{ |
{ |
my $fh=Apache::File->new($r->dir_config('lonTabDir').'/language.tab'); |
my $fh=Apache::File->new($r->dir_config('lonTabDir').'/language.tab'); |
map { |
map { |
$_=~/(\w+)\s+([\w\s\-]+)/; |
$_=~/(\w+)\s+([\w\s\-]+)/; chomp; |
$language{$1}=$2; |
$language{$1}=$2; |
} <$fh>; |
} <$fh>; |
} |
} |
Line 117 END
|
Line 117 END
|
{ |
{ |
my $fh=Apache::File->new($r->dir_config('lonIncludes').'/copyright.tab'); |
my $fh=Apache::File->new($r->dir_config('lonIncludes').'/copyright.tab'); |
map { |
map { |
$_=~/(\w+)\s+([\w\s\-]+)/; |
$_=~/(\w+)\s+([\w\s\-]+)/; chomp; |
$cprtag{$1}=$2; |
$cprtag{$1}=$2; |
} <$fh>; |
} <$fh>; |
} |
} |
Line 127 END
|
Line 127 END
|
{ |
{ |
my $fh=Apache::File->new($r->dir_config('lonTabDir').'/filetypes.tab'); |
my $fh=Apache::File->new($r->dir_config('lonTabDir').'/filetypes.tab'); |
map { |
map { |
$_=~/(\w+)\s+(\w+)\s+([\w\s\-]+)/; |
$_=~/(\w+)\s+(\w+)\s+([\w\s\-]+)/; chomp; |
$mimetag{$1}=".$1 $3"; |
$mimetag{$1}=".$1 $3"; |
} <$fh>; |
} <$fh>; |
} |
} |
Line 494 sub advancedsearch {
|
Line 494 sub advancedsearch {
|
|
|
my @queries; |
my @queries; |
# Go through logical expression AND/OR/NOT phrase fields. |
# 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}) { |
if ($ENV{'form.'.$field}) { |
push @queries,&build_SQL_query($field,$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'}\%\")"; |
|
} |
|
my $datequery=&build_date_queries( |
|
$ENV{'form.creationdatestart_month'}, |
|
$ENV{'form.creationdatestart_day'}, |
|
$ENV{'form.creationdatestart_year'}, |
|
$ENV{'form.creationdateend_month'}, |
|
$ENV{'form.creationdateend_day'}, |
|
$ENV{'form.creationdateend_year'}, |
|
$ENV{'form.lastrevisiondatestart_month'}, |
|
$ENV{'form.lastrevisiondatestart_day'}, |
|
$ENV{'form.lastrevisiondatestart_year'}, |
|
$ENV{'form.lastrevisiondateend_month'}, |
|
$ENV{'form.lastrevisiondateend_day'}, |
|
$ENV{'form.lastrevisiondateend_year'}, |
|
); |
|
if ($datequery!~/^Incorrect/) { |
|
push @queries,$datequery; |
|
} |
|
else { |
|
&output_date_error($r,$datequery); |
|
} |
if (@queries) { |
if (@queries) { |
$query=join(" and ",@queries); |
$query=join(" AND ",@queries); |
$query="select * from metadata where $query"; |
$query="select * from metadata where $query"; |
my $reply=&Apache::lonnet::metadata_query($query); |
my $reply=&Apache::lonnet::metadata_query($query); |
&output_results('Advanced',$r,$envhash,$query,$reply); |
&output_results('Advanced',$r,$envhash,$query,$reply); |
Line 784 sub detailed_citation_view {
|
Line 815 sub detailed_citation_view {
|
$notes,$shortabstract,$mime,$lang, |
$notes,$shortabstract,$mime,$lang, |
$creationdate,$lastrevisiondate,$owner,$copyright, |
$creationdate,$lastrevisiondate,$owner,$copyright, |
$hostname,$httphost)=@_; |
$hostname,$httphost)=@_; |
return 'abc'; |
|
my $result=<<END; |
my $result=<<END; |
<i>$owner</i>, last revised $lastrevisiondate |
<i>$owner</i>, last revised $lastrevisiondate |
<h3><A HREF="http://$httphost$url" TARGET='search_preview'>$title</A></h3> |
<h3><A HREF="http://$httphost$url" TARGET='search_preview'>$title</A></h3> |
Line 855 sub xml_sgml_view {
|
Line 885 sub xml_sgml_view {
|
my $result=<<END; |
my $result=<<END; |
<pre> |
<pre> |
<LonCapaResource> |
<LonCapaResource> |
<url>http://$httphost$url</url> |
<url>$url</url> |
<title>$title</title> |
<title>$title</title> |
<author>$author</author> |
<author>$author</author> |
<subject>$subject</subject> |
<subject>$subject</subject> |
Line 878 sub xml_sgml_view {
|
Line 908 sub xml_sgml_view {
|
</copyrightInfo> |
</copyrightInfo> |
<repositoryLocation>$hostname</repositoryLocation> |
<repositoryLocation>$hostname</repositoryLocation> |
<shortabstract>$shortabstract</shortabstract> |
<shortabstract>$shortabstract</shortabstract> |
|
</LonCapaResource> |
</pre> |
</pre> |
END |
END |
return $result; |
return $result; |
} |
} |
|
|
|
sub build_date_queries { |
|
my ($cmonth1,$cday1,$cyear1,$cmonth2,$cday2,$cyear2, |
|
$lmonth1,$lday1,$lyear1,$lmonth2,$lday2,$lyear2)=@_; |
|
|
|
return "Incorrect for some reason."; |
|
} |
|
|
|
sub output_date_error { |
|
my ($r,$message)=@_; |
|
# make query information persistent to allow for subsequent revision |
|
my $persistent=''; |
|
map { |
|
if (/^form\./ && !/submit/) { |
|
my $name=$_; |
|
my $key=$name; |
|
$name=~s/^form\.//; |
|
$persistent.=<<END; |
|
<INPUT TYPE='hidden' NAME='$name' VALUE='$ENV{$key}'> |
|
END |
|
} |
|
} (keys %ENV); |
|
|
|
$r->print(<<BEGINNING); |
|
<html> |
|
<head> |
|
<title>The LearningOnline Network with CAPA</title> |
|
BEGINNING |
|
$r->print(<<RESULTS); |
|
</head> |
|
<body bgcolor="#ffffff"> |
|
<img align=right src=/adm/lonIcons/lonlogos.gif> |
|
<h1>Search Catalog</h1> |
|
<form method="post" action="/adm/searchcat"> |
|
$persistent |
|
<input type='button' value='Revise search request' |
|
onClick='this.form.submit();'> |
|
$closebutton |
|
<hr> |
|
<h3>Helpful Message</h3> |
|
<p> |
|
$message |
|
</p> |
|
</body> |
|
</html> |
|
RESULTS |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |