--- loncom/interface/lonsearchcat.pm 2002/06/18 21:36:38 1.121 +++ loncom/interface/lonsearchcat.pm 2003/03/08 03:24:58 1.168 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.121 2002/06/18 21:36:38 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.168 2003/03/08 03:24:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,14 +25,6 @@ # # http://www.lon-capa.org/ # -# YEAR=2001 -# 3/8, 3/12, 3/13, 3/14, 3/15, 3/19 Scott Harrison -# 3/20, 3/21, 3/22, 3/26, 3/27, 4/2, 8/15, 8/24, 8/25 Scott Harrison -# 10/12,10/14,10/15,10/16,11/28,11/29,12/10,12/12,12/16 Scott Harrison -# YEAR=2002 -# 1/17 Scott Harrison -# 6/17 Matthew Hall -# ############################################################################### ############################################################################### @@ -40,7 +32,7 @@ =head1 NAME -lonsearchcat +lonsearchcat - LONCAPA Search Interface =head1 SYNOPSIS @@ -67,14 +59,14 @@ search (on a server basis) is displayed ############################################################################### ############################################################################### +############################################################################### ## ## ## ORGANIZATION OF THIS PERL MODULE ## ## ## ## 1. Modules used by this module ## -## 2. Choices for different output views (detailed, summary, xml, etc) ## -## 3. BEGIN block (to be run once after compilation) ## -## 4. Handling routine called via Apache and mod_perl ## -## 5. Other subroutines ## +## 2. Variables used throughout the module ## +## 3. handler subroutine called via Apache and mod_perl ## +## 4. Other subroutines ## ## ## ############################################################################### @@ -82,13 +74,14 @@ package Apache::lonsearchcat; # ------------------------------------------------- modules used by this module use strict; -use Apache::Constants qw(:common); +use Apache::Constants qw(:common :http); use Apache::lonnet(); use Apache::File(); use CGI qw(:standard); use Text::Query; use GDBM_File; use Apache::loncommon(); +use Apache::lonmysql(); # ---------------------------------------- variables used throughout the module @@ -101,51 +94,30 @@ use Apache::loncommon(); =over 4 -=item %hostdomains - -matches host name to host domain - -=item %hostips - -matches host name to host ip - -=item %hitcount - -stores number of hits per host - -=item $closebutton - -button that closes the search window - =item $importbutton -button to take the selecte results and go to group sorting - -=item $hidden - -holds 'hidden' html forms - -=item $scrout - -string that holds portions of the screen output +button to take the select results and go to group sorting -=item $yourself +=item %groupsearch_db -allows for quickly limiting to oneself +Database hash used to save values for the groupsearch RAT interface. -=item %hash +=item $diropendb -The ubiquitous database hash +The full path to the (temporary) search database file. This is set and +used in &handler() and is also used in &output_results(). -=item $basicviewselect and $advancedviewselect +=item %Views -View selection forms. These are not actually global and will be -moved soon. +Hash which associates an output view description with the function +that produces it. Adding a new view type should be as easy as +adding a line to the definition of this hash and making sure the function +takes the proper parameters. -=item $diropendb +=item $bodytag -The full path to the (temporary) search database file. This is set and -used in &handler() and is also used in &output_results(). +LON-CAPA standard body tag, gotten from &Apache::lonnet::bodytag. +No title, no table, just a
tag. =back @@ -154,194 +126,603 @@ used in &handler() and is also used in & ###################################################################### ###################################################################### -# -- information holders -my %hostdomains; # matches host name to host domain -my %hostips; # matches host name to host ip -my %hitcount; # stores number of hits per host - # -- dynamically rendered interface components -my $closebutton; # button that closes the search window my $importbutton; # button to take the selected results and go to group sorting -my $hidden; # Holds 'hidden' html forms # -- miscellaneous variables -my $scrout; # string that holds portions of the screen output -my $yourself; # allows for quickly limiting to oneself -my %hash; # database hash - -# ------------------------------------------ choices for different output views -# Detailed Citation View ---> sub detailed_citation_view -# Summary View ---> sub summary_view -# Fielded Format ---> sub fielded_format_view -# XML/SGML ---> sub xml_sgml_view -my $basicviewselect=<