->gather(1);
$list = [ map { (keys %$_)[0] } @$list ];
- push @$list, 'htmlholdings','html', 'marctxt';
+ push @$list, 'htmlholdings','html', 'marctxt', 'ris';
for my $browse_axis ( qw/title author subject topic series item-age/ ) {
for my $record_browse_format ( @$list ) {
<format name='html-full' type='text/html'/>
<format name='htmlholdings-full' type='text/html'/>
<format name='marctxt' type='text/plain'/>
+ <format name='ris' type='text/plain'/>
FORMATS
} elsif ($type eq 'metarecord') {
$body .= <<" FORMATS";
<format name='html-full' type='text/html'/>
<format name='htmlholdings-full' type='text/html'/>
<format name='marctxt' type='text/plain'/>
+ <format name='ris' type='text/plain'/>
FORMATS
@{ $supercat->request("open-ils.supercat.$type.formats")->gather(1) }
and !grep
{ $_ eq $base_format }
- qw/opac html htmlholdings marctxt/
+ qw/opac html htmlholdings marctxt ris/
) {
print "Content-type: text/html; charset=utf-8\n\n";
$apache->custom_response( 406, <<" HTML");
<format>
<name>marctxt</name>
<type>text/plain</type>
+ </format>
+ <format>
+ <name>ris</name>
+ <type>text/plain</type>
</format>";
}
<format>
<name>marctxt</name>
<type>text/plain</type>
+ </format>
+ <format>
+ <name>ris</name>
+ <type>text/plain</type>
</format>";
for my $h (@$list) {
$feed->unapi($unapi) if ($flesh);
$type = 'atom' if ($type eq 'html');
- $type = 'marcxml' if (($type eq 'htmlholdings') || ($type eq 'marctxt'));
+ $type = 'marcxml' if (($type eq 'htmlholdings') || ($type eq 'marctxt') || ($type eq 'ris'));
#$records = $supercat->request( "open-ils.supercat.record.object.retrieve", $records )->gather(1);
'bib.titlealternative' => 'title',
'bib.titleseries' => 'series',
'eg.series' => 'title',
- 'eg.identifier' => 'keyword|identifier',
+ 'eg.identifier' => 'keyword|identifier',
# Author/Name class:
'eg.author' => 'author',
'open-ils.search.biblio.multiclass.query' => {offset => $offset, limit => $limit} => $search_string => 1
)->gather(1);
- my $bre = $supercat->request( 'open-ils.supercat.record.object.retrieve' => [ map { $_->[0] } @{$recs->{ids}} ] )->gather(1);
+ my $bre = $supercat->request( 'open-ils.supercat.record.object.retrieve' => [ map { $_->[0] } @{$recs->{ids}} ] )->gather(1);
foreach my $record (@$bre) {
my $marcxml = $record->marc;
my $bib_holdings = $supercat->request('open-ils.supercat.record.basic_holdings.retrieve', $record->id, $shortname || '-')->gather(1);
my $marc = MARC::Record->new_from_xml($marcxml, 'UTF8', 'XML');
+ # Force record leader to 'a' as our data is always UTF8
+ # Avoids marc8_to_utf8 from being invoked with horrible results
+ # on the off-chance the record leader isn't correct
+ my $ldr = $marc->leader;
+ substr($ldr, 9, 1, 'a');
+ $marc->leader($ldr);
+
# Expects the record ID in the 001
$marc->delete_field($_) for ($marc->field('001'));
if (!$marc->field('001')) {
)
);
- $marcxml = $marc->as_xml_record();
+ # Ensure the data is encoded as UTF8 before we hand it off
+ $marcxml = encode_utf8($marc->as_xml_record());
$marcxml =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>//o;
}
);
}
- $resp->numberOfRecords($recs->{count});
+ $resp->numberOfRecords($recs->{count});
- } elsif ( $resp->type eq 'explain' ) {
+ } elsif ( $resp->type eq 'explain' ) {
if (!$ex_doc) {
my $host = $cgi->virtual_host || $cgi->server_name;
);
}
- print $cgi->header( -type => 'application/xml' );
- print $U->entityize($resp->asXML) . "\n";
- return Apache2::Const::OK;
+ print $cgi->header( -type => 'application/xml' );
+ print $U->entityize($resp->asXML) . "\n";
+ return Apache2::Const::OK;
}