From b9301a95c59231bad74346420954ba64727adbf1 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 22 Mar 2006 03:40:43 +0000 Subject: [PATCH] adding subject searches to feed output git-svn-id: svn://svn.open-ils.org/ILS/trunk@3409 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/SuperCat.pm | 5 +--- Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm | 27 +++++++++---------- .../src/perlmods/OpenILS/WWW/SuperCat/Feed.pm | 10 ++++++- Open-ILS/xsl/ATOM2XHTML.xsl | 15 +++++++---- Open-ILS/xsl/MARC21slim2ATOM.xsl | 2 +- 5 files changed, 34 insertions(+), 25 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm index 6e145d0e0f..bb60a2db1e 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm @@ -285,10 +285,7 @@ sub retrieve_metarecord_mods { my $id = $mr->id; $recordIdentifier->appendTextNode( - sprintf("tag:open-ils.org,$year-\%0.2d-\%0.2d:biblio-record_entry/$id", - $month, - $day - ) + sprintf("tag:open-ils.org,$year-\%0.2d-\%0.2d:metabib-metarecord/$id", $month, $day) ); $recordInfo->appendChild($recordIdentifier); diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index 45a25236bf..af6d597540 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -308,7 +308,7 @@ sub bookbag_feed { my $bucket_tag = "tag:$host,$year:record_bucket/$id"; if ($type eq 'opac') { - print "Location: $base/../../../opac/en-US/skin/default/xml/rresult.xml?rt=list&" . + print "Location: $root/../en-US/skin/default/xml/rresult.xml?rt=list&" . join('&', map { "rl=" . $_->target_biblio_record_entry } @{ $bucket->items }) . "\n\n"; return Apache2::Const::OK; @@ -321,19 +321,20 @@ sub bookbag_feed { ); $feed->root($root); - $feed->title("Items in Book Bag #".$bucket->id); + $feed->title("Items in Book Bag [".$bucket->name."]"); $feed->creator($host); $feed->update_ts(gmtime_ISO8601()); - $feed->link(atom => $base . "/bookbag/atom/$id" => 'application/atom+xml'); - $feed->link(rss2 => $base . "/bookbag/rss2/$id"); - $feed->link(html => $base . "/bookbag/html/$id" => 'text/html'); + $feed->link(atom => $base . "/atom/$id" => 'application/atom+xml'); + $feed->link(rss2 => $base . "/rss2/$id"); + $feed->link(html => $base . "/html/$id" => 'text/html'); + $feed->link(unapi => $unapi); $feed->link( OPAC => $root . '../en-US/skin/default/xml/rresult.xml?rt=list&' . join('&', map { 'rl=' . $_->target_biblio_record_entry } @{$bucket->items} ), - 'text/xhtml' + 'text/html' ); @@ -450,10 +451,10 @@ sub opensearch_feed { my $limit = $cgi->param('count') || 10; my $lang = $cgi->param('language') || 'en-US'; - $page = 1 if ($page =~ /^{/); - $offset = 1 if ($offset =~ /^{/); - $limit = 10 if ($limit =~ /^{/); - $lang = 'en-US' if ($lang =~ /^{/); + $page = 1 if ($page !~ /^\d+$/); + $offset = 1 if ($offset =~ /^\d+$/); + $limit = 10 if ($limit =~ /^\d+$/); $limit = 25 if ($limit > 25); + $lang = 'en-US' if ($lang =~ /^{/ or $lang eq '*'); if ($page > 1) { $offset = ($page - 1) * $limit; @@ -500,6 +501,7 @@ sub opensearch_feed { $unapi, ); $feed->root($root); + $feed->lib($org); $feed->title("Search results for [$class => $terms] at ".$org_unit->[0]->name); $feed->creator($host); @@ -544,10 +546,7 @@ sub opensearch_feed { 'application/opensearch+xml' ); - $feed->link( - unapi => - $unapi - ); + $feed->link( unapi => $unapi); $feed->link( alternate => diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm index 8203a35145..285acd0892 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm @@ -35,6 +35,13 @@ sub type { return $self->{type}; } +sub lib { + my $self = shift; + my $lib = shift; + $self->{lib} = $lib if ($lib); + return $self->{lib}; +} + sub base { my $self = shift; my $base = shift; @@ -402,6 +409,7 @@ sub toString { my $self = shift; my $base = $self->base; my $root = $self->root; + my $lib = $self->lib || '-'; $self->composeDoc; @@ -417,7 +425,7 @@ sub toString { # parse the MODS xslt ... my $atom2html_xslt = $_xslt->parse_stylesheet( $_parser->parse_file($xslt_file) ); - my $new_doc = $atom2html_xslt->transform($self->{doc}, base_dir => "'$root'"); + my $new_doc = $atom2html_xslt->transform($self->{doc}, base_dir => "'$root'", lib => "'$lib'"); return $new_doc->toString(1); } diff --git a/Open-ILS/xsl/ATOM2XHTML.xsl b/Open-ILS/xsl/ATOM2XHTML.xsl index 0fb3354286..3781a0a56b 100644 --- a/Open-ILS/xsl/ATOM2XHTML.xsl +++ b/Open-ILS/xsl/ATOM2XHTML.xsl @@ -67,7 +67,7 @@ To-do list: (untitled) view full entry by - categories: + Subjects: from comments download @@ -125,7 +125,7 @@ To-do list: - + @@ -382,9 +382,14 @@ To-do list: - - - + + + + + + + + diff --git a/Open-ILS/xsl/MARC21slim2ATOM.xsl b/Open-ILS/xsl/MARC21slim2ATOM.xsl index 476732af09..e706763b41 100644 --- a/Open-ILS/xsl/MARC21slim2ATOM.xsl +++ b/Open-ILS/xsl/MARC21slim2ATOM.xsl @@ -59,7 +59,7 @@ - + -- 2.43.2