From 086b3013d2342f085660178a246d27d119c1e647 Mon Sep 17 00:00:00 2001 From: dbs Date: Fri, 29 May 2009 03:13:10 +0000 Subject: [PATCH] Serials holdings: Use the 852 field to identify the location for each MFHD record 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 | 1 + Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm | 11 ++++++++++- Open-ILS/tests/datasets/README | 2 +- Open-ILS/web/js/dojo/openils/opac/nls/opac.js | 2 +- Open-ILS/web/opac/skin/default/js/rdetail.js | 5 +++-- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 9946398548..684a8acf20 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -2303,6 +2303,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm b/Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm index 6611d0e727..ad85797ef4 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm @@ -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}); diff --git a/Open-ILS/tests/datasets/README b/Open-ILS/tests/datasets/README index 37e182224a..825c77889f 100644 --- a/Open-ILS/tests/datasets/README +++ b/Open-ILS/tests/datasets/README @@ -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 diff --git a/Open-ILS/web/js/dojo/openils/opac/nls/opac.js b/Open-ILS/web/js/dojo/openils/opac/nls/opac.js index 5f0054cb9e..ccc920cd60 100644 --- a/Open-ILS/web/js/dojo/openils/opac/nls/opac.js +++ b/Open-ILS/web/js/dojo/openils/opac/nls/opac.js @@ -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", diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index c702258261..5bc76c0e3b 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -249,8 +249,9 @@ function _holdingsDrawMFHD(holdings, entryNum) { } dojo.place("
" + - opac_strings.HOLDINGS_TABLE_CAPTION + "
", "rdetail_details_table", "after" + dojo.string.substitute(opac_strings.HOLDINGS_TABLE_CAPTION, [holdings.location()]) + + "", "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); } -- 2.43.2