myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2951] branches/galaxy-integration: Stores galaxy


From: noreply
Subject: [myexperiment-hackers] [2951] branches/galaxy-integration: Stores galaxy URL in session, displays galaxy header, displays button to post workflow back to galaxy
Date: Wed, 29 Feb 2012 14:44:19 +0000 (UTC)

Revision
2951
Author
fbacall
Date
2012-02-29 14:44:19 +0000 (Wed, 29 Feb 2012)

Log Message

Stores galaxy URL in session, displays galaxy header, displays button to post workflow back to galaxy

Modified Paths

Diff

Modified: branches/galaxy-integration/app/controllers/application_controller.rb (2950 => 2951)


--- branches/galaxy-integration/app/controllers/application_controller.rb	2012-02-28 16:36:19 UTC (rev 2950)
+++ branches/galaxy-integration/app/controllers/application_controller.rb	2012-02-29 14:44:19 UTC (rev 2951)
@@ -20,6 +20,7 @@
   include AuthenticatedSystem
   before_filter :login_from_cookie
   before_filter :oauth_required
+  before_filter :check_galaxy_request
   
   include ActionView::Helpers::NumberHelper
   
@@ -1198,4 +1199,15 @@
     end
 
   end
+
+  def check_galaxy_request
+    if params[:galaxy_url]
+      session[:galaxy_url] = CGI.unescape(params[:galaxy_url])
+    end
+
+    #Disable galaxy layout when no longer relevant
+    if false #Something? check subdomain?
+      session[:galaxy_url] = nil
+    end
+  end
 end

Modified: branches/galaxy-integration/app/controllers/workflows_controller.rb (2950 => 2951)


--- branches/galaxy-integration/app/controllers/workflows_controller.rb	2012-02-28 16:36:19 UTC (rev 2950)
+++ branches/galaxy-integration/app/controllers/workflows_controller.rb	2012-02-29 14:44:19 UTC (rev 2951)
@@ -117,7 +117,7 @@
       @download = Download.create(:contribution => @workflow.contribution, :user => (logged_in? ? current_user : nil), :user_agent => request.env['HTTP_USER_AGENT'], :accessed_from_site => accessed_from_website?())
     end
     
-    send_data(@viewing_version.content_blob.data, :filename => @workflow.filename(@viewing_version_number), :type => @viewing_version.content_type.mime_type)
+    send_data(@viewing_version.content_blob.data, :filename => @workflow.filename(@viewing_version_number), :type => @viewing_version.content_type.mime_type, :disposition => (params[:disposition] || 'attachment'))
   end
   
   # GET /workflows/:id/download/:name

Modified: branches/galaxy-integration/app/helpers/application_helper.rb (2950 => 2951)


--- branches/galaxy-integration/app/helpers/application_helper.rb	2012-02-28 16:36:19 UTC (rev 2950)
+++ branches/galaxy-integration/app/helpers/application_helper.rb	2012-02-29 14:44:19 UTC (rev 2951)
@@ -1619,4 +1619,9 @@
     @layout = layout || {"layout" => Conf.page_template, "stylesheets" => [Conf.stylesheet]}
   end
 
+  #TODO: FIXME: Check subdomain?
+  def using_galaxy?
+    !session[:galaxy_url].blank?
+  end
+
 end

Modified: branches/galaxy-integration/app/views/layouts/application.rhtml (2950 => 2951)


--- branches/galaxy-integration/app/views/layouts/application.rhtml	2012-02-28 16:36:19 UTC (rev 2950)
+++ branches/galaxy-integration/app/views/layouts/application.rhtml	2012-02-29 14:44:19 UTC (rev 2951)
@@ -1,2 +1,3 @@
 <% configure_layout %>
-<%= render :partial => @layout["layout"] %>
\ No newline at end of file
+<%= render :partial => @layout["layout"] %>
+<%= render :partial => 'layouts/galaxy' if using_galaxy? %>

Modified: branches/galaxy-integration/app/views/workflows/galaxy/_run_options.rhtml (2950 => 2951)


--- branches/galaxy-integration/app/views/workflows/galaxy/_run_options.rhtml	2012-02-28 16:36:19 UTC (rev 2950)
+++ branches/galaxy-integration/app/views/workflows/galaxy/_run_options.rhtml	2012-02-29 14:44:19 UTC (rev 2951)
@@ -1,4 +1,8 @@
-<p class="none_text">
-  Not implemented.
-</p>
-
+<% if using_galaxy? %>
+  <div style="margin: 0 0.5em; text-align: center">
+    <form action="" session[:galaxy_url] -%>/workflow/import_workflow" method="POST" name="import_workflow">
+      <input type="hidden" name="url" value="<%= download_workflow_url(@workflow, :disposition => :inline) -%>"/>
+      <input type="submit" value="Import into Galaxy" name="import_button"/>
+    </form>
+  </div>
+<% end %>

Modified: branches/galaxy-integration/lib/workflow_processors/galaxy.rb (2950 => 2951)


--- branches/galaxy-integration/lib/workflow_processors/galaxy.rb	2012-02-28 16:36:19 UTC (rev 2950)
+++ branches/galaxy-integration/lib/workflow_processors/galaxy.rb	2012-02-29 14:44:19 UTC (rev 2951)
@@ -34,7 +34,7 @@
     # All the file extensions supported by this workflow processor.
     # Must be all in lowercase.
     def self.file_extensions_supported
-      []
+      ["ga"]
     end
     
     def self.can_determine_type_from_file?

reply via email to

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