summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gütlein <martin.guetlein@gmail.com>2010-02-26 09:47:52 +0100
committerMartin Gütlein <martin.guetlein@gmail.com>2010-02-26 09:47:52 +0100
commit428a78d095ee383cc839ce4a15a48ecfbe8562cb (patch)
treee3b13d8f0976e603d16d684069e87e3552741e42
parentd724cd5432162a38e51422d4877cc4ba5bd52dec (diff)
parent2dcf602090adbc8df84b9ef473d588b050e8ca0c (diff)
resolved conflict
-rw-r--r--application.rb6
-rw-r--r--views/compound.xml.builder11
-rw-r--r--views/dataset.xml.builder7
-rw-r--r--views/feature.xml.builder11
4 files changed, 6 insertions, 29 deletions
diff --git a/application.rb b/application.rb
index ec54d97..4222f3d 100644
--- a/application.rb
+++ b/application.rb
@@ -25,6 +25,7 @@ DataMapper.auto_upgrade!
## REST API
get '/?' do
+ response['Content-Type'] = 'text/uri-list'
Dataset.all.collect{|d| d.uri}.join("\n")
end
@@ -40,8 +41,10 @@ get '/:id/?' do
accept = 'application/rdf+xml' if accept == '*/*' or accept == '' or accept.nil?
case accept
when /rdf/ # redland sends text/rdf instead of application/rdf+xml
+ response['Content-Type'] = 'application/rdf+xml'
dataset.owl
when /yaml/
+ response['Content-Type'] = 'application/x-yaml'
OpenTox::Dataset.find(dataset.uri).to_yaml
else
halt 400, "Unsupported MIME type '#{accept}'"
@@ -92,6 +95,7 @@ post '/?' do
end
task.pid = pid
#status 303 # rest client tries to redirect
+ response['Content-Type'] = 'text/uri-list'
task.uri
@@ -104,6 +108,7 @@ delete '/:id/?' do
dataset = Dataset.get(params[:id])
File.delete dataset.file
dataset.destroy!
+ response['Content-Type'] = 'text/plain'
"Dataset #{params[:id]} deleted."
rescue
halt 404, "Dataset #{params[:id]} does not exist."
@@ -121,5 +126,6 @@ delete '/?' do
#d.destroy!
end
Dataset.auto_migrate!
+ response['Content-Type'] = 'text/plain'
"All datasets deleted."
end
diff --git a/views/compound.xml.builder b/views/compound.xml.builder
deleted file mode 100644
index b4f6cfa..0000000
--- a/views/compound.xml.builder
+++ /dev/null
@@ -1,11 +0,0 @@
-xml.instruct!
-xml.dataset do
- @compounds.each do |compound,features|
- xml.compound do
- xml.uri compound
- features.each do |f|
- xml.feature_uri f
- end
- end
- end
-end
diff --git a/views/dataset.xml.builder b/views/dataset.xml.builder
deleted file mode 100644
index f540d24..0000000
--- a/views/dataset.xml.builder
+++ /dev/null
@@ -1,7 +0,0 @@
-xml.instruct!
-xml.dataset do
- xml.uri url_for("/", :full) + @dataset.id.to_s
- xml.name @dataset.name
- xml.finished @dataset.finished
-end
-
diff --git a/views/feature.xml.builder b/views/feature.xml.builder
deleted file mode 100644
index f9d9881..0000000
--- a/views/feature.xml.builder
+++ /dev/null
@@ -1,11 +0,0 @@
-xml.instruct!
-xml.dataset do
- @features.each do |feature,compounds|
- xml.feature do
- xml.uri feature
- compounds.each do |c|
- xml.compound_uri c
- end
- end
- end
-end