You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/17 12:37:18 UTC

[58/70] [abbrv] incubator-taverna-common-activities git commit: taverna-external-tool-activity/

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/java/net/sf/taverna/t2/activities/externaltool/ssh/SshMechanismCreator.java
----------------------------------------------------------------------
diff --git a/src/main/java/net/sf/taverna/t2/activities/externaltool/ssh/SshMechanismCreator.java b/src/main/java/net/sf/taverna/t2/activities/externaltool/ssh/SshMechanismCreator.java
deleted file mode 100644
index 5271b12..0000000
--- a/src/main/java/net/sf/taverna/t2/activities/externaltool/ssh/SshMechanismCreator.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * 
- */
-package net.sf.taverna.t2.activities.externaltool.ssh;
-
-import java.util.ArrayList;
-
-import net.sf.taverna.t2.activities.externaltool.manager.InvocationMechanism;
-import net.sf.taverna.t2.activities.externaltool.manager.MechanismCreator;
-
-import org.apache.log4j.Logger;
-import org.jdom.Element;
-
-import de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshNode;
-import de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshNodeFactory;
-import de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshUseCaseInvocation;
-
-/**
- * @author alanrw
- *
- */
-public class SshMechanismCreator extends MechanismCreator {
-
-
-	private static Logger logger = Logger.getLogger(SshMechanismCreator.class);
-	
-	/* (non-Javadoc)
-	 * @see net.sf.taverna.t2.activities.externaltool.manager.MechanismCreator#canHandle(java.lang.String)
-	 */
-	@Override
-	public boolean canHandle(String mechanismType) {
-		return mechanismType.equals(SshUseCaseInvocation.SSH_USE_CASE_INVOCATION_TYPE);
-	}
-
-
-	@Override
-	public InvocationMechanism convert(Element detailsElement,
-			String mechanismName) {
-		ExternalToolSshInvocationMechanism result = new ExternalToolSshInvocationMechanism();
-		result.setName(mechanismName);
-		ArrayList<SshNode> nodeList = new ArrayList<SshNode>();
-		for (Object nodeObject : detailsElement.getChildren("sshNode")) {
-			Element nodeElement = (Element) nodeObject;
-			Element hostElement = nodeElement.getChild("host");
-			String host;
-			int port;
-			String directory;
-
-				host = hostElement.getText();
-
-			Element portElement = nodeElement.getChild("port");
-			port = Integer.parseInt(portElement.getText());
-			
-			Element directoryElement = nodeElement.getChild("directory");
-
-				directory = directoryElement.getText();
-
-				boolean newNode = !SshNodeFactory.getInstance().containsSshNode(host, port, directory);
-			
-			SshNode node = SshNodeFactory.getInstance().getSshNode(host, port, directory);
-			
-			if (newNode) {
-
-			Element linkCommandElement = nodeElement.getChild("linkCommand");
-			if (linkCommandElement != null) {
-				node.setLinkCommand(linkCommandElement.getText());
-			}
-
-			Element copyCommandElement = nodeElement.getChild("copyCommand");
-			if (copyCommandElement != null) {
-				node.setCopyCommand(copyCommandElement.getText());
-			}
-			
-			Element retrieveDataElement = nodeElement.getChild("retrieveData");
-			node.setRetrieveData(retrieveDataElement != null);
-			}
-			nodeList.add(node);
-
-		}
-		result.setNodes(nodeList);		
-		return result;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.InvocationCreator
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.InvocationCreator b/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.InvocationCreator
deleted file mode 100644
index 3eeef74..0000000
--- a/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.InvocationCreator
+++ /dev/null
@@ -1,2 +0,0 @@
-net.sf.taverna.t2.activities.externaltool.local.LocalInvocationCreator
-net.sf.taverna.t2.activities.externaltool.ssh.SshInvocationCreator

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.manager.InvocationPersister
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.manager.InvocationPersister b/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.manager.InvocationPersister
deleted file mode 100644
index 4f4b71f..0000000
--- a/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.manager.InvocationPersister
+++ /dev/null
@@ -1,2 +0,0 @@
-net.sf.taverna.t2.activities.externaltool.local.LocalInvocationPersister
-net.sf.taverna.t2.activities.externaltool.ssh.SshInvocationPersister
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.manager.MechanismCreator
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.manager.MechanismCreator b/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.manager.MechanismCreator
deleted file mode 100644
index 2166ed6..0000000
--- a/src/main/resources/META-INF/services/net.sf.taverna.t2.activities.externaltool.manager.MechanismCreator
+++ /dev/null
@@ -1,2 +0,0 @@
-net.sf.taverna.t2.activities.externaltool.local.LocalMechanismCreator
-net.sf.taverna.t2.activities.externaltool.ssh.SshMechanismCreator
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI b/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI
deleted file mode 100644
index 6a18935..0000000
--- a/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ExternalReferenceSPI
+++ /dev/null
@@ -1,2 +0,0 @@
-# Implementation classes of ExternalReferenceSPI go here, one per line
-de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshReference

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ValueToReferenceConverterSPI
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ValueToReferenceConverterSPI b/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ValueToReferenceConverterSPI
deleted file mode 100644
index 53ca06c..0000000
--- a/src/main/resources/META-INF/services/net.sf.taverna.t2.reference.ValueToReferenceConverterSPI
+++ /dev/null
@@ -1,3 +0,0 @@
-# Implementation classes of ValueToReferenceConverterSPI go here, one per line
-de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshUrlToSshReference
-

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.RunDeletionListener
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.RunDeletionListener b/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.RunDeletionListener
deleted file mode 100644
index ac84bb3..0000000
--- a/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.RunDeletionListener
+++ /dev/null
@@ -1 +0,0 @@
-net.sf.taverna.t2.activities.externaltool.ExternalToolRunDeletionListener

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker b/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
deleted file mode 100644
index c97a79d..0000000
--- a/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
+++ /dev/null
@@ -1,2 +0,0 @@
-net.sf.taverna.t2.activities.externaltool.ExternalToolActivityHealthChecker
-net.sf.taverna.t2.activities.externaltool.ExternalToolActivityMimeTypeChecker

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/META-INF/spring/external-tool-activity-context-osgi.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/spring/external-tool-activity-context-osgi.xml b/src/main/resources/META-INF/spring/external-tool-activity-context-osgi.xml
deleted file mode 100644
index 197f2c0..0000000
--- a/src/main/resources/META-INF/spring/external-tool-activity-context-osgi.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:beans="http://www.springframework.org/schema/beans"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans
-                      http://www.springframework.org/schema/beans/spring-beans.xsd
-                      http://www.springframework.org/schema/osgi
-                      http://www.springframework.org/schema/osgi/spring-osgi.xsd">
-
-	<service ref="SshReference" interface="net.sf.taverna.t2.reference.ExternalReferenceSPI" />
-
-	<service ref="invocationGroupManager" interface="net.sf.taverna.t2.activities.externaltool.manager.InvocationGroupManager" />
-
-	<service ref="LocalInvocationPersister" interface="net.sf.taverna.t2.activities.externaltool.manager.InvocationPersister" />
-	<service ref="SshInvocationPersister" interface="net.sf.taverna.t2.activities.externaltool.manager.InvocationPersister" />
-
-	<service ref="LocalMechanismCreator" interface="net.sf.taverna.t2.activities.externaltool.manager.MechanismCreator" />
-	<service ref="SshMechanismCreator" interface="net.sf.taverna.t2.activities.externaltool.manager.MechanismCreator" />
-
-	<service ref="ExternalToolRunDeletionListener" interface="net.sf.taverna.t2.workflowmodel.RunDeletionListener" />
-
-	<service ref="SshUrlToSshReference" interface="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" />
-
-	<service ref="ExternalToolActivityHealthChecker" interface="net.sf.taverna.t2.workflowmodel.health.HealthChecker" />
-	<service ref="ExternalToolActivityMimeTypeChecker" interface="net.sf.taverna.t2.workflowmodel.health.HealthChecker" />
-
-	<service ref="LocalInvocationCreator" interface="net.sf.taverna.t2.activities.externaltool.InvocationCreator" />
-	<service ref="SshInvocationCreator" interface="net.sf.taverna.t2.activities.externaltool.InvocationCreator" />
-
-	<service ref="externalToolActivityFactory" interface="net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory" />
-
-	<list id="invocationCreators" interface="net.sf.taverna.t2.activities.externaltool.InvocationCreator" cardinality="0..N" />
-
-	<list id="mechanismCreators" interface="net.sf.taverna.t2.activities.externaltool.manager.MechanismCreator" cardinality="0..N" />
-
-        <list id="invocationPersisters" interface="net.sf.taverna.t2.activities.externaltool.manager.InvocationPersister" cardinality="0..N" />
-
-	<reference id="credentialManager" interface="net.sf.taverna.t2.security.credentialmanager.CredentialManager" />
-
-	<reference id="applicationConfiguration" interface="uk.org.taverna.configuration.app.ApplicationConfiguration" />
-
-        <reference id="edits" interface="net.sf.taverna.t2.workflowmodel.Edits" />
-</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/META-INF/spring/external-tool-activity-context.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/META-INF/spring/external-tool-activity-context.xml b/src/main/resources/META-INF/spring/external-tool-activity-context.xml
deleted file mode 100644
index a3cfdb8..0000000
--- a/src/main/resources/META-INF/spring/external-tool-activity-context.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans
-                      http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-	<bean id="SshReference" class="de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshReference">
-		<property name="credentialManager" ref="credentialManager" />
-	</bean>
-
-	<bean id="LocalInvocationPersister" class="net.sf.taverna.t2.activities.externaltool.local.LocalInvocationPersister" />
-	<bean id="SshInvocationPersister" class="net.sf.taverna.t2.activities.externaltool.ssh.SshInvocationPersister">
-		<property name="credentialManager" ref="credentialManager" />
-	</bean>
-
-	<bean id="LocalMechanismCreator" class="net.sf.taverna.t2.activities.externaltool.local.LocalMechanismCreator" />
-	<bean id="SshMechanismCreator" class="net.sf.taverna.t2.activities.externaltool.ssh.SshMechanismCreator" />
-
-	<bean id="ExternalToolRunDeletionListener" class="net.sf.taverna.t2.activities.externaltool.ExternalToolRunDeletionListener">
-		<property name="invocationGroupManager" ref="invocationGroupManager" />
-	</bean>
-
-	<bean id="SshUrlToSshReference" class="de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshUrlToSshReference">
-		<property name="credentialManager" ref="credentialManager" />
-	</bean>
-
-	<bean id="ExternalToolActivityHealthChecker" class="net.sf.taverna.t2.activities.externaltool.ExternalToolActivityHealthChecker">
-		<property name="invocationGroupManager" ref="invocationGroupManager" />
-	</bean>
-	<bean id="ExternalToolActivityMimeTypeChecker" class="net.sf.taverna.t2.activities.externaltool.ExternalToolActivityMimeTypeChecker" />
-
-	<bean id="LocalInvocationCreator" class="net.sf.taverna.t2.activities.externaltool.local.LocalInvocationCreator" />
-	<bean id="SshInvocationCreator" class="net.sf.taverna.t2.activities.externaltool.ssh.SshInvocationCreator">
-		<property name="credentialManager" ref="credentialManager" />
-	</bean>
-
-
-	<bean id="externalToolActivityFactory" class="net.sf.taverna.t2.activities.externaltool.ExternalToolActivityFactory">
-		<property name="invocationCreators" ref="invocationCreators" />
-		<property name="mechanismCreators" ref="mechanismCreators" />
-                <property name="edits" ref="edits" />
-	</bean>
-
-	<bean id="invocationGroupManager" class="net.sf.taverna.t2.activities.externaltool.manager.impl.InvocationGroupManagerImpl">
-		<constructor-arg name="applicationConfiguration" ref="applicationConfiguration" />
-		<constructor-arg name="mechanismCreators" ref="mechanismCreators" />
-		<constructor-arg name="invocationPersisters" ref="invocationPersisters" />
-	</bean>
-
-
-</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/src/main/resources/de/uni_luebeck/inb/knowarc/usecases/invocation/ssh/SshReference.hbm.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/de/uni_luebeck/inb/knowarc/usecases/invocation/ssh/SshReference.hbm.xml b/src/main/resources/de/uni_luebeck/inb/knowarc/usecases/invocation/ssh/SshReference.hbm.xml
deleted file mode 100644
index 384cb25..0000000
--- a/src/main/resources/de/uni_luebeck/inb/knowarc/usecases/invocation/ssh/SshReference.hbm.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
-                "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-                "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<!-- Hibernate mapping for ssh reference bean -->
-<hibernate-mapping>
-	<joined-subclass
-		name="de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshReference"
-		extends="net.sf.taverna.t2.reference.AbstractExternalReference">
-		<!-- Link to primary key from abstract superclass -->
-		<key column="bean_id" />
-		<!-- SshReference specific properties below here -->
-		<property name="host" type="string" />
-		<property name="port" type="integer"/>
-		<property name="directory" type="string" />
-		<property name="subDirectory" type="string" />
-		<property name="fileName" type="string" />
-		<property name="dataNatureInteger" type="integer"/> 
- 
-		<property name="charset" type="string" />
-	</joined-subclass>
-</hibernate-mapping>
-

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/pom.xml b/taverna-external-tool-activity/pom.xml
new file mode 100644
index 0000000..17c551f
--- /dev/null
+++ b/taverna-external-tool-activity/pom.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>net.sf.taverna</groupId>
+		<artifactId>taverna-parent</artifactId>
+		<version>3.0.1-SNAPSHOT</version>
+	</parent>
+	<groupId>net.sf.taverna.t2.activities</groupId>
+	<artifactId>external-tool-activity</artifactId>
+	<version>2.0.1-SNAPSHOT</version>
+	<packaging>bundle</packaging>
+	<name>Taverna 2 External Tool Activity</name>
+
+	<dependencies>
+		<dependency>
+			<groupId>net.sf.taverna.t2.core</groupId>
+			<artifactId>workflowmodel-api</artifactId>
+			<version>${t2.core.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.core</groupId>
+			<artifactId>reference-api</artifactId>
+			<version>${t2.core.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.core</groupId>
+			<artifactId>reference-core-extensions</artifactId>
+			<version>${t2.reference-core-extensions.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.security</groupId>
+			<artifactId>credential-manager</artifactId>
+			<version>${t2.security.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>uk.org.taverna.configuration</groupId>
+			<artifactId>taverna-app-configuration-api</artifactId>
+			<version>${taverna.configuration.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.jdom</groupId>
+			<artifactId>com.springsource.org.jdom</artifactId>
+			<version>${jdom.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>${commons.io.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.lang</artifactId>
+			<version>${commons.lang.version}</version>
+		</dependency>
+                <dependency>
+                        <groupId>org.openengsb.wrapped</groupId>
+                        <artifactId>com.jcraft.jsch-all</artifactId>
+                        <version>${jsch.version}</version>
+                </dependency>
+		<!--dependency>
+			<groupId>com.jcraft.jsch</groupId>
+			<artifactId>com.springsource.com.jcraft.jsch</artifactId>
+			<version>${jsch.version}</version>
+		</dependency-->
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.activities</groupId>
+			<artifactId>activity-test-utils</artifactId>
+			<version>${t2.activities.version}</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<repositories>
+		<repository>
+			<releases />
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+			<id>mygrid-repository</id>
+			<name>myGrid Repository</name>
+			<url>http://www.mygrid.org.uk/maven/repository</url>
+		</repository>
+		<repository>
+			<releases>
+				<enabled>false</enabled>
+			</releases>
+			<snapshots />
+			<id>mygrid-snapshot-repository</id>
+			<name>myGrid Snapshot Repository</name>
+			<url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
+		</repository>
+                <repository>
+                        <id>repository.springframework.maven.release</id>
+                        <name>Spring Framework Maven Release Repository</name>
+                        <url>http://maven.springframework.org/release</url>
+                </repository> 
+	</repositories>
+	<scm>
+		<connection>scm:git:https://github.com/taverna/taverna-external-tool-activity.git</connection>
+		<developerConnection>scm:git:ssh://git@github.com/taverna/taverna-external-tool-activity.git</developerConnection>
+		<url>https://github.com/taverna/taverna-external-tool-activity/</url>
+		<tag>HEAD</tag>
+	</scm>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/gui/AskUserForPwPopup.java
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/gui/AskUserForPwPopup.java b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/gui/AskUserForPwPopup.java
new file mode 100644
index 0000000..e2ae7e1
--- /dev/null
+++ b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/gui/AskUserForPwPopup.java
@@ -0,0 +1,77 @@
+/* Part of the KnowARC Janitor Use-case processor for taverna
+ *  written 2007-2010 by Hajo Nils Krabbenhoeft and Steffen Moeller
+ *  University of Luebeck, Institute for Neuro- and Bioinformatics
+ *  University of Luebeck, Institute for Dermatolgy
+ *
+ *  This package is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This package is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this package; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+package de.uni_luebeck.inb.knowarc.gui;
+
+import javax.swing.JOptionPane;
+
+import de.uni_luebeck.inb.knowarc.usecases.invocation.AskUserForPw;
+import de.uni_luebeck.inb.knowarc.usecases.invocation.ssh.SshNode;
+
+public final class AskUserForPwPopup implements AskUserForPw {
+	private SshNode ret;
+	private String pw, pp, kf, us;
+
+	public static String ask(String message, String title) {
+		return (String) JOptionPane.showInputDialog(null, message, title, JOptionPane.QUESTION_MESSAGE, null, null, "");
+	}
+
+	public static boolean askYN(String message, String title) {
+		return JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION;
+	}
+
+	public String getPassword() {
+		getUsername();
+		if (pw != null)
+			return pw;
+		pw = ask("Please enter your password for " + us + " @ " + ret.getHost(), us + " @ " + ret.getHost());
+		return pw;
+	}
+
+	public String getPassphrase() {
+		getUsername();
+		if (pp != null)
+			return pp;
+		pp = ask("Please enter your passphrase for " + kf + " used for " + us + " @ " + ret.getHost(), us + " @ " + ret.getHost());
+		return pp;
+	}
+
+	public String getKeyfile() {
+		getUsername();
+		if (kf != null)
+			return kf;
+		kf = ask("Please enter the keyfile for " + us + " @ " + ret.getHost(), us + " @ " + ret.getHost());
+		return kf;
+	}
+
+	public String getUsername() {
+		if (us != null)
+			return us;
+		us = ask("Please enter the username for " + ret.getHost(), "Username for " + ret.getHost());
+		return us;
+	}
+
+	public void setSshNode(SshNode sshNode) {
+		this.ret = sshNode;
+	}
+
+	public void authenticationSucceeded() {
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/gui/PleaseWaitDialog.java
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/gui/PleaseWaitDialog.java b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/gui/PleaseWaitDialog.java
new file mode 100755
index 0000000..a6bf707
--- /dev/null
+++ b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/gui/PleaseWaitDialog.java
@@ -0,0 +1,75 @@
+/* Part of the KnowARC Janitor Use-case processor for taverna
+ *  written 2007-2010 by Hajo Nils Krabbenhoeft and Steffen Moeller
+ *  University of Luebeck, Institute for Neuro- and Bioinformatics
+ *  University of Luebeck, Institute for Dermatolgy
+ *
+ *  This package is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This package is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this package; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+package de.uni_luebeck.inb.knowarc.gui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+
+public class PleaseWaitDialog extends JDialog {
+	private static final long serialVersionUID = 1L;
+
+	static PleaseWaitDialog instance = new PleaseWaitDialog();
+
+	public class WaitMessage{
+		public WaitMessage() {
+		}
+		
+		String str;
+		public void set(String newstr) {
+			synchronized (PleaseWaitDialog.instance) {
+				if(this.str != null && this.str.equals(newstr)) return;
+				if(this.str != null) messages.remove(this.str);
+				this.str = newstr;
+				if(this.str != null) messages.add(this.str);
+			}
+			updateDialog();
+		}
+		public void done() {
+			set(null);
+		}
+	}
+
+	private void updateDialog() {
+		synchronized (PleaseWaitDialog.instance) {
+			if(messages.size() > 0) this.setVisible(true);
+			else this.setVisible(false);
+			String t = "";
+			for (String  cur : messages) {
+				t += cur + "<br>";
+			}
+			l.setText("<html>"+t+"</html>");
+		}
+	}
+	
+	List<String> messages = new ArrayList<String>();
+	
+	JLabel l;
+	private PleaseWaitDialog() {
+		this.setAlwaysOnTop(true);
+		this.setTitle("Please wait");
+		l = new JLabel("");
+		this.add(l);
+		this.setSize(400, 100);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/RuntimeEnvironment.java
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/RuntimeEnvironment.java b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/RuntimeEnvironment.java
new file mode 100644
index 0000000..ea49079
--- /dev/null
+++ b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/RuntimeEnvironment.java
@@ -0,0 +1,253 @@
+/* Part of the KnowARC Janitor Use-case processor for taverna
+ *  written 2007-2010 by Hajo Nils Krabbenhoeft and Steffen Moeller
+ *  University of Luebeck, Institute for Neuro- and Bioinformatics
+ *  University of Luebeck, Institute for Dermatolgy
+ *
+ *  This package is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This package is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this package; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+package de.uni_luebeck.inb.knowarc.usecases;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Representation of information about a single runtime environment. It is used
+ * to decide if one runtime environment is possibly compatible with another one
+ * for the selection of queues to commit to.
+ * 
+ * To experiment/test these functions, run the following java -cp
+ * target/taverna-knowarc-processor-0.1.7.jar
+ * de.uni_luebeck.janitor.ldap.RuntimeEnvironment compare bla-1 foo-1 java -cp
+ * target/taverna-knowarc-processor-0.1.7.jar
+ * de.uni_luebeck.janitor.ldap.RuntimeEnvironment compare bla-1 bla-2 java -cp
+ * target/taverna-knowarc-processor-0.1.7.jar
+ * de.uni_luebeck.janitor.ldap.RuntimeEnvironment compare bla-1.2 bla-1
+ * 
+ * @author Steffen Moeller
+ */
+@SuppressWarnings("unchecked")
+public class RuntimeEnvironment implements Comparable {
+	
+	private static Logger logger = Logger.getLogger(RuntimeEnvironment.class);
+
+
+	/**
+	 * Unique identification of the runtime environment - the full name
+	 */
+	protected String id;
+
+	/**
+	 * Accessor function for the complete identifier of the runtime environment
+	 */
+	public String getID() {
+		return id;
+	}
+
+	protected String name;
+
+	/**
+	 * Accessor function for the RE's name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	protected String version;
+
+	/**
+	 * Accessfor function for the version
+	 */
+	public String getVersion() {
+		return version;
+	}
+
+	/**
+	 * for those busy fellows who don't have the time to convert the String into
+	 * a RuntimeEnvironment object.
+	 * 
+	 * @author Steffen Moeller
+	 */
+	public boolean atLeastAsCapableAs(String s) {
+		RuntimeEnvironment tmpRE = new RuntimeEnvironment(s);
+		return this.atLeastAsCapableAs(tmpRE);
+	}
+
+	/**
+	 * Indicates if a runtime environment has the same name, and if so, if the
+	 * given RE has the same or a later version.
+	 * 
+	 * @author Steffen Moeller
+	 */
+	public boolean atLeastAsCapableAs(RuntimeEnvironment re) {
+		if (!name.equals(re.name))
+			return false;
+		int c = compareVersions(getVersion(), re.getVersion());
+		if (c >= 0) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * Indicates if this runtimeEnvironment is the same version or later as any
+	 * in that list.
+	 * 
+	 * @author Steffen Moeller
+	 */
+	public boolean atLeastAsCapableAsAnyOf(Iterable<RuntimeEnvironment> res) {
+		boolean compatibleOneFound = false;
+		Iterator<RuntimeEnvironment> i = res.iterator();
+		while (i.hasNext() && !compatibleOneFound) {
+			RuntimeEnvironment r = i.next();
+			compatibleOneFound = atLeastAsCapableAs(r);
+		}
+		return compatibleOneFound;
+	}
+
+	/**
+	 * Indicates if any of the runtime environments listed is the same version
+	 * as this or later.
+	 * 
+	 * @author Steffen Moeller
+	 */
+	public boolean isInferiorToAtLeastOneIn(Iterable<RuntimeEnvironment> res) {
+		boolean compatibleOneFound = false;
+		Iterator<RuntimeEnvironment> i = res.iterator();
+		while (i.hasNext() && !compatibleOneFound) {
+			RuntimeEnvironment r = i.next();
+			compatibleOneFound = r.atLeastAsCapableAs(this);
+		}
+		return compatibleOneFound;
+	}
+
+	/**
+	 * Parses a string as commonly presented by the infosystem
+	 * 
+	 * @author Steffen Moeller
+	 */
+	public RuntimeEnvironment(String raw) {
+		id = raw;
+		int dashpos = raw.indexOf("-");
+		if (-1 == dashpos) {
+			version = "";
+			name = raw;
+		} else {
+			name = raw.substring(0, dashpos);
+			if (dashpos + 1 <= raw.length()) {
+				version = raw.substring(dashpos + 1, raw.length());
+			} else {
+				version = "";
+			}
+		}
+	}
+
+	/**
+	 * to make it behave like a string at time, as it was originally implemented
+	 */
+	@Override
+	public String toString() {
+		return id;
+	}
+
+	/**
+	 * Implementation of Comparable interface. It comes handy albeit this
+	 * function says nothing about the compatibility of two runtime environments
+	 * unless their names are identical and the relation of the constraint was
+	 * taken into account. It just sorts them in lists.
+	 */
+	public int compareTo(Object o) throws ClassCastException {
+		RuntimeEnvironment r = (RuntimeEnvironment) o;
+		if (getName().equals(r.getName())) {
+			return RuntimeEnvironment.compareVersions(getVersion(), r.getVersion());
+		} else {
+			return id.compareTo(r.getID());
+		}
+	}
+
+	/**
+	 * FIXME: For the sake of simplicity, this implementation makes an error in
+	 * treating . and - in the versions equally. Versions, if numerical, are
+	 * treated numerically. Otherwise it is lexicographical, which is error
+	 * prone, though. Should the 'Scanner' class should be tapped into?
+	 * 
+	 * @author Steffen Moeller
+	 */
+	public static int compareVersions(String a, String b) {
+
+		// null pointer exceptions are not risked .. we are nice
+		if (null == a)
+			a = "";
+		if (null == b)
+			b = "";
+
+		// catching the dumb case first
+		if (a.equals(b))
+			return 0;
+
+		List as = Arrays.asList(a.split("[.-]"));
+		List bs = Arrays.asList(b.split("[.-]"));
+
+		// both lists have the empty element as members at least
+		Iterator aIterator = as.iterator();
+		Iterator bIterator = bs.iterator();
+
+		while (aIterator.hasNext()) {
+			String aa = (String) aIterator.next();
+			if (!bIterator.hasNext()) {
+				// a is longer while equal so far
+				return 1; // a > b
+			}
+			String bb = (String) bIterator.next();
+			if (!aa.equals(bb)) {
+				// a and b differ
+				try {
+					Integer aInt = Integer.parseInt(aa);
+					Integer bInt = Integer.parseInt(bb);
+					return aInt.compareTo(bInt);
+				} catch (Exception e) {
+					return aa.compareTo(bb);
+				}
+			}
+		}
+		if (bIterator.hasNext()) {
+			// b is longer while equal so far
+			return -1; // a < b
+		}
+		return 0; // a == b
+	}
+
+	/**
+	 * For testing purposes
+	 */
+	public static void main(String argv[]) {
+		if ("compare".equals(argv[0])) {
+			RuntimeEnvironment r1 = new RuntimeEnvironment(argv[1]);
+			RuntimeEnvironment r2 = new RuntimeEnvironment(argv[2]);
+			logger.info("r1.getName(): " + r1.getName());
+			logger.info("r1.getVersion(): " + r1.getVersion());
+			logger.info("r2.getName(): " + r2.getName());
+			logger.info("r2.getVersion(): " + r2.getVersion());
+			logger.info("r1.atLeastAsCapableAs(r2): " + String.valueOf(r1.atLeastAsCapableAs(r2)));
+		} else {
+			logger.info("Don't know how to '" + argv[0] + "'");
+		}
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/RuntimeEnvironmentConstraint.java
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/RuntimeEnvironmentConstraint.java b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/RuntimeEnvironmentConstraint.java
new file mode 100644
index 0000000..baa68d2
--- /dev/null
+++ b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/RuntimeEnvironmentConstraint.java
@@ -0,0 +1,162 @@
+/* Part of the KnowARC Janitor Use-case processor for taverna
+ *  written 2007-2010 by Hajo Nils Krabbenhoeft and Steffen Moeller
+ *  University of Luebeck, Institute for Neuro- and Bioinformatics
+ *  University of Luebeck, Institute for Dermatolgy
+ *
+ *  This package is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This package is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this package; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+package de.uni_luebeck.inb.knowarc.usecases;
+ 
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.apache.log4j.Logger;
+
+
+/**
+ * When use cases present a runtime environment, then they don't want to express
+ * that these would provide such, but that these request such, i.e. they constrain
+ * lists of potentially eligible queues. 
+ * @author Steffen Moeller
+ * @since 2008
+ */
+public class RuntimeEnvironmentConstraint extends RuntimeEnvironment {
+	
+	private static Logger logger = Logger.getLogger(RuntimeEnvironmentConstraint.class);
+
+	private static String[] ACCEPTED_RELATIONS = new String[] {"=", ">=", "<=", ">", "<"};
+	/**
+	 * If there is no relation specified, presume >=
+	 */
+	private static String DEFAULT_RELATION = ">=";
+	
+	public static String[] getAcceptedRelations() {
+		return ACCEPTED_RELATIONS;
+	}
+
+	public static String getDefaultRelation() {
+		return DEFAULT_RELATION;
+	}
+
+	/**
+	 *  Identifies the relation between runtime environments to be tested
+	 */
+	protected String relation;
+	
+	/**
+	 * Accessor function for relation
+	 */
+	public String getRelation() {
+		return this.relation;
+	}
+	
+	/**
+	 * Tests of a relation is supported
+	 * @param relation
+	 * @return true iff in <, > , <=, >=, =
+	 */
+	public static boolean acceptedRelation(String relation) {
+		if ((null == relation) || relation.equals("")) {
+			return false;
+		}
+		return relation.equals("=")||relation.equals(">=")||relation.equals("<=")||relation.equals(">")||relation.equals("<");
+	}
+	
+	/**
+	 * Constructor
+	 * @param id - expects the name of the runtime environment together with the version to which the
+	 * @param relation - relates to (">","<","=",">=","<=")
+	 */
+	public RuntimeEnvironmentConstraint(String id, String relation) {
+		super(id);
+		if (null == relation || relation.equals("")) {
+			relation=RuntimeEnvironmentConstraint.getDefaultRelation();
+		}
+		if (relation.equals("==")) {
+			relation="=";
+		}
+		else if (relation.equals("=<")) {
+			relation="<=";
+		}
+		else if (!RuntimeEnvironmentConstraint.acceptedRelation(relation)) {
+			logger.warn("Unknown relation '"+relation+"', presuming '"+RuntimeEnvironmentConstraint.getDefaultRelation()+"'");
+			relation=RuntimeEnvironmentConstraint.getDefaultRelation();
+		}
+		this.relation=relation;
+	}
+	
+	/**
+	 * Perfoms test if the RuntimeEnvironment (RE) passed as argument fulfills the requirements set by the constraint.
+	 * @param re - RE to test
+	 * @return true iff the RE fulfills this REconstraint.
+	 */
+	public boolean isFulfilledBy(RuntimeEnvironment re) {
+		logger.info(re.getID()+" " + this.getRelation() + " "+this.getID() + " ?");
+		if (this.getRelation().equals("=")) {
+			logger.info("=");
+			return re.getID().equals(this.getID());
+		}
+		if (!re.getName().equals(this.getName())) {
+			logger.warn("Name match failed");
+			return false;
+		}
+		int c = RuntimeEnvironment.compareVersions(re.getVersion(),this.getVersion());
+		logger.info("c="+c);
+		if (this.getRelation().equals(">")) return c>0;
+		if (this.getRelation().equals(">=")) return c>=0;
+		if (this.getRelation().equals("<=")) return c<=0;
+		if (this.getRelation().equals("<")) return c<0;
+		throw new RuntimeException("Unknown/untreated releation '"+this.getRelation()+"'");
+	}
+	
+	/**
+	 * Iterates over all the RuntimeEnvironments passed as argument.
+	 * @param REs - list of RuntimeEnvironments, mostly those offered at a particular queue
+	 * @return true iff any RE among the REs passed as argument are fulfilling the constraint
+	 */
+	public boolean isFulfilledByAtLeastOneIn(Collection<RuntimeEnvironment> REs) {
+		boolean fulfilled = false;
+		Iterator<RuntimeEnvironment> i = REs.iterator();
+		while(i.hasNext() && !fulfilled) {
+			RuntimeEnvironment r = i.next();
+			fulfilled = this.isFulfilledBy(r);
+		}
+		return fulfilled;
+	}
+	/**
+	 * For testing purposes
+	 */
+	public static void main(String argv[]) {
+		try {
+			if (argv[0].equals("--help") || argv.length != 3) {
+				logger.error("Expecting arguments (<|>|=|<=|>=) runtime1-version runtime2-version");
+			}
+			else {
+				RuntimeEnvironmentConstraint r1 = new RuntimeEnvironmentConstraint(argv[1], argv[0]);
+				RuntimeEnvironment r2 = new RuntimeEnvironment(argv[2]);
+				logger.info("r1.getName(): "+r1.getName());
+				logger.info("r1.getVersion(): "+r1.getVersion());
+				logger.info("r1.getRelation(): "+r1.getRelation());
+				logger.info("r2.getName(): "+r2.getName());
+				logger.info("r2.getVersion(): "+r2.getVersion());
+				logger.info("r1.isFulfilledBy(r2): "+String.valueOf(r1.isFulfilledBy(r2)));
+			}
+		}
+		catch (Exception e) {
+			logger.error(e);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInput.java
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInput.java b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInput.java
new file mode 100644
index 0000000..a9f97b0
--- /dev/null
+++ b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInput.java
@@ -0,0 +1,136 @@
+/* Part of the KnowARC Janitor Use-case processor for taverna
+ *  written 2007-2010 by Hajo Nils Krabbenhoeft and Steffen Moeller
+ *  University of Luebeck, Institute for Neuro- and Bioinformatics
+ *  University of Luebeck, Institute for Dermatolgy
+ *
+ *  This package is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This package is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this package; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+package de.uni_luebeck.inb.knowarc.usecases;
+
+import java.nio.charset.Charset;
+
+import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationBean;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationProperty;
+
+/**
+ * Integrates inputs to the grid that come from the use case descriptions
+ * with those that are fed through the workflow.
+ *
+ * this class controls name and data storage of one input,
+ * no matter where the data comes from
+ */
+@ConfigurationBean(uri = ExternalToolActivity.URI + "#AbstractScriptInput")
+public abstract class ScriptInput {
+	/**
+	 * This input can be referenced under the name 'tag'.
+	 */
+	private String tag = null;
+	/**
+	 * In most cases, the data will be stored under a specific
+	 * filename.
+	 */
+	private boolean file = false;
+	/**
+	 * Set, if the name of the file to be executed is not
+	 * explicitly set but prepared by some automatism and referenced
+	 * via the tagging principle.
+	 */
+	private boolean tempFile = false;
+	/**
+	 * True if (!) the data is binary. (Text otherwise)
+	 */
+	private boolean binary = false;
+
+	private String charsetName = Charset.defaultCharset().name();
+	private boolean forceCopy = false;
+
+	/**
+	 * @return the tag
+	 */
+	public final String getTag() {
+		return tag;
+	}
+	/**
+	 * @param tag the tag to set
+	 */
+	@ConfigurationProperty(name = "tag", label = "Tag")
+	public final void setTag(String tag) {
+		this.tag = tag;
+	}
+	/**
+	 * @return the file
+	 */
+	public final boolean isFile() {
+		return file;
+	}
+	/**
+	 * @param file the file to set
+	 */
+	@ConfigurationProperty(name = "file", label = "File")
+	public final void setFile(boolean file) {
+		this.file = file;
+	}
+	/**
+	 * @return the tempFile
+	 */
+	public final boolean isTempFile() {
+		return tempFile;
+	}
+	/**
+	 * @param tempFile the tempFile to set
+	 */
+	@ConfigurationProperty(name = "tempFile", label = "Temporary File")
+	public final void setTempFile(boolean tempFile) {
+		this.tempFile = tempFile;
+	}
+	/**
+	 * @return the binary
+	 */
+	public final boolean isBinary() {
+		return binary;
+	}
+	/**
+	 * @param binary the binary to set
+	 */
+	@ConfigurationProperty(name = "binary", label = "Binary")
+	public final void setBinary(boolean binary) {
+		this.binary = binary;
+	}
+
+	public String getCharsetName() {
+		return this.charsetName;
+	}
+	/**
+	 * @param charsetName the charsetName to set
+	 */
+	@ConfigurationProperty(name = "charsetName", label = "Chararter Set")
+	public void setCharsetName(String charsetName) {
+		this.charsetName = charsetName;
+	}
+
+	@ConfigurationProperty(name = "forceCopy", label = "Force Copy")
+	public final void setForceCopy(boolean forceCopy) {
+		this.forceCopy = forceCopy;
+
+	}
+	/**
+	 * @return the forceCopy
+	 */
+	public boolean isForceCopy() {
+		return forceCopy;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInputStatic.java
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInputStatic.java b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInputStatic.java
new file mode 100644
index 0000000..4e108b9
--- /dev/null
+++ b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInputStatic.java
@@ -0,0 +1,75 @@
+/* Part of the KnowARC Janitor Use-case processor for taverna
+ *  written 2007-2010 by Hajo Nils Krabbenhoeft and Steffen Moeller
+ *  University of Luebeck, Institute for Neuro- and Bioinformatics
+ *  University of Luebeck, Institute for Dermatolgy
+ *
+ *  This package is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This package is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this package; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+package de.uni_luebeck.inb.knowarc.usecases;
+
+import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationBean;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationProperty;
+
+/**
+ * This subclass of script input is used to manage static content
+ * which is embedded into the use case description.
+ */
+@ConfigurationBean(uri = ExternalToolActivity.URI + "#ScriptInputStatic")
+public class ScriptInputStatic extends ScriptInput {
+
+	public ScriptInputStatic() {
+	}
+
+	private String url = null;  //if this is set, load content from remote URL
+	private String content = null;
+
+	@Override
+	public String toString() {
+		return "InputStatic[tag: " +
+			getTag() + (isFile() ? ", file" : "") + (isTempFile() ? ", tempfile" : "") + (isBinary() ? ", binary" : "") + ", content: " + content + "]";
+	}
+
+	/**
+	 * @return the url
+	 */
+	public final String getUrl() {
+		return url;
+	}
+
+	/**
+	 * @param url the url to set
+	 */
+	@ConfigurationProperty(name = "url", label = "URL", required=false)
+	public final void setUrl(String url) {
+		this.url = url;
+	}
+
+	/**
+	 * @return the content
+	 */
+	public final String getContent() {
+		return content;
+	}
+
+	/**
+	 * @param content the content to set
+	 */
+	@ConfigurationProperty(name = "content", label = "Content", required=false)
+	public final void setContent(String content) {
+		this.content = content;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInputUser.java
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInputUser.java b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInputUser.java
new file mode 100644
index 0000000..858b7fa
--- /dev/null
+++ b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptInputUser.java
@@ -0,0 +1,101 @@
+/* Part of the KnowARC Janitor Use-case processor for taverna
+ *  written 2007-2010 by Hajo Nils Krabbenhoeft and Steffen Moeller
+ *  University of Luebeck, Institute for Neuro- and Bioinformatics
+ *  University of Luebeck, Institute for Dermatolgy
+ *
+ *  This package is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This package is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this package; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+package de.uni_luebeck.inb.knowarc.usecases;
+import java.util.ArrayList;
+
+import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationBean;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationProperty;
+
+/**
+ * Internal description of output
+ */
+@ConfigurationBean(uri = ExternalToolActivity.URI + "#ScriptInput")
+public class ScriptInputUser extends ScriptInput {
+
+	/**
+	 * This input may be fed from multiple ouputs.
+	 */
+	private boolean list = false;
+	/**
+	 * True if the data from a list input in taverna is concatenated into one single input file.
+	 */
+	private boolean concatenate = false;
+
+	private ArrayList<String> mime = new ArrayList<String>();
+
+	@Override
+	public String toString() {
+		return "Input[tag: " + getTag() + (isFile() ? ", file" : "")
+				+ (isTempFile() ? ", tempfile" : "")
+				+ (isBinary() ? ", binary" : "") + (list ? ", list" : "")
+				+ (concatenate ? ", concatenate" : "")
+				+ " mime: " + mime.toString() + "]";
+	}
+
+	/**
+	 * @return the list
+	 */
+	public final boolean isList() {
+		return list;
+	}
+
+	/**
+	 * @param list the list to set
+	 */
+	@ConfigurationProperty(name = "list", label = "List")
+	public final void setList(boolean list) {
+		this.list = list;
+	}
+
+	/**
+	 * @return the concatenate
+	 */
+	public final boolean isConcatenate() {
+		return concatenate;
+	}
+
+	/**
+	 * @param concatenate the concatenate to set
+	 */
+	@ConfigurationProperty(name = "concatenate", label = "Concatenate")
+	public final void setConcatenate(boolean concatenate) {
+		this.concatenate = concatenate;
+	}
+
+	/**
+	 * @return the mime
+	 */
+	public final ArrayList<String> getMime() {
+		if (mime == null) {
+			mime = new ArrayList<String>();
+		}
+		return mime;
+	}
+
+	/**
+	 * @param mime the mime to set
+	 */
+	@ConfigurationProperty(name = "mime", label = "Mime Types", required=false)
+	public final void setMime(ArrayList<String> mime) {
+		this.mime = mime;
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptOutput.java
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptOutput.java b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptOutput.java
new file mode 100644
index 0000000..fe63cc9
--- /dev/null
+++ b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/ScriptOutput.java
@@ -0,0 +1,90 @@
+/* Part of the KnowARC Janitor Use-case processor for taverna
+ *  written 2007-2010 by Hajo Nils Krabbenhoeft and Steffen Moeller
+ *  University of Luebeck, Institute for Neuro- and Bioinformatics
+ *  University of Luebeck, Institute for Dermatolgy
+ *
+ *  This package is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This package is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this package; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+package de.uni_luebeck.inb.knowarc.usecases;
+import java.util.ArrayList;
+
+import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationBean;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationProperty;
+
+/**
+ * Internal description of input
+ */
+@ConfigurationBean(uri = ExternalToolActivity.URI + "#ScriptOutput")
+public class ScriptOutput {
+	private String path;
+	private boolean binary;
+	private ArrayList<String> mime = new ArrayList<String>();
+
+	@Override
+	public String toString() {
+		return "Output[path: " + path + (binary ? ", binary" : "")
+				+ " mime: " + mime.toString() + "]";
+	}
+
+	/**
+	 * @return the path
+	 */
+	public final String getPath() {
+		return path;
+	}
+
+	/**
+	 * @param path the path to set
+	 */
+	@ConfigurationProperty(name = "path", label = "Path")
+	public final void setPath(String path) {
+		this.path = path;
+	}
+
+	/**
+	 * @return the binary
+	 */
+	public final boolean isBinary() {
+		return binary;
+	}
+
+	/**
+	 * @param binary the binary to set
+	 */
+	@ConfigurationProperty(name = "binary", label = "Binary")
+	public final void setBinary(boolean binary) {
+		this.binary = binary;
+	}
+
+	/**
+	 * @return the mime
+	 */
+	public final ArrayList<String> getMime() {
+		if (mime == null) {
+			mime = new ArrayList<String>();
+		}
+		return mime;
+	}
+
+	/**
+	 * @param mime the mime to set
+	 */
+	@ConfigurationProperty(name = "mime", label = "Mime Types", required=false)
+	public final void setMime(ArrayList<String> mime) {
+		this.mime = mime;
+	}
+};

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/6bc470a3/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/UseCaseDescription.java
----------------------------------------------------------------------
diff --git a/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/UseCaseDescription.java b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/UseCaseDescription.java
new file mode 100644
index 0000000..217eae5
--- /dev/null
+++ b/taverna-external-tool-activity/src/main/java/de/uni_luebeck/inb/knowarc/usecases/UseCaseDescription.java
@@ -0,0 +1,899 @@
+/* Part of the KnowARC Janitor Use-case processor for taverna
+ *  written 2007-2010 by Hajo Nils Krabbenhoeft and Steffen Moeller
+ *  University of Luebeck, Institute for Neuro- and Bioinformatics
+ *  University of Luebeck, Institute for Dermatolgy
+ *
+ *  This package is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Lesser General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This package is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this package; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+package de.uni_luebeck.inb.knowarc.usecases;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.swing.ImageIcon;
+
+import net.sf.taverna.t2.activities.externaltool.ExternalToolActivity;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationBean;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationProperty;
+import net.sf.taverna.t2.workflowmodel.processor.config.ConfigurationProperty.OrderPolicy;
+import net.sf.taverna.t2.workflowmodel.serialization.DeserializationException;
+import net.sf.taverna.t2.workflowmodel.utils.Tools;
+
+import org.apache.log4j.Logger;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.input.SAXBuilder;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * Class representation of XML-description of UseCases
+ */
+@ConfigurationBean(uri = ExternalToolActivity.URI + "#ToolDescription")
+public class UseCaseDescription {
+
+	private static Logger logger = Logger.getLogger(UseCaseDescription.class);
+
+	/**
+	 * Identifier for the retrieval of this UseCase in the sharedRepository
+	 * database, respectively its XML export.
+	 */
+	private String usecaseid = "";
+	/**
+	 * Workflow Elements now can get a group identifier. There may be subgroups
+	 * divided by :
+	 */
+	private String group = "";
+	/**
+	 * Textual description of the use case itself. This description is very
+	 * short to fit on the single line that is prepared for such descriptions in
+	 * the Taverna workflow element list.
+	 */
+	private String description = "";
+	/**
+	 * What is actually executed on the shell.
+	 */
+	private String command = "";
+
+	/**
+	 * Accessor function of command
+	 *
+	 * @return shell-executable series of commands
+	 */
+	public String getCommand() {
+		if (null == command) {
+			// FIXME: Is this possible?
+			return "";
+		} else {
+			return command;
+		}
+	}
+
+	/**
+	 * Routine that may be executed as a first check if the program is indeed
+	 * installed.
+	 */
+	private String test_local = null;
+
+	/**
+	 * URL of an icon that would help users to recognise the use case
+	 */
+	private String icon_url = null;
+
+	private int preparingTimeoutInSeconds = 20 * 60; // 20 minutes
+	private int executionTimeoutInSeconds = 30 * 60; // 30 minutes
+
+	private List<String> tags = new ArrayList<String>();
+	private List<RuntimeEnvironmentConstraint> REs = new ArrayList<RuntimeEnvironmentConstraint>();
+	private ArrayList<String> queue_preferred = new ArrayList<String>();
+	private ArrayList<String> queue_deny = new ArrayList<String>();
+
+	private List<ScriptInputStatic> static_inputs = new ArrayList<ScriptInputStatic>();
+	private Map<String, ScriptInput> inputs = new HashMap<String, ScriptInput>();
+	private Map<String, ScriptOutput> outputs = new HashMap<String, ScriptOutput>();
+
+	private boolean includeStdIn = false;
+	private boolean includeStdOut = true;
+	private boolean includeStdErr = true;
+
+	private List<Integer> validReturnCodes = new ArrayList<Integer>();
+	
+	/**
+	 * Default constructor to make xstream happy
+	 */
+	public UseCaseDescription() {
+		
+	}
+
+	/**
+	 * Constructor, for special purpose usecases.
+	 *
+	 * @param usecaseid
+	 */
+	public UseCaseDescription(String usecaseid) {
+		this.setUsecaseid(usecaseid);
+	}
+
+	/**
+	 * Constructor, expects an input stream containing the xml. for example, use
+	 * getClass().getClassLoader().getResourceAsStream("..") to load a usecase
+	 * from your program jar
+	 */
+	public UseCaseDescription(InputStream programAsStream) throws DeserializationException {
+		SAXBuilder builder = new SAXBuilder();
+		Document doc;
+		try {
+			doc = builder.build(programAsStream);
+			programAsStream.close();
+		} catch (JDOMException e) {
+			throw new DeserializationException("Error deserializing usecase", e);
+		} catch (IOException e) {
+			throw new DeserializationException("Error deserializing usecase", e);
+		}
+		readFromXmlElement(doc.getRootElement());
+	}
+
+	/**
+	 * Constructor, expects an XML-root to dissect.
+	 */
+	public UseCaseDescription(Element programNode) throws DeserializationException {
+		readFromXmlElement(programNode);
+	}
+
+/**
+ * Produce an XML description of the UseCaseDescription
+ */
+	public Element writeToXMLElement() {
+		Element programNode = new Element("program");
+		programNode.setAttribute("name", getUsecaseid());
+		programNode.setAttribute("description", getDescription());
+		// Always use element version of command
+//		programNode.setAttribute("command", getCommand());
+		Element commandNode = new Element("command");
+		commandNode.addContent(getCommand());
+		programNode.addContent(commandNode);
+		programNode.setAttribute("timeout", Integer.toString(getExecutionTimeoutInSeconds()));
+		programNode.setAttribute("preparing_timeout", Integer.toString(getPreparingTimeoutInSeconds()));
+		programNode.setAttribute("includeStdIn", Boolean.toString(isIncludeStdIn()));
+		programNode.setAttribute("includeStdOut", Boolean.toString(isIncludeStdOut()));
+		programNode.setAttribute("includeStdErr", Boolean.toString(isIncludeStdErr()));
+		for (ScriptInputStatic si : getStatic_inputs()) {
+			Element staticNode = new Element("static");
+			if (si.isBinary()) {
+				staticNode.setAttribute("binary", "true");
+			}
+			if (si.isForceCopy()) {
+				staticNode.setAttribute("forceCopy", "true");
+			}
+			if (si.isFile()) {
+				Element fileNode = new Element("file");
+				fileNode.setAttribute("path", si.getTag());
+				staticNode.addContent(fileNode);
+			} else if (si.isTempFile()) {
+				Element tempfileNode = new Element("tempfile");
+				tempfileNode.setAttribute("tag", si.getTag());
+				staticNode.addContent(tempfileNode);
+			} else {
+				Element replaceNode = new Element("replace");
+				replaceNode.setAttribute("tag", si.getTag());
+				staticNode.addContent(replaceNode);
+			}
+			if (si.getUrl() != null) {
+				Element contentNode = new Element("content");
+				contentNode.setAttribute("url", si.getUrl());
+				staticNode.addContent(contentNode);
+			} else {
+				Element contentNode = new Element("content");
+				contentNode.addContent((String) si.getContent());
+				staticNode.addContent(contentNode);
+			}
+			programNode.addContent(staticNode);
+		}
+		for (Entry<String, ScriptInput> entry : getInputs().entrySet()) {
+			String name = entry.getKey();
+			ScriptInputUser si = (ScriptInputUser) entry.getValue();
+			Element inputNode = new Element("input");
+			inputNode.setAttribute("name", name);
+			if (si.isBinary()) {
+				inputNode.setAttribute("binary", "true");
+			}
+			if (si.isForceCopy()) {
+				inputNode.setAttribute("forceCopy", "true");
+			}
+			if (si.isConcatenate()) {
+				inputNode.setAttribute("concatenate", "true");
+			}
+			if (si.isList()) {
+				inputNode.setAttribute("list", "true");
+			}
+			if (si.isFile()) {
+				Element fileNode = new Element("file");
+				fileNode.setAttribute("path", si.getTag());
+				inputNode.addContent(fileNode);
+			} else if (si.isTempFile()) {
+				Element tempfileNode = new Element("tempfile");
+				tempfileNode.setAttribute("tag", si.getTag());
+				inputNode.addContent(tempfileNode);
+			} else {
+				Element replaceNode = new Element("replace");
+				replaceNode.setAttribute("tag", si.getTag());
+				inputNode.addContent(replaceNode);
+			}
+			for (String mime : si.getMime()) {
+				Element mimeNode = new Element("mime");
+				mimeNode.setAttribute("type", mime);
+				inputNode.addContent(mimeNode);
+			}
+			programNode.addContent(inputNode);
+		}
+		for (Entry<String, ScriptOutput> entry : getOutputs().entrySet()) {
+			String name = entry.getKey();
+			ScriptOutput so = entry.getValue();
+			Element outputNode = new Element("output");
+			outputNode.setAttribute("name", name);
+			if (so.isBinary()) {
+				outputNode.setAttribute("binary", "true");
+			}
+			Element fromfileNode = new Element("fromfile");
+			fromfileNode.setAttribute("path", so.getPath());
+			outputNode.addContent(fromfileNode);
+			for (String mime : so.getMime()) {
+				Element mimeNode = new Element("mime");
+				mimeNode.setAttribute("type", mime);
+				outputNode.addContent(mimeNode);
+			}
+			programNode.addContent(outputNode);
+		}
+		for (RuntimeEnvironmentConstraint rec : getREs()) {
+			Element rteNode = new Element("rte");
+			rteNode.setAttribute("name", rec.getID());
+			rteNode.setAttribute("relation", rec.getRelation());
+			programNode.addContent(rteNode);
+		}
+		if ((group != null) && !group.isEmpty()) {
+			Element groupNode = new Element("group");
+			groupNode.setAttribute("name", group);
+			programNode.addContent(groupNode);
+		}
+		if ((test_local != null) && !test_local.isEmpty()) {
+			Element testNode = new Element("test");
+			testNode.setAttribute("local", test_local);
+			programNode.addContent(testNode);
+		}
+		if ((icon_url != null) && !icon_url.isEmpty()) {
+			Element iconNode = new Element("icon");
+			iconNode.setAttribute("url", icon_url);
+			programNode.addContent(iconNode);
+		}
+		if (!getQueue_preferred().isEmpty() || !getQueue_deny().isEmpty()) {
+			Element queueNode = new Element("queue");
+			for (String url : getQueue_preferred()) {
+				Element preferredNode = new Element("prefer");
+				preferredNode.setAttribute("url", url);
+				queueNode.addContent(preferredNode);
+			}
+			for (String url : getQueue_deny()) {
+				Element denyNode = new Element("deny");
+				denyNode.setAttribute("url", url);
+				queueNode.addContent(denyNode);
+			}
+			programNode.addContent(queueNode);
+		}
+			Element validReturnCodesNode = new Element("validReturnCodes");
+			validReturnCodesNode.setAttribute("codes", getReturnCodesAsText());
+			programNode.addContent(validReturnCodesNode);
+
+		return programNode;
+	}
+	/**
+	 * Specifies the UseCaseDescription from the root of an XML description
+	 * which is accessible online.
+	 *
+	 * @param programNode
+	 * @throws DeserializationException
+	 */
+	private void readFromXmlElement(Element programNode) throws DeserializationException {
+		if (programNode.getName().compareToIgnoreCase("program") != 0)
+			throw new DeserializationException("Expected <program>, read '" + programNode.getName() + "'");
+
+		setUsecaseid(programNode.getAttributeValue("name"));
+		setDescription(programNode.getAttributeValue("description"));
+		setCommand(programNode.getAttributeValue("command"));
+		String timeoutStr = programNode.getAttributeValue("timeout");
+		if (timeoutStr != null)
+			setExecutionTimeoutInSeconds(Integer.parseInt(timeoutStr));
+		timeoutStr = programNode.getAttributeValue("preparing_timeout");
+		if (timeoutStr != null)
+			setPreparingTimeoutInSeconds(Integer.parseInt(timeoutStr));
+
+		String includeStdInStr = programNode.getAttributeValue("includeStdIn");
+		if (includeStdInStr != null && !includeStdInStr.isEmpty()) {
+			setIncludeStdIn(includeStdInStr.equals("true"));
+		}
+
+		String includeStdOutStr = programNode.getAttributeValue("includeStdOut");
+		if (includeStdOutStr != null && !includeStdOutStr.isEmpty()) {
+			setIncludeStdOut(includeStdOutStr.equals("true"));
+		}
+
+		String includeStdErrStr = programNode.getAttributeValue("includeStdErr");
+		if (includeStdErrStr != null && !includeStdErrStr.isEmpty()) {
+			setIncludeStdErr(includeStdErrStr.equals("true"));
+		}
+
+		for (Object cur_ob : programNode.getChildren()) {
+			Element cur = (Element) cur_ob;
+
+			String name = cur.getAttributeValue("name");
+
+			String type = cur.getName();
+			boolean binary = false;
+			if (null != cur.getAttributeValue("binary") && cur.getAttributeValue("binary").equalsIgnoreCase("true")) {
+				binary = true;
+			}
+			boolean list = false;
+			if (null != cur.getAttributeValue("list") && cur.getAttributeValue("list").equalsIgnoreCase("true")) {
+				list = true;
+			}
+			boolean concatenate = false;
+			if (null != cur.getAttributeValue("concatenate") && cur.getAttributeValue("concatenate").equalsIgnoreCase("true")) {
+				concatenate = true;
+			}
+			boolean forceCopy = false;
+			if (null != cur.getAttributeValue("forceCopy") && cur.getAttributeValue("forceCopy").equalsIgnoreCase("true")) {
+				forceCopy = true;
+			}
+
+			Element inner = null;
+			String innerType = null, tag = null, path = null;
+			if (cur.getChildren().size() > 0) {
+				inner = (Element) cur.getChildren().get(0);
+				innerType = inner.getName();
+				tag = inner.getAttributeValue("tag");
+				path = inner.getAttributeValue("path");
+			}
+			// build mime type declaration list
+			ArrayList<String> mime = new ArrayList<String>();
+			for (Object child : cur.getChildren()) {
+				Element curChild = (Element) child;
+				if (curChild.getName().equalsIgnoreCase("mime")) {
+					mime.add(curChild.getAttributeValue("type"));
+				}
+			}
+			if (type.equalsIgnoreCase("static")) {
+				ScriptInputStatic si = new ScriptInputStatic();
+				Element content = cur.getChild("content");
+				if (content == null)
+					throw new DeserializationException("FIXME: script tag without embedded content tag");
+				si.setUrl(content.getAttributeValue("url"));
+				if (si.getUrl() == null)
+					si.setContent(content.getText());
+				fillInputDescription(si, binary, forceCopy, innerType, tag, path);
+				getStatic_inputs().add(si);
+			} else if (type.equalsIgnoreCase("input")) {
+				ScriptInputUser indesc = new ScriptInputUser();
+				indesc.setList(list);
+				indesc.setMime(mime);
+				indesc.setConcatenate(concatenate);
+				fillInputDescription(indesc, binary, forceCopy, innerType, tag, path);
+				getInputs().put(Tools.sanitiseName(name), indesc);
+			} else if (type.equalsIgnoreCase("output")) {
+				ScriptOutput outdesc = new ScriptOutput();
+				outdesc.setMime(mime);
+
+				boolean ok = true;
+				if (null == innerType) {
+					// don't know what to do
+					throw new DeserializationException("FIXME: Found null == innerType for output, is this the bug?");
+				} else if (innerType.equalsIgnoreCase("fromfile")) {
+					outdesc.setPath(path);
+					outdesc.setBinary(binary);
+				} else {
+					throw new DeserializationException("Problem reading output port: unknown innerType '" + innerType + "'");
+				}
+				if (ok) {
+					getOutputs().put(Tools.sanitiseName(name), outdesc);
+				}
+			} else if (type.equalsIgnoreCase("rte") || type.equalsIgnoreCase("re")) {
+				getREs().add(new RuntimeEnvironmentConstraint(name, cur.getAttributeValue("relation")));
+			} else if (type.equalsIgnoreCase("group")) {
+				group = name;
+			} else if (type.equalsIgnoreCase("test")) {
+				test_local = cur.getAttributeValue("local");
+			} else if (type.equalsIgnoreCase("icon")) {
+				icon_url = cur.getAttributeValue("url");
+			} else if (type.equalsIgnoreCase("queue")) {
+				for (Object child_ob : cur.getChildren()) {
+					Element child = (Element) child_ob;
+					if (child.getName().equalsIgnoreCase("prefer"))
+						getQueue_preferred().add(child.getAttributeValue("url"));
+					else if (child.getName().equalsIgnoreCase("deny"))
+						getQueue_deny().add(child.getAttributeValue("url"));
+					else
+						throw new DeserializationException("Error while reading usecase " + this.getUsecaseid() + ": invalid queue entry");
+				}
+			} else if (type.equalsIgnoreCase("command")) {
+				// i like to have the ability to inject complete shell script
+				// fragments into the use case,
+				// so this should be replace and should allow multiple lines
+				if ((getCommand() != null) && !getCommand().isEmpty()) {
+					throw new DeserializationException("You have specified both command attribute and command tag.");
+				}
+				setCommand(cur.getText());
+			} else if (type.equalsIgnoreCase("validReturnCodes")) {
+					String codeString = cur.getAttributeValue("codes");
+					if (codeString != null) {
+						setReturnCodesAsText(codeString);
+					}
+			}
+			else {
+				throw new DeserializationException("Unexpected and uninterpreted attribute " + type);
+			}
+		}
+	}
+
+	private void fillInputDescription(ScriptInput fillMe, boolean binary, boolean forceCopy, String innerType, String tag, String path) throws DeserializationException {
+		fillMe.setBinary(binary);
+		fillMe.setForceCopy(forceCopy);
+		if (null == innerType) {
+			// don't know what to do
+			throw new DeserializationException("FIXME: Found null == innerType for input, is this the bug?");
+		} else if (innerType.equalsIgnoreCase("replace")) {
+			fillMe.setTag(tag);
+			fillMe.setTempFile(false);
+			fillMe.setFile(false);
+			getTags().add(tag);
+		} else if (innerType.equalsIgnoreCase("tempfile")) {
+			fillMe.setTag(tag);
+			fillMe.setTempFile(true);
+			fillMe.setFile(false);
+			getTags().add(tag);
+		} else if (innerType.equalsIgnoreCase("file")) {
+			fillMe.setTag(path);
+			fillMe.setTempFile(false);
+			fillMe.setFile(true);
+		} else {
+			throw new DeserializationException("Problem reading input port: unknown innerType '" + innerType + "'");
+		}
+	}
+
+	/**
+	 * returns icon that is referenced in use case description
+	 */
+	public ImageIcon getImageIcon() {
+		if (null == icon_url) return null;
+		try {
+			URL u = new URL(icon_url);
+			return new ImageIcon(u, getUsecaseid());
+		} catch (Exception e) {
+			logger.error(e);
+			return null;
+		}
+	}
+
+	/**
+	 * String representation of the use case. It also contains interesting
+	 * information on the availability of resources in the grid to actually
+	 * execute that workflow element.
+	 *
+	 * @return String
+	 */
+	@Override
+	public String toString() {
+		List<String> hlp = new ArrayList<String>();
+		hlp.add("usecaseid: " + getUsecaseid());
+		hlp.add("description: " + getDescription());
+		hlp.add("group: " + group);
+		hlp.add("test: " + test_local);
+		hlp.add("tags: " + getTags());
+		for (Map.Entry<String, ScriptInput> cur : getInputs().entrySet()) {
+			hlp.add(">" + cur.getKey() + ">: " + cur.getValue().toString());
+		}
+		for (Map.Entry<String, ScriptOutput> cur : getOutputs().entrySet()) {
+			hlp.add("<" + cur.getKey() + "<: " + cur.getValue().toString());
+		}
+		hlp.add("RE: " + getREs().toString());
+		hlp.add("preferred queues: " + getQueue_preferred());
+		hlp.add("denied queues: " + getQueue_deny());
+		String tos = super.toString() + "[";
+		for (int i = 0; i < hlp.size(); i++) {
+			if (i != 0)
+				tos += ", ";
+			tos += hlp.get(i);
+		}
+		return tos + " ]";
+	}
+
+	/**
+	 * hajo's test just pass an url or file url to an xml file
+	 *
+	 * @throws IOException
+	 * @throws MalformedURLException
+	 * @throws DeserializationException
+	 */
+	public static void main(String[] argv) throws MalformedURLException, IOException, DeserializationException {
+		UseCaseDescription d = new UseCaseDescription(new URL(argv[0]).openStream());
+		logger.info(d.getCommand());
+	}
+
+	/**
+	 * @param command the command to set
+	 */
+	@ConfigurationProperty(name = "command", label = "Command", description="What is actually executed on the shell")
+	public void setCommand(String command) {
+		this.command = command;
+	}
+
+	/**
+	 * @param description the description to set
+	 */
+	@ConfigurationProperty(name = "description", label = "Description", description="Textual description of the tool", required=false, uri="http://purl.org/dc/elements/1.1/description")
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * @return the description
+	 */
+	public String getDescription() {
+		return description;
+	}
+
+	/**
+	 * @param executionTimeoutInSeconds the executionTimeoutInSeconds to set
+	 */
+	@ConfigurationProperty(name = "executionTimeoutInSeconds", label = "Execution Timeout In Seconds")
+	public void setExecutionTimeoutInSeconds(int executionTimeoutInSeconds) {
+		this.executionTimeoutInSeconds = executionTimeoutInSeconds;
+	}
+
+	/**
+	 * @return the executionTimeoutInSeconds
+	 */
+	public int getExecutionTimeoutInSeconds() {
+		return executionTimeoutInSeconds;
+	}
+
+	/**
+	 * @param inputs the inputs to set
+	 */
+	public void setInputs(Map<String, ScriptInput> inputs) {
+		this.inputs = inputs;
+	}
+
+	@ConfigurationProperty(name = "inputs", label = "Inputs", required=false)
+	public void setInputs(Set<InputMap> inputs) {
+		if (inputs != null) {
+			this.inputs = new HashMap<String, ScriptInput>();
+			for (InputMap inputMap : inputs) {
+				this.inputs.put(inputMap.getPort(), inputMap.getInput());
+			}
+		} else {
+			this.inputs = null;
+		}
+	}
+
+	/**
+	 * @return the inputs
+	 */
+	public Map<String, ScriptInput> getInputs() {
+		if (inputs == null) {
+			inputs = new HashMap<String, ScriptInput>();
+		}
+		return inputs;
+	}
+
+	/**
+	 * @param outputs the outputs to set
+	 */
+	public void setOutputs(Map<String, ScriptOutput> outputs) {
+		this.outputs = outputs;
+	}
+
+	@ConfigurationProperty(name = "outputs", label = "Outputs", required=false)
+	public void setOutputs(Set<OutputMap> outputs) {
+		if (outputs != null) {
+			this.outputs = new HashMap<String, ScriptOutput>();
+			for (OutputMap outputMap : outputs) {
+				this.outputs.put(outputMap.getPort(), outputMap.getOutput());
+			}
+		} else {
+			this.outputs = null;
+		}
+	}
+
+	/**
+	 * @return the outputs
+	 */
+	public Map<String, ScriptOutput> getOutputs() {
+		if (outputs == null) {
+			outputs = new HashMap<String, ScriptOutput>();
+		}
+		return outputs;
+	}
+
+	/**
+	 * @param preparingTimeoutInSeconds the preparingTimeoutInSeconds to set
+	 */
+	@ConfigurationProperty(name = "preparingTimeoutInSeconds", label = "Preparing Timeout In Seconds")
+	public void setPreparingTimeoutInSeconds(int preparingTimeoutInSeconds) {
+		this.preparingTimeoutInSeconds = preparingTimeoutInSeconds;
+	}
+
+	/**
+	 * @return the preparingTimeoutInSeconds
+	 */
+	public int getPreparingTimeoutInSeconds() {
+		return preparingTimeoutInSeconds;
+	}
+
+	/**
+	 * @param queue_deny the queue_deny to set
+	 */
+	public void setQueue_deny(ArrayList<String> queue_deny) {
+		this.queue_deny = queue_deny;
+	}
+
+	/**
+	 * @return the queue_deny
+	 */
+	public ArrayList<String> getQueue_deny() {
+		if (queue_deny == null) {
+			queue_deny = new ArrayList<String>();
+		}
+		return queue_deny;
+	}
+
+	/**
+	 * @param queue_preferred the queue_preferred to set
+	 */
+	public void setQueue_preferred(ArrayList<String> queue_preferred) {
+		this.queue_preferred = queue_preferred;
+	}
+
+	/**
+	 * @return the queue_preferred
+	 */
+	public ArrayList<String> getQueue_preferred() {
+		if (queue_preferred == null) {
+			queue_preferred = new ArrayList<String>();
+		}
+		return queue_preferred;
+	}
+
+	/**
+	 * @param rEs the rEs to set
+	 */
+	public void setREs(List<RuntimeEnvironmentConstraint> rEs) {
+		REs = rEs;
+	}
+
+	/**
+	 * @return the rEs
+	 */
+	public List<RuntimeEnvironmentConstraint> getREs() {
+		if (REs == null) {
+			REs = new ArrayList<RuntimeEnvironmentConstraint>();
+		}
+		return REs;
+	}
+
+	/**
+	 * @param static_inputs the static_inputs to set
+	 */
+	@ConfigurationProperty(name = "staticInputs", label = "Static Inputs", ordering=OrderPolicy.NON_ORDERED, required=false)
+	public void setStatic_inputs(List<ScriptInputStatic> static_inputs) {
+		this.static_inputs = static_inputs;
+	}
+
+	/**
+	 * @return the static_inputs
+	 */
+	public List<ScriptInputStatic> getStatic_inputs() {
+		if (static_inputs == null) {
+			static_inputs = new ArrayList<ScriptInputStatic>();
+		}
+		return static_inputs;
+	}
+
+	/**
+	 * @param tags the tags to set
+	 */
+	public void setTags(List<String> tags) {
+		this.tags = tags;
+	}
+
+	/**
+	 * @return the tags
+	 */
+	public List<String> getTags() {
+		if (tags == null) {
+			tags = new ArrayList<String>();
+		}
+		return tags;
+	}
+
+	/**
+	 * @param usecaseid the usecaseid to set
+	 */
+	@ConfigurationProperty(name = "usecaseid", label = "Title", uri="http://purl.org/dc/elements/1.1/title", required=false)
+	public void setUsecaseid(String usecaseid) {
+		this.usecaseid = usecaseid;
+	}
+
+	/**
+	 * @return the usecaseid
+	 */
+	public String getUsecaseid() {
+		return usecaseid;
+	}
+
+	public boolean isIncludeStdIn() {
+		return includeStdIn;
+	}
+
+	@ConfigurationProperty(name = "includeStdIn", label = "Include STDIN")
+	public void setIncludeStdIn(boolean includeStdIn) {
+		this.includeStdIn = includeStdIn;
+	}
+
+	public boolean isIncludeStdOut() {
+		return includeStdOut;
+	}
+
+	@ConfigurationProperty(name = "includeStdOut", label = "Include STDOUT")
+	public void setIncludeStdOut(boolean includeStdOut) {
+		this.includeStdOut = includeStdOut;
+	}
+
+	public boolean isIncludeStdErr() {
+		return includeStdErr;
+	}
+
+	@ConfigurationProperty(name = "includeStdErr", label = "Include STDERR")
+	public void setIncludeStdErr(boolean includeStdErr) {
+		this.includeStdErr = includeStdErr;
+	}
+
+	/**
+	 * @return the validReturnCodes
+	 */
+	public List<Integer> getValidReturnCodes() {
+		if (validReturnCodes == null) {
+			validReturnCodes = new ArrayList<Integer>();
+		}
+		if (validReturnCodes.isEmpty()) {
+			validReturnCodes.add(0);
+		}
+		return validReturnCodes;
+	}
+
+	/**
+	 * @param validReturnCodes the validReturnCodes to set
+	 */
+	public void setValidReturnCodes(List<Integer> validReturnCodes) {
+		this.validReturnCodes = validReturnCodes;
+	}
+
+	public String getReturnCodesAsText() {
+		return StringUtils.join(getValidReturnCodes(), ",");
+	}
+
+	public void setReturnCodesAsText(String text) {
+		if (getValidReturnCodes() == null) {
+			validReturnCodes = new ArrayList<Integer>();
+		}
+		validReturnCodes.clear();
+		String[] codes = text.split(",");
+		for (String code : codes) {
+			try {
+				Integer codeInt = new Integer(code);
+				if (!validReturnCodes.contains(codeInt)) {
+					validReturnCodes.add(codeInt);
+				}
+			}
+			catch (NumberFormatException e) {
+				logger.error(e);
+			}
+		}
+		if (validReturnCodes.isEmpty()) {
+			validReturnCodes.add(0);
+		}
+		Collections.sort(validReturnCodes);
+	}
+
+	/**
+	 * @return the group
+	 */
+	public String getGroup() {
+		return group;
+	}
+
+	/**
+	 * @param group the group to set
+	 */
+	public void setGroup(String group) {
+		this.group = group;
+	}
+
+	/**
+	 * @return the icon_url
+	 */
+	public String getIcon_url() {
+		return icon_url;
+	}
+
+	@ConfigurationBean(uri = ExternalToolActivity.URI + "#OutputMap")
+	public static class OutputMap {
+		private String port;
+
+		private ScriptOutput output;
+
+		public String getPort() {
+			return port;
+		}
+
+		@ConfigurationProperty(name = "port", label = "Port")
+		public void setPort(String port) {
+			this.port = port;
+		}
+
+		public ScriptOutput getOutput() {
+			return output;
+		}
+
+		@ConfigurationProperty(name = "output", label = "Output")
+		public void setOutput(ScriptOutput output) {
+			this.output = output;
+		}
+	}
+
+	@ConfigurationBean(uri = ExternalToolActivity.URI + "#InputMap")
+	public static class InputMap {
+		private String port;
+
+		private ScriptInputUser input;
+
+		public String getPort() {
+			return port;
+		}
+
+		@ConfigurationProperty(name = "port", label = "Port")
+		public void setPort(String port) {
+			this.port = port;
+		}
+
+		public ScriptInputUser getInput() {
+			return input;
+		}
+
+		@ConfigurationProperty(name = "input", label = "Input")
+		public void setInput(ScriptInputUser input) {
+			this.input = input;
+		}
+	}
+
+}