[open-ils-commits] r9069 - in trunk/Open-ILS: examples src/perlmods/OpenILS/Application/Search

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Mar 18 11:00:01 EDT 2008


Author: erickson
Date: 2008-03-18 10:25:49 -0400 (Tue, 18 Mar 2008)
New Revision: 9069

Modified:
   trunk/Open-ILS/examples/opensrf.xml.example
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
Log:
added config option for defining the downloaded record format for each Z source

Modified: trunk/Open-ILS/examples/opensrf.xml.example
===================================================================
--- trunk/Open-ILS/examples/opensrf.xml.example	2008-03-18 14:23:20 UTC (rev 9068)
+++ trunk/Open-ILS/examples/opensrf.xml.example	2008-03-18 14:25:49 UTC (rev 9069)
@@ -96,6 +96,8 @@
                     <host>z3950.loc.gov</host>
                     <port>7090</port>
                     <db>Voyager</db>
+                    <!-- fetch the full record with no holdings. FI is the default -->
+                    <record_format>FI</record_format> 
                     <attrs>
                         <tcn><code>12</code><format>1</format></tcn>
                         <isbn><code>7</code><format>6</format></isbn>

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm	2008-03-18 14:23:20 UTC (rev 9068)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm	2008-03-18 14:25:49 UTC (rev 9069)
@@ -145,7 +145,7 @@
 		my $ev = $connections[$index - 1]->last_event();
 		$logger->debug("z3950: Received event $ev");
 		if ($ev == OpenILS::Utils::ZClient::EVENT_END()) {
-			my $munged = process_results( $results[$index - 1], $$args{limit}, $$args{offset} );
+			my $munged = process_results( $results[$index - 1], $$args{limit}, $$args{offset}, $$args{service}[$index -1] );
 			$$munged{service} = $$args{service}[$index - 1];
 			$conn->respond($munged);
 		}
@@ -167,9 +167,9 @@
 	
 	my $info = $services{$$args{service}};
 
-	$$args{host}	= $$info{host},
-	$$args{port}	= $$info{port},
-	$$args{db}		= $$info{db},
+	$$args{host}	= $$info{host};
+	$$args{port}	= $$info{port};
+	$$args{db}		= $$info{db};
 
 	return do_search( $self, $conn, $auth, $args );
 }
@@ -238,7 +238,7 @@
 
 	return {result => $results, connection => $connection} if ($async);
 
-	my $munged = process_results($results, $limit, $offset);
+	my $munged = process_results($results, $limit, $offset, $$args{service});
 	$munged->{query} = $query;
 
 	return $munged;
@@ -253,8 +253,11 @@
 	my $results	= shift;
 	my $limit	= shift || 10;
 	my $offset	= shift || 0;
+    my $service = shift;
 
-	$results->option(elementSetName => "FI"); # full records with no holdings
+    my $rformat = $services{$service}->{record_format} || 'FI';
+	$results->option(elementSetName => $rformat);
+    $logger->info("z3950: using record format '$rformat'");
 
 	my @records;
 	my $res = {};



More information about the open-ils-commits mailing list