Lines 157-173
sub GetRecords {
Link Here
|
157 |
push @setSpecs, $_->{spec}; |
157 |
push @setSpecs, $_->{spec}; |
158 |
} |
158 |
} |
159 |
if ( $metadata ) { |
159 |
if ( $metadata ) { |
160 |
my $marcxml = !$deleted ? $repository->get_biblio_marcxml($biblionumber, $format) : undef; |
160 |
my ( $marcxml, $marcxml_error ); |
161 |
if ( $marcxml ) { |
161 |
( $marcxml, $marcxml_error ) = $repository->get_biblio_marcxml( $biblionumber, $format ) if !$deleted; |
162 |
$self->record( Koha::OAI::Server::Record->new( |
162 |
my %params; |
163 |
$repository, $marcxml, $timestamp, \@setSpecs, |
163 |
$params{identifier} = $repository->{koha_identifier} . ':' . $biblionumber; |
164 |
identifier => $repository->{ koha_identifier } . ':' . $biblionumber, |
164 |
$params{metadataPrefix} = $token->{metadata_prefix}; |
165 |
metadataPrefix => $token->{metadata_prefix} |
165 |
$params{about} = [$marcxml_error] if $marcxml_error; |
166 |
) ); |
166 |
if ($marcxml) { |
|
|
167 |
$self->record( |
168 |
Koha::OAI::Server::Record->new( |
169 |
$repository, $marcxml, $timestamp, \@setSpecs, |
170 |
%params |
171 |
) |
172 |
); |
167 |
} else { |
173 |
} else { |
168 |
$self->record( Koha::OAI::Server::DeletedRecord->new( |
174 |
$self->record( |
169 |
$timestamp, \@setSpecs, identifier => $repository->{ koha_identifier } . ':' . $biblionumber |
175 |
Koha::OAI::Server::DeletedRecord->new( |
170 |
) ); |
176 |
$timestamp, \@setSpecs, identifier => $repository->{koha_identifier} . ':' . $biblionumber |
|
|
177 |
) |
178 |
); |
171 |
} |
179 |
} |
172 |
} else { |
180 |
} else { |
173 |
$timestamp =~ s/ /T/; |
181 |
$timestamp =~ s/ /T/; |
Lines 175-181
sub GetRecords {
Link Here
|
175 |
$self->identifier( HTTP::OAI::Header->new( |
183 |
$self->identifier( HTTP::OAI::Header->new( |
176 |
identifier => $repository->{ koha_identifier} . ':' . $biblionumber, |
184 |
identifier => $repository->{ koha_identifier} . ':' . $biblionumber, |
177 |
datestamp => $timestamp, |
185 |
datestamp => $timestamp, |
178 |
status => $deleted ? 'deleted' : undef |
186 |
status => $deleted ? 'deleted' : undef, |
179 |
) ); |
187 |
) ); |
180 |
} |
188 |
} |
181 |
} |
189 |
} |