summaryrefslogtreecommitdiff
path: root/report/report_application.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-11-29 11:07:48 +0100
committermguetlein <martin.guetlein@gmail.com>2010-11-29 11:07:48 +0100
commitb50453d2ad038c9bab17a418bf4e065e31acb999 (patch)
tree8ca555aed14e14bfb44660cfd04e9a90c2f635f5 /report/report_application.rb
parent16a25a63ba7882901a778745d0a32baaafc22cad (diff)
addjust report service init to ortona
Diffstat (limited to 'report/report_application.rb')
-rw-r--r--report/report_application.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/report/report_application.rb b/report/report_application.rb
index f6b810c..a61a2df 100644
--- a/report/report_application.rb
+++ b/report/report_application.rb
@@ -2,8 +2,8 @@ require "report/environment.rb"
def perform
begin
- $rep = Reports::ReportService.new(url_for("/report", :full)) unless $rep
- yield( $rep )
+ @@report_service = Reports::ReportService.instance( url_for("/report", :full) ) unless defined?@@report_service
+ yield( @@report_service )
rescue Reports::NotFound => ex
halt 404, ex.message
rescue Reports::BadRequest => ex
@@ -79,10 +79,11 @@ get '/report/:report_type' do
end
post '/report/:type/:id/format_html' do
-
- rs.get_report(params[:type],params[:id],"text/html",true,params)
- content_type "text/uri-list"
- rs.get_uri(params[:type],params[:id])+"\n"
+ perform do |rs|
+ rs.get_report(params[:type],params[:id],"text/html",true,params)
+ content_type "text/uri-list"
+ rs.get_uri(params[:type],params[:id])+"\n"
+ end
end