Bugzilla – Attachment 46435 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]
Bug 15527: (followup) Allow using custom stylesheets
Bug-15527-followup-Allow-using-custom-stylesheets.patch (text/plain), 4.64 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-01-08 14:30:03 UTC
(
hide
)
Description:
Bug 15527: (followup) Allow using custom stylesheets
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-01-08 14:30:03 UTC
Size:
4.64 KB
patch
obsolete
>From 47a606ebc39e5c71c04adf034415c87d78c03e85 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 8 Jan 2016 11:19:50 -0300 >Subject: [PATCH] Bug 15527: (followup) Allow using custom stylesheets > >This patch introduces a syspref to let users choose their own >XSLT stylesheets for the OAI-PMH front end. > >Regards > >Sponsored-by: Universidad Empresarial Siglo 21 >--- > 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 > >diff --git a/Koha/OAI/Server/Repository.pm b/Koha/OAI/Server/Repository.pm >index 374ce29..ff2fc8e 100644 >--- a/Koha/OAI/Server/Repository.pm >+++ b/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; >diff --git a/installer/data/mysql/atomicupdate/bug_15527_oai_stylesheets.sql b/installer/data/mysql/atomicupdate/bug_15527_oai_stylesheets.sql >new file mode 100644 >index 0000000..5945cc0 >--- /dev/null >+++ b/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); >+-- } >\ No newline at end of file >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index aa53139..7e38861 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >index ee65980..5e14635 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >+++ b/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: >-- >2.7.0
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