support /really/ bare zebra installations that do not like elementSetName
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 12 Aug 2008 15:09:48 +0000 (15:09 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 12 Aug 2008 15:09:48 +0000 (15:09 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2_3@10343 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index bbd7477..5338126 100644 (file)
@@ -94,7 +94,7 @@ Example opensrf config file for OpenILS
                     <port>7090</port>
                     <db>Voyager</db>
 
-                    <!-- fetch the full record with no holdings. FI is the default -->
+                    <!-- fetch the full record with no holdings. FI is the most common setting -->
                     <record_format>FI</record_format> 
 
                     <!-- Record transmission format from the server.  Supported -->
index 10f12a3..86d495a 100755 (executable)
@@ -215,9 +215,11 @@ sub process_results {
     my $service = shift;
 
     my $tformat = $services{$service}->{transmission_format} || $output;
-    my $rformat = $services{$service}->{record_format} || 'FI';
-       $results->option(elementSetName => $rformat);
-    $logger->info("z3950: using record format '$rformat'");
+    my $rformat = $services{$service}->{record_format};
+
+    $results->option(elementSetName => $rformat);
+    $results->option(preferredRecordSyntax => $tformat);
+    $logger->info("z3950: using record format '$rformat' and transmission format '$tformat'");
 
        my @records;
        my $res = {};
@@ -243,10 +245,10 @@ sub process_results {
 
                        my $rec = $results->record($_);
 
-            if ($tformat eq 'usmarc') {
-                       $marc           = MARC::Record->new_from_usmarc($rec->raw());
-            } elsif ($tformat eq 'xml') {
-                       $marc           = MARC::Record->new_from_xml($rec->raw());
+            if (lc($tformat) eq 'usmarc') {
+                       $marc = MARC::Record->new_from_usmarc($rec->raw());
+            } elsif (lc($tformat) eq 'xml') {
+                       $marc = MARC::Record->new_from_xml($rec->raw());
             } else {
                 die "Unsupported record transmission format $tformat"
             }