From a9bff78aa0387e00ff85c9c99bdad149324e074f Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 10 Mar 2006 15:06:50 +0000 Subject: [PATCH] adding proper mods v3 support git-svn-id: svn://svn.open-ils.org/ILS/trunk@3320 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/SuperCat.pm | 13 ++++++++++ Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm | 2 ++ .../src/perlmods/OpenILS/WWW/SuperCat/Feed.pm | 26 +++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm index 1d00204aae..6e145d0e0f 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm @@ -48,6 +48,19 @@ sub child_init { # and an xslt parser $_xslt = new XML::LibXSLT; + # parse the MODS xslt ... + my $mods3_xslt = $_parser->parse_file( + OpenSRF::Utils::SettingsClient + ->new + ->config_value( dirs => 'xsl' ). + "/MARC21slim2MODS3.xsl" + ); + # and stash a transformer + $record_xslt{mods3}{xslt} = $_xslt->parse_stylesheet( $mods3_xslt ); + $record_xslt{mods3}{namespace_uri} = 'http://www.loc.gov/mods/v3'; + $record_xslt{mods3}{docs} = 'http://www.loc.gov/mods/'; + $record_xslt{mods3}{schema_location} = 'http://www.loc.gov/standards/mods/v3/mods-3-1.xsd'; + # parse the MODS xslt ... my $mods_xslt = $_parser->parse_file( OpenSRF::Utils::SettingsClient diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index 6fc587ec26..05c53e36cf 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -381,6 +381,8 @@ Content-type: application/opensearchdescription+xml; charset=utf-8 template="$base/1.1/$lib/atom/$class/{searchTerms}?startPage={startPage?}&startIndex={startIndex?}&count={count?}&language={language?}"/> + SUPER::build(''); + $self->{type} = 'application/xml'; + $self->{item_xpath} = '/mods:modsCollection'; + return $self; +} + +package OpenILS::WWW::SuperCat::Feed::mods3::item; +use base 'OpenILS::WWW::SuperCat::Feed::mods3'; + +sub new { + my $class = shift; + my $xml = shift; + my $self = $class->SUPER::build($xml); + $self->{doc}->documentElement->setNamespace('http://www.loc.gov/mods/v3', 'mods'); + $self->{type} = 'application/xml'; + return $self; +} + + #---------------------------------------------------------- package OpenILS::WWW::SuperCat::Feed::marcxml; -- 2.43.2