myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3277] branches/wf4ever/app: added options to agg


From: noreply
Subject: [myexperiment-hackers] [3277] branches/wf4ever/app: added options to aggregate workflows and external resources to a pack
Date: Tue, 18 Dec 2012 14:01:45 +0000 (UTC)

Revision
3277
Author
dgc
Date
2012-12-18 14:01:45 +0000 (Tue, 18 Dec 2012)

Log Message

added options to aggregate workflows and external resources to a pack

Modified Paths

Diff

Modified: branches/wf4ever/app/controllers/packs_controller.rb (3276 => 3277)


--- branches/wf4ever/app/controllers/packs_controller.rb	2012-12-18 13:55:33 UTC (rev 3276)
+++ branches/wf4ever/app/controllers/packs_controller.rb	2012-12-18 14:01:45 UTC (rev 3277)
@@ -135,20 +135,30 @@
 
     session = ROSRS::Session.new(@pack.ro_uri, Conf.rodl_bearer_token)
 
-    filename = File.basename(params[:data].original_filename)
+    filename = File.basename(params[:data].original_filename) if params[:data]
 
-    if params[:commit] == "Aggregate workflow"
+    case params[:commit]
 
+    when "Aggregate workflow"
+
+      c, r, puri, ruri = session.aggregate_internal_resource(@pack.ro_uri, filename, { :body => params[:data].read, :ctype=> 'text/plain' })
+
       service_uri = "http://sandbox.wf4ever-project.org/wf-ro/jobs"
       format = "application/vnd.taverna.t2flow+xml"
       token = Conf.rodl_bearer_token
-      resource = "http://www.myexperiment.org/workflows/2470/download/_untitled__947103.t2flow?version=2"
-      ro = @pack.ro_uri
 
-      uri = Wf4Ever::TransformationClient.create_job(service_uri, resource, format, ro, token)
-    else
+      uri = Wf4Ever::TransformationClient.create_job(service_uri, ruri, format, @pack.ro_uri, token)
+
+    when "Aggregate internal resource"
+
       c, r, puri, ruri = session.aggregate_internal_resource(@pack.ro_uri, filename, { :body => params[:data].read, :ctype=> 'text/plain' })
+
+    when "Aggregate external resource"
+
+      c, r, puri, ruri = session.aggregate_external_resource(@pack.ro_uri, params[:uri])
+
     end
+
     respond_to do |format|
       format.html {
         redirect_to pack_url(@pack)

Modified: branches/wf4ever/app/controllers/workflows_controller.rb (3276 => 3277)


--- branches/wf4ever/app/controllers/workflows_controller.rb	2012-12-18 13:55:33 UTC (rev 3276)
+++ branches/wf4ever/app/controllers/workflows_controller.rb	2012-12-18 14:01:45 UTC (rev 3277)
@@ -748,7 +748,11 @@
       if ao_body
         agraph = ROSRS::RDFGraph.new(:data ="" ao_body.to_s, :format => :xml)
 
-        code, reason, stub_uri, body_uri = session.create_internal_annotation(@workflow.ro_uri, resource_uri, agraph)
+        begin
+          code, reason, stub_uri, body_uri = session.create_internal_annotation(@workflow.ro_uri, resource_uri, agraph)
+        rescue ROSRS::Exception => e
+          @workflow.errors.add(params[:template], 'Error from remote server')
+        end
       end
     end
 

Modified: branches/wf4ever/app/views/packs/show.rhtml (3276 => 3277)


--- branches/wf4ever/app/views/packs/show.rhtml	2012-12-18 13:55:33 UTC (rev 3276)
+++ branches/wf4ever/app/views/packs/show.rhtml	2012-12-18 14:01:45 UTC (rev 3277)
@@ -121,12 +121,23 @@
 					Add an Item
 				</h3>
         <p>
-        <% form_tag(create_resource_pack_path(@pack), :multipart => true, :method => :post) do %>
-          <%= file_field_tag :data -%>
-          <%= submit_tag("Aggregate resource") -%>
-          <%= submit_tag("Aggregate workflow") -%>
-        <% end %>
+          <% form_tag(create_resource_pack_path(@pack), :multipart => true, :method => :post) do %>
+            <%= file_field_tag :data -%>
+            <%= submit_tag("Aggregate internal resource") -%>
+          <% end %>
         </p>
+        <p>
+          <% form_tag(create_resource_pack_path(@pack), :multipart => true, :method => :post) do %>
+            <%= file_field_tag :data -%>
+            <%= submit_tag("Aggregate workflow") -%>
+          <% end %>
+        </p>
+        <p>
+          <% form_tag(create_resource_pack_path(@pack), :multipart => true, :method => :post) do %>
+            <%= text_field_tag :uri -%>
+            <%= submit_tag("Aggregate external resource") -%>
+          <% end %>
+        </p>
 				<a name="add_item"></a>
 				<%= render :partial => "add_item", :locals => { :pack => @pack } -%>
 			<% end -%>

Modified: branches/wf4ever/app/views/workflows/edit_annotations.rhtml (3276 => 3277)


--- branches/wf4ever/app/views/workflows/edit_annotations.rhtml	2012-12-18 13:55:33 UTC (rev 3276)
+++ branches/wf4ever/app/views/workflows/edit_annotations.rhtml	2012-12-18 14:01:45 UTC (rev 3277)
@@ -1,5 +1,7 @@
 <h1>Edit annotations for <%= h(@workflow.title) -%></h1>
 
+<%= error_messages_for :workflow -%>
+
 <%
 templates = [
   {

reply via email to

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