From ae9aa7f61d45020b0eb625aa47487d177e23661c 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Martin Šťastný Signed-off-by: Katrin Fischer --- 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 57bc67a665..a916da411c 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.11.0