[open-ils-commits] r7602 - trunk/Open-ILS/src/perlmods/OpenILS/WWW
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jul 27 14:06:45 EDT 2007
Author: miker
Date: 2007-07-27 14:05:28 -0400 (Fri, 27 Jul 2007)
New Revision: 7602
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm
Log:
printing on demand instead of at the end
Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm 2007-07-27 17:58:22 UTC (rev 7601)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm 2007-07-27 18:05:28 UTC (rev 7602)
@@ -95,10 +95,7 @@
$r->content_type('application/octet-stream') if (uc($format) ne 'XML');
$r->content_type('application/xml') if (uc($format) eq 'XML');
- my $content = '';
-
-
- $content .= <<" HEADER" if (uc($format) eq 'XML');
+ $r->print( <<" HEADER" ) if (uc($format) eq 'XML');
<?xml version="1.0" encoding="$encoding"?>
<collection xmlns='http://www.loc.gov/MARC21/slim'>
HEADER
@@ -147,7 +144,7 @@
next unless $bib;
if (uc($format) eq 'BRE') {
- $content .= OpenSRF::Utils::JSON->perl2JSON($bib);
+ $r->print( OpenSRF::Utils::JSON->perl2JSON($bib) );
next;
}
@@ -209,11 +206,11 @@
if (uc($format) eq 'XML') {
my $x = $r->as_xml_record;
$x =~ s/^<\?xml version="1.0" encoding="UTF-8"\?>//o;
- $content .= $x;
+ $r->print($x);
} elsif (uc($format) eq 'UNIMARC') {
- $content .= $r->as_unimarc
+ $r->print($r->as_unimarc);
} elsif (uc($format) eq 'USMARC') {
- $content .= $r->as_usmarc
+ $r->print($r->as_usmarc);
}
} otherwise {
@@ -223,9 +220,8 @@
}
- $content .= "</collection>\n" if ($format eq 'XML');
+ $r->print("</collection>\n") if ($format eq 'XML');
- $r->print($content);
return Apache2::Const::OK;
}
More information about the open-ils-commits
mailing list