added config option for defining the downloaded record format for each Z source
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 18 Mar 2008 14:23:20 +0000 (14:23 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 18 Mar 2008 14:23:20 +0000 (14:23 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@9068 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/opensrf.xml.example
Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm

index 48bdaab..0b804e6 100644 (file)
@@ -93,6 +93,8 @@ Example opensrf config file for OpenILS
                     <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>
index 71bc3ae..e2dd3f9 100755 (executable)
@@ -195,7 +195,7 @@ sub do_search {
 
        $logger->info("z3950: search [$query] took ".(time - $start)." seconds");
 
-       my $munged = process_results($results, $limit, $offset);
+       my $munged = process_results($results, $limit, $offset, $$args{service});
        $munged->{query} = $query;
 
        return $munged;
@@ -210,8 +210,11 @@ sub process_results {
        my $results     = shift;
        my $limit       = shift;
        my $offset      = shift;
+    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 = {};