[open-ils-commits] r13256 - in trunk/Open-ILS: examples src/perlmods/OpenILS/Utils tests/datasets web/js/dojo/openils/opac/nls web/opac/skin/default/js (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 28 23:13:12 EDT 2009
Author: dbs
Date: 2009-05-28 23:13:10 -0400 (Thu, 28 May 2009)
New Revision: 13256
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm
trunk/Open-ILS/tests/datasets/README
trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
Log:
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
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2009-05-28 16:20:36 UTC (rev 13255)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2009-05-29 03:13:10 UTC (rev 13256)
@@ -2303,6 +2303,7 @@
<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" />
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm 2009-05-28 16:20:36 UTC (rev 13255)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/MFHDParser.pm 2009-05-29 03:13:10 UTC (rev 13256)
@@ -54,6 +54,7 @@
sub mfhd_to_hash {
my ($self, $mfhd_xml) = @_;
+ my $location;
my $holdings = [];
my $supplements = [];
my $indexes = [];
@@ -67,6 +68,12 @@
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 @@
}
}
- 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 @@
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 @@
$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});
Modified: trunk/Open-ILS/tests/datasets/README
===================================================================
--- trunk/Open-ILS/tests/datasets/README 2009-05-28 16:20:36 UTC (rev 13255)
+++ trunk/Open-ILS/tests/datasets/README 2009-05-29 03:13:10 UTC (rev 13256)
@@ -17,7 +17,7 @@
=====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
Modified: trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js 2009-05-28 16:20:36 UTC (rev 13255)
+++ trunk/Open-ILS/web/js/dojo/openils/opac/nls/opac.js 2009-05-29 03:13:10 UTC (rev 13256)
@@ -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",
Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-05-28 16:20:36 UTC (rev 13255)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js 2009-05-29 03:13:10 UTC (rev 13256)
@@ -249,8 +249,9 @@
}
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); }
More information about the open-ils-commits
mailing list