From: Dan Scott Date: Mon, 11 Jun 2018 18:27:57 +0000 (-0400) Subject: Fix MIME types for various SuperCat feeds X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9dff7ddaa2c6963bc8e4cca5875d0f1a49034947;p=contrib%2FConifer.git Fix MIME types for various SuperCat feeds Zotero depends on valid MIME types as a way of identifying content retrieved via unAPI. Passing 'application/xml' instead of 'application/marcxml' or 'application/xml+mods' doesn't enable Zotero (or other applications) to properly distinguish the content. Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm index a5fea7e630..a23293b090 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm @@ -480,8 +480,8 @@ sub unapi2_formats { print < - - + + FORMATS } else { @@ -911,7 +911,7 @@ sub supercat { ris - text/plain + application/x-research-info-systems "; } @@ -971,7 +971,7 @@ sub supercat { ris - text/plain + application/x-research-info-systems "; for my $h (@$list) { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat/Feed.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat/Feed.pm index 56146cb988..9896c526a3 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat/Feed.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat/Feed.pm @@ -431,7 +431,7 @@ use base 'OpenILS::WWW::SuperCat::Feed'; sub new { my $class = shift; my $self = $class->SUPER::build(''); - $self->{type} = 'application/xml'; + $self->{type} = 'application/xml+mods'; $self->{item_xpath} = '/mods:modsCollection'; return $self; } @@ -445,7 +445,7 @@ sub new { my $self = $class->SUPER::build($xml); $self->{doc}->documentElement->setNamespace('http://www.loc.gov/mods/', 'mods'); $self->{doc}->documentElement->setNamespace('http://www.loc.gov/mods/', undef, 1); - $self->{type} = 'application/xml'; + $self->{type} = 'application/xml+mods'; $self->{holdings_xpath} = '/mods:mods'; return $self; } @@ -483,7 +483,7 @@ use base 'OpenILS::WWW::SuperCat::Feed::mods'; sub new { my $class = shift; my $self = $class->SUPER::build(''); - $self->{type} = 'application/xml'; + $self->{type} = 'application/xml+mods'; $self->{item_xpath} = '/mods:modsCollection'; return $self; } @@ -497,7 +497,7 @@ sub new { my $self = $class->SUPER::build($xml); $self->{doc}->documentElement->setNamespace('http://www.loc.gov/mods/v3', 'mods'); $self->{doc}->documentElement->setNamespace('http://www.loc.gov/mods/v3', undef, 1); - $self->{type} = 'application/xml'; + $self->{type} = 'application/xml+mods'; $self->{holdings_xpath} = '/mods:mods'; return $self; } @@ -534,7 +534,7 @@ use base 'OpenILS::WWW::SuperCat::Feed::mods3'; sub new { my $class = shift; my $self = $class->SUPER::build(''); - $self->{type} = 'application/xml'; + $self->{type} = 'application/xml+mods'; $self->{item_xpath} = '/mods:modsCollection'; return $self; } @@ -550,7 +550,7 @@ use base 'OpenILS::WWW::SuperCat::Feed::mods3'; sub new { my $class = shift; my $self = $class->SUPER::build(''); - $self->{type} = 'application/xml'; + $self->{type} = 'application/xml+mods'; $self->{item_xpath} = '/mods:modsCollection'; return $self; } @@ -567,7 +567,7 @@ use base 'OpenILS::WWW::SuperCat::Feed'; sub new { my $class = shift; my $self = $class->SUPER::build(''); - $self->{type} = 'application/xml'; + $self->{type} = 'application/marcxml'; $self->{item_xpath} = '/marc:collection'; return $self; } @@ -598,7 +598,7 @@ sub new { my $self = $class->SUPER::build($xml); return undef unless $self; $self->{doc}->documentElement->setNamespace('http://www.loc.gov/MARC21/slim', undef); - $self->{type} = 'application/xml'; + $self->{type} = 'application/marcxml'; $self->{holdings_xpath} = '/*[local-name()="record"]'; return $self; } @@ -807,7 +807,7 @@ use base 'OpenILS::WWW::SuperCat::Feed::marcxml'; sub new { my $class = shift; my $self = $class->SUPER::new; - $self->{type} = 'text/plain'; + $self->{type} = 'application/x-research-info-systems'; $self->{xsl} = "/MARC21slim2RIS.xsl"; return $self; } @@ -859,7 +859,7 @@ use MARC::File::XML ( BinaryEncoding => 'utf8', RecordFormat => 'USMARC' ); sub new { my $class = shift; my $self = $class->SUPER::new; - $self->{type} = 'application/octet-stream'; + $self->{type} = 'application/marc'; return $self; }