Hi,
As a late follow-up to this message thread, I have implemented a
single-instance launcher utility for Java apps. It's now part of the
Moby CVS (I use it in Seahawk). This should allow us to safely
associate T2flow files with Taverna in the OS, and not launch multiple
windows when a user is file-click-happy...
The usage pattern is dead simple:
1. Call the static method
SingletonApplication.setArgumentListener(ArgumentListener) in your app's
static void main() method.
2. Have whatever class that opens files/URLs/etc in your app implement
the method processArgument(String), and hence the interface ArgumentListener
That's it! Well, not quite. If you want to launch your app using java
-jar myapp.jar, the Main-class in the manifest needs to be
ca.ucalgary.util.SingletonApplication. You specify your app's main
class in META-INF/services/ca.ucalgary.util.SingletonApplication.
If this functionality is still of interest, let me know.
Regards,
Paul
Stian Soiland-Reyes wrote:
On Tue, Mar 16, 2010 at 14:51, Paul Gordon <[email protected]> wrote:
Is there any chance Taverna could accept a workflow file as a command
line argument? In that way, when a user double clicks on a workflow
file in Windows, it would open it (assuming the file association is made
too)?
This is certainly a good idea, and something we've wanted for a long
time. Since Taverna 2 we've been using a 'proper' file extension
.t2flow (instead of .xml which can really be anything), and it should
be possible to do.
You would typically do it via a dispatcher that communicates to or
starts the real Taverna workbench, as otherwise you would get a
duplicate workbench per file you open. (Alternatively the launch
process would do a very-early test for which Taverna is already
running, but it would probably have to be before Raven, as it would
not be fun to wait for a second splashscreen just for opening a
workflow).
This is recorded as a bug
http://www.mygrid.org.uk/dev/issues/browse/TAV-650 (note that that bug
report is written around T1) - but we've not had time to investigate
it. Anyone who wants to volunteer..? Java should be able to help you
along the way, and we can get help from our OS X application bundle
and Windows installer to make the actual association of the extension.
------------------------------------------------------------------------------
_______________________________________________
taverna-hackers mailing list
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/
Developers Guide: http://www.taverna.org.uk/developers/