--- loncom/interface/lonsearchcat.pm 2001/03/21 02:09:38 1.50 +++ loncom/interface/lonsearchcat.pm 2001/03/21 03:06:50 1.56 @@ -52,8 +52,16 @@ my %metadatafields; my %cprtag; my %mimetag; my $closebutton; -my $viewselect=< +my $basicviewselect=< + + + + + +END +my $advancedviewselect=< @@ -262,7 +270,7 @@ ENDDOCUMENT $closebutton -$viewselect +$basicviewselect


Advanced Search

@@ -271,7 +279,7 @@ $scrout $closebutton -$viewselect +$advancedviewselect

@@ -593,7 +601,7 @@ sub output_results { $replyfile=$r->dir_config('lonDaemons').'/tmp/'.$1; $reply=~/(.*?)\_/; my $hostname=$1; - + sleep 3; # temporary fix, need to check for completion and status { while (1) { last if -e $replyfile; @@ -615,6 +623,7 @@ sub output_results { $creationdate,$lastrevisiondate,$owner,$copyright)=@fields; my $shortabstract=$abstract; $shortabstract=substr($abstract,0,200) if length($abstract)>200; + $fields[7]=$shortabstract; $compiledresult.=< END @@ -624,18 +633,29 @@ onClick="javascript:select_data('$title'
END - - if ($ENV{'form.viewselect'} eq 'Detailed Citation View') { - $compiledresult.=&detailed_citation_view(@fields); + my $httphost=$ENV{'HTTP_HOST'}; + + my $viewselect; + if ($mode eq 'Basic') { + $viewselect=$ENV{'form.basicviewselect'}; } - elsif ($ENV{'form.viewselect'} eq 'Summary View') { - $compiledresult.=&summary_view(@fields); + elsif ($mode eq 'Advanced') { + $viewselect=$ENV{'form.advancedviewselect'}; } - elsif ($ENV{'form.viewselect'} eq 'Fielded Format') { - $compiledresult.=&fielded_format_view(@fields); + + if ($viewselect eq 'Detailed Citation View') { + $compiledresult.=&detailed_citation_view(@fields, + $hostname,$httphost); } - elsif ($ENV{'form.viewselect'} eq 'XML/SGML') { - $compiledresult.=&xml_sgml_view(@fields); + elsif ($viewselect eq 'Summary View') { + $compiledresult.=&summary_view(@fields,$hostname,$httphost); + } + elsif ($viewselect eq 'Fielded Format') { + $compiledresult.=&fielded_format_view(@fields,$hostname, + $httphost); + } + elsif ($viewselect eq 'XML/SGML') { + $compiledresult.=&xml_sgml_view(@fields,$hostname,$httphost); } } @@ -761,24 +781,23 @@ sub recursive_SQL_query_build { # ------------------------------------------------------ Detailed Citation View sub detailed_citation_view { my ($title,$author,$subject,$url,$keywords,$version, - $notes,$abstract,$mime,$lang, - $creationdate,$lastrevisiondate,$owner,$copyright)=@_; + $notes,$shortabstract,$mime,$lang, + $creationdate,$lastrevisiondate,$owner,$copyright, + $hostname,$httphost)=@_; + return 'abc'; my $result=<URL: $url -
-Title: $title
-Author(s): $author
+$owner, last revised $lastrevisiondate +

$title

+

$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 +Copyright/Distribution: $cprtag{$copyright}
+$shortabstract

END return $result; @@ -787,24 +806,14 @@ END # ---------------------------------------------------------------- Summary View sub summary_view { my ($title,$author,$subject,$url,$keywords,$version, - $notes,$abstract,$mime,$lang, - $creationdate,$lastrevisiondate,$owner,$copyright)=@_; + $notes,$shortabstract,$mime,$lang, + $creationdate,$lastrevisiondate,$owner,$copyright, + $hostname,$httphost)=@_; 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 +$author
+$title
+$owner -- $lastrevisiondate
+$cprtag{$copyright}

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

END return $result; @@ -839,25 +849,36 @@ END # -------------------------------------------------------------------- XML/SGML sub xml_sgml_view { my ($title,$author,$subject,$url,$keywords,$version, - $notes,$abstract,$mime,$lang, - $creationdate,$lastrevisiondate,$owner,$copyright)=@_; + $notes,$shortabstract,$mime,$lang, + $creationdate,$lastrevisiondate,$owner,$copyright, + $hostname,$httphost)=@_; 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 -

+
+<LonCapaResource>
+<url>http://$httphost$url</url>
+<title>$title</title>
+<author>$author</author>
+<subject>$subject</subject>
+<keywords>$keywords</keywords>
+<notes>$notes</notes>
+<mimeInfo>
+<mime>$mime</mime>
+<mimetag>$mimetag{$mime}</mimetag>
+</mimeInfo>
+<languageInfo>
+<language>$lang</language>
+<languagetag>$language{$lang}</languagetag>
+</languageInfo>
+<creationdate>$creationdate</creationdate>
+<lastrevisiondate>$lastrevisiondate</lastrevisiondate>
+<owner>$owner</owner>
+<copyrightInfo>
+<copyright>$copyright</copyright>
+<copyrighttag>$cprtag{$copyright}</copyrighttag>
+</copyrightInfo>
+<repositoryLocation>$hostname</repositoryLocation>
+<shortabstract>$shortabstract</shortabstract>
+
END return $result; }