|
From: | Paul Gordon |
Subject: | [Myexperiment-discuss] Re: [Taverna-hackers] Scufl 2 workflow language |
Date: | Tue, 12 Jan 2010 10:47:42 -0700 |
User-agent: | Thunderbird 2.0.0.9 (X11/20071119) |
The gems worked like a charm (so to speak), thanks. In case anyone is
interested, here's a minimal CGI Ruby script to generate a T2Flow PNG
diagram with no temp files: #!/usr/local/bin/ruby # Contents is the output for a T2Flow document (Taverna workflow) visualized # using myExperiment.org gems and 'dot'. The workflow should be posted as a parameter called 'workflow' require 'cgi' require 'rubygems' require 't2flow/model.rb' require 't2flow/parser.rb' require 't2flow/dot.rb' # Create an instance of CGI cgi = CGI.new print "Content-type: image/png\n\n" # give dot the input (model) to render dot = IO.popen("/opt/csw/bin/dot -Tpng", "wb+") T2Flow::Dot.new.write_dot(dot, T2Flow::Parser.new.parse(cgi['workflow'])) # terminate processing dot.close_write dot.each {|l| puts l} ___________________________________________________________ Paul Gordon wrote: Well, my situation os a follows. I export a T2Flow workflow from Seahawk, but it would be really nice to be able to preview the workflow that would be generated (as there are few export options available). So the workflow is transient, and not necessarily public. A remote workflow image generator based on submission of a T2Flow doc would be ideal, because then Seahawk would not need to ensure dot is locally installed. Looks like the easiest solution in the absence of an existing idempotent generator in myExperiment is for me to build a simple POST CGI in Ruby myself using the Gems mentioned earlier. |
[Prev in Thread] | Current Thread | [Next in Thread] |