myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2295] trunk: workflow version api - handle updat


From: noreply
Subject: [myexperiment-hackers] [2295] trunk: workflow version api - handle updating main record if last version changes
Date: Tue, 10 Nov 2009 08:52:47 -0500 (EST)

Revision
2295
Author
dgc
Date
2009-11-10 08:52:47 -0500 (Tue, 10 Nov 2009)

Log Message

workflow version api - handle updating main record if last version changes

Modified Paths

Diff

Modified: trunk/app/views/workflows/show.rhtml (2294 => 2295)


--- trunk/app/views/workflows/show.rhtml	2009-11-09 15:50:47 UTC (rev 2294)
+++ trunk/app/views/workflows/show.rhtml	2009-11-10 13:52:47 UTC (rev 2295)
@@ -155,6 +155,16 @@
 			
 			<h3>
 				<%= info_icon_with_tooltip("This section shows the preview of this version of the Workflow (click on the image to expand)") %>
+				Classification
+			</h3>
+			
+      <p>
+        <span class="classification">Sequence Analysis</span>
+        <span class="classification">Gene Prediction</span>
+      </p>
+
+			<h3>
+				<%= info_icon_with_tooltip("This section shows the preview of this version of the Workflow (click on the image to expand)") %>
 				Preview
 			</h3>
 			
@@ -210,8 +220,170 @@
 			
 			<br/>
 			
+
 			<h3>
 				<%= info_icon_with_tooltip("This section provides links to the different downloads for this version of the Workflow") %>
+				Inputs
+			</h3>
+			
+      <h4 style="text-align: left">Input 1: chromosome_name</h4>
+
+      <table class="simple">
+        <tr>
+          <td>Name</td>
+          <td>chromosome_name</td>
+        </tr>
+        <tr>
+          <td>Type</td>
+          <td>Text</td>
+        </tr>
+        <tr>
+          <td>Description</td>
+          <td>A chromosome name or number.</td>
+        </tr>
+        <tr>
+          <td>Example 1</td>
+          <td>17</td>
+        </tr>
+      </table>
+      <br />
+      <br />
+
+      <h4 style="text-align: left">Input 2: qtl_start_position</h4>
+
+      <table class="simple">
+        <tr>
+          <td>Name</td>
+          <td>qtl_start_position</td>
+        </tr>
+        <tr>
+          <td>Type</td>
+          <td>Text</td>
+        </tr>
+        <tr>
+          <td>Description</td>
+          <td>QTL start base pair position</td>
+        </tr>
+        <tr>
+          <td>Example 1</td>
+          <td>28500000</td>
+        </tr>
+      </table>
+      <br />
+      <br />
+
+      <h4 style="text-align: left">Input 3: qtl_end_position</h4>
+
+      <table class="simple">
+        <tr>
+          <td>Name</td>
+          <td>qtl_end_position</td>
+        </tr>
+        <tr>
+          <td>Type</td>
+          <td>Text</td>
+        </tr>
+        <tr>
+          <td>Description</td>
+          <td>QTL end base pair position</td>
+        </tr>
+        <tr>
+          <td>Example 1</td>
+          <td>29500000</td>
+        </tr>
+      </table>
+      <br />
+      <br />
+
+			<h3>
+				<%= info_icon_with_tooltip("This section provides links to the different downloads for this version of the Workflow") %>
+				Outputs
+			</h3>
+			
+      <h4 style="text-align: left">Output 1: chromosome_name</h4>
+
+      <table class="simple">
+        <tr>
+          <td>Name</td>
+          <td>merged_pathways</td>
+        </tr>
+        <tr>
+          <td>Type</td>
+          <td><a href="" record</a></td>
+        </tr>
+        <tr>
+          <td>Description</td>
+          <td>The merged pathways</td>
+        </tr>
+        <tr>
+          <td>Example 1</td>
+          <td>17</td>
+        </tr>
+      </table>
+      <br />
+      <br />
+
+
+			<h3><%= info_icon_with_tooltip("This section provides links to the different downloads for this version of the Workflow") %> Complete examples</h3>
+			
+      <h4 style="text-align: left">Complete example 1: Example given from the original description</h4>
+
+      <table class="simple">
+        <tr>
+          <th>Input</th>
+          <th>Value</th>
+        </tr>
+        <tr>
+          <td>chromosome_name</td>
+          <td>17</td>
+        </tr>
+        <tr>
+          <td>qtl_start_position</td>
+          <td>28500000</td>
+        </tr>
+        <tr>
+          <td>qtl_end_position</td>
+          <td>29500000</td>
+        </tr>
+      </table>
+      <br />
+      <br />
+
+      <table class="simple">
+        <tr>
+          <th>Output</th>
+          <th>Value</th>
+        </tr>
+        <tr>
+          <td>merged_pathways</td>
+          <td>Example output value.</td>
+        </tr>
+      </table>
+      <br />
+      <br />
+
+
+			<h3><%= info_icon_with_tooltip("This section provides links to the different downloads for this version of the Workflow") %> Dependencies</h3>
+			
+      <div class="dependencies">
+        <p>This workflow depends on the following:
+          <br />
+
+          <ul>
+            <li>
+              <%= icon('blob', nil, nil, nil, '') %>
+              <a href="" Compounds to Inchi strings</a>
+            </li>
+            <li>
+              <span class="icon"><img src="" /></span>
+              <a href=""
+            </li>
+          </ul>
+        </p>
+      </div>
+
+			<h3>
+				<%= info_icon_with_tooltip("This section provides links to the different downloads for this version of the Workflow") %>
 				Download
 			</h3>
 			
@@ -271,6 +443,23 @@
 	
 	<%= render :partial => "contributions/credits_attributions_box", :locals => { :contributable => @workflow, :edit_path => edit_workflow_path(@workflow) } %>
 	
+<div class="contribution_section_box">
+	<p class="heading" style="margin-bottom: 0; padding-bottom: 0;">
+		<%= info_icon_with_tooltip("Which people/groups get the credit for this?") %>
+		Scope and Quality
+	</p>
+  <div style="font-size: 85%;">
+  <p>The scope and quality of this Workflow has been classified by our curators as:</p>
+  </div>
+  <br />
+  <div class="quality"><a href=""
+  <div class="quality"><a href=""
+  <br />
+  <div style="font-size: 85%;">
+    <a href="" breakdown</a>
+  </div>
+</div>
+
 	<%= render :partial => "tags/tags_box", :locals => { :taggable => @workflow,
 																											 :owner_id => ((@workflow.contribution.contributor_type == 'User') ? @workflow.contribution.contributor_id : nil),  
 																											 :add_path => tag_workflow_path(@workflow), 

Modified: trunk/lib/explicit_versioning.rb (2294 => 2295)


--- trunk/lib/explicit_versioning.rb	2009-11-09 15:50:47 UTC (rev 2294)
+++ trunk/lib/explicit_versioning.rb	2009-11-10 13:52:47 UTC (rev 2295)
@@ -47,6 +47,12 @@
           # create the dynamic versioned model
           const_set(versioned_class_name, Class.new(ActiveRecord::Base)).class_eval do
             def self.reloadable? ; false ; end
+
+            after_update :sync_main_record
+
+            def sync_main_record
+              # If this is the current version, update the main record with it
+            end
           end
           
           versioned_resource = self.to_s.demodulize.underscore.to_sym

Modified: trunk/lib/rest.rb (2294 => 2295)


--- trunk/lib/rest.rb	2009-11-09 15:50:47 UTC (rev 2294)
+++ trunk/lib/rest.rb	2009-11-10 13:52:47 UTC (rev 2295)
@@ -757,7 +757,11 @@
     return nil
   end
 
-  resource = resource.find_version(version) if version
+  if version
+    if resource.versions.last.version != version.to_i
+      resource = resource.find_version(version)
+    end
+  end
 
   if resource.nil?
     rest_response(404)
@@ -956,9 +960,7 @@
     end
   end
 
-  if query['version']
-    ob = ob.versioned_resource
-  end
+  ob = ob.versioned_resource if ob.respond_to?("versioned_resource")
 
   rest_get_request(ob, "workflow", user,
       rest_resource_uri(ob), "workflow", { "id" => ob.id.to_s })

Modified: trunk/public/stylesheets/styles.css (2294 => 2295)


--- trunk/public/stylesheets/styles.css	2009-11-09 15:50:47 UTC (rev 2294)
+++ trunk/public/stylesheets/styles.css	2009-11-10 13:52:47 UTC (rev 2295)
@@ -1985,3 +1985,23 @@
   white-space: nowrap;
 }
 
+.classification {
+  border: 1px SOLID gray;
+  padding: 3px;
+  padding-left: 6px;
+  padding-right: 6px;
+  background: #ffffd0;
+}
+
+.quality {
+  width: 90%;
+  background: #EEA;
+  border: 1px solid #CCCCAA;
+  margin: 4px;
+  padding: 4px;
+}
+
+.dependencies UL LI {
+	list-style-type: none;
+}
+

Modified: trunk/test/functional/workflows_controller_test.rb (2294 => 2295)


--- trunk/test/functional/workflows_controller_test.rb	2009-11-09 15:50:47 UTC (rev 2294)
+++ trunk/test/functional/workflows_controller_test.rb	2009-11-10 13:52:47 UTC (rev 2295)
@@ -5,6 +5,7 @@
 
 require File.dirname(__FILE__) + '/../test_helper'
 require 'workflows_controller'
+require 'xml/libxml'
 
 # Re-raise errors caught by the controller.
 class WorkflowsController; def rescue_action(e) raise e end; end
@@ -80,4 +81,27 @@
     assert_equal old_count-1, Workflow.count
     assert_redirected_to workflows_path
   end
+
+  def test_workflow_api
+    login_as(:john)
+
+    content = LibXML::XML::Node.new("content") <<
+      Base64.encode64(File.read('test/fixtures/files/workflow_dilbert.xml'))
+
+    content["encoding"] = "base64"
+
+    doc = LibXML::XML::Document.new
+    doc.root = LibXML::XML::Node.new("workflow")
+
+    {
+      "title"        => "Test title",
+      "description"  => "Test description.",
+      "license-type" => "by-sa",
+      "content-type" => "application/vnd.taverna.scufl+xml",
+      "content"      => content
+    }.each do |k, v|
+      doc.root << (LibXML::XML::Node.new(k) << v)
+    end
+
+  end
 end

reply via email to

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