Bugzilla – Attachment 46464 Details for
Bug 15527
OAI-PMH should have a stylesheet to aid usability
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF]Bug 15527: Custom stylesheet in extended mode
SIGNED-OFFBug-15527-Custom-stylesheet-in-extended-.patch (text/plain), 3.75 KB, created by
Héctor Eduardo Castro Avalos
on 2016-01-10 01:45:26 UTC
(
hide
)
Description:
[SIGNED-OFF]Bug 15527: Custom stylesheet in extended mode
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-01-10 01:45:26 UTC
Size:
3.75 KB
patch
obsolete
>From aede8ef7c28ded91eff64e907f3601d302934d07 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Fri, 8 Jan 2016 12:12:12 -0300 >Subject: [PATCH] [SIGNED-OFF]Bug 15527: Custom stylesheet in extended mode > >Add a parameter to YAML config file in order to specify a local XSLT >used style the XML returned by OAI Server. Some doc. > >Move default XSLT from /opac-tmpl/xslt to >/opac-tmpl/bootstrap/css/OAI.xslt. > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Works as advertised >--- > 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%) > >diff --git a/Koha/OAI/Server/Repository.pm b/Koha/OAI/Server/Repository.pm >index 374ce29..ee667ed 100644 >--- a/Koha/OAI/Server/Repository.pm >+++ b/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<include_items> parameter), (b) to provide other metadata format than >+oai_dc/marcxml (C<format> parameter), (c) to provide a localized OAI server >+view (C<xslt> 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; >diff --git a/koha-tmpl/opac-tmpl/xslt/OAI.xslt b/koha-tmpl/opac-tmpl/bootstrap/css/OAI.xslt >similarity index 99% >rename from koha-tmpl/opac-tmpl/xslt/OAI.xslt >rename to koha-tmpl/opac-tmpl/bootstrap/css/OAI.xslt >index 976f0c2..9407611 100644 >--- a/koha-tmpl/opac-tmpl/xslt/OAI.xslt >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/OAI.xslt >@@ -808,7 +808,7 @@ > <xsl:with-param name="text"> > <xsl:call-template name="replace-substring"> > <xsl:with-param name="value" >- select="translate($text,' ',' ')" /> >+ select="$text" /> > <xsl:with-param name="from" select="'	'" /> > <xsl:with-param name="to" > select="'        '" /> >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15527
:
46429
|
46430
|
46434
|
46435
|
46438
|
46459
|
46460
|
46464
|
49414
|
49451
|
49452