Changed to use new Zconn object in Context.pm. Not sure if the Zconn

should be set within the subroutine or should be passed in via the
script -- Chris, what do you think?
This commit is contained in:
kados 2006-02-25 22:47:37 +00:00
parent 43ba997935
commit 13388132cd
1 changed files with 2 additions and 16 deletions

View File

@ -62,12 +62,8 @@ sub search {
my ( $search, $type, $number ) = @_;
my $dbh = C4::Context->dbh();
my $q;
my $Zconn;
my $Zconn = C4::Context->Zconn;
my $raw;
eval { $Zconn = new ZOOM::Connection( C4::Context->config("zebradb") ); };
if ($@) {
warn "Error ", $@->code(), ": ", $@->message(), "\n";
}
if ( $type eq 'CQL' ) {
my $string;
@ -79,9 +75,6 @@ sub search {
$string .= "$var=\"$search->{$var}\" ";
}
}
$Zconn->option( cqlfile => C4::Context->config("intranetdir")
. "/zebra/pqf.properties" );
$Zconn->option( preferredRecordSyntax => "xml" );
$q = new ZOOM::Query::CQL2RPN( $string, $Zconn );
}
my $rs;
@ -112,15 +105,8 @@ sub get_record {
# pass in an id (biblionumber at this stage) and get back a MARC record
my ($id) = @_;
my $q;
my $Zconn;
my $Zconn = C4::Context->Zconn
my $raw;
eval { $Zconn = new ZOOM::Connection( C4::Context->config("zebradb") ); };
if ($@) {
warn "Error ", $@->code(), ": ", $@->message(), "\n";
}
$Zconn->option( cqlfile => C4::Context->config("intranetdir")
. "/zebra/pqf.properties" );
$Zconn->option( preferredRecordSyntax => "xml" );
my $string = "identifier=$id";
warn $string;