--- loncom/interface/lonsearchcat.pm 2001/01/03 16:20:59 1.1
+++ loncom/interface/lonsearchcat.pm 2001/03/08 16:45:22 1.3
@@ -1,28 +1,617 @@
# The LearningOnline Network
# Search Catalog
#
-# (Internal Server Error Handler
-#
-# (Login Screen
-# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
-# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
-#
-# 3/1/1 Gerd Kortemeyer)
-#
-# 3/1 Gerd Kortemeyer
+# 03/08/2001 Scott Harrison
#
package Apache::lonsearchcat;
use strict;
use Apache::Constants qw(:common);
+my %language;
+my $scrout;
+my %metadatafields;
+my %cprtag;
+my %mimetag;
+
sub handler {
my $r = shift;
$r->content_type('text/html');
$r->send_http_header;
return OK if $r->header_only;
-# --------------------------------------------------- Print login screen header
+ %metadatafields=();
+
+# ------------------------------------------------ First, check out environment
+ $metadatafields{'owner'}=$ENV{'user.name'}.'@'.$ENV{'user.domain'};
+
+
+ %language=();
+ $language{'any'}='Any language';
+ {
+ my $fh=Apache::File->new($r->dir_config('lonTabDir').'/language.tab');
+ map {
+ $_=~/(\w+)\s+([\w\s\-]+)/;
+ $language{$1}=$2;
+ } <$fh>;
+ }
+
+ %cprtag=();
+ $cprtag{'any'}='Any copyright/distribution';
+ {
+ my $fh=Apache::File->new($r->dir_config('lonIncludes').'/copyright.tab');
+ map {
+ $_=~/(\w+)\s+([\w\s\-]+)/;
+ $cprtag{$1}=$2;
+ } <$fh>;
+ }
+
+ %mimetag=();
+ $mimetag{'any'}='Any type';
+ {
+ my $fh=Apache::File->new($r->dir_config('lonTabDir').'/filetypes.tab');
+ map {
+ $_=~/(\w+)\s+(\w+)\s+([\w\s\-]+)/;
+ $mimetag{$1}=".$1 $3";
+ } <$fh>;
+ }
+
+ $scrout="";
+ $scrout.=&searchphrasefield('Limit by title','title',
+ '');
+
+ $scrout.=&searchphrasefield('Limit by author','author',
+ '');
+
+ $scrout.=&searchphrasefield('Limit by subject','subject',
+ '');
+
+ $scrout.=&searchphrasefield('Limit by notes','notes',
+ '');
+
+ $scrout.=&searchphrasefield('Limit by abstract','abstract',
+ '');
+
+ $scrout.=&selectbox('Limit by MIME type','mime',
+ 'notxxx',%mimetag);
+
+ $scrout.=&selectbox('Limit by language','language',
+ 'any',%language);
+
+ $scrout.=<
+LIMIT BY CREATION DATE RANGE:
+
+
+between:
+
+
+and:
+
+
+
+CREATIONDATEEND
+
+ $scrout.=<
+LIMIT BY LAST REVISION DATE RANGE:
+
+
between:
+
+
+and:
+
+
+
+LASTREVISIONDATEEND
+
+ $scrout.=&searchphrasefield('Limit by publisher/owner','owner',
+ $metadatafields{'owner'});
+
+ $scrout.=&selectbox('Limit by copyright/distribution','copyright',
+ 'any',%cprtag);
+
+# ---------------------------------------------------------------- Print screen
$r->print(<
@@ -30,12 +619,66 @@ sub handler {
Search Catalog
-
+