myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3356] branches/wf4ever: changed pack creation so


From: noreply
Subject: [myexperiment-hackers] [3356] branches/wf4ever: changed pack creation so that, by default, it will automatically generate a RO URI
Date: Fri, 25 Jan 2013 14:05:27 +0000 (UTC)

Revision
3356
Author
dgc
Date
2013-01-25 14:05:26 +0000 (Fri, 25 Jan 2013)

Log Message

changed pack creation so that, by default, it will automatically generate a RO URI

Modified Paths

Diff

Modified: branches/wf4ever/app/controllers/packs_controller.rb (3355 => 3356)


--- branches/wf4ever/app/controllers/packs_controller.rb	2013-01-25 11:53:23 UTC (rev 3355)
+++ branches/wf4ever/app/controllers/packs_controller.rb	2013-01-25 14:05:26 UTC (rev 3356)
@@ -8,6 +8,7 @@
 
 class PacksController < ApplicationController
   include ApplicationHelper
+  include ResearchObjectsHelper
   include ActionView::Helpers::NumberHelper
   
   ## NOTE: URI must match config/default_settings.yml ro_resource_types
@@ -266,6 +267,9 @@
     
     respond_to do |format|
       if @pack.save
+
+        @pack.update_attribute(:ro_uri, "address@hidden") if @pack.ro_uri.blank?
+
         if params[:pack][:tag_list]
           @pack.tags_user_id = current_user
           @pack.tag_list = convert_tags_to_gem_format params[:pack][:tag_list]

Modified: branches/wf4ever/app/helpers/folders_helper.rb (3355 => 3356)


--- branches/wf4ever/app/helpers/folders_helper.rb	2013-01-25 11:53:23 UTC (rev 3355)
+++ branches/wf4ever/app/helpers/folders_helper.rb	2013-01-25 14:05:26 UTC (rev 3356)
@@ -3,12 +3,9 @@
 # Copyright (c) 2012 University of Manchester and the University of Southampton.
 # See license.txt for details.
 module FoldersHelper
-  # TODO: Move to config
-  BASE_URI = "http://sandbox.wf4ever-project.org/rodl/ROs/"
-  API_KEY = "32801fc0-1df1-4e34-b"
   
   def make_research_object(ro_uri) 
-    session = ROSRS::Session.new(BASE_URI, API_KEY)
+    session = ROSRS::Session.new(Conf.rodl_base_uri, Conf.rodl_bearer_token)
     ROSRS::ResearchObject.new(session, ro_uri)    
   end
   
@@ -34,4 +31,4 @@
     resources
   end
   
-end
\ No newline at end of file
+end

Modified: branches/wf4ever/app/views/contributions/_ro_uri_box.rhtml (3355 => 3356)


--- branches/wf4ever/app/views/contributions/_ro_uri_box.rhtml	2013-01-25 11:53:23 UTC (rev 3355)
+++ branches/wf4ever/app/views/contributions/_ro_uri_box.rhtml	2013-01-25 14:05:26 UTC (rev 3356)
@@ -1,8 +1,10 @@
 <div class="ro_uri_edit_box">
   <p><b>Research Object URI</b></p>
 
-  <p>You may associate a <em>research object</em> by specifying the RO URI.
-  Once set, metadata will be synchronised with the research object.</p>
+  <p>By default, a <em>research object</em> will be created to maintain the
+  annotations within the pack.  You may specify an alternate URI below to link
+  this pack with a pre-existing research object or to create a research object
+  with a specific URI.</p>
 
   <p>
     <% if f %>
@@ -11,6 +13,6 @@
       <%= text_field_tag input_name, '', :size => 60, :placeholder => 'http://www.example.org/rodl/ROs/research_object/' %>
     <% end %>
   </p>
+  
 </div>
 
-

Modified: branches/wf4ever/config/default_settings.yml (3355 => 3356)


--- branches/wf4ever/config/default_settings.yml	2013-01-25 11:53:23 UTC (rev 3355)
+++ branches/wf4ever/config/default_settings.yml	2013-01-25 14:05:26 UTC (rev 3356)
@@ -709,6 +709,8 @@
     - "Results"
     - "http://purl.org/wf4ever/roterms#Results"
     
+rodl_base_uri: "http://sandbox.wf4ever-project.org/rodl/ROs/"
+
 ro_terms:
 
   - ["Input selected", "http://purl.org/wf4ever/roterms#inputSelected"]

Modified: branches/wf4ever/config/initializers/web_cache.rb (3355 => 3356)


--- branches/wf4ever/config/initializers/web_cache.rb	2013-01-25 11:53:23 UTC (rev 3355)
+++ branches/wf4ever/config/initializers/web_cache.rb	2013-01-25 14:05:26 UTC (rev 3356)
@@ -15,6 +15,8 @@
 
     def exist_in_cache?(uri)
 
+      return false if uri.blank?
+
       # FIXME: The manifest check here is hacky.  This really ought to be done
       # with appropriate HTTP headers.
 

Modified: branches/wf4ever/lib/conf.rb (3355 => 3356)


--- branches/wf4ever/lib/conf.rb	2013-01-25 11:53:23 UTC (rev 3355)
+++ branches/wf4ever/lib/conf.rb	2013-01-25 14:05:26 UTC (rev 3356)
@@ -215,6 +215,10 @@
     self.fetch_entry('ro_terms')
   end
 
+  def self.rodl_base_uri
+    self.fetch_entry('rodl_base_uri')
+  end
+
   def self.rodl_bearer_token
     self.fetch_entry('rodl_bearer_token')
   end

reply via email to

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