Lines 259-272
sub new {
Link Here
|
259 |
|
259 |
|
260 |
my $dbh = C4::Context->dbh; |
260 |
my $dbh = C4::Context->dbh; |
261 |
my $sth = $dbh->prepare(" |
261 |
my $sth = $dbh->prepare(" |
262 |
SELECT marcxml, timestamp |
262 |
SELECT timestamp |
263 |
FROM biblioitems |
263 |
FROM biblioitems |
264 |
WHERE biblionumber=? " ); |
264 |
WHERE biblionumber=? " ); |
265 |
my $prefix = $repository->{koha_identifier} . ':'; |
265 |
my $prefix = $repository->{koha_identifier} . ':'; |
266 |
my ($biblionumber) = $args{identifier} =~ /^$prefix(.*)/; |
266 |
my ($biblionumber) = $args{identifier} =~ /^$prefix(.*)/; |
267 |
$sth->execute( $biblionumber ); |
267 |
$sth->execute( $biblionumber ); |
268 |
my ($marcxml, $timestamp); |
268 |
my ($marcxml, $timestamp); |
269 |
unless ( ($marcxml, $timestamp) = $sth->fetchrow ) { |
269 |
unless ( ($timestamp) = $sth->fetchrow ) { |
270 |
return HTTP::OAI::Response->new( |
270 |
return HTTP::OAI::Response->new( |
271 |
requestURL => $repository->self_url(), |
271 |
requestURL => $repository->self_url(), |
272 |
errors => [ new HTTP::OAI::Error( |
272 |
errors => [ new HTTP::OAI::Error( |
Lines 275-280
sub new {
Link Here
|
275 |
) ] , |
275 |
) ] , |
276 |
); |
276 |
); |
277 |
} |
277 |
} |
|
|
278 |
my $record = C4::Biblio::GetMarcBiblio( $biblionumber, 1); |
279 |
$marcxml = C4::Record::marc2marcxml( $record ); |
278 |
|
280 |
|
279 |
my $oai_sets = GetOAISetsBiblio($biblionumber); |
281 |
my $oai_sets = GetOAISetsBiblio($biblionumber); |
280 |
my @setSpecs; |
282 |
my @setSpecs; |
Lines 452-457
use strict;
Link Here
|
452 |
use warnings; |
454 |
use warnings; |
453 |
use HTTP::OAI; |
455 |
use HTTP::OAI; |
454 |
use C4::OAI::Sets; |
456 |
use C4::OAI::Sets; |
|
|
457 |
use C4::Record; |
455 |
|
458 |
|
456 |
use base ("HTTP::OAI::ListRecords"); |
459 |
use base ("HTTP::OAI::ListRecords"); |
457 |
|
460 |
|
Lines 468-474
sub new {
Link Here
|
468 |
$set = GetOAISetBySpec($token->{'set'}); |
471 |
$set = GetOAISetBySpec($token->{'set'}); |
469 |
} |
472 |
} |
470 |
my $sql = " |
473 |
my $sql = " |
471 |
SELECT biblioitems.biblionumber, biblioitems.marcxml, biblioitems.timestamp |
474 |
SELECT biblioitems.biblionumber, biblioitems.timestamp |
472 |
FROM biblioitems |
475 |
FROM biblioitems |
473 |
"; |
476 |
"; |
474 |
$sql .= " JOIN oai_sets_biblios ON biblioitems.biblionumber = oai_sets_biblios.biblionumber " if defined $set; |
477 |
$sql .= " JOIN oai_sets_biblios ON biblioitems.biblionumber = oai_sets_biblios.biblionumber " if defined $set; |
Lines 485-496
sub new {
Link Here
|
485 |
$sth->execute( @bind_params ); |
488 |
$sth->execute( @bind_params ); |
486 |
|
489 |
|
487 |
my $pos = $token->{offset}; |
490 |
my $pos = $token->{offset}; |
488 |
while ( my ($biblionumber, $marcxml, $timestamp) = $sth->fetchrow ) { |
491 |
while ( my ($biblionumber, $timestamp) = $sth->fetchrow ) { |
489 |
my $oai_sets = GetOAISetsBiblio($biblionumber); |
492 |
my $oai_sets = GetOAISetsBiblio($biblionumber); |
490 |
my @setSpecs; |
493 |
my @setSpecs; |
491 |
foreach (@$oai_sets) { |
494 |
foreach (@$oai_sets) { |
492 |
push @setSpecs, $_->{spec}; |
495 |
push @setSpecs, $_->{spec}; |
493 |
} |
496 |
} |
|
|
497 |
my $record = C4::Biblio::GetMarcBiblio( $biblionumber, 1 ); |
498 |
$marcxml = C4::Record::marc2marcxml( $record ); |
494 |
$self->record( C4::OAI::Record->new( |
499 |
$self->record( C4::OAI::Record->new( |
495 |
$repository, $marcxml, $timestamp, \@setSpecs, |
500 |
$repository, $marcxml, $timestamp, \@setSpecs, |
496 |
identifier => $repository->{ koha_identifier } . ':' . $biblionumber, |
501 |
identifier => $repository->{ koha_identifier } . ':' . $biblionumber, |
497 |
- |
|
|