summaryrefslogtreecommitdiff
path: root/reach_reports
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-02-19 11:28:29 +0100
committermguetlein <martin.guetlein@gmail.com>2011-02-19 11:28:29 +0100
commite77fd138b4de5e467ded21ef075828e2b04e7928 (patch)
treebfbf27fae3084681110e3bd32c30792f0b3df250 /reach_reports
parent299552130b7deb821f7de544f153a9ebf00929db (diff)
add subject-id to to-html, minor changes
Diffstat (limited to 'reach_reports')
-rwxr-xr-xreach_reports/reach_application.rb6
-rwxr-xr-xreach_reports/reach_test.rb17
2 files changed, 14 insertions, 9 deletions
diff --git a/reach_reports/reach_application.rb b/reach_reports/reach_application.rb
index 293a5ac..fc670fd 100755
--- a/reach_reports/reach_application.rb
+++ b/reach_reports/reach_application.rb
@@ -24,7 +24,7 @@ get '/reach_report' do
"Validation reporting: "+url_for("/report",:full)
description =
"A list of all suported REACH reporting types."
- OpenTox.text_to_html uri_list,related_links,description
+ OpenTox.text_to_html uri_list,related_links,description, @subjectid
else
content_type "text/uri-list"
uri_list
@@ -51,7 +51,7 @@ get '/reach_report/:type' do
when /(?i)QPRF/
#TODO
end
- OpenTox.text_to_html ReachReports.list_reports(type),related_links,description,post_params
+ OpenTox.text_to_html ReachReports.list_reports(type),@subjectid,related_links,description,post_params
else
content_type "text/uri-list"
ReachReports.list_reports(type)
@@ -98,7 +98,7 @@ get '/reach_report/:type/:id' do
"All "+type+" reports: "+url_for("/reach_report/"+type,:full)
description =
"A QMRF report."
- OpenTox.text_to_html rep.to_yaml,related_links,description
+ OpenTox.text_to_html rep.to_yaml,@subjectid,related_links,description
when /application\/x-yaml|\*\/\*|^$/ # matches 'application/x-yaml', '*/*', ''
content_type "application/x-yaml"
rep.to_yaml
diff --git a/reach_reports/reach_test.rb b/reach_reports/reach_test.rb
index 47e5158..87addfa 100755
--- a/reach_reports/reach_test.rb
+++ b/reach_reports/reach_test.rb
@@ -20,10 +20,10 @@ LOGGER.datetime_format = "%Y-%m-%d %H:%M:%S "
LOGGER.formatter = Logger::Formatter.new
if AA_SERVER
- TEST_USER = "mgtest"
- TEST_PW = "mgpasswd"
-# TEST_USER = "guest"
-# TEST_PW = "guest"
+ #TEST_USER = "mgtest"
+ #TEST_PW = "mgpasswd"
+ TEST_USER = "guest"
+ TEST_PW = "guest"
SUBJECTID = OpenTox::Authorization.authenticate(TEST_USER,TEST_PW)
raise "could not log in" unless SUBJECTID
puts "logged in: "+SUBJECTID.to_s
@@ -148,7 +148,10 @@ class ReachTest < Test::Unit::TestCase
#model_uri = "http://local-ot/majority/class/model/58"
- model_uri = "http://local-ot/model/104"
+
+ #model_uri = "http://local-ot/model/104"
+ model_uri = "http://local-ot/majority/class/model/125"
+
# m = OpenTox::Model::Generic.find(model_uri)
# puts m.metadata[OT.algorithm] if m
@@ -156,12 +159,14 @@ class ReachTest < Test::Unit::TestCase
# puts a.metadata.inspect
# exit
+ puts SUBJECTID
+
# model_uri = "http://local-ot/model/1"
#http://local-ot/majority/class/model/15
#model_uri = "http://local-ot/majority/class/model/15"
# model_uri = "http://local-ot/majority/class/model/91"
#model_uri = "http://apps.ideaconsult.net:8080/ambit2/model/2"
- post '/reach_report/qmrf', {:model_uri=>model_uri}, {:subjectid => SUBJECTID} #http://local-ot/model/1"
+ post '/reach_report/qmrf',{:model_uri=>model_uri, :subjectid => SUBJECTID} #http://local-ot/model/1"
##post '/reach_report/qprf',:compound_uri=>"http://local-ot/compound/XYZ"
uri = last_response.body
puts "task: "+uri.to_s