@@ -, +, @@ --- Koha/OAI/Server/Repository.pm | 28 ++++++++++++++++------ .../opac-tmpl/{xslt => bootstrap/css}/OAI.xslt | 2 +- 2 files changed, 22 insertions(+), 8 deletions(-) rename koha-tmpl/opac-tmpl/{xslt => bootstrap/css}/OAI.xslt (99%) --- a/Koha/OAI/Server/Repository.pm +++ a/Koha/OAI/Server/Repository.pm @@ -65,12 +65,19 @@ respecively MARC21slim2OAIDC.xsl for MARC21 and MARC21slim2OAIDC.xsl for UNIMARC. In extended mode, it's possible to parameter other format than marcxml or -Dublin Core. A new syspref OAI-PMH:ConfFile specify a YAML configuration file -which list available metadata formats and XSL file used to create them from -marcxml records. If this syspref isn't set, Koha OAI server works in simple -mode. A configuration file koha-oai.conf can look like that: +Dublin Core. Syspref OAI-PMH:ConfFile specify a YAML configuration file which +list available metadata formats and XSL file used to create them from marcxml +records. If this syspref isn't set, Koha OAI server works in simple mode. + +Extended mode is required when you want: (a) to return item info +(C parameter), (b) to provide other metadata format than +oai_dc/marcxml (C parameter), (c) to provide a localized OAI server +view (C parameter). + +A configuration file koha-oai.conf can look like that: --- + xslt: /usr/local/koha/xslt/serverview.xslt format: vs: metadataPrefix: vs @@ -103,8 +110,9 @@ sub new { $self->{ koha_stylesheet } = { }; # Build when needed # Load configuration file if defined in OAI-PMH:ConfFile syspref - if ( my $file = C4::Context->preference("OAI-PMH:ConfFile") ) { - $self->{ conf } = LoadFile( $file ); + my $conf = C4::Context->preference("OAI-PMH:ConfFile"); + if ( $conf ) { + $self->{ conf } = $conf = LoadFile( $conf ); my @formats = keys %{ $self->{conf}->{format} }; $self->{ koha_metadata_format } = \@formats; } @@ -136,7 +144,13 @@ sub new { } $response->set_handler( XML::SAX::Writer->new( Output => *STDOUT ) ); - $response->xslt( "/opac-tmpl/xslt/OAI.xslt" ); + + $response->xslt( + $conf && $conf->{xslt} + ? $conf->{xslt} + : "/opac-tmpl/bootstrap/css/OAI.xslt" + ); + $response->generate; bless $self, $class; --- a/koha-tmpl/opac-tmpl/xslt/OAI.xslt +++ a/koha-tmpl/opac-tmpl/xslt/OAI.xslt @@ -808,7 +808,7 @@ + select="$text" /> --