use strict; use warnings;
use base qw/OpenSRF::Application/;
-use Net::Z3950;
+use OpenILS::Utils::ZClient;
use MARC::Record;
use MARC::File::XML;
use Unicode::Normalize;
return $editor->event unless $editor->checkauth;
return $editor->event unless $editor->allowed('REMOTE_Z3950_QUERY');
- my $connection = new Net::Z3950::Connection(
+ my $connection = OpenILS::Utils::ZClient->new(
$host, $port,
databaseName => $db,
user => $username,
$logger->info("z3950: query => $query");
try {
- $results = $connection->search( $query );
+ $results = $connection->search_pqf( $query );
} catch Error with { $err = shift; };
return OpenILS::Event->new(
$logger->info("z3950: search returned $count hits");
my $tend = $limit + $offset;
- $offset++; # records start at 1
my $end = ($tend <= $count) ? $tend : $count;
- for($offset..$end) {
+ for($offset..$end - 1) {
my $err;
my $mods;
try {
my $rec = $results->record($_);
- $marc = MARC::Record->new_from_usmarc($rec->rawdata());
+ $marc = MARC::Record->new_from_usmarc($rec->raw());
$marcs = entityize($marc->as_xml_record);
my $doc = XML::LibXML->new->parse_string($marcs);
$marcxml = entityize( $doc->documentElement->toString );
# $services{$service}->{attrs}->{$_}->{code} . " \"" . $$hash{$_} . "\" ";
$str .=
'@attr 1=' . $services{$service}->{attrs}->{$_}->{code} . # add the use attribute
- ' @attr 4=' . $services{$service}->{attrs}->{$_}->{format} . # add teh structure attribute
+ ' @attr 4=' . $services{$service}->{attrs}->{$_}->{format} . # add the structure attribute
" \"" . $$hash{$_} . "\" "; # add the search term
}
return $str;