myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2859] branches/datasets: Added Rails 2 fixes and


From: noreply
Subject: [myexperiment-hackers] [2859] branches/datasets: Added Rails 2 fixes and optimizations
Date: Fri, 2 Dec 2011 08:40:17 -0500 (EST)

Revision
2859
Author
fbacall
Date
2011-12-02 08:40:16 -0500 (Fri, 02 Dec 2011)

Log Message

Added Rails 2 fixes and optimizations

Modified Paths

Added Paths

Diff

Modified: branches/datasets/app/controllers/data_items_controller.rb (2858 => 2859)


--- branches/datasets/app/controllers/data_items_controller.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/controllers/data_items_controller.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -5,27 +5,27 @@
 
 class DataItemsController < ApplicationController
 
+  before_filter :fetch_relationship, :except => [:create, :new]
   before_filter :fetch_data_set_and_workflow
   before_filter :auth
-  before_filter :fetch_relationship, :except => [:create, :new]
   before_filter :fetch_port_names, : [:new, :edit]
   before_filter :fetch_blobs, : [:new, :edit]
 
   def create
     @errors = []
-    @relationship = Relationship.new
+    @data_item = Relationship.new
 
     data = ""
     port = get_port
     predicate = Predicate.find(params[:predicate_id])
 
-    if @errors.empty? && @relationship.update_attributes(:subject => data, :objekt => port, :predicate => predicate,
-                                                         :context => @data_set)
+    if @errors.empty? && @data_item.update_attributes(:subject => data, :objekt => port, :predicate => predicate,
+                                                      :context => @data_set)
       respond_to do |format|
         format.html {render :partial => "data_sets/data_set", :object => @data_set}
       end
     else
-      @errors = @errors + @relationship.errors.full_messages
+      @errors = @errors + @data_item.errors.full_messages
       respond_to do |format|
         format.html {render :partial => "data_sets/errors", :status => 400}
       end
@@ -39,13 +39,13 @@
     port = get_port
     predicate = Predicate.find(params[:predicate_id])
 
-    if @errors.empty? && @relationship.update_attributes(:subject => data, :objekt => port, :predicate => predicate)
+    if @errors.empty? && @data_item.update_attributes(:subject => data, :objekt => port, :predicate => predicate)
       respond_to do |format|
-        format.html {render :partial => "data_sets/data_item", :object => @relationship,
+        format.html {render :partial => "data_sets/data_item", :object => @data_item,
                             :locals => {:port_type => params[:workflow_port_type]}}
       end
     else
-      @errors = @errors + @relationship.errors.full_messages
+      @errors = @errors + @data_item.errors.full_messages
       respond_to do |format|
         format.html {render :partial => "data_sets/errors", :status => 400}
       end
@@ -55,7 +55,7 @@
   def destroy
     @errors = []
 
-    if @relationship.destroy
+    if @data_item.destroy
       respond_to do |format|
         format.html {render :partial => "data_sets/data_set", :object => @data_set}
       end
@@ -65,12 +65,12 @@
   def edit
     respond_to do |format|
       format.html {render :partial => "data_sets/data_item_form",
-                          :locals => {:port_type => @relationship.objekt.port_type.to_s}}
+                          :locals => {:port_type => @data_item.objekt.port_type.to_s}}
     end
   end
 
   def new
-    @relationship = Relationship.new
+    @data_item = Relationship.new
 
     if @port_names.empty?
       respond_to do |format|
@@ -86,42 +86,42 @@
 
   def show
     respond_to do |format|
-      format.html {render :partial => "data_sets/data_item", :object => @relationship,
-                          :locals => {:port_type => @relationship.objekt.port_type.to_s}}
+      format.html {render :partial => "data_sets/data_item", :object => @data_item,
+                          :locals => {:port_type => @data_item.objekt.port_type.to_s}}
     end
   end
 
   private
+  def fetch_relationship
+    @data_item = Relationship.find(params[:id])
+  end
+
   def fetch_data_set_and_workflow
-    @data_set = DataSet.find(params[:data_set_id])
+    @data_set = @data_item ? @data_item.context : DataSet.find(params[:data_set_id])
     @workflow = @data_set.workflow
   end
 
-  def fetch_relationship
-    @relationship = Relationship.find(params[:id])
-  end
-
   def get_data
     data = ""
 
     if params[:data_type] == "text"
       #If it wasn't associated with text data before, create some
-      if address@hidden(TextData)
+      if address@hidden(TextData)
         data = "" => params[:data], :data_set => @data_set)
         unless data.save
           @errors = @errors + data.errors.full_messages
         end
       #Otherwise just update the existing text data
       else
-        data = ""
+        data = ""
         unless data.update_attributes(:data ="" params[:data])
           @errors = @errors + data.errors.full_messages
         end
       end
     elsif params[:data_type] == "file"
       #delete existing text data
-      if @relationship.subject.kind_of?(TextData)
-        @relationship.subject.destroy
+      if @data_item.subject.kind_of?(TextData)
+        @data_item.subject.destroy
       end
 
       data = ""
@@ -138,13 +138,13 @@
     version = @data_set.workflow_version
 
     #Try and get existing port from relationship
-    if @relationship.objekt
+    if @data_item.objekt
       #But only if port wasn't changed in the form
-      if (params[:workflow_port] == @relationship.objekt.name) &&
-         (port_type == @relationship.objekt.port_type.to_s) &&
-         (version == @relationship.objekt.workflow_version)
+      if (params[:workflow_port] == @data_item.objekt.name) &&
+         (port_type == @data_item.objekt.port_type.to_s) &&
+         (version == @data_item.objekt.workflow_version)
 
-        port = @relationship.objekt
+        port = @data_item.objekt
       end
     end
 
@@ -176,14 +176,14 @@
   end
 
   def fetch_port_names
-    port_type = params[:port_type] || @relationship.objekt.port_type.to_s
+    port_type = params[:port_type] || @data_item.objekt.port_type.to_s
 
     existing_ports = @data_set.relationships.select do |r|
       port_type == "input" && r.objekt.input? ||
       port_type == "output" && r.objekt.output?
     end.collect {|r| r.objekt.name}
 
-    existing_ports -= address@hidden if @relationship
+    existing_ports.delete(@data_item.objekt.name) if @data_item
 
     version = @data_set.workflow_version
 
@@ -194,7 +194,6 @@
   end
 
   def fetch_blobs
-    #todo: Rails 2: can eagerly load bookmarkable... but that may not make a difference to perf
     @blobs = current_user.blobs +
         (current_user.bookmarks.find(:all, :conditions => ["bookmarkable_type = 'Blob'"]).map {|b| b.bookmarkable})
   end

Modified: branches/datasets/app/controllers/data_sets_controller.rb (2858 => 2859)


--- branches/datasets/app/controllers/data_sets_controller.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/controllers/data_sets_controller.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -17,7 +17,7 @@
 
     if @data_set.save && updated_policy?
       respond_to do |format|
-        format.html { redirect_to workflow_data_set_url(@workflow, @data_set) }
+        format.html { redirect_to data_set_url(@data_set) }
       end
     else
       respond_to do |format|
@@ -29,7 +29,7 @@
   def update
     if @data_set.update_attributes(params[:data_set]) && updated_policy?
       respond_to do |format|
-        format.html { redirect_to workflow_data_set_url(@workflow, @data_set) }
+        format.html { redirect_to data_set_url(@data_set) }
       end
     else
       respond_to do |format|
@@ -45,7 +45,7 @@
       end
     else
       respond_to do |format|
-        format.html { redirect_to workflow_data_set_url(@workflow, @data_set) }
+        format.html { redirect_to data_set_url(@data_set) }
       end
     end
   end
@@ -84,6 +84,13 @@
 
   def fetch_workflow
     @workflow = @data_set ? @data_set.workflow : Workflow.find(params[:workflow_id])
+    unless DataSet::SUPPORTED_TYPES.include?(@workflow.type)
+      flash[:error] = "Data sets are not yet supported for address@hidden workflows."
+
+      respond_to do |format|
+        format.html { redirect_to workflow_url(@workflow) }
+      end
+    end
   end
 
   def fetch_data_set
@@ -127,7 +134,7 @@
         flash[:error] = "You are not authorized to #{action_name} this data set."
 
         respond_to do |format|
-          format.html { redirect_to workflow_data_set_url(@workflow, @data_set) }
+          format.html { redirect_to data_set_url(@data_set) }
         end
       end
     end

Modified: branches/datasets/app/helpers/application_helper.rb (2858 => 2859)


--- branches/datasets/app/helpers/application_helper.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/helpers/application_helper.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -367,9 +367,7 @@
     when "Blob", "Pack", "Blog", "DataSet"
       resource = eval(contributabletype).find_by_id(contributableid)
       name = h(resource.label)
-      # todo: Rails 2: refactor this, or just remove and use polymorphic_path
-      url = "" + "_url(resource)")
-      return link ? link_to(name, url) : name
+      return link ? link_to(name, poly_url(resource)) : name
     when "Workflow"
       if w = Workflow.find(:first, :conditions => ["id = ?", contributableid])
         name = h(w.title)
@@ -1586,4 +1584,17 @@
     @layout = layout || {"layout" => Conf.page_template, "stylesheets" => [Conf.stylesheet]}
   end
 
+
+  #todo: fixme: hack! Work around for blob/group routes
+  def poly_url(object, options = {})
+    if object.kind_of?(Blob)
+      file_url(object, options = {})
+    elsif object.kind_of?(Network)
+      group_url(object, options = {})
+    else
+      polymorphic_url(object, options = {})
+    end
+  end
+
+
 end

Modified: branches/datasets/app/models/data_set.rb (2858 => 2859)


--- branches/datasets/app/models/data_set.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/models/data_set.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -5,8 +5,11 @@
 
 class DataSet < ActiveRecord::Base
 
+  SUPPORTED_TYPES = ["Taverna 1", "Taverna 2", "RapidMiner"] # Only supporting these for now, due to how input/output
+                                                             #  ports are fetched
+  include ZipInMemory
   include ActionController::UrlWriter #To generate URLs for the metadata file of the zip archive
-  include ZipInMemory
+  default_url_options[:host] = URI.parse(Conf.base_uri).host
 
   acts_as_site_entity
   acts_as_contributable
@@ -19,7 +22,7 @@
   belongs_to :contributor, :polymorphic => true
 
   #The "data items" are represented as relationships. Subject = data, Object = port
-  has_many :relationships, :class_name => "Relationship", :as => :context,
+  has_many :data_items, :class_name => "Relationship", :as => :context,
            :dependent => :destroy
 
   #this association is just to ensure text data is deleted when the data set is. not actually used.
@@ -29,7 +32,7 @@
 
   # Zips the pack up and returns a StringIO object containing its contents
   def create_zip(user)
-    # Some stats to be included in the metadata file
+    # Some simple stats to be included in the metadata file
     stats = {"input" =>  {:text => 0, :files => 0, :hidden => 0},
              "output" => {:text => 0, :files => 0, :hidden => 0}}
 
@@ -81,7 +84,7 @@
     "========== Data Set Details ==========\r\n\r\n" +
 
     "Title: #{title}\r\n" +
-    "Location: #{workflow_data_set_url(workflow, self)}\r\n" +
+    "Location: #{data_set_url(self)}\r\n" +
     "Workflow: #{workflow.title}\r\n" +
     "Workflow location: #{workflow_url(workflow)}\r\n" +
     "Created by: #{self.contributor.label}\r\n" +
@@ -89,12 +92,12 @@
     "Last updated at: #{self.updated_at.strftime("%H:%M:%S on %A, %d %B %Y")}\r\n\r\n" +
 
     "Summary of contents:\r\n" +
-    "  Inputs:\r\n" +
+    "  Input data:\r\n" +
     "    Text: #{stats["input"][:text]}\r\n" +
     "    Files: #{stats["input"][:files]}" +
       (stats["input"][:hidden] > 0 ?
         " (#{stats["input"][:hidden]} files were omitted due to insufficient access privileges)\r\n" : "\r\n") +
-    "  Outputs:\r\n" +
+    "  Output data:\r\n" +
     "    Text: #{stats["output"][:text]}\r\n" +
     "    Files: #{stats["output"][:files]}" +
       (stats["output"][:hidden] > 0 ?

Modified: branches/datasets/app/models/pack.rb (2858 => 2859)


--- branches/datasets/app/models/pack.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/models/pack.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -86,6 +86,7 @@
   end
 
   # A generic method to get an appropriate filename for the given contributable item
+  #  Ideally this would be implemented by each contributable model
   def item_filename(item)
     filename = nil
     if item.kind_of?(Workflow)
@@ -105,6 +106,7 @@
   end
 
   # A generic method to get the data of the given contributable item
+  #  Ideally this would be implemented by each contributable model
   def item_data(item, user)
     data = ""
     if [Workflow, Workflow::Version, Blob].include?(item.class)
@@ -132,7 +134,6 @@
     FileUtils.rm Dir.glob(archive_file_path(true).gsub(/[\[\]]/, "?")), :force => true
 
     # create the zip file
-
     zipfile = Zip::ZipFile.open(archive_file_path, Zip::ZipFile::CREATE)
 
     # will keep a list of all filenames that are put into the archive (to delete temp files later)
@@ -173,30 +174,28 @@
     zipfile.add("_images/link.png", list_images_hash["link"])
     zipfile.add("_images/denied.png", list_images_hash["denied"])
 
-   zipfile.close() # finalize the archive file
+    zipfile.close() # finalize the archive file
 
-   # set read permissions on the zip file
-   File.chmod(0644, archive_file_path)
+    # set read permissions on the zip file
+    File.chmod(0644, archive_file_path)
 
-   # remove any temporary files that were created while creating the zip file
-   # (these are created in the same place, where the zip file is stored)
-   zip_filenames.each do |temp_file|
-     FileUtils.rm Dir.glob(Pack.archive_folder + "/" + "#{temp_file}*"), :force => true # 'force' option makes sure that exceptions are never raised
-   end
+    # remove any temporary files that were created while creating the zip file
+    # (these are created in the same place, where the zip file is stored)
+    zip_filenames.each do |temp_file|
+      FileUtils.rm Dir.glob(Pack.archive_folder + "/" + "#{temp_file}*"), :force => true # 'force' option makes sure that exceptions are never raised
+    end
 
-
+    zipfile.path
   end
 
   def text_metadata(stats)
-    total_items = self.contributable_entries.length + self.remote_entries.length
+    total_items = self.items_count
     total_downloaded = stats[:downloaded].values.flatten.size
 
+    # Ignore packs as part of "view only" set, as they're treated differently
     pack_entries = stats[:view_only]["Pack"] || {}
+    view_only = stats[:view_only].except("Pack")
 
-    # Ignore packs as part of "view only" set, as they're treated differently
-    view_only = {}
-    stats[:view_only].each {|key, value| view_only[key] = value unless key == "Pack"}
-
     text = "********** Snapshot of the Pack: #{self.title} **********\n\n"
     text << "Downloaded from #{Conf.sitename}\n"
     text << "Snapshot generated at " + Time.now.strftime("%H:%M:%S on %A, %d %B %Y") + "\n\n\n\n"
@@ -323,16 +322,14 @@
   end
 
   def html_metadata(stats)
-    total_items = self.contributable_entries.size + self.remote_entries.size
+    total_items = self.items_count
     total_downloaded = stats[:downloaded].values.flatten.size
 
     pack_entries = stats[:view_only]["Pack"] || {}
 
     # Ignore packs as part of "view only" set, as they're treated differently
-    view_only = {}
-    stats[:view_only].each {|key, value| view_only[key] = value unless key == "Pack"}
+    view_only = stats[:view_only].except("Pack")
 
-
     cgi = CGI.new("html4")
     html = cgi.html {
       cgi.head{

Modified: branches/datasets/app/models/workflow.rb (2858 => 2859)


--- branches/datasets/app/models/workflow.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/models/workflow.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -66,6 +66,7 @@
 
     belongs_to :content_blob
     belongs_to :content_type
+    belongs_to :contributor, :polymorphic => true
 
     validates_presence_of :content_blob
     validates_presence_of :content_type

Modified: branches/datasets/app/views/data_sets/_breadcrumbs.rhtml (2858 => 2859)


--- branches/datasets/app/views/data_sets/_breadcrumbs.rhtml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/views/data_sets/_breadcrumbs.rhtml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -20,7 +20,7 @@
   <li>Create new data set</li>
 <% when "edit" %>
   <li><b>&#187;</b></li>
-  <li><%= link_to h(@data_set.title), workflow_data_set_path(@workflow, @data_set) %></li>
+  <li><%= link_to h(@data_set.title), data_set_path(@data_set) %></li>
   <li><b>&#187;</b></li>
   <li>Edit</li>
 <% else %>

Modified: branches/datasets/app/views/data_sets/_data_item.rhtml (2858 => 2859)


--- branches/datasets/app/views/data_sets/_data_item.rhtml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/views/data_sets/_data_item.rhtml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -54,7 +54,7 @@
 <%# data sets should probably have their own policy %>
 <% if mine? @workflow %>
 <td class="controls">
-  <%= icon('destroy', {:url ="" data_set_data_item_path(@data_set, data_item), :method => :delete,
+  <%= icon('destroy', {:url ="" data_item_path(data_item), :method => :delete,
                       :update => {:success => "data_set_container"},
                       :loading => "$('data_item_#{data_item.id}_spinner').show();",
                       :complete => "$('data_item_#{data_item.id}_spinner').hide();"},
@@ -62,7 +62,7 @@
                  :confirm => "Are you sure?",
                  :title => "Delete this #{data.kind_of?(TextData) ? "data" : "association"}"}, "", true) %>
   <br/>
-  <%= icon('edit', {:url ="" edit_data_set_data_item_path(@data_set, data_item), :method => :get,
+  <%= icon('edit', {:url ="" edit_data_item_path(data_item), :method => :get,
                     :update => {:success => "item_#{data_item.id}"},
                     :loading => "$('data_item_#{data_item.id}_spinner').show();",
                     :complete => "$('data_item_#{data_item.id}_spinner').hide();"},

Modified: branches/datasets/app/views/data_sets/_data_item_form.rhtml (2858 => 2859)


--- branches/datasets/app/views/data_sets/_data_item_form.rhtml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/views/data_sets/_data_item_form.rhtml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -1,6 +1,6 @@
 <%
-  data = ""
-  port = @relationship.objekt
+  data = ""
+  port = @data_item.objekt
   data_type = ""
   data_type = "file" if data.kind_of?(Blob)
   data_type = "text" if data.kind_of?(TextData)
@@ -15,8 +15,8 @@
         value="#{b.id}" title="#{h b.title}">#{h truncate(b.title,30)}</option>)
   end
 
-  container_element = @relationship.id.nil? ? "data_item_#{port_type}_form" : "address@hidden"
-  unique_id = (@relationship.id || port_type).to_s
+  container_element = @data_item.id.nil? ? "data_item_#{port_type}_form" : "address@hidden"
+  unique_id = (@data_item.id || port_type).to_s
 %>
 
 <td colspan="4" style="padding: 0">
@@ -63,15 +63,16 @@
 
     </td>
   <% end  %>
-  <% form_remote_tag  :url ="" (@relationship.id.nil? ? data_set_data_items_path(@data_set) : data_set_data_item_path(@data_set, @relationship)),
-                      :method => (@relationship.id.nil? ? :post : :put),
-                      :update => {:success => (@relationship.id.nil? ? "data_set_container" : container_element),
+  <% form_remote_tag  :url ="" (@data_item.id.nil? ? data_set_data_items_path(@data_set) : data_item_path(@data_item)),
+                      :method => (@data_item.id.nil? ? :post : :put),
+                      :update => {:success => (@data_item.id.nil? ? "data_set_container" : container_element),
                                   :failure => "data_item_form_errors"},
                       :failure => "$('data_item_form_errors').show();",
                       :loading => "$('relationship_form_spinner_#{unique_id}').show();",
                       :complete => "$('relationship_form_spinner_#{unique_id}').hide();" do %>
     <%# todo: fix this %>
-    <%= hidden_field_tag :predicate_id, port_type == "input" ? Predicate.find_by_title("exampleInputTo").id : Predicate.find_by_title("exampleOutputFrom").id %>
+    <%= hidden_field_tag :predicate_id, port_type == "input" ? Predicate.find_by_title("exampleInputDataTo").id :
+                                                               Predicate.find_by_title("exampleOutputDataFrom").id %>
 
     <div id="data_item_form_errors" style="display:none"></div>
 
@@ -85,10 +86,10 @@
           <%= hidden_field_tag(:workflow_port_type, port_type) %>
           <%= submit_tag "Save" %><br/>
           or<br/>
-          <% if @relationship.id.nil? %>
+          <% if @data_item.id.nil? %>
             <%= link_to "Cancel", "#", : "$$('##{container_element} td').each(function (e){ e.remove()});return false;" %>
           <% else %>
-            <%= link_to "Cancel", "#", : remote_function(:url ="" data_set_data_item_path(@data_set, @relationship),
+            <%= link_to "Cancel", "#", : remote_function(:url ="" data_item_path(@data_item),
                                                      :method => :get,
                                                      :update => {:success => container_element},
                                                      :loading => "$('relationship_form_spinner_#{unique_id}').show();",

Modified: branches/datasets/app/views/data_sets/_data_set.rhtml (2858 => 2859)


--- branches/datasets/app/views/data_sets/_data_set.rhtml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/views/data_sets/_data_set.rhtml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -23,7 +23,7 @@
   <h3>Input data</h3>
   <table>
     <tbody>
-      <% (@data_set.relationships.select{|r| r.objekt.input?}).each do |i| %>
+      <% (@data_set.data_items.select{|r| r.objekt.input?}).each do |i| %>
         <tr class="data_item" id="item_<%= i.id -%>">
           <%= render :partial => "data_sets/data_item", :object => i, :locals => {:port_type => "input"} %>
         </tr>
@@ -35,7 +35,7 @@
     </tbody>
   </table>
 
-  <% if @data_set.relationships.select{|r| r.objekt.input?}.empty? %>
+  <% if @data_set.data_items.select{|r| r.objekt.input?}.empty? %>
     <span class="none_text">No output data specified</span>
   <% end  %>
 
@@ -57,7 +57,7 @@
 
   <table>
     <tbody>
-      <% (@data_set.relationships.select{|r| r.objekt.output?}).each do |o| %>
+      <% (@data_set.data_items.select{|r| r.objekt.output?}).each do |o| %>
         <tr class="data_item" id="item_<%= o.id -%>">
           <%= render :partial => "data_sets/data_item", :object => o, :locals => {:port_type => "output"} %>
         </tr>
@@ -69,7 +69,7 @@
     </tbody>
   </table>
 
-  <% if @data_set.relationships.select{|r| r.objekt.output?}.empty? %>
+  <% if @data_set.data_items.select{|r| r.objekt.output?}.empty? %>
     <span class="none_text">No output data specified</span>
   <% end  %>
 

Modified: branches/datasets/app/views/data_sets/_form.rhtml (2858 => 2859)


--- branches/datasets/app/views/data_sets/_form.rhtml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/views/data_sets/_form.rhtml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -1,8 +1,8 @@
-<%= _javascript__include_tag :fckeditor %>
+<%= _javascript__include_tag "fckeditor/fckeditor.js" %>
 
 <% form_for :data_set,
             :html => {:method => (@data_set.id.nil? ? :post : :put)},
-            :url ="" (@data_set.id.nil? ? workflow_data_sets_url(@workflow) : workflow_data_set_url(@workflow, @data_set)) do |f| %>
+            :url ="" (@data_set.id.nil? ? workflow_data_sets_url(@workflow) : data_set_url(@data_set)) do |f| %>
 
   <%= error_messages_for :data_set %>
 
@@ -31,6 +31,6 @@
   <%= submit_tag (@data_set.id.nil? ? "Create" : "Update") %>
   or
   <%= link_to "Cancel", (@data_set.id.nil? ? workflow_data_sets_path(@workflow) :
-                                             workflow_data_set_path(@workflow, @data_set)) %>
+                                             data_set_path(@data_set)) %>
 <% end %>
 

Modified: branches/datasets/app/views/data_sets/_table.rhtml (2858 => 2859)


--- branches/datasets/app/views/data_sets/_table.rhtml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/views/data_sets/_table.rhtml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -6,7 +6,7 @@
   <% collection.sort_by(&:workflow_version).reverse_each do |data_set| %>
     <tr class="data_set <%= "old_version" if data_set.workflow_version < data_set.workflow.current_version-%>">
       <td style="width: 25em">
-        <%= link_to data_set.title, workflow_data_set_path(data_set.workflow, data_set) %>
+        <%= link_to data_set.title, data_set_path(data_set) %>
       </td>
       <td>
         <%= link_to data_set.contributor.name, user_path(data_set.contributor) %>

Modified: branches/datasets/app/views/data_sets/show.rhtml (2858 => 2859)


--- branches/datasets/app/views/data_sets/show.rhtml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/views/data_sets/show.rhtml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -1,23 +1,23 @@
 <div id="data_sets_container">
   <div id="data_set_selector" style="float: left" class="sectionIcons">
     Jump to data set:
-    <%= select_tag :data_set, (@data_sets.collect {|d| "<option #{"selected = \"selected\"" if d == @data_set}value=\"#{d.id}\">#{truncate h(d.title), 25}</option>"}),
-                   : "window.location = '#{workflow_data_sets_path(@workflow)}/' + $F('data_set');",
+    <%= select_tag :data_set, (@data_sets.collect {|d| "<option #{"selected = \"selected\"" if d == @data_set}value=\"#{data_set_url(d.id)}\">#{truncate h(d.title), 25}</option>"}),
+                   : "window.location = $F('data_set');",
                    :style => "width: 15em"%>
   </div>
   <div style="float: right; margin: 0.5em">
     <ul class="sectionIcons">
       <% if Authorization.is_authorized?("download", nil, @workflow, current_user) %>
         <li>
-          <%= icon('download', download_workflow_data_set_path(@workflow, @data_set), nil, nil, 'Download as a zip file') %>
+          <%= icon('download', download_data_set_path(@data_set), nil, nil, 'Download as a zip file') %>
         </li>
       <% end %>
       <% if mine?(@workflow) %>
         <li>
-          <%= icon('edit', edit_workflow_data_set_path(@workflow, @data_set), nil, nil, 'Edit data set') %>
+          <%= icon('edit', edit_data_set_path(@data_set), nil, nil, 'Edit data set') %>
         </li>
         <li>
-          <%= icon('destroy', workflow_data_set_path(@workflow, @data_set), nil,
+          <%= icon('destroy', data_set_path(@data_set), nil,
                    {:method => :delete, :confirm => "Are you sure wish to delete this data set? All associated text data "+
                                                     "will be deleted, but any uploaded files will remain on #{Conf.sitename}."},
                    'Delete data set') %>

Modified: branches/datasets/app/views/packs/_add_item.rhtml (2858 => 2859)


--- branches/datasets/app/views/packs/_add_item.rhtml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/app/views/packs/_add_item.rhtml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -48,8 +48,7 @@
 						<td>
 							<select id="uri2" name="uri" style="width: 320px;">
 					  		<% contributions.reject {|c| c == @pack || c.contributable.nil?}.each do |c| -%>
-                  <%# todo: Rails 2: Refactor this to use polymorphic_url %>
-                  <option value="<%= eval(c.contributable_type.model_alias.underscore + "_url(c.contributable_id)") -%>">
+                  <option value="<%= poly_url(c.contributable) -%>">
                     <%= "#{visible_name c.contributable_type}: #{c.contributable.label}" -%>
                   </option>
 					  		<% end -%>

Modified: branches/datasets/config/environment.rb (2858 => 2859)


--- branches/datasets/config/environment.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/config/environment.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -84,10 +84,6 @@
 
 require 'lib/conf'
 
-# Extensions to core ruby/rails functionality
-
-require 'lib/core_extensions'
-
 # SMTP configuration
 
 require 'smtp_tls'

Added: branches/datasets/config/initializers/load_extensions.rb (0 => 2859)


--- branches/datasets/config/initializers/load_extensions.rb	                        (rev 0)
+++ branches/datasets/config/initializers/load_extensions.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -0,0 +1,3 @@
+# Extensions to core ruby/rails functionality
+
+require 'lib/core_extensions'
\ No newline at end of file

Modified: branches/datasets/config/routes.rb (2858 => 2859)


--- branches/datasets/config/routes.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/config/routes.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -126,20 +126,11 @@
     workflow.resources :reviews
     workflow.resources :previews
     workflow.resources :comments, :collection => { :timeline => :get }
-    workflow.resources :data_sets, :member => { :download => :get }
+    workflow.resources :data_sets, :shallow => true, :member => { :download => :get } do |data_set|
+      data_set.resources :data_items
+    end
   end
 
-  # Data Sets
-  #todo: Rails 2. Nest this in the above and use :shallow => true
-  map.resources :data_items, :controller => "data_items",
-                :path_prefix => "/data_sets/:data_set_id",
-                :name_prefix => "data_set_"
-
-  # So we can access a data set on its own (without needing workflow id)
-  #  Useful for polymorphic_urls
-  map.data_set 'data_sets/:id', :controller => 'data_sets', :action ="" 'show'
-
-
   # workflow redirect for linked data model
   map.workflow_version           '/workflows/:id/versions/:version',         :conditions => { :method => :get }, :controller => 'workflows', :action ="" 'show'
   map.formatted_workflow_version '/workflows/:id/versions/:version.:format', :conditions => { :method => :get }, :controller => 'workflows', :action ="" 'show'
@@ -168,7 +159,7 @@
 
   # files (downloadable)
   map.resources :files, 
-    :controller => :blobs, 
+    :controller => :blobs,
     :collection => { :search => :get }, 
     :member => { :download => :get,
                  :statistics => :get,
@@ -248,7 +239,7 @@
     user.resources :reports, :controller => :user_reports
   end
 
-  map.resources :groups, 
+  map.resources :groups,
     :controller => :networks, 
     :collection => { :all => :get, :search => :get }, 
     :member => { :invite => :get,

Modified: branches/datasets/test/fixtures/content_blobs.yml (2858 => 2859)


--- branches/datasets/test/fixtures/content_blobs.yml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/test/fixtures/content_blobs.yml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -24,3 +24,9 @@
   id: 4
   data: <%= load_blob_data('workflow_branch_choice.xml') %>
 
+string_concat_v1:
+  data: <%= load_blob_data('string_concat_v1.t2flow') %>
+
+string_concat_v2:
+  data: <%= load_blob_data('string_concat_v2.t2flow') %>
+

Modified: branches/datasets/test/fixtures/content_types.yml (2858 => 2859)


--- branches/datasets/test/fixtures/content_types.yml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/test/fixtures/content_types.yml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -31,3 +31,12 @@
   created_at: 2008-04-22 15:32:01
   updated_at: 2008-04-22 15:32:01
 
+taverna2:
+  user_id: 1
+  title: Taverna 2
+  description: The Taverna 2 workflow file format.
+  description_html: "<p>The Taverna 2 workflow file format.</p>"
+  mime_type: application/vnd.taverna.t2flow+xml
+  created_at: 2008-04-22 15:32:01
+  updated_at: 2008-04-22 15:32:01
+  category: Workflow

Added: branches/datasets/test/fixtures/files/string_concat_v1.t2flow (0 => 2859)


--- branches/datasets/test/fixtures/files/string_concat_v1.t2flow	                        (rev 0)
+++ branches/datasets/test/fixtures/files/string_concat_v1.t2flow	2011-12-02 13:40:16 UTC (rev 2859)
@@ -0,0 +1,58 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="7515a7ba-b02c-424f-ae41-c7b71097eed4" role="top"><name>Workflow1</name><inputPorts><port><name>string1</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port><port><name>string2</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>result</name><annotations /></port></outputPorts><processors><processor><name>Concatenate_two_strings</name><inputPorts><port><name>string1</name><depth>0</depth></port><port><name>string2</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="string2" to="string2" /><map from="string1" to="string1" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>string1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>string2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>output = string1 + string2;</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringConcat</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="string1" depth="0" /><port name="string2" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string1</port></sink><source type="dataflow"><port>string1</port></source></datalink><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string2</port></sink><source type="dataflow"><port>string2</port></source></datalink><datalink><sink type="dataflow"><port>result</port></sink><source type="processor"><processor>Concatenate_two_strings</processor><port>output</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7515a7ba-b02c-424f-ae41-c7b71097eed4</identification>
+      </annotationBean>
+      <date>2011-11-18 08:43:55.777 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

Added: branches/datasets/test/fixtures/files/string_concat_v2.t2flow (0 => 2859)


--- branches/datasets/test/fixtures/files/string_concat_v2.t2flow	                        (rev 0)
+++ branches/datasets/test/fixtures/files/string_concat_v2.t2flow	2011-12-02 13:40:16 UTC (rev 2859)
@@ -0,0 +1,115 @@
+<workflow xmlns="http://taverna.sf.net/2008/xml/t2flow" version="1" producedBy="taverna-2.3.0"><dataflow id="03f0152b-cf16-4112-a90b-caac3d4694c9" role="top"><name>Workflow1</name><inputPorts><port><name>string1</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port><port><name>string2</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port><port><name>string3</name><depth>0</depth><granularDepth>0</granularDepth><annotations /></port></inputPorts><outputPorts><port><name>result</name><annotations /></port></outputPorts><processors><processor><name>Concatenate_two_strings</name><inputPorts><port><name>string1</name><depth>0</depth></port><port><name>string2</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="string2" to="string2" /><map from="string1" to="string1" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>string1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>string2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>output = string1 + string2;</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringConcat</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="string1" depth="0" /><port name="string2" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor><processor><name>Concatenate_two_strings_2</name><inputPorts><port><name>string2</name><depth>0</depth></port><port><name>string1</name><depth>0</depth></port></inputPorts><outputPorts><port><name>output</name><depth>0</depth><granularDepth>0</granularDepth></port></outputPorts><annotations /><activities><activity><raven><group>net.sf.taverna.t2.activities</group><artifact>localworker-activity</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap><map from="string2" to="string2" /><map from="string1" to="string1" /></inputMap><outputMap><map from="output" to="output" /></outputMap><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns="">
+  <inputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>string1</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+      <name>string2</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <handledReferenceSchemes />
+      <translatedElementType>java.lang.String</translatedElementType>
+      <allowsLiteralValues>true</allowsLiteralValues>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean>
+  </inputs>
+  <outputs>
+    <net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+      <name>output</name>
+      <depth>0</depth>
+      <mimeTypes>
+        <string>'text/plain'</string>
+      </mimeTypes>
+      <granularDepth>0</granularDepth>
+    </net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean>
+  </outputs>
+  <classLoaderSharing>workflow</classLoaderSharing>
+  <localDependencies />
+  <artifactDependencies />
+  <script>output = string1 + string2;</script>
+  <dependencies />
+  <localworkerName>org.embl.ebi.escience.scuflworkers.java.StringConcat</localworkerName>
+</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean><annotations /></activity></activities><dispatchStack><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Parallelize</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig xmlns="">
+  <maxJobs>1</maxJobs>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ParallelizeConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.ErrorBounce</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Failover</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Retry</class><configBean encoding="xstream"><net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig xmlns="">
+  <backoffFactor>1.0</backoffFactor>
+  <initialDelay>1000</initialDelay>
+  <maxDelay>5000</maxDelay>
+  <maxRetries>0</maxRetries>
+</net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.RetryConfig></configBean></dispatchLayer><dispatchLayer><raven><group>net.sf.taverna.t2.core</group><artifact>workflowmodel-impl</artifact><version>1.3</version></raven><class>net.sf.taverna.t2.workflowmodel.processor.dispatch.layers.Invoke</class><configBean encoding="xstream"><null xmlns="" /></configBean></dispatchLayer></dispatchStack><iterationStrategyStack><iteration><strategy><cross><port name="string2" depth="0" /><port name="string1" depth="0" /></cross></strategy></iteration></iterationStrategyStack></processor></processors><conditions /><datalinks><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string1</port></sink><source type="dataflow"><port>string1</port></source></datalink><datalink><sink type="processor"><processor>Concatenate_two_strings</processor><port>string2</port></sink><source type="dataflow"><port>string2</port></source></datalink><datalink><sink type="processor"><processor>Concatenate_two_strings_2</processor><port>string2</port></sink><source type="dataflow"><port>string3</port></source></datalink><datalink><sink type="processor"><processor>Concatenate_two_strings_2</processor><port>string1</port></sink><source type="processor"><processor>Concatenate_two_strings</processor><port>output</port></source></datalink><datalink><sink type="dataflow"><port>result</port></sink><source type="processor"><processor>Concatenate_two_strings_2</processor><port>output</port></source></datalink></datalinks><annotations><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>7515a7ba-b02c-424f-ae41-c7b71097eed4</identification>
+      </annotationBean>
+      <date>2011-11-18 08:43:55.777 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2><annotation_chain_2_2 encoding="xstream"><net.sf.taverna.t2.annotation.AnnotationChainImpl xmlns="">
+  <annotationAssertions>
+    <net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+      <annotationBean class="net.sf.taverna.t2.annotation.annotationbeans.IdentificationAssertion">
+        <identification>03f0152b-cf16-4112-a90b-caac3d4694c9</identification>
+      </annotationBean>
+      <date>2011-11-18 08:45:14.220 GMT</date>
+      <creators />
+      <curationEventList />
+    </net.sf.taverna.t2.annotation.AnnotationAssertionImpl>
+  </annotationAssertions>
+</net.sf.taverna.t2.annotation.AnnotationChainImpl></annotation_chain_2_2></annotations></dataflow></workflow>
\ No newline at end of file

Modified: branches/datasets/test/fixtures/workflow_versions.yml (2858 => 2859)


--- branches/datasets/test/fixtures/workflow_versions.yml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/test/fixtures/workflow_versions.yml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -28,3 +28,17 @@
   revision_comments: 
   content_type_id: 3
   content_blob_id: 4
+
+string_concat_v1:
+  workflow: string_concat
+  contributor: john (User)
+  title: Concatenate Two Strings
+  content_blob: string_concat_v1
+  version: 1
+
+string_concat_v2:
+  workflow: string_concat
+  contributor: john (User)
+  title: Concatenate Three Strings
+  content_blob: string_concat_v2
+  version: 2

Modified: branches/datasets/test/fixtures/workflows.yml (2858 => 2859)


--- branches/datasets/test/fixtures/workflows.yml	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/test/fixtures/workflows.yml	2011-12-02 13:40:16 UTC (rev 2859)
@@ -26,3 +26,11 @@
   current_version: 1
   content_type_id: 3
   content_blob_id: 4
+
+string_concat:
+  contributor: john (User)
+  title: Concatenate Three Strings
+  unique_name: string_concat
+  content_blob: string_concat_v2
+  current_version: 2
+  content_type: taverna2

Modified: branches/datasets/test/test_helper.rb (2858 => 2859)


--- branches/datasets/test/test_helper.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/test/test_helper.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -34,6 +34,9 @@
   # -- they do not yet inherit this setting
   fixtures :all
 
+  # So the workflow_versions fixtures are created like Rails models rather than just DB records
+  set_fixture_class :workflow_versions=> Workflow::Version
+
   # Add more helper methods to be used by all tests here...
 
   def login_as(user)

Modified: branches/datasets/test/unit/data_set_test.rb (2858 => 2859)


--- branches/datasets/test/unit/data_set_test.rb	2011-12-01 14:16:25 UTC (rev 2858)
+++ branches/datasets/test/unit/data_set_test.rb	2011-12-02 13:40:16 UTC (rev 2859)
@@ -1,6 +1,6 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class DataSetTest < Test::Unit::TestCase
+class DataSetTest < ActiveSupport::TestCase
   fixtures :workflows
   fixtures :blobs
   fixtures :workflow_ports

reply via email to

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