summaryrefslogtreecommitdiff
path: root/reach_reports/reach_application.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-08-19 11:26:00 +0200
committermguetlein <martin.guetlein@gmail.com>2010-08-19 11:26:00 +0200
commitf4c065998f6c918e67058b05ac17778cfbc57f58 (patch)
treebe4a6cf71c7177bdb306344e052b456aa73b454e /reach_reports/reach_application.rb
parent0f5cc11dcecf6eda0a7230d69aa346cfb86c6a49 (diff)
task title and creator, reach report minor fixes
Diffstat (limited to 'reach_reports/reach_application.rb')
-rw-r--r--reach_reports/reach_application.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/reach_reports/reach_application.rb b/reach_reports/reach_application.rb
index 596bae2..807800c 100644
--- a/reach_reports/reach_application.rb
+++ b/reach_reports/reach_application.rb
@@ -13,6 +13,11 @@ def extract_type(params)
params.delete("type")
end
+get '/reach_report' do
+ content_type "text/uri-list"
+ url_for('/reach_report/QMRF', :full)+"\n"+url_for('/reach_report/QPRF', :full)+"\n"
+end
+
get '/reach_report/:type' do
content_type "text/uri-list"
type = extract_type(params)
@@ -57,12 +62,14 @@ end
post '/reach_report/:type/:id' do
type = extract_type(params)
- LOGGER.info "set "+type+" report with id "+params[:id].to_s+"' "+request.env['HTTP_ACCEPT'].to_s+"'"
+ LOGGER.info "Post to "+type+" report with id "+params[:id].to_s+"' "+request.env['HTTP_ACCEPT'].to_s+"'"
rep = ReachReports.get_report(type, params[:id])
input = request.env["rack.input"].read
- halt 400, "no xml data specified" unless input && input.to_s.size>0
+ halt 400, "no xml data specified" unless input && input.to_s.size>0
+
ReachReports::QmrfReport.from_xml(rep,input)
+
#f = File.new("/home/martin/info_home/.public_html/qmrf.out.xml","w")
#f.puts rep.to_xml
end