On Sat, Oct 16, 2010 at 14:14, Egon Willighagen <[email protected]> wrote: > thanx to the new tutorial, creating a plugin from scratch is very > easy! Well done!
Thanks! > Now, there also is a stub tutorial for creating a plugin site, so that > people can easily install a plugin? Hi! Unfortunately the tutorials don't yet cover how to deploy the plugin and make a plugin site. David wrote a Maven plugin that can create the plugin site for you, but I'm afraid I don't remember the details.. David? You'll need to run mvn deploy to your public repository, and refer to the URI of that repository in your plugin file. The Maven documentation should be able to help you on how to configure your project for Maven deploy, as it depends on how you want to host your Maven repository I won't go into details. For small projects I tend to recommend to simply put a 'repository' folder on the plugin site - but obviously this does not scale if you have several projects or other public Maven modules. For small projects you can also try to put the plugin site directly in say SVN - as long as it's served on anonymous HTTP and relative links works it should be fine with Taverna and Maven. > For the XMPP plugin I wrote for 2.0, I wrote up how to do it manually > [0], but I rather have a plugin site. The simplest starting point to make a plugin point at the moment would be to have a look at the official plugin sites for Taverna - like http://www.mygrid.org.uk/taverna/updates/2.2.0/plugins/prototype/ There's two important things here. The plugins are listed in pluginlist.xml (Taverna will append this to the plugin site you specify). The second is that you can include several plugins, but each plugin should have a unique combination of <identifier> and <version>. That means that you can keep plugin descriptions of old version - Taverna will select the newest one. (Note - using simple ASCII sorting of the version - so unfortunately 1.1 < 1.10 < 1.9 ) Note that Taverna's plugin manager only accept HTTP based plugin sites, so file:///home/stain/taverna-plugins will not work. For testing of plugin install you can use something like Dropbox' public folder or run a local webserver. You are recommended to do this testing on a different site from where existing users have installed their plugin from. The reason is that they might pick up your update - and if you find out that your plugin is faulty - you will need to make a brand new version (with new version numbers of the Maven artifacts) to force your users to get a fresh update. That means that you should never redeploy a Maven artifact of a certain version number - as you could end up with myactivity-0.2.jar in the Repository and an older myactivity-0.2.jar installed in users' ~/.taverna/repository/ (Raven and Maven does not re-download an artifact of the same version number) You can see a typical plugin at http://www.mygrid.org.uk/taverna/updates/2.2.0/plugins/prototype/rest-0.3.1.xml There's an XSD schema that should help Eclipse or equivalent to do auto completion and validation. Note that you might find legacy plugins that use the top element <plugin> instead of <plugins:plugin> - Taverna will accept both. <provider>taverna.org.uk</provider> <identifier>net.sf.taverna.t2.ui-activities.rest</identifier> <version>0.3.1</version> The <provider> should somehow match your plugin site - so all your plugins should have the same <provider>. This field is only informative at the moment. The <identifier> is used to uniquely identify your plugin, to see if it is already installed, and to check for updates. It is typically matching the Maven groupId or Java package name. The <version> is your version number of the plugin. This version number is typically the same as your Maven version numbers. When Taverna starts up, it will check the plugin sites for newer versions of the installed plugins based on the <identifier> and <version>. <name>REST Activity Plugin</name> <description>Generic REST Activity that can handle all HTTP methods</description> These are simply shown in the plugin interface when listing your plugin. Be careful to not put too long a description, as no line wrapping is (currently) done in the GUI. In a pinch you can squeese in some escaped HTML to force line breaks - but you would need to use CDATA: <description><![CDATA[XPath Activity enables point-and-click creation of ><br> XPath expressions from example XML documents.]]></description> <enabled>true</enabled> should always be true - this is only set to false locally in ~/.taverna-*/plugins/plugins.xml if your plugin has been installed, and then disabled. <repositories> should include the required Maven repositories to install your plugin and all its dependencies. This set of repositories is added to the ones installed by other plugins in Taverna - so to be sure that you include both your new plugin Maven repository, anything new from your <repositories> in pom.xml. <repositories> <!-- myGrid repositories and mirrors --> <repository>http://www.mygrid.org.uk/maven/repository/</repository> .. <repository>http://www.mygrid.org.uk/maven/snapshot-repository/</repository> <!-- Mirror of official maven repository --> <repository>http://www.mygrid.org.uk/maven/repo1/</repository> <repository>http://ibiblio.lsu.edu/main/pub/packages/maven2/</repository> .. <!-- Where to find the plugin artifacts --> <repository>http://myhost.example.com/repository/</repository> <!-- Third-party plugin dependencies --> <repository>http://download.java.net/maven/2/</repository> </repositories> The profile defines which Maven artifacts should be downloaded and installed: <profile> <artifact groupId="net.sf.taverna.t2.ui-activities" artifactId="rest-activity" version="0.3.1" /> <artifact groupId="net.sf.taverna.t2.ui-activities" artifactId="rest-activity-ui" version="0.3.1" /> </profile> In this case there's two artifacts identified by their Maven groupID, artifactID and version, both the activity (for execution) and the activity's UI (for configuration). All dependencies of the artifacts will also be loaded (and their dependencies), so in this case rest-activity-ui would implicitly include rest-activity anyway. The reason both are listed is in case one wanted to tweak the plugin for running with the Taverna command line tool - in which case the rest-activity-ui line can be commented out. Unless your plugin is (to be) an official part of Taverna, be sure to use 'your' group ID, and not net.sf.taverna.something. For example, use groupID com.example.coolproduct for coolproduct-activity, or com.example.coolproduct.taverna if you want to separate your plugin from other bits of coolproduct. Finally included is the compatibility statement of the plugin: <compatibility> <application> <version>2.2.0</version> </application> </compatibility> This is to mean that the plugin is compatible (and therefore installable) in Taverna 2.2.0. You can include several plugins (as long as they differ in version) matching different Taverna versions. In theory it is possible to include several <version> lines if your plugin is supported by several Taverna versions, but in practice this will unfortunately not work. The reason for this is that Taverna's current plugin system Raven is quite picky on dependency's versions - so if say rest-activity-ui depend on net.sf.taverna.core.workflowmodel-api version 1.2 from Taverna 2.2.0 - and you wanted your plugin to also work with Taverna 2.1.2, it would not load correctly, as 2.1.2 has workflowmodel-api version 1.1. Raven would then download and load the 1.2 version of workflowmodel-api - which would not be cast-able to the 1.1-expecting code of 2.1.2. We're changing Taverna to use OSGi for the plugin system - which should avoid many of these kind of issues - but unfortunately that would also mean a change to how to describe and distribute plugins. We're not planning this move until after 2.3.0. -- Stian Soiland-Reyes, myGrid team School of Computer Science The University of Manchester ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ 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/
