--- loncom/interface/lonsearchcat.pm 2001/03/21 01:19:37 1.49 +++ loncom/interface/lonsearchcat.pm 2001/03/21 02:09:38 1.50 @@ -54,8 +54,10 @@ my %mimetag; my $closebutton; my $viewselect=< - - + + + + END @@ -605,10 +607,12 @@ sub output_results { } foreach my $result (@results) { + my @fields=map + {&Apache::lonnet::unescape($_)} + (split(/\,/,$result)); my ($title,$author,$subject,$url,$keywords,$version, $notes,$abstract,$mime,$lang, - $creationdate,$lastrevisiondate,$owner,$copyright - )=map {&Apache::lonnet::unescape($_)} (split(/\,/,$result)); + $creationdate,$lastrevisiondate,$owner,$copyright)=@fields; my $shortabstract=$abstract; $shortabstract=substr($abstract,0,200) if length($abstract)>200; $compiledresult.=<$url -
-Title: $title
-Author(s): $author
-Subject: $subject
-Keyword(s): $keywords
-Notes: $notes
-Abstract: $shortabstract
-MIME Type: $mimetag{$mime}
-Language: $language{$lang}
-Creation Date: $creationdate
-Last Revision Date: $lastrevisiondate
-Publisher/Owner: $owner
-Copyright/Distribution: $copyright
-Repository Location: $hostname -

-END + + if ($ENV{'form.viewselect'} eq 'Detailed Citation View') { + $compiledresult.=&detailed_citation_view(@fields); + } + elsif ($ENV{'form.viewselect'} eq 'Summary View') { + $compiledresult.=&summary_view(@fields); + } + elsif ($ENV{'form.viewselect'} eq 'Fielded Format') { + $compiledresult.=&fielded_format_view(@fields); + } + elsif ($ENV{'form.viewselect'} eq 'XML/SGML') { + $compiledresult.=&xml_sgml_view(@fields); + } + } unless ($compiledresult) { @@ -758,5 +758,109 @@ sub recursive_SQL_query_build { &recursive_SQL_query_build($dkey,$pattern); } +# ------------------------------------------------------ Detailed Citation View +sub detailed_citation_view { + my ($title,$author,$subject,$url,$keywords,$version, + $notes,$abstract,$mime,$lang, + $creationdate,$lastrevisiondate,$owner,$copyright)=@_; + my $result=<URL: $url +
+Title: $title
+Author(s): $author
+Subject: $subject
+Keyword(s): $keywords
+Notes: $notes
+Abstract: $shortabstract
+MIME Type: $mimetag{$mime}
+Language: $language{$lang}
+Creation Date: $creationdate
+Last Revision Date: $lastrevisiondate
+Publisher/Owner: $owner
+Copyright/Distribution: $copyright
+Repository Location: $hostname +

+END + return $result; +} + +# ---------------------------------------------------------------- Summary View +sub summary_view { + my ($title,$author,$subject,$url,$keywords,$version, + $notes,$abstract,$mime,$lang, + $creationdate,$lastrevisiondate,$owner,$copyright)=@_; + my $result=<URL: $url +
+Title: $title
+Author(s): $author
+Subject: $subject
+Keyword(s): $keywords
+Notes: $notes
+Abstract: $shortabstract
+MIME Type: $mimetag{$mime}
+Language: $language{$lang}
+Creation Date: $creationdate
+Last Revision Date: $lastrevisiondate
+Publisher/Owner: $owner
+Copyright/Distribution: $copyright
+Repository Location: $hostname +

+END + return $result; +} + +# -------------------------------------------------------------- Fielded Format +sub fielded_format_view { + my ($title,$author,$subject,$url,$keywords,$version, + $notes,$abstract,$mime,$lang, + $creationdate,$lastrevisiondate,$owner,$copyright)=@_; + my $result=<URL: $url +
+Title: $title
+Author(s): $author
+Subject: $subject
+Keyword(s): $keywords
+Notes: $notes
+Abstract: $shortabstract
+MIME Type: $mimetag{$mime}
+Language: $language{$lang}
+Creation Date: $creationdate
+Last Revision Date: $lastrevisiondate
+Publisher/Owner: $owner
+Copyright/Distribution: $copyright
+Repository Location: $hostname +

+END + return $result; +} + +# -------------------------------------------------------------------- XML/SGML +sub xml_sgml_view { + my ($title,$author,$subject,$url,$keywords,$version, + $notes,$abstract,$mime,$lang, + $creationdate,$lastrevisiondate,$owner,$copyright)=@_; + my $result=<URL: $url +
+Title: $title
+Author(s): $author
+Subject: $subject
+Keyword(s): $keywords
+Notes: $notes
+Abstract: $shortabstract
+MIME Type: $mimetag{$mime}
+Language: $language{$lang}
+Creation Date: $creationdate
+Last Revision Date: $lastrevisiondate
+Publisher/Owner: $owner
+Copyright/Distribution: $copyright
+Repository Location: $hostname +

+END + return $result; +} + 1; __END__