--- loncom/interface/lonsearchcat.pm 2001/03/08 16:55:43 1.5
+++ loncom/interface/lonsearchcat.pm 2001/03/15 13:23:15 1.11
@@ -7,6 +7,9 @@ package Apache::lonsearchcat;
use strict;
use Apache::Constants qw(:common);
+use Apache::lonnet();
+use Apache::File();
+use CGI qw(:standard);
my %language;
my $scrout;
@@ -16,15 +19,32 @@ my %mimetag;
sub handler {
my $r = shift;
+
+# -------------------------------------- see if called from an interactive mode
+ map {
+ my ($name, $value) = split(/=/,$_);
+ $value =~ tr/+/ /;
+ $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
+ if ($name eq 'catalogmode') {
+ $ENV{'form.'.$name}=$value;
+ }
+ } (split(/&/,$ENV{'QUERY_STRING'}));
+
$r->content_type('text/html');
$r->send_http_header;
return OK if $r->header_only;
%metadatafields=();
+ my $hidden='';
+ $hidden=<
+END
+
# ------------------------------------------------ First, check out environment
$metadatafields{'owner'}=$ENV{'user.name'}.'@'.$ENV{'user.domain'};
+# --------------------------------- Compute various listings of metadata values
%language=();
$language{'any'}='Any language';
@@ -56,560 +76,96 @@ sub handler {
} <$fh>;
}
- $scrout="";
+ if ($ENV{'form.basicsubmit'} eq 'SEARCH') {
+ return &basicsearch($r,$ENV{'form.basicexp'});
+ }
+
+ $scrout=''; # building a part of screen output
$scrout.=&searchphrasefield('Limit by title','title',
- '');
+ $ENV{'form.title'});
$scrout.=&searchphrasefield('Limit by author','author',
- '');
+ $ENV{'form.author'});
$scrout.=&searchphrasefield('Limit by subject','subject',
- '');
+ $ENV{'form.subject'});
+
+ $scrout.=&searchphrasefield('Limit by keywords','keywords',
+ $ENV{'form.keywords'});
+
+ $scrout.=&searchphrasefield('Limit by URL','url',
+ $ENV{'form.url'});
+
+ $scrout.=&searchphrasefield('Limit by version','version',
+ $ENV{'form.version'});
$scrout.=&searchphrasefield('Limit by notes','notes',
- '');
+ $ENV{'form.notes'});
$scrout.=&searchphrasefield('Limit by abstract','abstract',
- '');
+ $ENV{'form.abstract'});
+ $ENV{'form.mime'}='notxxx' unless length($ENV{'form.mime'});
$scrout.=&selectbox('Limit by MIME type','mime',
- 'notxxx',%mimetag);
+ $ENV{'form.mime'},%mimetag);
+
+ $ENV{'form.language'}='any' unless length($ENV{'form.language'});
$scrout.=&selectbox('Limit by language','language',
- 'any',%language);
+ $ENV{'form.language'},%language);
- $scrout.=<
LIMIT BY CREATION DATE RANGE:
-between:
-
-
-and:
-
-
-
+between:
+CREATIONDATESTART
+ $scrout.=&dateboxes('creationdatestart',1,1,1976,
+ $ENV{'form.creationdatestart_month'},
+ $ENV{'form.creationdatestart_day'},
+ $ENV{'form.creationdatestart_year'},
+ );
+ $scrout.=<";
- $scrout.=<
LIMIT BY LAST REVISION DATE RANGE:
-
between:
-
-
-and:
-
-
-
+
between:
+LASTREVISIONDATESTART
+ $scrout.=&dateboxes('lastrevisiondatestart',1,1,1976,
+ $ENV{'form.lastrevisiondatestart_month'},
+ $ENV{'form.lastrevisiondatestart_day'},
+ $ENV{'form.lastrevisiondatestart_year'},
+ );
+ $scrout.=<';
$scrout.=&searchphrasefield('Limit by publisher/owner','owner',
- $metadatafields{'owner'});
+ $ENV{'form.owner'});
+# $metadatafields{'owner'});
+ $ENV{'form.copyright'}='any' unless length($ENV{'form.copyright'});
$scrout.=&selectbox('Limit by copyright/distribution','copyright',
- 'any',%cprtag);
+ $ENV{'form.copyright'},%cprtag);
# ---------------------------------------------------------------- Print screen
$r->print(<
Search Catalog