--- loncom/interface/lonsearchcat.pm 2002/06/20 19:43:50 1.125 +++ loncom/interface/lonsearchcat.pm 2002/06/24 15:09:52 1.126 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.125 2002/06/20 19:43:50 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.126 2002/06/24 15:09:52 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -515,7 +515,8 @@ ENDDOCUMENT =item &make_persistent() Returns a scalar which holds the current ENV{'form.*'} values in -a 'hidden' html input tag. +a 'hidden' html input tag. This allows search interface information +to be somewhat persistent. =cut @@ -573,8 +574,13 @@ is where the $name and $value are used) =item &dateboxes() +Returns html selection form elements for the specification of +the day, month, and year. + =item &selectbox() +Returns html selection form. + =back =cut @@ -674,7 +680,9 @@ sub selectbox { =pod -=item &advancedsearch() +=item &advancedsearch() + +Parse advanced search results. =cut @@ -785,12 +793,13 @@ sub advancedsearch { $customquery,$customshow); } &output_results('Advanced',$r,$envhash,$customquery,$reply,$hidden); - } - elsif ($customquery) { + return OK; + } elsif ($customquery) { my $reply; # reply hash reference $reply=&Apache::lonnet::metadata_query('', $customquery,$customshow); &output_results('Advanced',$r,$envhash,$customquery,$reply,$hidden); + return OK; } # should not get to this point return 'Error. Should not have gone to this point.'; @@ -803,6 +812,8 @@ sub advancedsearch { =item &basicsearch() +Parse basic search form. + =cut ###################################################################### @@ -837,8 +848,9 @@ sub basicsearch { $query=&build_SQL_query('concat('.$concatarg.')',$ENV{'form.'.'basicexp'}); # Get reply (either a hash reference to filehandles or bad connection) +# &Apache::lonnet::logthis("metadata query started:".time); my $reply=&Apache::lonnet::metadata_query('select * from metadata where '.$query); - +# &Apache::lonnet::logthis("metadata query finished:".time); # Output search results &output_results('Basic',$r,$envhash,$query,$reply,$hidden); @@ -854,6 +866,9 @@ sub basicsearch { =item &build_SQL_query() +Builds a SQL query string from a logical expression with AND/OR keywords +using Text::Query and &recursive_SQL_query_builder() + =cut ###################################################################### @@ -876,14 +891,15 @@ sub build_SQL_query { =item &build_custommetadata_query() +Constructs a custom metadata query using a rather heinous regular +expression. + =cut ###################################################################### ###################################################################### sub build_custommetadata_query { my ($field_name,$logic_statement)=@_; - &Apache::lonnet::logthis("Entered build_custommetadata_query:". - $field_name.':'.$logic_statement); my $q=new Text::Query('abc', -parse => 'Text::Query::ParseAdvanced', -build => 'Text::Query::BuildAdvancedString'); @@ -898,7 +914,6 @@ sub build_custommetadata_query { \*$2\[\^\\<\]?# *wordtwo[^\<] \*\\<\\\/$1\\>?# *\<\/wordone\> /g; - &Apache::lonnet::logthis("match expression: ".$matchexp); return $matchexp; } @@ -909,6 +924,8 @@ sub build_custommetadata_query { =item &recursive_SQL_query_build() +Recursively constructs an SQL query. Takes as input $dkey and $pattern. + =cut ###################################################################### @@ -953,6 +970,9 @@ sub recursive_SQL_query_build { =item &build_date_queries() +Builds a SQL logic query to check time/date entries. +Also reports errors (check for /^Incorrect/). + =cut ###################################################################### @@ -1023,6 +1043,7 @@ contacted, etc.) ###################################################################### ###################################################################### sub output_results { +# &Apache::lonnet::logthis("output_results:".time); my $fnum; # search result counter my ($mode,$r,$envhash,$query,$replyref,$hidden)=@_; my %ENV=%{$envhash}; @@ -1088,10 +1109,9 @@ CATALOGCONTROLS ## (within the foreach loop below). ## foreach my $rkey (sort keys %rhash) { +# &Apache::lonnet::logthis("Server $rkey:".time); $servercount++; - $tflag=1; $compiledresult=''; - my $hostname=$rkey; my $reply=$rhash{$rkey}; my @results; if ($reply eq 'con_lost') { @@ -1103,79 +1123,59 @@ CATALOGCONTROLS $reply=~/^([\.\w]+)$/; my $replyfile=$r->dir_config('lonDaemons').'/tmp/'.$1; $reply=~/(.*?)\_/; - { - my $temp=0; - WLOOP: while (1) { - if (-e $replyfile && $tflag) { - &popwin_imgupdate($r,$rkey,"srvhalf.gif"); - &popwin_js($r,'popwin.hc["'.$rkey.'"]='. - '"still transferring..."'.';'); - $tflag=0; - } - if (-e "$replyfile.end") { - $serversleft--; - delete $rhash{$rkey}; - if (-s $replyfile) { - &popwin_imgupdate($r,$rkey,"srvgood.gif"); - my $fh=Apache::File->new($replyfile) or - ($r->print('ERROR: file '. - $replyfile.' cannot be opened') and - return OK); - @results=<$fh> if $fh; - $hitcount{$rkey}=@results+0; - &popwin_js($r,'popwin.hc["'.$rkey.'"]='. - $hitcount{$rkey}.';'); - $hitcountsum+=$hitcount{$rkey}; - &popwin_js($r,'popwin.document.forms.popremain.'. - 'numhits.value='.$hitcountsum.';'); - } - else { - &popwin_imgupdate($r,$rkey,"srvempty.gif"); - &popwin_js($r,'popwin.hc["'.$rkey.'"]=0;'); - } - last WLOOP; - } # end of if ( -e "$replyfile.end") - last WLOOP unless $timeremain; - sleep 1; # wait for daemons to write files? - $timeremain--; - $elapsetime++; - last WLOOP if ($temp>1); - &popwin_js($r,"popwin.document.popremain.". - "elapsetime.value=$elapsetime;"); - $temp++; - } + for (my $counter=0;$counter<2;$counter++) { + if (-e $replyfile && ! -e "$replyfile.end") { + &popwin_imgupdate($r,$rkey,"srvhalf.gif"); + &popwin_js($r,'popwin.hc["'.$rkey.'"]='. + '"still transferring..."'.';'); + } + # Are we finished transferring data? + if (-e "$replyfile.end") { + $serversleft--; + delete $rhash{$rkey}; + if (-s $replyfile) { + &popwin_imgupdate($r,$rkey,"srvgood.gif"); + my $fh; + unless ($fh=Apache::File->new($replyfile)){ + # Is it really appropriate to die on this error? + $r->print('ERROR: file '. + $replyfile.' cannot be opened'); + return OK; + } + @results=<$fh> if $fh; + $hitcount{$rkey}=@results+0; + &popwin_js($r,'popwin.hc["'.$rkey.'"]='. + $hitcount{$rkey}.';'); + $hitcountsum+=$hitcount{$rkey}; + &popwin_js($r,'popwin.document.forms.popremain.'. + 'numhits.value='.$hitcountsum.';'); + } else { + &popwin_imgupdate($r,$rkey,"srvempty.gif"); + &popwin_js($r,'popwin.hc["'.$rkey.'"]=0;'); + } + last; + } # end of if ( -e "$replyfile.end") + last unless $timeremain; + sleep 1; # wait for daemons to write files? + $timeremain--; + $elapsetime++; + &popwin_js($r,"popwin.document.popremain.". + "elapsetime.value=$elapsetime;"); } &popwin_js($r,'popwin.document.whirly.'. 'src="/adm/lonIcons/lonanimend.gif";'); } # end of if ($reply eq 'con_lost') else statement - my $customshow=''; - my $extrashow=''; - my @customfields; - if ($ENV{'form.customshow'}) { - $customshow=$ENV{'form.customshow'}; - $customshow=~s/[^\w\s]//g; - my @fields=map {"$_:"} - split(/\s+/,$customshow); - @customfields=split(/\s+/,$customshow); - if ($customshow) { - $extrashow="\n"; - } - } - my $customdata=''; - my %customhash; - foreach my $result (@results) { - if ($result=~/^(custom\=.*)$/) { # grab all custom metadata - my $tmp=$result; - $tmp=~s/^custom\=//; - my ($k,$v)=map {&Apache::lonnet::unescape($_); - } split(/\,/,$tmp); - $customhash{$k}=$v; - } - } - if (keys %hash) { - untie %hash; - } - if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) { + my %Fields = undef; # Holds the data to be sent to the various + # *_view routines. + my ($extrashow,$customfields,$customhash) = &handle_custom_fields(\@results); + my @customfields = @$customfields; + my %customhash = %$customhash; + untie %hash if (keys %hash); + # + if (! tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT,0640)) { + $r->print('Unable to tie hash to db '. + 'file'); + } else { if ($ENV{'form.launch'} eq '1') { &start_fresh_session(); } @@ -1183,63 +1183,33 @@ CATALOGCONTROLS next if $result=~/^custom\=/; chomp $result; next unless $result; - my @fields=map - {&Apache::lonnet::unescape($_)} - (split(/\,/,$result)); - my ($title,$author,$subject,$url,$keywords,$version, - $notes,$abstract,$mime,$lang, - $creationdate,$lastrevisiondate,$owner,$copyright)=@fields; - unless ($title =~ /^\s*$/ ) { $title='Untitled'; } - unless ($ENV{'user.adv'}) { - $keywords='- not displayed -'; - $fields[4]=$keywords; - $notes='- not displayed -'; - $fields[6]=$notes; - $abstract='- not displayed -'; - $fields[7]=$abstract; - $subject='- not displayed -'; - $fields[2]=$subject; - } - - my $shortabstract=$abstract; - $shortabstract=substr($abstract,0,200).'...' if length($abstract)>200; - $fields[7]=$shortabstract; - my $shortkeywords=$keywords; - $shortkeywords=substr($keywords,0,200).'...' if length($keywords)>200; - $fields[4]=$shortkeywords; - - my $extrashow2=$extrashow; + %Fields = &parse_raw_result($result,$rkey); + $Fields{'extrashow'}=$extrashow; if ($extrashow) { foreach my $field (@customfields) { my $value=''; - if ($customhash{$url}=~/\<${field}[^\>]*\>(.*?)\<\/${field}[^\>]*\>/s) { - $value=$1; - } - $extrashow2=~s/\<\!\-\- $field \-\-\>/ $value/g; - } + $value = $1 if ($customhash{$Fields{'url'}}=~/\<{$field}[^\>]*\>(.*?)\<\/{$field}[^\>]*\>/s); + $Fields{'extrashow'}=~s/\<\!\-\- $field \-\-\>/ $value/g; + } } - - $compiledresult.=< -END - $compiledresult.=< -END - if ($ENV{'form.catalogmode'} eq 'interactive') { - my $titleesc=$title; - $titleesc=~s/\'/\\'/; # ' - - $compiledresult.=< +onClick="javascript:select_data('$titleesc','$Fields{'url'}')">
END } if ($ENV{'form.catalogmode'} eq 'groupsearch') { $fnum+=0; - $hash{"pre_${fnum}_link"}=$url; - $hash{"pre_${fnum}_title"}=$title; + $hash{"pre_${fnum}_link"}=$Fields{'url'}; + $hash{"pre_${fnum}_title"}=$Fields{'title'}; $compiledresult.=< $fnum++; } - my $httphost=$ENV{'HTTP_HOST'}; - my $viewselect; if ($mode eq 'Basic') { $viewselect=$ENV{'form.basicviewselect'}; @@ -1260,51 +1228,161 @@ END elsif ($mode eq 'Advanced') { $viewselect=$ENV{'form.advancedviewselect'}; } - if ($viewselect eq 'Detailed Citation View') { - $compiledresult.=&detailed_citation_view(@fields, - $hostname,$httphost, - $extrashow2); + $compiledresult.=&detailed_citation_view + (%Fields, hostname => $rkey ); } elsif ($viewselect eq 'Summary View') { - $compiledresult.=&summary_view(@fields,$hostname,$httphost, - $extrashow2); + $compiledresult.=&summary_view + (%Fields, hostname => $rkey ); } elsif ($viewselect eq 'Fielded Format') { - $compiledresult.=&fielded_format_view(@fields,$hostname, - $httphost,$extrashow2); + $compiledresult.=&fielded_format_view + (%Fields, hostname => $rkey ); } elsif ($viewselect eq 'XML/SGML') { - $compiledresult.=&xml_sgml_view(@fields,$hostname,$httphost, - $extrashow2); + $compiledresult.=&xml_sgml_view + (%Fields, hostname => $rkey ); } - } - untie %hash; } - else { - $r->print('Unable to tie hash to db '. - 'file'); - } if ($compiledresult) { $resultflag=1; + $r->print($compiledresult); } - - $r->print(<print("\nThere were no results that matched your query\n"); } # $r->print(''."\n"); $r->rflush(); - $r->print(< - -RESULTS + $r->print("\n\n"); + return; +} + +########################################################### +########################################################### + +=pod + +=item &parse_raw_result() + +Takes a line from the file of results and parse it. Returns a hash +with keys for the following fields: +'title', 'author', 'subject', 'url', 'keywords', 'version', 'notes', +'abstract', 'mime', 'lang', 'owner', 'copyright', 'creationdate', +'lastrevisiondate'. + +In addition, the following tags are set by calling the appropriate +lonnet function: 'language', 'cprtag', 'mimetag'. + +The 'title' field is set to "Untitled" if the title field is blank. + +'abstract' and 'keywords' are truncated to 200 characters. + +=cut + +########################################################### +########################################################### +sub parse_raw_result { + my ($result,$hostname) = @_; + # Check for a comma - if it is there then we do not need to unescape the + # string. There seems to be some kind of problem with some items in + # the database - the entire string gets sent out unescaped...? + unless ($result =~ /,/) { + $result = &Apache::lonnet::unescape($result); + } + my @fields=map { + &Apache::lonnet::unescape($_); + } (split(/\,/,$result)); + my ($title,$author,$subject,$url,$keywords,$version, + $notes,$abstract,$mime,$lang, + $creationdate,$lastrevisiondate,$owner,$copyright)=@fields; + my %Fields = + ( title => &Apache::lonnet::unescape($title), + author => &Apache::lonnet::unescape($author), + subject => &Apache::lonnet::unescape($subject), + url => &Apache::lonnet::unescape($url), + keywords => &Apache::lonnet::unescape($keywords), + version => &Apache::lonnet::unescape($version), + notes => &Apache::lonnet::unescape($notes), + abstract => &Apache::lonnet::unescape($abstract), + mime => &Apache::lonnet::unescape($mime), + lang => &Apache::lonnet::unescape($lang), + owner => &Apache::lonnet::unescape($owner), + copyright => &Apache::lonnet::unescape($copyright), + creationdate => &Apache::lonnet::unescape($creationdate), + lastrevisiondate => &Apache::lonnet::unescape($lastrevisiondate) + ); + $Fields{'language'} = + &Apache::loncommon::languagedescription($Fields{'lang'}); + $Fields{'copyrighttag'} = + &Apache::loncommon::copyrightdescription($Fields{'copyright'}); + $Fields{'mimetag'} = + &Apache::loncommon::filedescription($Fields{'mime'}); + # Put spaces in the keyword list, if needed. + $Fields{'keywords'}=~ s/,([A-z])/, $1/g; + if ($Fields{'title'}=~ /^\s*$/ ) { + $Fields{'title'}='Untitled'; + } + unless ($ENV{'user.adv'}) { + $Fields{'keywords'} = '- not displayed -'; + $Fields{'notes'} = '- not displayed -'; + $Fields{'abstract'} = '- not displayed -'; + $Fields{'subject'} = '- not displayed -'; + } + if (length($Fields{'abstract'})>200) { + $Fields{'abstract'} = + substr($Fields{'abstract'},0,200).'...'; + } + if (length($Fields{'keywords'})>200) { + $Fields{'keywords'} = + substr($Fields{'keywords'},0,200).'...'; + } + return %Fields; +} + +########################################################### +########################################################### + +=pod + +=item &handle_custom_fields() + +=cut + +########################################################### +########################################################### +sub handle_custom_fields { + my @results = @{shift()}; + my $customshow=''; + my $extrashow=''; + my @customfields; + if ($ENV{'form.customshow'}) { + $customshow=$ENV{'form.customshow'}; + $customshow=~s/[^\w\s]//g; + my @fields=map { + "$_:"; + } split(/\s+/,$customshow); + @customfields=split(/\s+/,$customshow); + if ($customshow) { + $extrashow="
  • ".join("
  • ",@fields)."
\n"; + } + } + my $customdata=''; + my %customhash; + foreach my $result (@results) { + if ($result=~/^(custom\=.*)$/) { # grab all custom metadata + my $tmp=$result; + $tmp=~s/^custom\=//; + my ($k,$v)=map {&Apache::lonnet::unescape($_); + } split(/\,/,$tmp); + $customhash{$k}=$v; + } + } + return ($extrashow,\@customfields,\%customhash); } ###################################################################### @@ -1314,6 +1392,27 @@ RESULTS =item &search_results_header +Output the proper javascript code to deal with different calling modes. + +Takes inputs directly from from %ENV. The following environment variables +are checked: + +=over 4 + +=item 'form.catalogmode' + +Checked for 'interactive' and 'groupsearch'. + +=item 'form.mode' + +Checked for existance & 'edit' mode. + +=item 'form.form' + +=item 'form.element' + +=back + =cut ###################################################################### @@ -1515,7 +1614,7 @@ ENDPOP Output is a HTML-ified string. Input arguments are title, author, subject, url, keywords, version, notes, short abstract, mime, language, creation date, -last revision date, owner, copyright, hostname, httphost, and +last revision date, owner, copyright, hostname, and extra custom metadata to show. =over 4 @@ -1527,38 +1626,36 @@ extra custom metadata to show. ###################################################################### ###################################################################### sub detailed_citation_view { - my ($title,$author,$subject,$url,$keywords,$version, - $notes,$shortabstract,$mime,$lang, - $creationdate,$lastrevisiondate,$owner,$copyright, - $hostname,$httphost,$extrashow)=@_; + my %values = @_; my $result=<$owner, last revised $lastrevisiondate -

$title

-

$author

+$values{'owner'}, last revised $values{'lastrevisiondate'} +

$values{'title'}

+

$values{'author'}

-Subject: $subject
-Keyword(s): $keywords
-Notes: $notes
+Subject: $values{'subject'}
+Keyword(s): $values{'keywords'}
+Notes: $values{'notes'}
MIME Type: END - $result.=&Apache::loncommon::filedescription($mime); + $result.=&Apache::loncommon::filedescription($values{'mime'}); $result.=< Language: END - $result.=&Apache::loncommon::languagedescription($lang); + $result.=&Apache::loncommon::languagedescription($values{'lang'}); $result.=< Copyright/Distribution: END - $result.=&Apache::loncommon::copyrightdescription($copyright); + $result.=&Apache::loncommon::copyrightdescription($values{'copyright'}); $result.=<

-$extrashow +$values{'extrashow'}

-$shortabstract +$values{'shortabstract'}

END return $result; @@ -1576,17 +1673,14 @@ END ###################################################################### ###################################################################### sub summary_view { - my ($title,$author,$subject,$url,$keywords,$version, - $notes,$shortabstract,$mime,$lang, - $creationdate,$lastrevisiondate,$owner,$copyright, - $hostname,$httphost,$extrashow)=@_; - my $cprtag=&Apache::loncommon::copyrightdescription($copyright); + my %values = @_; my $result=<$author
-$title
-$owner -- $lastrevisiondate
-$cprtag
-$extrashow +$values{'author'}
+$values{'title'}
+$values{'owner'} -- $values{'lastrevisiondate'}
+$values{'copyrighttag'}
+$values{'extrashow'}

END return $result; @@ -1604,30 +1698,25 @@ END ###################################################################### ###################################################################### sub fielded_format_view { - my ($title,$author,$subject,$url,$keywords,$version, - $notes,$shortabstract,$mime,$lang, - $creationdate,$lastrevisiondate,$owner,$copyright, - $hostname,$httphost,$extrashow)=@_; - my $mimetag=&Apache::loncommon::filedescription($mime); - my $language=&Apache::loncommon::languagedescription($lang); - my $cprtag=&Apache::loncommon::copyrightdescription($copyright); + my %values = @_; my $result=<URL: $url +URL: $values{'url'}
-Title: $title
-Author(s): $author
-Subject: $subject
-Keyword(s): $keywords
-Notes: $notes
-MIME Type: $mimetag
-Language: $language
-Creation Date: $creationdate
-Last Revision Date: $lastrevisiondate
-Publisher/Owner: $owner
-Copyright/Distribution: $cprtag
-Repository Location: $hostname
-Abstract: $shortabstract
-$extrashow +Title: $values{'title'}
+Author(s): $values{'author'}
+Subject: $values{'subject'}
+Keyword(s): $values{'keywords'}
+Notes: $values{'notes'}
+MIME Type: $values{'mimetag'}
+Language: $values{'language'}
+Creation Date: $values{'creationdate'}
+Last Revision Date: $values{'lastrevisiondate'}
+Publisher/Owner: $values{'owner'}
+Copyright/Distribution: $values{'copyrighttag'}
+Repository Location: $values{'hostname'}
+Abstract: $values{'shortabstract'}
+$values{'extrashow'}

END return $result; @@ -1647,42 +1736,36 @@ END ###################################################################### ###################################################################### sub xml_sgml_view { - my ($title,$author,$subject,$url,$keywords,$version, - $notes,$shortabstract,$mime,$lang, - $creationdate,$lastrevisiondate,$owner,$copyright, - $hostname,$httphost,$extrashow)=@_; - my $cprtag=&Apache::loncommon::copyrightdescription($copyright); - my $mimetag=&Apache::loncommon::filedescription($mime); - my $language=&Apache::loncommon::languagedescription($lang); + my %values = @_; my $result=< <LonCapaResource> -<url>$url</url> -<title>$title</title> -<author>$author</author> -<subject>$subject</subject> -<keywords>$keywords</keywords> -<notes>$notes</notes> +<url>$values{'url'}</url> +<title>$values{'title'}</title> +<author>$values{'author'}</author> +<subject>$values{'subject'}</subject> +<keywords>$values{'keywords'}</keywords> +<notes>$values{'notes'}</notes> <mimeInfo> -<mime>$mime</mime> -<mimetag>$mimetag</mimetag> +<mime>$values{'mime'}</mime> +<mimetag>$values{'mimetag'}</mimetag> </mimeInfo> <languageInfo> -<language>$lang</language> -<languagetag>$language</languagetag> +<language>$values{'lang'}</language> +<languagetag>$values{'language'}</languagetag> </languageInfo> -<creationdate>$creationdate</creationdate> -<lastrevisiondate>$lastrevisiondate</lastrevisiondate> -<owner>$owner</owner> +<creationdate>$values{'creationdate'}</creationdate> +<lastrevisiondate>$values{'lastrevisiondate'}</lastrevisiondate> +<owner>$values{'owner'}</owner> <copyrightInfo> -<copyright>$copyright</copyright> -<copyrighttag>$cprtag</copyrighttag> +<copyright>$values{'copyright'}</copyright> +<copyrighttag>$values{'copyrighttag'}</copyrighttag> </copyrightInfo> -<repositoryLocation>$hostname</repositoryLocation> -<shortabstract>$shortabstract</shortabstract> +<repositoryLocation>$values{'hostname'}</repositoryLocation> +<shortabstract>$values{'shortabstract'}</shortabstract> </LonCapaResource> -$extrashow +$values{'extrashow'} END return $result; } @@ -1872,199 +1955,4 @@ __END__ =back -=over 4 - -=head1 HANDLER SUBROUTINE - -This routine is called by Apache and mod_perl. - -=over 4 - -=item * - -configure dynamic components of interface - -=item * - -determine current user - -=item * - -see if a search invocation should be done - -=item * - -else, begin building search interface to output - -=item * - -compute date selection boxes - -=item * - -compute customized metadata field - -=item * - -print screen - -=back - -=head1 OTHER SUBROUTINES - -=over 4 - -=item * - -get_unprocessed_cgi() : reads in critical name/value pairs that may have not -been processed and passed into %ENV by the web server - -=item * - -make_persistent() : makes a set of hidden HTML fields to make -SQL search interface information to be persistent - -=back - -WEB INTERFACE COMPONENT FUNCTIONS - -=over 4 - -=item * - -simpletextfield(name,value) : returns HTML formatted string for simple text -field - -=item * - -simplecheckbox(name,value) : returns HTML formatted string for simple -checkbox - -=item * - -searchphrasefield(title,name,value) : returns HTML formatted string for -a search expression phrase field - -=item * - -dateboxes(name, defaultmonth, defaultday, defaultyear) : returns HTML -formatted string for a calendar date - -=item * - -selectbox(title,name,value,%HASH=options) : returns HTML formatted string for -a selection box field - -=back - -SEARCH FUNCTIONS - -=over 4 - -=item * - -advancedsearch(server reference, environment reference) : perform a complex -multi-field logical query - -=item * - -basicsearch(server reference, environment reference) : perform a simple -single-field logical query - -=item * - -build_SQL_query(field name, logic) : builds a SQL query string from a -logical expression with AND/OR keywords - -=item * - -build_custommetadata_query(field_name, logic_statement) : builds a perl -regular expression from a logical expression with AND/OR keywords - -=item * - -recursive_SQL_query_build(field name, reverse notation expression) : -builds a SQL query string from a reverse notation expression -logical expression with AND/OR keywords - -=item * - -build_date_queries(cmonth1, cday1, cyear1, cmonth2, cday2, cyear2, -lmonth1, lday1, lyear1, lmonth2, lday2, lyear2) : -Builds a SQL logic query to check time/date entries. - -=back - -OUTPUTTING RESULTS FUNCTION - -=over 4 - -=item * - -output_results(output mode, server reference, environment reference, -reply list reference) : outputs results from search - -=back - -DIFFERENT WAYS TO VIEW METADATA RECORDS - -=over 4 - -=item * - -detailed_citation_view(ORDERED METADATA LIST FOR A RESULT OBJECT INSTANCE) : -see metadata viewing notes below - -=item * - -summary_view(ORDERED METADATA LIST FOR A RESULT OBJECT INSTANCE) : -see metadata viewing notes below - -=item * - -fielded_format_view(ORDERED METADATA LIST FOR A RESULT OBJECT INSTANCE) : -see metadata viewing notes below - -=item * - -xml_sgml_view(ORDERED METADATA LIST FOR A RESULT OBJECT INSTANCE) : -see metadata viewing notes below - -=back - - _____________________________________________________________________ - | * Metadata viewing notes | - | Output is a HTML-ified string. | - | Input arguments are title, author, subject, url, keywords, version, | - | notes, short abstract, mime, language, creation date, | - | last revision date, owner, copyright, hostname, httphost, and | - | extra custom metadata to show. | - --------------------------------------------------------------------- - -TEST CONDITIONAL FUNCTIONS - -=over 4 - -=item * - -filled(field) : determines whether a given field has been filled - -=back - -ERROR FUNCTIONS - -=over 4 - -=item * - -output_blank_field_error(server reference) : outputs a message saying that -more fields need to be filled in - -=item * - -output_date_error(server reference, error message) : - - -=back - =cut