@@ -, +, @@ --- Koha/OAI/Server/Repository.pm | 8 +++++++- .../data/mysql/atomicupdate/bug_15527_oai_stylesheets.sql | 12 ++++++++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/web_services.pref | 4 ++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_15527_oai_stylesheets.sql --- a/Koha/OAI/Server/Repository.pm +++ a/Koha/OAI/Server/Repository.pm @@ -136,7 +136,13 @@ sub new { } $response->set_handler( XML::SAX::Writer->new( Output => *STDOUT ) ); - $response->xslt( "/opac-tmpl/xslt/OAI.xslt" ); + + my $stylesheet = C4::Context->preference('OAI-PMH:CustomStylesheet'); + if ( !$stylesheet ) { + # fallback to shipped xslt + $stylesheet = '/opac-tmpl/xslt/OAI.xslt'; + } + $response->xslt( $stylesheet ); $response->generate; bless $self, $class; --- a/installer/data/mysql/atomicupdate/bug_15527_oai_stylesheets.sql +++ a/installer/data/mysql/atomicupdate/bug_15527_oai_stylesheets.sql @@ -0,0 +1,12 @@ +INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) +VALUES('OAI-PMH:CustomStylesheet',NULL,'Use a custom stylesheet instead of the default stylesheet for the OAI-PMH server. Leave the field blank to use the default.',NULL,'free'); + +-- $DBversion = "3.23.00.XXX"; +-- if(CheckVersion($DBversion)) { +-- $dbh->do(q{ +-- INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) +-- VALUES('OAI-PMH:CustomStylesheet',NULL,'Use a custom stylesheet instead of the default stylesheet for the OAI-PMH server. Leave the field blank to use the default.',NULL,'free') +-- }); +-- print "Upgrade to $DBversion done (Bug 15527: Add a stylesheet for OAI-PMH to aid usability)\n"; +-- SetVersion($DBversion); +-- } --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -255,6 +255,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'), ('OAI-PMH:DeletedRecord','persistent','Koha\'s deletedbiblio table will never be deleted (persistent), might be deleted (transient), or will never have any data in it (no)','transient|persistent|no','Choice'), ('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'), +('OAI-PMH:CustomStylesheet',NULL,NULL,'Use a custom stylesheet instead of the default stylesheet for the OAI-PMH server. Leave the field blank to use the default.','free'), ('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'), ('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'), ('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref @@ -28,6 +28,10 @@ Web services: no: Disable - automatic update of OAI-PMH sets when a bibliographic record is created or updated - + - Use + - pref: "OAI-PMH:CustomStylesheet" + - instead of the default stylesheet for the OAI-PMH server. Leave the field blank to use the default. + - - Koha's deletedbiblio table - pref: "OAI-PMH:DeletedRecord" choices: --