Bugzilla – Attachment 39993 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]
Bug 3206 [Follow-up]: OAI repository deleted records support.
Bug-3206-Follow-up-OAI-repository-deleted-records-.patch (text/plain), 5.48 KB, created by
Matthias Meusburger
on 2015-06-08 13:34:12 UTC
(
hide
)
Description:
Bug 3206 [Follow-up]: OAI repository deleted records support.
Filename:
MIME Type:
Creator:
Matthias Meusburger
Created:
2015-06-08 13:34:12 UTC
Size:
5.48 KB
patch
obsolete
>From 7df4a2eb4eae4143bbd80ba4d8a2cb14a2556c79 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] Bug 3206 [Follow-up]: OAI repository deleted records > support. > > - Fix QA. >--- > 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 ecb96fa..7071e84 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -233,6 +233,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 5be11e8..ade616e 100755 >--- a/opac/oai.pl >+++ b/opac/oai.pl >@@ -242,8 +242,7 @@ sub new { > > package C4::OAI::DeletedRecord; > >-use strict; >-use warnings; >+use Modern::Perl; > use HTTP::OAI; > use HTTP::OAI::Metadata::OAI_DC; > >@@ -288,23 +287,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(), >@@ -358,7 +354,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; >@@ -523,7 +519,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.10.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 3206
:
39771
|
39794
|
39795
|
39797
|
39993
|
40427
|
40459
|
40460
|
40478
|
40479
|
40846
|
40849