From 6c06d2fdcd678d2129953becd8e3f8ebeff90b9f Mon Sep 17 00:00:00 2001 From: miker Date: Sun, 11 Jun 2006 15:50:05 +0000 Subject: [PATCH] adding a holdings-specific stylesheet git-svn-id: svn://svn.open-ils.org/ILS/trunk@4569 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../Application/Storage/Publisher/metabib.pm | 11 +- Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm | 4 +- .../src/perlmods/OpenILS/WWW/SuperCat/Feed.pm | 16 +- Open-ILS/xsl/MARC21slim2HTMLCard-holdings.xsl | 150 ++++++++++++++++++ Open-ILS/xsl/MARC21slim2HTMLCard.xsl | 50 ++---- 5 files changed, 185 insertions(+), 46 deletions(-) create mode 100755 Open-ILS/xsl/MARC21slim2HTMLCard-holdings.xsl diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm index 5feca73b1c..72afa115d2 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm @@ -2023,13 +2023,12 @@ sub biblio_search_multi_class_fts { SELECT b.id, $relevance AS rel, $rank AS rank, - src.transcendant + b.source FROM $search_table_list $metabib_record_descriptor rd, $source_table src, $br_table b WHERE rd.record = b.id - AND src.id = b.source AND b.active IS TRUE AND b.deleted IS FALSE $fts_list @@ -2039,7 +2038,7 @@ sub biblio_search_multi_class_fts { $a_filter $l_filter $lf_filter - GROUP BY b.id, src.transcendant + GROUP BY b.id, b.source ORDER BY 3 $sort_dir LIMIT $visiblity_limit SQL @@ -2049,6 +2048,7 @@ sub biblio_search_multi_class_fts { SELECT s.* FROM ($select) s + LEFT OUTER JOIN $source_table src ON (s.source = src.id) WHERE EXISTS ( SELECT 1 FROM $asset_call_number_table cn, @@ -2068,7 +2068,7 @@ sub biblio_search_multi_class_fts { AND cn.deleted IS FALSE LIMIT 1 ) - OR transcendant IS TRUE + OR src.transcendant IS TRUE ORDER BY 3 $sort_dir SQL } else { @@ -2076,6 +2076,7 @@ sub biblio_search_multi_class_fts { SELECT s.* FROM ($select) s + LEFT OUTER JOIN $source_table src ON (s.source = src.id) WHERE EXISTS ( SELECT 1 FROM $asset_call_number_table cn, @@ -2091,7 +2092,7 @@ sub biblio_search_multi_class_fts { WHERE cn.record = s.id LIMIT 1 ) - OR transcendant IS TRUE + OR src.transcendant IS TRUE ORDER BY 3 $sort_dir SQL } diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index 82840ea166..07efd9040a 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -761,7 +761,7 @@ sub create_record_feed { $feed->unapi($unapi); $type = 'atom' if ($type eq 'html'); - $type = 'marcxml' if ($type eq 'htmlcard'); + $type = 'marcxml' if ($type eq 'htmlcard' or $type eq 'htmlholdings'); for my $rec (@$records) { next unless($rec); @@ -782,7 +782,7 @@ sub create_record_feed { } $node->id($item_tag); - $node->link(alternate => $feed->unapi . "?id=$item_tag&format=htmlcard" => 'text/html'); + $node->link(alternate => $feed->unapi . "?id=$item_tag&format=htmlholdings" => 'text/html'); $node->link(opac => $feed->unapi . "?id=$item_tag&format=opac"); $node->link(unapi => $feed->unapi . "?id=$item_tag"); $node->link('unapi-id' => $item_tag); diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm index ffd86db9e2..255ee117ec 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm @@ -475,6 +475,7 @@ sub new { my $class = shift; my $self = $class->SUPER::new; $self->type('text/html'); + $self->{xsl} = "/MARC21slim2HTMLCard.xsl"; return $self; } @@ -495,8 +496,7 @@ sub toString { $xslt_file ||= OpenSRF::Utils::SettingsClient ->new - ->config_value( dirs => 'xsl' ). - "/MARC21slim2HTMLCard.xsl"; + ->config_value( dirs => 'xsl' ).$self->{xsl}; # parse the MODS xslt ... my $atom2html_xslt = $_xslt->parse_stylesheet( $_parser->parse_file($xslt_file) ); @@ -511,8 +511,20 @@ sub toString { return $new_doc->toString(1); } +package OpenILS::WWW::SuperCat::Feed::htmlholdings; +use base 'OpenILS::WWW::SuperCat::Feed::htmlcard'; + +sub new { + my $class = shift; + my $self = $class->SUPER::new; + $self->{xsl} = "/MARC21slim2HTMLCard-holdings.xsl"; + return $self; +} package OpenILS::WWW::SuperCat::Feed::htmlcard::item; use base 'OpenILS::WWW::SuperCat::Feed::marcxml::item'; +package OpenILS::WWW::SuperCat::Feed::htmlholdings::item; +use base 'OpenILS::WWW::SuperCat::Feed::htmlcard::item'; + 1; diff --git a/Open-ILS/xsl/MARC21slim2HTMLCard-holdings.xsl b/Open-ILS/xsl/MARC21slim2HTMLCard-holdings.xsl new file mode 100755 index 0000000000..ed6c41e1f3 --- /dev/null +++ b/Open-ILS/xsl/MARC21slim2HTMLCard-holdings.xsl @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+ +
+
+ + + + Holdings + +
    + + + +
+
+ + +
  • + +
  • +
    + + +
      + + + +
    +
    + + +
  • +
      +
    • Circulating from
    • +
    • Located at
    • +
    • Status is
    • +
    +
  • +
    + + + # + + + + +

    +
    + + + + + + +
    +
    + + + + + + +

    +
    + + +

    +
    + + + . + + + + . + + + + + + + LCCN: + + + + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + -- + + + + +
    diff --git a/Open-ILS/xsl/MARC21slim2HTMLCard.xsl b/Open-ILS/xsl/MARC21slim2HTMLCard.xsl index 5ac8c4c4e3..dcfe00444b 100755 --- a/Open-ILS/xsl/MARC21slim2HTMLCard.xsl +++ b/Open-ILS/xsl/MARC21slim2HTMLCard.xsl @@ -27,42 +27,6 @@ -
    - Holdings - -
    - - - -
      - - - -
    -
    - - -
  • - -
  • -
    - - -
      - - - -
    -
    - - -
  • -
      -
    • Circulating from
    • -
    • Located at
    • -
    • Status is
    • -
    -
  • @@ -121,7 +85,19 @@ - + + + + + + + + + + + + + -- 2.43.2