Bugzilla – Attachment 40427 Details for
Bug 3206
OAI-PMH repository deleted record support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 3206 [Follow-up]: OAI repository deleted records support.
SIGNED-OFF-Bug-3206-Follow-up-OAI-repository-delet.patch (text/plain), 5.67 KB, created by
Bernardo Gonzalez Kriegel
on 2015-06-19 23:21:03 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 3206 [Follow-up]: OAI repository deleted records support.
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-06-19 23:21:03 UTC
Size:
5.67 KB
patch
obsolete
>From d02f13b275b6b86f1898ef381a10c9f0c670146e Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Mon, 8 Jun 2015 15:33:24 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 3206 [Follow-up]: OAI repository deleted > records support. > > - Fix QA. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >New pref in right order, new option 'no' on syspref, other >fixes following comment #12 >All seems to work >No errors >--- > installer/data/mysql/sysprefs.sql | 4 +-- > .../en/modules/admin/preferences/web_services.pref | 1 + > opac/oai.pl | 28 +++++++++----------- > 3 files changed, 15 insertions(+), 18 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 78c5fc1..e38332a 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -232,6 +232,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OAI-PMH:archiveID','KOHA-OAI-TEST',NULL,'OAI-PMH archive identification','Free'), > ('OAI-PMH:AutoUpdateSets','0','','Automatically update OAI sets when a bibliographic record is created or updated','YesNo'), > ('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'), > ('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'), >@@ -479,6 +480,5 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'), > ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), > ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), >-('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), >-('OAI-PMH:DeletedRecord','persistent','Koha\'s deletedbiblio table will never be deleted (persistent) or might be deleted (transient)','transient|persistent','Choice') >+('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','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 518dfbd..ee65980 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 >@@ -33,6 +33,7 @@ Web services: > choices: > persistent: will never be emptied or truncated (persistent) > transient: might be emptied or truncated at some point (transient) >+ no: will never have any data in it (no) > - "." > ILS-DI: > - >diff --git a/opac/oai.pl b/opac/oai.pl >index 82af58c..ab56d79 100755 >--- a/opac/oai.pl >+++ b/opac/oai.pl >@@ -254,8 +254,7 @@ sub new { > > package C4::OAI::DeletedRecord; > >-use strict; >-use warnings; >+use Modern::Perl; > use HTTP::OAI; > use HTTP::OAI::Metadata::OAI_DC; > >@@ -300,23 +299,20 @@ sub new { > my $self = HTTP::OAI::GetRecord->new(%args); > > my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare(" >- SELECT marcxml, timestamp >- FROM biblioitems >- WHERE biblionumber=? " ); > my $prefix = $repository->{koha_identifier} . ':'; > my ($biblionumber) = $args{identifier} =~ /^$prefix(.*)/; >- $sth->execute( $biblionumber ); > my ($marcxml, $timestamp); > my $deleted = 0; >- unless ( ($marcxml, $timestamp) = $sth->fetchrow ) { >- $sth = $dbh->prepare(" >- SELECT biblionumber, timestamp >- FROM deletedbiblio >- WHERE biblionumber=? " ); >- $sth->execute( $biblionumber ); >+ unless ( ($marcxml, $timestamp) = $dbh->selectrow_array(q/ >+ SELECT marcxml, timestamp >+ FROM biblioitems >+ WHERE biblionumber=? /, undef, $biblionumber)) { >+ >+ unless ( ($marcxml, $timestamp) = $dbh->selectrow_array(q/ >+ SELECT biblionumber, timestamp >+ FROM deletedbiblio >+ WHERE biblionumber=? /, undef, $biblionumber )) { > >- unless ( ($marcxml, $timestamp) = $sth->fetchrow ) { > > return HTTP::OAI::Response->new( > requestURL => $repository->self_url(), >@@ -370,7 +366,7 @@ sub new { > } > my $max = $repository->{koha_max_count}; > my $sql = " >- (SELECT biblioitems.biblionumber, timestamp >+ (SELECT biblioitems.biblionumber, biblioitems.timestamp > FROM biblioitems > "; > $sql .= " JOIN oai_sets_biblios ON biblioitems.biblionumber = oai_sets_biblios.biblionumber " if defined $set; >@@ -535,7 +531,7 @@ sub new { > } > my $max = $repository->{koha_max_count}; > my $sql = " >- (SELECT biblioitems.biblionumber, marcxml, timestamp >+ (SELECT biblioitems.biblionumber, biblioitems.marcxml, biblioitems.timestamp > FROM biblioitems > "; > $sql .= " JOIN oai_sets_biblios ON biblioitems.biblionumber = oai_sets_biblios.biblionumber " if defined $set; >-- >1.7.9.5
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 3206
:
39771
|
39794
|
39795
|
39797
|
39993
|
40427
|
40459
|
40460
|
40478
|
40479
|
40846
|
40849