[open-ils-commits] r10691 -
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Sep 23 17:47:41 EDT 2008
Author: erickson
Date: 2008-09-23 17:47:36 -0400 (Tue, 23 Sep 2008)
New Revision: 10691
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
Log:
can now pass raw marcxml to the marc2html method and it will generate the html
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2008-09-23 18:38:17 UTC (rev 10690)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm 2008-09-23 21:47:36 UTC (rev 10691)
@@ -1216,7 +1216,7 @@
my $settings_client = OpenSRF::Utils::SettingsClient->new();
sub biblio_record_to_marc_html {
- my($self, $client, $recordid, $slim) = @_;
+ my($self, $client, $recordid, $slim, $marcxml) = @_;
my $sheet;
my $dir = $settings_client->config_value("dirs", "xsl");
@@ -1245,16 +1245,19 @@
}
my $record;
- my $e = new_editor();
- if($self->api_name =~ /authority/) {
- $record = $e->retrieve_authority_record_entry($recordid)
- or return $e->event;
- } else {
- $record = $e->retrieve_biblio_record_entry($recordid)
- or return $e->event;
+ unless($marcxml) {
+ my $e = new_editor();
+ if($self->api_name =~ /authority/) {
+ $record = $e->retrieve_authority_record_entry($recordid)
+ or return $e->event;
+ } else {
+ $record = $e->retrieve_biblio_record_entry($recordid)
+ or return $e->event;
+ }
+ $marcxml = $record->marc;
}
- my $xmldoc = $parser->parse_string($record->marc);
+ my $xmldoc = $parser->parse_string($marcxml);
my $html = $sheet->transform($xmldoc);
return $html->documentElement->toString();
}
More information about the open-ils-commits
mailing list