From 5dedda9daea5025e9ca9764d3460d32fc64fd164 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Tue, 7 Nov 2017 11:51:20 +0000 Subject: [PATCH] Bug 19353: Ability to use xsl template on marc21 and marcxml metadataprefixes in OAI provider Test plan: 0) apply the patchset 1) setup oai server with oaiconf file defining xsl_file for metadata format marcxml or marc21 2) play with your oai and confirm that records are transformed as expected 3) prove t/db_dependent/OAI/Server.t --- Koha/OAI/Server/Record.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Koha/OAI/Server/Record.pm b/Koha/OAI/Server/Record.pm index c0c4b4b..c9c889a 100644 --- a/Koha/OAI/Server/Record.pm +++ b/Koha/OAI/Server/Record.pm @@ -43,7 +43,12 @@ sub new { my $format = $args{metadataPrefix}; my $record_dom; - if ( $format ne 'marcxml' && $format ne 'marc21' ) { + my $xsl_file = $repository->{conf} ? + defined $repository->{conf}->{format}->{$format}->{xsl_file} + : undef; + if (($format ne 'marc21' && $format ne 'marcxml') + || $xsl_file + ) { my $args = { OPACBaseURL => "'" . C4::Context->preference('OPACBaseURL') . "'" }; -- 2.1.4