adding proper mods v3 support
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Mar 2006 15:06:50 +0000 (15:06 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 10 Mar 2006 15:06:50 +0000 (15:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3320 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm

index 1d00204..6e145d0 100644 (file)
@@ -49,6 +49,19 @@ sub child_init {
        $_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
                        ->new
index 6fc587e..05c53e3 100644 (file)
@@ -381,6 +381,8 @@ Content-type: application/opensearchdescription+xml; charset=utf-8
        template="$base/1.1/$lib/atom/$class/{searchTerms}?startPage={startPage?}&amp;startIndex={startIndex?}&amp;count={count?}&amp;language={language?}"/>
   <Url type="application/rss+xml"
        template="$base/1.1/$lib/rss2/$class/{searchTerms}?startPage={startPage?}&amp;startIndex={startIndex?}&amp;count={count?}&amp;language={language?}"/>
+  <Url type="application/mods3+xml"
+       template="$base/1.1/$lib/mods3/$class/{searchTerms}?startPage={startPage?}&amp;startIndex={startIndex?}&amp;count={count?}&amp;language={language?}"/>
   <Url type="application/mods+xml"
        template="$base/1.1/$lib/mods/$class/{searchTerms}?startPage={startPage?}&amp;startIndex={startIndex?}&amp;count={count?}&amp;language={language?}"/>
   <Url type="application/marcxml+xml"
index 38d5cf5..1124d45 100644 (file)
@@ -335,6 +335,32 @@ sub link {
 
 #----------------------------------------------------------
 
+package OpenILS::WWW::SuperCat::Feed::mods3;
+use base 'OpenILS::WWW::SuperCat::Feed';
+
+sub new {
+       my $class = shift;
+       my $self = $class->SUPER::build('<mods:modsCollection version="3.0" xmlns:mods="http://www.loc.gov/mods/v3"/>');
+       $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;
 use base 'OpenILS::WWW::SuperCat::Feed';