--- loncom/interface/lonsearchcat.pm 2001/03/22 14:58:58 1.76 +++ loncom/interface/lonsearchcat.pm 2001/03/26 21:24:12 1.77 @@ -229,9 +229,9 @@ LASTREVISIONDATEEND # ------------------------------------------- Compute customized metadata field $scrout.=< -LIMIT BY OTHER METADATA FIELDS: +LIMIT BY SPECIAL METADATA FIELDS: -For author-specific metadata, enter in an expression in the form of +For resource-specific metadata, enter in an expression in the form of key=value separated by operators such as AND or OR.
Example: grandmother=75 OR grandfather=85
@@ -239,6 +239,17 @@ CUSTOMMETADATA $scrout.=&simpletextfield('custommetadata',$ENV{'form.custommetadata'}); $scrout.=' initial users of this system do not need to worry about this option'; + $scrout.=< +SHOW SPECIAL METADATA FIELDS: + +Enter in a space-separated list of special metadata fields to show +in a fielded listing for each record result. +
+CUSTOMSHOW +$scrout.=&simpletextfield('customshow',$ENV{'form.customshow'}); +$scrout.=' initial users of this system do not need to worry about this option'; + # ---------------------------------------------------------------- Print screen $r->print(< @@ -487,7 +498,7 @@ sub advancedsearch { 'lastrevisiondatestart_year','lastrevisiondateend_month', 'lastrevisiondateend_day','lastrevisiondateend_year', 'notes','abstract','mime','language','owner', - 'custommetadata') { + 'custommetadata','customshow') { $ENV{"form.$field"}=~s/[^\w\s\(\)\=\-\"\']//g; } for my $field ('title','author','subject','keywords','url','version', @@ -665,6 +676,15 @@ sub output_results { @results=<$fh>; } + my $customshow=''; + my $extrashow=''; + if ($ENV{'form.customshow'}) { + $customshow=$ENV{'form.customshow'}; + $customshow=~s/[^\w\s]//g; + my @fields=map {"$_:"} + split(/\s+/,$customshow); + $extrashow="
  • ".join("
  • ",@fields)."
\n"; + } foreach my $result (@results) { my @fields=map {&Apache::lonnet::unescape($_)} @@ -696,17 +716,20 @@ END if ($viewselect eq 'Detailed Citation View') { $compiledresult.=&detailed_citation_view(@fields, - $hostname,$httphost); + $hostname,$httphost, + $extrashow); } elsif ($viewselect eq 'Summary View') { - $compiledresult.=&summary_view(@fields,$hostname,$httphost); + $compiledresult.=&summary_view(@fields,$hostname,$httphost, + $extrashow); } elsif ($viewselect eq 'Fielded Format') { $compiledresult.=&fielded_format_view(@fields,$hostname, - $httphost); + $httphost,$extrashow); } elsif ($viewselect eq 'XML/SGML') { - $compiledresult.=&xml_sgml_view(@fields,$hostname,$httphost); + $compiledresult.=&xml_sgml_view(@fields,$hostname,$httphost, + $extrashow); } } @@ -839,7 +862,7 @@ sub detailed_citation_view { my ($title,$author,$subject,$url,$keywords,$version, $notes,$shortabstract,$mime,$lang, $creationdate,$lastrevisiondate,$owner,$copyright, - $hostname,$httphost)=@_; + $hostname,$httphost,$extrashow)=@_; my $result=<$owner, last revised $lastrevisiondate

$title

@@ -852,6 +875,7 @@ sub detailed_citation_view { MIME Type: $mimetag{$mime}
Language: $language{$lang}
Copyright/Distribution: $cprtag{$copyright}
+$extrashow $shortabstract

END @@ -863,12 +887,13 @@ sub summary_view { my ($title,$author,$subject,$url,$keywords,$version, $notes,$shortabstract,$mime,$lang, $creationdate,$lastrevisiondate,$owner,$copyright, - $hostname,$httphost)=@_; + $hostname,$httphost,$extrashow)=@_; my $result=<$author
$title
$owner -- $lastrevisiondate
$cprtag{$copyright}
+$extrashow

END return $result; @@ -879,7 +904,7 @@ sub fielded_format_view { my ($title,$author,$subject,$url,$keywords,$version, $notes,$shortabstract,$mime,$lang, $creationdate,$lastrevisiondate,$owner,$copyright, - $hostname,$httphost)=@_; + $hostname,$httphost,$extrashow)=@_; my $result=<URL: $url
@@ -896,6 +921,7 @@ sub fielded_format_view { Copyright/Distribution: $cprtag{$copyright}
Repository Location: $hostname
Abstract: $shortabstract
+$extrashow

END return $result; @@ -906,7 +932,7 @@ sub xml_sgml_view { my ($title,$author,$subject,$url,$keywords,$version, $notes,$shortabstract,$mime,$lang, $creationdate,$lastrevisiondate,$owner,$copyright, - $hostname,$httphost)=@_; + $hostname,$httphost,$extrashow)=@_; my $result=< <LonCapaResource> @@ -935,6 +961,7 @@ sub xml_sgml_view { <shortabstract>$shortabstract</shortabstract> </LonCapaResource> +$extrashow END return $result; }