Serials holdings: Use the 852 field to identify the location for each MFHD record
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 29 May 2009 03:13:10 +0000 (03:13 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 29 May 2009 03:13:10 +0000 (03:13 +0000)
Also, fix up the import instructions a bit; however, marc2sre.pl still needs to be taught to generate owning_lib

git-svn-id: svn://svn.open-ils.org/ILS/trunk@13256 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm
Open-ILS/tests/datasets/README
Open-ILS/web/js/dojo/openils/opac/nls/opac.js
Open-ILS/web/opac/skin/default/js/rdetail.js

index 9946398..684a8ac 100644 (file)
@@ -2303,6 +2303,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
        <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
                <fields>
                        <field name="id" oils_persist:virtual="true" />
+                       <field name="location" oils_persist:virtual="true" />
                        <field name="owning_lib" oils_persist:virtual="true" />
                        <field name="holdings" oils_persist:virtual="true" />
                        <field name="current_holdings" oils_persist:virtual="true" />
index 6611d0e..ad85797 100644 (file)
@@ -54,6 +54,7 @@ Returns a Perl hash containing fields of interest from the MFHD record
 sub mfhd_to_hash {
        my ($self, $mfhd_xml) = @_;
 
+       my $location;
        my $holdings = [];
        my $supplements = [];
        my $indexes = [];
@@ -67,6 +68,12 @@ sub mfhd_to_hash {
        my $marc = MARC::Record->new_from_xml($mfhd_xml);
        my $mfhd = MFHD->new($marc);
 
+       foreach my $subfield_ref ($marc->field('852')->subfields) {
+               my ($subfield, $data) = @$subfield_ref;
+               $location .= $data . " -- ";
+       }
+       $location =~ s/ -- $//;
+
        foreach my $field ($marc->field('866')) {
                my $textual_holdings = $self->format_textual_holdings($field);
                if ($textual_holdings) {
@@ -132,7 +139,7 @@ sub mfhd_to_hash {
                }
        }
 
-       return { holdings => $holdings, current_holdings => $current_holdings,
+       return { location => $location, holdings => $holdings, current_holdings => $current_holdings,
                        supplements => $supplements, current_supplements => $current_supplements,
                        indexes => $indexes, current_indexes => $current_indexes,
                        missing => $missing, incomplete => $incomplete, };
@@ -150,6 +157,7 @@ Initialize the serial virtual record (svr) instance
 sub init_holdings_virtual_record {
        my $record = Fieldmapper::serial::virtual_record->new;
        $record->id();
+       $record->location();
        $record->owning_lib();
        $record->holdings([]);
        $record->current_holdings([]);
@@ -184,6 +192,7 @@ sub generate_svr {
 
        $record->id($id);
        $record->owning_lib($owning_lib);
+       $record->location($holdings->{location});
        $record->holdings($holdings->{holdings});
        $record->current_holdings($holdings->{current_holdings});
        $record->supplements($holdings->{supplements});
index 37e1822..825c778 100644 (file)
@@ -17,7 +17,7 @@ The following table lists the data sets we have collected for testing purposes.
 =====How to load the test MFHD records=====
 
   - First load the MARC21 records:
-    - PERL5LIB=/openils/lib/perl5/ perl ../../src/extras/import/marc2sre.pl --marctype XML --password demo123 --idfield 901 --idsubfield a serials_mfhd.xml | perl ../../src/extras/import/direct_ingest.pl --serial | perl ../../src/extras/import/pg_loader.pl -or sre -or sfr -a sfr | psql -U evergreen -h localhost
+    - PERL5LIB=/openils/lib/perl5/ perl ../../src/extras/import/marc2bre.pl --marctype XML --start 1 --idfield 901 --idsubfield a serials_marc21.xml | perl ../../src/extras/import/direct_ingest.pl  | perl ../../src/extras/import/pg_loader.pl -or bre -or mrd -or mfr -or mtfe -or mafe -or msfe -or mkfe -or msefe -a mrd -a mfr -a mtfe -a mafe -a msfe -a mkfe -a msefe | psql -U evergreen -h localhost
 
   - Then load the MFHD records
     - PERL5LIB=/openils/lib/perl5/ perl ../../src/extras/import/marc2sre.pl --marctype XML --password demo123 serials_mfhd.xml | perl ../../src/extras/import/direct_ingest.pl --serial | perl ../../src/extras/import/pg_loader.pl -or sre -or sfr -a sfr > mfhd21.sql
index 5f0054c..ccc920c 100644 (file)
@@ -5,7 +5,7 @@
        "CURRENT_HOLDINGS": "Current holdings",
        "CURRENT_INDEXES": "Current indexes",
        "CURRENT_SUPPLEMENTS": "Current supplements",
-       "HOLDINGS_TABLE_CAPTION": "Holdings summary",
+       "HOLDINGS_TABLE_CAPTION": "Holdings summary (${0})",
        "INCOMPLETE_VOLUMES": "Incomplete volumes",
        "MISSING_VOLUMES": "Missing volumes",
        "ONLINE_VOLUMES": "Online volumes",
index c702258..5bc76c0 100644 (file)
@@ -249,8 +249,9 @@ function _holdingsDrawMFHD(holdings, entryNum) {
        }
 
        dojo.place("<table><caption id='mfhdHoldingsCaption' class='rdetail_header color_1'>" +
-               opac_strings.HOLDINGS_TABLE_CAPTION + "</caption><tbody id='rdetail_holdings_tbody_" +
-               entryNum + "'></tbody></table>", "rdetail_details_table", "after"
+               dojo.string.substitute(opac_strings.HOLDINGS_TABLE_CAPTION, [holdings.location()]) +
+               "</caption><tbody id='rdetail_holdings_tbody_" + entryNum +
+               "'></tbody></table>", "rdetail_details_table", "after"
        );
        if (hh.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.HOLDINGS, hh); }
        if (hch.length > 0) { _holdingsDrawMFHDEntry(entryNum, opac_strings.CURRENT_HOLDINGS, hch); }