From 1f9eeede828dcc4f6fc8c6fbc313ad02645f1811 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 27 Jul 2007 18:05:28 +0000 Subject: [PATCH] printing on demand instead of at the end git-svn-id: svn://svn.open-ils.org/ILS/trunk@7602 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm index f4435956a0..cb88056ce8 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Exporter.pm @@ -95,10 +95,7 @@ sub handler { $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'); HEADER @@ -147,7 +144,7 @@ sub handler { 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 @@ sub handler { 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 @@ sub handler { } - $content .= "\n" if ($format eq 'XML'); + $r->print("\n") if ($format eq 'XML'); - $r->print($content); return Apache2::Const::OK; } -- 2.11.0