<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" />
sub mfhd_to_hash {
my ($self, $mfhd_xml) = @_;
+ my $location;
my $holdings = [];
my $supplements = [];
my $indexes = [];
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) {
}
}
- 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, };
sub init_holdings_virtual_record {
my $record = Fieldmapper::serial::virtual_record->new;
$record->id();
+ $record->location();
$record->owning_lib();
$record->holdings([]);
$record->current_holdings([]);
$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});
=====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
"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",
}
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); }