myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3561] branches/packs: removed data column from r


From: noreply
Subject: [myexperiment-hackers] [3561] branches/packs: removed data column from resources
Date: Thu, 23 May 2013 08:40:30 +0000 (UTC)

Revision
3561
Author
dgc
Date
2013-05-23 08:40:29 +0000 (Thu, 23 May 2013)

Log Message

removed data column from resources

Modified Paths

Diff

Modified: branches/packs/app/controllers/research_objects_controller.rb (3560 => 3561)


--- branches/packs/app/controllers/research_objects_controller.rb	2013-05-23 08:25:37 UTC (rev 3560)
+++ branches/packs/app/controllers/research_objects_controller.rb	2013-05-23 08:40:29 UTC (rev 3561)
@@ -57,7 +57,7 @@
 
     response.headers["Location"] = ro_uri
 
-    send_data(ro.manifest_resource.data, :type => "application/rdf+xml", :filename => ResearchObject::MANIFEST_PATH, :status => 201)
+    send_data(ro.manifest_resource.content_blob.data, :type => "application/rdf+xml", :filename => ResearchObject::MANIFEST_PATH, :status => 201)
   end
 
   # DELETE /rodl/:id

Modified: branches/packs/app/controllers/resources_controller.rb (3560 => 3561)


--- branches/packs/app/controllers/resources_controller.rb	2013-05-23 08:25:37 UTC (rev 3560)
+++ branches/packs/app/controllers/resources_controller.rb	2013-05-23 08:40:29 UTC (rev 3561)
@@ -55,7 +55,7 @@
       return
     end
 
-    send_data(resource.data, :type => resource.content_type)
+    send_data(resource.content_blob.data, :type => resource.content_type)
   end
 
   def post

Modified: branches/packs/app/models/research_object.rb (3560 => 3561)


--- branches/packs/app/models/research_object.rb	2013-05-23 08:25:37 UTC (rev 3560)
+++ branches/packs/app/models/research_object.rb	2013-05-23 08:40:29 UTC (rev 3561)
@@ -90,7 +90,6 @@
 
       resource.content_blob.destroy if resource.content_blob
 
-      resource.data = "" # FIXME - to be removed
       resource.content_blob = ContentBlob.new(:data ="" data)
       resource.creator_uri = user_uri
       resource.content_type = content_type
@@ -140,7 +139,6 @@
       proxy.is_proxy       = true
       proxy.proxy_for_path = proxy_for_path
       proxy.proxy_in_path  = proxy_in_path
-      proxy.data           = "" # FIXME - to be removed
       proxy.content_blob   = ContentBlob.new(:data ="" proxy_body)
       proxy.creator_uri    = user_uri
       proxy.content_type   = content_type
@@ -162,7 +160,6 @@
 
       resource.content_blob.destroy if resource.content_blob
 
-      resource.data = "" # FIXME - to be removed
       resource.content_blob = ContentBlob.new(:data ="" data)
       resource.creator_uri = user_uri
       resource.content_type = content_type
@@ -176,7 +173,7 @@
       resource.is_annotation = true
       resource.is_folder     = false
 
-      graph = load_graph(resource.data)
+      graph = load_graph(resource.content_blob.data)
 
       aggregated_annotations = graph.query([nil, RDF.type, RDF::URI("http://purl.org/wf4ever/ro#AggregatedAnnotation")])
 
@@ -223,7 +220,6 @@
 
       resource.content_blob.destroy if resource.content_blob
 
-      resource.data = "" # FIXME - to be removed
       resource.content_blob = ContentBlob.new(:data ="" data)
       resource.creator_uri = user_uri
       resource.content_type = content_type
@@ -252,7 +248,6 @@
       # FIXME - this should be a recursive call
 
       resource_map_attributes = {
-        :data            ="" resource_map_body,
         :content_blob    => ContentBlob.new(:data ="" resource_map_body),
         :creator_uri     => user_uri,
         :content_type    => 'application/vnd.wf4ever.folder',
@@ -303,7 +298,6 @@
       end
 
       folder_entry.is_folder_entry = true
-      folder_entry.data = "" # FIXME - to be removed
       folder_entry.content_blob    = ContentBlob.new(:data ="" folder_entry_body)
       folder_entry.proxy_in_path   = proxy_in_path
       folder_entry.proxy_for_path  = proxy_for_path
@@ -338,7 +332,6 @@
 
       ao_body.content_blob.destroy if ao_body.content_blob
 
-      ao_body.data          = "" # FIXME - to be removed
       ao_body.content_blob  = ContentBlob.new(:data ="" data)
       ao_body.creator_uri   = user_uri
       ao_body.content_type  = content_type
@@ -364,7 +357,6 @@
       annotation_stub = resources.new({
         :creator_uri   => user_uri,
         :path          => calculate_path(nil, 'application/vnd.wf4ever.annotation'),
-        :data          ="" annotation_rdf, # FIXME
         :content_blob  => ContentBlob.new(:data ="" annotation_rdf),
         :content_type  => 'application/vnd.wf4ever.annotation',
         :is_annotation => true,
@@ -393,7 +385,6 @@
 
       resource.content_blob.destroy if resource.content_blob
 
-      resource.data          = "" # FIXME - to be removed
       resource.content_blob  = ContentBlob.new(:data ="" data)
       resource.creator_uri   = user_uri
       resource.content_type  = content_type
@@ -428,7 +419,6 @@
       # FIXME - this should be a recursive call
 
       proxy_attributes = {
-        :data           ="" proxy_body,
         :content_blob   => ContentBlob.new(:data ="" proxy_body),
         :proxy_in_path  => '.',
         :proxy_for_path => relative_resource_uri,
@@ -461,7 +451,7 @@
   def create_manifest
 
     resources.create(:path => ResearchObject::MANIFEST_PATH,
-                     :data ="" "Dummy content",
+                     :content_blob => ContentBlob.new(:data ="" "Dummy content"),
                      :content_type => 'application/rdf+xml')
 
     update_manifest!

Modified: branches/packs/app/models/resource.rb (3560 => 3561)


--- branches/packs/app/models/resource.rb	2013-05-23 08:25:37 UTC (rev 3560)
+++ branches/packs/app/models/resource.rb	2013-05-23 08:40:29 UTC (rev 3561)
@@ -144,7 +144,5 @@
     content_blob.destroy if content_blob
     content_blob = ContentBlob.new(:data ="" new_description)
     content_blob.save
-
-    update_attribute(:data, new_description) # FIXME - to be removed
   end
 end

Modified: branches/packs/db/schema.rb (3560 => 3561)


--- branches/packs/db/schema.rb	2013-05-23 08:25:37 UTC (rev 3560)
+++ branches/packs/db/schema.rb	2013-05-23 08:40:29 UTC (rev 3561)
@@ -615,7 +615,6 @@
     t.integer  "research_object_id"
     t.integer  "content_blob_id"
     t.string   "sha1",               :limit => 40
-    t.binary   "data",               :limit => 2147483647
     t.integer  "size"
     t.string   "content_type"
     t.text     "path"
@@ -625,14 +624,14 @@
     t.string   "ao_body_path"
     t.string   "resource_map_path"
     t.string   "aggregated_by_path"
-    t.boolean  "is_resource",                              :default => false
-    t.boolean  "is_aggregated",                            :default => false
-    t.boolean  "is_proxy",                                 :default => false
-    t.boolean  "is_annotation",                            :default => false
-    t.boolean  "is_resource_map",                          :default => false
-    t.boolean  "is_folder",                                :default => false
-    t.boolean  "is_folder_entry",                          :default => false
-    t.boolean  "is_root_folder",                           :default => false
+    t.boolean  "is_resource",                      :default => false
+    t.boolean  "is_aggregated",                    :default => false
+    t.boolean  "is_proxy",                         :default => false
+    t.boolean  "is_annotation",                    :default => false
+    t.boolean  "is_resource_map",                  :default => false
+    t.boolean  "is_folder",                        :default => false
+    t.boolean  "is_folder_entry",                  :default => false
+    t.boolean  "is_root_folder",                   :default => false
     t.datetime "created_at"
     t.datetime "updated_at"
   end

reply via email to

[Prev in Thread] Current Thread [Next in Thread]