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/03/20 15:22:33 UTC

[19/51] [abbrv] [partial] incubator-taverna-workbench git commit: taverna-workbench-* -> taverna-*

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-parallelize-ui/src/main/java/net/sf/taverna/t2/workbench/parallelize/ParallelizeContextualView.java
----------------------------------------------------------------------
diff --git a/taverna-parallelize-ui/src/main/java/net/sf/taverna/t2/workbench/parallelize/ParallelizeContextualView.java b/taverna-parallelize-ui/src/main/java/net/sf/taverna/t2/workbench/parallelize/ParallelizeContextualView.java
new file mode 100644
index 0000000..22d2da1
--- /dev/null
+++ b/taverna-parallelize-ui/src/main/java/net/sf/taverna/t2/workbench/parallelize/ParallelizeContextualView.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (C) 2008 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program 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 program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.workbench.parallelize;
+
+import java.awt.BorderLayout;
+import java.awt.Frame;
+import java.util.List;
+
+import javax.swing.Action;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+
+import net.sf.taverna.t2.lang.ui.ReadOnlyTextArea;
+import net.sf.taverna.t2.workbench.edits.EditManager;
+import net.sf.taverna.t2.workbench.selection.SelectionManager;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.ContextualView;
+import uk.org.taverna.scufl2.api.common.Scufl2Tools;
+import uk.org.taverna.scufl2.api.configurations.Configuration;
+import uk.org.taverna.scufl2.api.core.Processor;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * View of a processor, including it's iteration stack, activities, etc.
+ *
+ * @author Alan R Williams
+ *
+ */
+@SuppressWarnings("serial")
+public class ParallelizeContextualView extends ContextualView {
+
+	private final Scufl2Tools scufl2Tools = new Scufl2Tools();
+
+	private Processor processor;
+
+	private JPanel panel;
+
+	private final EditManager editManager;
+
+	private final SelectionManager selectionManager;
+
+	public ParallelizeContextualView(Processor processor, EditManager editManager, SelectionManager selectionManager) {
+		super();
+		this.processor = processor;
+		this.editManager = editManager;
+		this.selectionManager = selectionManager;
+		initialise();
+		initView();
+	}
+
+	@Override
+	public void refreshView() {
+		initialise();
+	}
+
+	private void initialise() {
+		if (panel == null) {
+			panel = createPanel();
+		} else {
+			panel.removeAll();
+		}
+
+		JTextArea textArea = new ReadOnlyTextArea();
+		textArea.setEditable(false);
+		String maxJobs = "1";
+		for (Configuration configuration : scufl2Tools.configurationsFor(processor, selectionManager.getSelectedProfile())) {
+			JsonNode processorConfig = configuration.getJson();
+			if (processorConfig.has("parallelize")) {
+				JsonNode parallelizeConfig = processorConfig.get("parallelize");
+				if (parallelizeConfig.has("maximumJobs")) {
+					maxJobs = parallelizeConfig.get("maximumJobs").asText();
+				}
+			}
+		}
+		textArea.setText("The maximum number of jobs is " + maxJobs);
+		textArea.setBackground(panel.getBackground());
+		panel.add(textArea, BorderLayout.CENTER);
+		revalidate();
+	}
+
+
+	@Override
+	public JComponent getMainFrame() {
+		return panel;
+	}
+
+	@Override
+	public String getViewTitle() {
+	    return "Parallel jobs";
+	}
+
+	protected JPanel createPanel() {
+		JPanel result = new JPanel();
+		result.setLayout(new BorderLayout());
+
+
+		return result;
+	}
+
+	@Override
+	public int getPreferredPosition() {
+		return 400;
+	}
+
+	@Override
+	public Action getConfigureAction(Frame owner) {
+		return new ParallelizeConfigureAction(owner, this, processor, editManager, selectionManager);
+	}
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-parallelize-ui/src/main/java/net/sf/taverna/t2/workbench/parallelize/ParallelizeContextualViewFactory.java
----------------------------------------------------------------------
diff --git a/taverna-parallelize-ui/src/main/java/net/sf/taverna/t2/workbench/parallelize/ParallelizeContextualViewFactory.java b/taverna-parallelize-ui/src/main/java/net/sf/taverna/t2/workbench/parallelize/ParallelizeContextualViewFactory.java
new file mode 100644
index 0000000..f9ff7e7
--- /dev/null
+++ b/taverna-parallelize-ui/src/main/java/net/sf/taverna/t2/workbench/parallelize/ParallelizeContextualViewFactory.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (C) 2008 The University of Manchester
+ *
+ *  Modifications to the initial code base are copyright of their
+ *  respective authors, or their employers as appropriate.
+ *
+ *  This program 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 2.1 of
+ *  the License, or (at your option) any later version.
+ *
+ *  This program 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 program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ ******************************************************************************/
+package net.sf.taverna.t2.workbench.parallelize;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+import net.sf.taverna.t2.workbench.edits.EditManager;
+import net.sf.taverna.t2.workbench.selection.SelectionManager;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.ContextualView;
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory;
+import uk.org.taverna.scufl2.api.core.Processor;
+
+public class ParallelizeContextualViewFactory implements ContextualViewFactory<Processor> {
+
+	public static URI TYPE = URI.create("http://ns.taverna.org.uk/2010/scufl2/taverna/dispatchlayer/Parallelize");
+
+	private EditManager editManager;
+	private SelectionManager selectionManager;
+
+	public boolean canHandle(Object selection) {
+		return selection instanceof Processor;
+	}
+
+	public List<ContextualView> getViews(Processor selection) {
+		return Arrays.asList(new ContextualView[] {new ParallelizeContextualView(selection, editManager, selectionManager)});
+	}
+
+	public void setEditManager(EditManager editManager) {
+		this.editManager = editManager;
+	}
+
+	public void setSelectionManager(SelectionManager selectionManager) {
+		this.selectionManager = selectionManager;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-parallelize-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent
----------------------------------------------------------------------
diff --git a/taverna-parallelize-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent b/taverna-parallelize-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent
new file mode 100644
index 0000000..edd7b2d
--- /dev/null
+++ b/taverna-parallelize-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent
@@ -0,0 +1 @@
+net.sf.taverna.t2.workbench.parallelize.ParallelizeConfigureMenuAction

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-parallelize-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory
----------------------------------------------------------------------
diff --git a/taverna-parallelize-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory b/taverna-parallelize-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory
new file mode 100644
index 0000000..8b94f86
--- /dev/null
+++ b/taverna-parallelize-ui/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory
@@ -0,0 +1 @@
+net.sf.taverna.t2.workbench.parallelize.ParallelizeContextualViewFactory

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-parallelize-ui/src/main/resources/META-INF/spring/parallelize-ui-context-osgi.xml
----------------------------------------------------------------------
diff --git a/taverna-parallelize-ui/src/main/resources/META-INF/spring/parallelize-ui-context-osgi.xml b/taverna-parallelize-ui/src/main/resources/META-INF/spring/parallelize-ui-context-osgi.xml
new file mode 100644
index 0000000..1859672
--- /dev/null
+++ b/taverna-parallelize-ui/src/main/resources/META-INF/spring/parallelize-ui-context-osgi.xml
@@ -0,0 +1,16 @@
+<?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="ParallelizeConfigureMenuAction" auto-export="interfaces" />
+
+	<service ref="ParallelizeContextualViewFactory" interface="net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory" />
+
+	<reference id="editManager" interface="net.sf.taverna.t2.workbench.edits.EditManager" />
+	<reference id="selectionManager" interface="net.sf.taverna.t2.workbench.selection.SelectionManager" />
+
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-parallelize-ui/src/main/resources/META-INF/spring/parallelize-ui-context.xml
----------------------------------------------------------------------
diff --git a/taverna-parallelize-ui/src/main/resources/META-INF/spring/parallelize-ui-context.xml b/taverna-parallelize-ui/src/main/resources/META-INF/spring/parallelize-ui-context.xml
new file mode 100644
index 0000000..1d1fdd4
--- /dev/null
+++ b/taverna-parallelize-ui/src/main/resources/META-INF/spring/parallelize-ui-context.xml
@@ -0,0 +1,16 @@
+<?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="ParallelizeConfigureMenuAction" class="net.sf.taverna.t2.workbench.parallelize.ParallelizeConfigureMenuAction">
+			<property name="editManager" ref="editManager" />
+			<property name="selectionManager" ref="selectionManager" />
+	</bean>
+
+	<bean id="ParallelizeContextualViewFactory" class="net.sf.taverna.t2.workbench.parallelize.ParallelizeContextualViewFactory">
+			<property name="editManager" ref="editManager" />
+			<property name="selectionManager" ref="selectionManager" />
+	</bean>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/LocalTestLauncher.bat
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/LocalTestLauncher.bat b/taverna-perspective-biocatalogue/LocalTestLauncher.bat
new file mode 100644
index 0000000..1c7f299
--- /dev/null
+++ b/taverna-perspective-biocatalogue/LocalTestLauncher.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo.
+del biocatalogue-perspective-local-launch.jar
+echo Deleted old JAR file if it was there.
+cd target\classes
+jar cfM ..\..\biocatalogue-perspective-local-launch.jar *.*
+cd ..\..
+echo JAR assembly done, launching app...
+
+java -cp .;.\biocatalogue-perspective-local-launch.jar;c:/Users/Sergey/.m2/repository/net/sf/taverna/t2/workbench/ui-api/0.2/ui-api-0.2.jar;c:\Users\Sergey\.m2\repository\net\sf\taverna\t2\lang\ui\1.0\ui-1.0.jar;c:\Users\Sergey\.m2\repository\net\sf\taverna\t2\ui-components\workflow-view\1.0\workflow-view-1.0.jar;c:\Users\Sergey\.m2\repository\net\sf\taverna\t2\ui-activities\wsdl-activity-ui\0.7\wsdl-activity-ui-0.7.jar;C:\Users\Sergey\.m2\repository\log4j\log4j\1.2.13\log4j-1.2.13.jar;C:\Users\Sergey\.m2\repository\net\sf\taverna\t2\workbench\commons-icons\0.2\commons-icons-0.2.jar;c:\Users\Sergey\.m2\repository\BrowserLauncher2\BrowserLauncher2\1.3\BrowserLauncher2-1.3.jar;C:\Users\Sergey\.m2\repository\jdom\jdom\1.0\jdom-1.0.jar;"c:\Program Files\Java\xmlbeans-2.4.0\lib\xbean.jar";"c:\Program Files\Java\xmlbeans-2.4.0\lib\jsr173_1.0_api.jar";.\lib\lablib-checkboxtree-3.1.jar;.\lib\core-renderer.jar;.\lib\commons-lang-2.4.jar net.sf.taverna.t2.ui.perspectives.biocatalogue.TestJFra
 meForLocalLaunch
+
+del biocatalogue-perspective-local-launch.jar
+echo Cleanup done - deleted old the JAR file that was used for the current launch.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/lib/core-renderer.jar
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/lib/core-renderer.jar b/taverna-perspective-biocatalogue/lib/core-renderer.jar
new file mode 100644
index 0000000..871fabf
Binary files /dev/null and b/taverna-perspective-biocatalogue/lib/core-renderer.jar differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/log4j.properties
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/log4j.properties b/taverna-perspective-biocatalogue/log4j.properties
new file mode 100644
index 0000000..fcd1d0c
--- /dev/null
+++ b/taverna-perspective-biocatalogue/log4j.properties
@@ -0,0 +1,4 @@
+log4j.rootLogger=DEBUG, A1
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/pom.xml b/taverna-perspective-biocatalogue/pom.xml
new file mode 100644
index 0000000..4188449
--- /dev/null
+++ b/taverna-perspective-biocatalogue/pom.xml
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<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>org.apache.taverna.workbench</groupId>
+		<artifactId>taverna-workbench</artifactId>
+		<version>3.1.0-incubating-SNAPSHOT</version>
+	</parent>
+	<artifactId>perspective-biocatalogue</artifactId>
+	<name>BioCatalogue Perspective</name>
+	<repositories>
+		<repository>
+			<releases />
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+			<id>fuse</id>
+			<name>fuseRepository</name>
+			<url>http://repo.fusesource.com/maven2-all/</url>
+		</repository>
+	</repositories>
+
+	<dependencies>
+		<!-- <dependency> <groupId>${project.parent.groupId}</groupId> <artifactId>perspective-core</artifactId>
+			<version>${project.parent.version}</version> </dependency> -->
+		<dependency>
+			<groupId>org.apache.taverna.engine</groupId>
+			<artifactId>workflowmodel-impl</artifactId>
+			<version>${taverna.engine.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>menu-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>file-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.lang</groupId>
+			<artifactId>ui</artifactId>
+			<version>${t2.lang.version}</version>
+		</dependency>
+		<!-- required for providing contextual views in the bottom-left area of
+			Design perspective -->
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>contextual-views-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<!-- required for inserting a SOAP processor into the current workflow -->
+		<dependency>
+			<groupId>net.sf.taverna.t2.ui-activities</groupId>
+			<artifactId>wsdl-activity-ui</artifactId>
+			<version>${t2.ui.activities.version}</version>
+		</dependency>
+		<!-- required for importing REST processors into the current workflow -->
+		<dependency>
+			<groupId>net.sf.taverna.t2.ui-activities</groupId>
+			<artifactId>rest-activity-ui</artifactId>
+			<version>${t2.ui.activities.version}</version>
+		</dependency>
+		<!-- required for inserting a processor into the current workflow -->
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>workflow-view</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<!-- required registering with and opening help window -->
+		<dependency>
+			<groupId>${project.parent.groupId}</groupId>
+			<artifactId>helper</artifactId>
+			<version>${project.parent.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>org.apache.log4j</groupId>
+			<artifactId>com.springsource.org.apache.log4j</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.xmlbeans</groupId>
+			<artifactId>xmlbeans</artifactId>
+			<version>2.5.0</version>
+		</dependency>
+
+		<!-- FlyingSaucer XHTML Renderer -->
+		<!-- (it is critical to use version R8, not any earlier ones - e.g. R8pre2,
+			etc.) -->
+		<dependency>
+			<groupId>org.xhtmlrenderer</groupId>
+			<artifactId>core-renderer</artifactId>
+			<version>${org.xhtmlrenderer.core-renderer.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>bouncycastle</groupId>
+					<artifactId>bcprov-jdk14</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>bouncycastle</groupId>
+					<artifactId>bcmail-jdk14</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+
+		<!-- At least StringEscapeUtils class is used from this library -->
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>com.springsource.org.apache.commons.lang</artifactId>
+			<version>${commons.lang.version}</version>
+		</dependency>
+
+		<!-- Gson: Java to Json conversion -->
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>${gson.version}</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<!-- Adds "xmlbeans:xmlbeans" Maven2 goal to compile the API binding classes
+			from XSD schema. -->
+		<plugins>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>xmlbeans-maven-plugin</artifactId>
+				<version>2.3.3</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>xmlbeans</goal>
+						</goals>
+					</execution>
+				</executions>
+				<inherited>true</inherited>
+				<configuration>
+					<!-- "javaSource=1.5" is required to make use of generics and have getXXXList()
+						methods available, not just getXXXArrray() -->
+					<javaSource>1.5</javaSource>
+					<download>true</download>
+					<schemaDirectory>src/main/xsd</schemaDirectory>
+					<!-- Default is target/generated-sources/xmlbeans - which the Maven
+						plugin should be able to add to the Project classpath -->
+					<!-- <sourceGenerationDirectory>src/main/java</sourceGenerationDirectory> -->
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/schema_compilation/move_scomp_results_into_project.bat
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/schema_compilation/move_scomp_results_into_project.bat b/taverna-perspective-biocatalogue/schema_compilation/move_scomp_results_into_project.bat
new file mode 100644
index 0000000..3786d7c
--- /dev/null
+++ b/taverna-perspective-biocatalogue/schema_compilation/move_scomp_results_into_project.bat
@@ -0,0 +1,29 @@
+@echo off
+
+echo This will replace the JAR file with compiled API classes
+pause
+del ..\lib\biocatalogue_api_classes.jar
+move biocatalogue_api_classes.jar ..\lib\
+echo JAR file replaced
+echo.
+
+REM replace the sources of API classes
+echo This will delete *ALL* files in \src\main\java\org\biocatalogue
+echo                                 \src\main\java\org\purl
+echo                                 \src\main\java\org\w3
+pause
+
+rd /S /Q ..\src\main\java\org\biocatalogue
+rd /S /Q ..\src\main\java\org\purl
+rd /S /Q ..\src\main\java\org\w3
+
+move /Y org\biocatalogue ..\src\main\java\org
+move /Y org\purl ..\src\main\java\org
+move /Y org\w3 ..\src\main\java\org
+rd org
+
+echo Sources of API classes replaced
+echo.
+
+echo Done!
+pause
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web.bat
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web.bat b/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web.bat
new file mode 100644
index 0000000..ee10a50
--- /dev/null
+++ b/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web.bat
@@ -0,0 +1,9 @@
+@echo off
+
+REM -src . -- put source files here
+REM -srconly -- only sources, no compiling of java classes, no jar bundling
+REM -compiler -- where to find javac
+REM -javasource -- which JAVA version to aim for (1.5 uses generics)
+REM -dl -- allows download of referenced schemas
+
+scomp -src . -srconly -compiler "%JAVA_HOME%\bin\javac.exe" -javasource 1.5 -dl http://www.biocatalogue.org/2009/xml/rest/schema-v1.xsd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web_to_jar.bat
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web_to_jar.bat b/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web_to_jar.bat
new file mode 100644
index 0000000..dd66206
--- /dev/null
+++ b/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web_to_jar.bat
@@ -0,0 +1,9 @@
+@echo off
+
+REM -src . -- put source files here
+REM -compiler -- where to find javac
+REM -javasource -- which JAVA version to aim for (1.5 uses generics)
+REM -out -- specifies the name of the target JAR file
+REM -dl -- allows download of referenced schemas
+
+scomp -src . -compiler "%JAVA_HOME%\bin\javac.exe" -javasource 1.5 -out biocatalogue_api_classes.jar -dl http://www.biocatalogue.org/2009/xml/rest/schema-v1.xsd
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/doc/BioCatalogue Plugin Documentation.odt
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/doc/BioCatalogue Plugin Documentation.odt b/taverna-perspective-biocatalogue/src/main/doc/BioCatalogue Plugin Documentation.odt
new file mode 100644
index 0000000..85056d7
Binary files /dev/null and b/taverna-perspective-biocatalogue/src/main/doc/BioCatalogue Plugin Documentation.odt differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/help/Index-TOC-Map-Additions.txt
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/help/Index-TOC-Map-Additions.txt b/taverna-perspective-biocatalogue/src/main/help/Index-TOC-Map-Additions.txt
new file mode 100644
index 0000000..8d6c953
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/help/Index-TOC-Map-Additions.txt
@@ -0,0 +1,20 @@
+/* http://www.mygrid.org.uk/taverna2_1/helpset/toc.xml */
+
+<tocitem text="BioCatalogue Plugin" target="biocatalogue-plugin" expand="false">
+  <tocitem text="Feature Overview" target="biocatalogue-plugin-features"/>
+  <tocitem text="Feedback" target="biocatalogue-plugin-feedback"/>
+</tocitem>
+
+
+
+/* http://www.mygrid.org.uk/taverna2_1/helpset/index.xml */
+
+<indexitem text="BioCatalogue Plugin" target="biocatalogue-plugin"/>
+
+
+
+/* http://www.mygrid.org.uk/taverna2_1/helpset/map.xml */
+
+<mapID target="biocatalogue-plugin" url="html/biocatalogue-plugin.html"/>
+<mapID target="biocatalogue-plugin-features" url="html/biocatalogue-plugin-features.html"/>
+<mapID target="biocatalogue-plugin-feedback" url="html/biocatalogue-plugin-feedback.html"/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-features.html
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-features.html b/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-features.html
new file mode 100644
index 0000000..ece2949
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-features.html
@@ -0,0 +1,113 @@
+<html>
+  <head>
+    <meta content="text/html; charset=MacRoman" http-equiv="Content-Type">
+    <link rel="stylesheet" href="./basic.css" type="text/css">
+    <meta name="generator" content="Helen">
+    <title>BioCatalogue Plugin - Features</title>
+  </head>
+  <body>
+    <h2>
+      BioCatalogue Plugin - Features
+    </h2>
+    
+    <h3>
+      BioCatalogue Perspective
+    </h3>
+    <p>
+      This perspective is designed for searching and browsing the BioCatalogue
+      data. It aids with discovery of Processors that may be used in a workflow.
+    </p>
+    
+    <p>
+      In the BioCatalogue perspective you may:
+      <ul>
+        <li>Search for Web Services by free text queries of by tags;</li>
+        <li>Filter search results by the same set of criteria as available on the BioCatalogue website;</li>
+        <li>Save favourite filters and search queries for re-use at a later point;</li>
+        <li>View search history;</li>
+        <li>Immediately see the types and monitoring statuses of all found Web
+            Services directly in the results listings;</li>
+        <li>Preview Web Services.</li>
+      </ul>
+    </p>
+    
+    <p>
+      Web Service previews display a similar set of information to
+      that shown on the BioCatalogue website: service description,
+      type, location, provider and other details are shown. Listing
+      of all operations and their descriptions within that Web Service
+      is shown. Any operation may be added directly into the current
+      workflow or into the Service Panel in the Design Perspective
+      for later use.
+    </p>
+    
+    <h3>
+      Integration into Design Perspective
+    </h3>
+    
+    <p>
+      <ul>
+        <li>Any Web Service operations added to the Service Panel from the BioCatalogue
+            perspective can be dragged into the Workflow Diagram like any other Processors.
+            They are saved by the plugin, so that when Taverna is restarted, those services
+            can still be found in the Service Panel.
+        </li>
+        <li>Right mouse click on a Processor in the Workflow Explorer or Workflow Diagram
+            will display options provided by the plugin - for all WSDL Processors it is
+            possible to check their monitoring status or launch the Processor Preview.
+        </li>
+        <li>Right mouse click on an empty space in the Workflow Diagram will let to launch
+            the workflow "health check" - currently this feature will identify a list of all
+            WSDL activities in a workflow and will fetch the latest monitoring data about
+            each of the from BioCatalogue.
+        </li>
+        <li>"Details" tab in the contextual view area (bottom-left corner of the Design
+            Perspective) will display information about the WSDL Processors and their
+            input or output ports (if they are registered in BioCatalogue). These contextual
+            views are only shown if BioCatalogue knows how to handle the selected type of
+            workflow element.
+        </li>
+      </ul>
+    </p>
+    
+    
+    <h3>
+      Choosing the BioCatalogue Instance to Work With
+    </h3>
+    
+    <p>
+      The BioCatalogue is an open-source project and anyone can setup their
+      own instance of the BioCatalogue software. By default, the plugin is
+      configured to use the main BioCatalogue website
+      (at <font color="blue">http://www.biocatalogue.org</font>) as a source
+      of data.
+    </p>
+    <p>
+      Should this be necessary, the plugin can be configured to use another
+      instance of BioCatalogue. This can be done through the Preferences dialog
+      of Taverna by going to: <pre>File -> Preferences -> BioCatalogue</pre>
+    </p>
+    
+    
+    <h3>
+      Known Issues and Missing Functionality
+    </h3>
+    
+    <p>
+      Below are the most important known issues. These will be fixed in the later releases.
+    </p>
+    
+    <p>
+      <ul>
+        <li>Previews are only available for SOAP services, but not REST services
+            or users, registries, service providers.
+        </li>
+        <li>Search history, favourite search queries and filters are not persisted.
+            This means that this data will only be available for the current working
+            session and will be lost after Taverna is switched off.
+        </li>
+        <li>Only read access to the BioCatalogue data is currently provided.</li>
+      </ul>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-feedback.html
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-feedback.html b/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-feedback.html
new file mode 100644
index 0000000..b2c48b4
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-feedback.html
@@ -0,0 +1,28 @@
+<html>
+  <head>
+    <meta content="text/html; charset=MacRoman" http-equiv="Content-Type">
+    <link rel="stylesheet" href="./basic.css" type="text/css">
+    <meta name="generator" content="Helen">
+    <title>BioCatalogue Plugin - Feedback</title>
+  </head>
+  <body>
+    <h2>
+      BioCatalogue Plugin - Feedback
+    </h2>
+    <p>
+      Please provide us with your feedback to help improve the BioCatalogue plugin.
+      In order to do so, please go to <em>About</em> tab in the <em>BioCatalogue perspective</em>
+      and click the "Leave feedback" button - you will be taken to a web page with a form
+      to fill in and submit your comments.
+    </p>
+    <p>
+      Developers are very interested to hear:
+      <ul>
+        <li>suggestions regarding the existing functionality;</li>
+        <li>new feature requests;</li>
+        <li>ideas for improving the user interfaces;</li>
+        <li>any other feedback you may have.</li>
+      </ul>
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin.html
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin.html b/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin.html
new file mode 100644
index 0000000..152b935
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin.html
@@ -0,0 +1,54 @@
+<html>
+  <head>
+    <meta content="text/html; charset=MacRoman" http-equiv="Content-Type">
+    <link rel="stylesheet" href="./basic.css" type="text/css">
+    <meta name="generator" content="Helen">
+    <title>BioCatalogue Plugin</title>
+  </head>
+  <body>
+    <h2>
+      BioCatalogue Plugin
+    </h2>
+    <h3><small>Version: 0.1.1 (alpha)</small></h3>
+    <p>
+      The <em>BioCatalogue plugin</em> is intended to provide access to the data held 
+      in the <em>BioCatalogue Web Services Registry</em> directly from <em>Taverna Workbench</em>.
+    </p>
+    <p>
+      In its current state the plugin is designed to:
+      <ul>
+        <li>display the integration capabilities with both BioCatalogue and Taverna;</li>
+        <li>provide a general idea of the kinds of data that can be fetched
+            from the Biocatalogue through its REST API;
+        </li>
+        <li>attempt to make the workflow composition process easier and provide useful
+            contextual data to help with understanding of existing workflows.
+        </li>
+      </ul>
+    </p>
+    <p>
+      This release has made the plugin compatible with the latest version of 
+      Taverna - 2.2. Several important bugs were also fixed, however more new
+      functionality will be added soon.
+    </p>
+    <p>
+      To learn more about the available functionality, please see the <a href=
+      "./biocatalogue-plugin-features.html">feature list</a>.
+    </p>
+    <p><b>
+      Please note that this is an incomplete version of the BioCatalogue plugin.
+      You may see notifications that certain pieces of functionality have not been
+      implemented yet; some features are not yet fully stable, which means that
+      occasionally you may see unexpected error messages.
+    </b></p>
+    <p>
+       Any <a href="./biocatalogue-plugin-feedback.html">feedback</a> will be greatly apppreciated - it
+       will help to understand the true needs of the user community and develop
+       a complete version of this plugin later in the year.
+    </p>
+    <p>
+      This version of the plugin was developed by Sergejs Aleksejevs as part of his
+      final year project on the undergraduate Computer Science course at the University of Manchester.
+    </p>
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/BioCataloguePluginConstants.java
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/BioCataloguePluginConstants.java b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/BioCataloguePluginConstants.java
new file mode 100644
index 0000000..791b544
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/BioCataloguePluginConstants.java
@@ -0,0 +1,77 @@
+package net.sf.taverna.biocatalogue.model;
+
+import java.io.File;
+
+
+/**
+ * This class contains the collection of important constants,
+ * which are used throughout the BioCatalogue plugin.
+ *
+ * @author Sergejs Aleksejevs
+ */
+public class BioCataloguePluginConstants
+{
+  public static final String APP_VISIBLE_NAME = "Service Catalogue Plugin";
+  public static final String APP_PREFIX = "T2ServiceCataloguePlugin:";
+
+
+  public static final boolean PERFORM_API_RESPONSE_TIME_LOGGING = true;
+  public static final boolean PERFORM_API_XML_DATA_BINDING_TIME_LOGGING = true;
+  public static final String API_OPERATION_LOG_FILENAME = "service_catalogue_api.log";
+
+
+  public static final int DEFAULT_SCROLL = 15;               // default vertical scroll increment to be used in all JScrollPane instances within the plugin
+  public static final int DEFAULT_TOOLTIP_DURATION = 10000;  // default duration of visibility of tooltips (in "ms")
+  public static final int DEFAULT_THREAD_STARTUP_TIME = 10;  // this is the time (in "ms") that we think the system takes at most to start a new thread
+
+  public static final int API_DEFAULT_REQUESTED_TAG_COUNT_PER_PAGE = 50;
+  public static final int API_DEFAULT_REQUESTED_WEB_SERVICE_COUNT_PER_PAGE = 20;
+  public static final int API_DEFAULT_REQUESTED_SOAP_OPERATION_COUNT_PER_PAGE = 20;
+  public static final int API_DEFAULT_REQUESTED_REST_METHOD_COUNT_PER_PAGE = 20;
+  public static final int API_DEFAULT_REQUESTED_USER_COUNT_PER_PAGE = 20;
+  public static final int API_DEFAULT_REQUESTED_SERVICE_PROVIDER_COUNT_PER_PAGE = 20;
+
+
+  public static final int SEARCH_HISTORY_LENGTH = 50;        // maximum number of search history items to store (if exceeded, oldest will be removed)
+  public static final int FAVOURITE_SEARCHES_LENGTH = 30;    // maximum number of favourite search settings to store (if exceeded, oldest will be removed)
+  public static final int FAVOURITE_FILTERS_LENGTH = 30;     // maximum number of favourite service filters to store (if exceeded, oldest will be removed)
+  public static final int RESOURCE_PREVIEW_HISTORY_LENGTH = 50;
+
+  public static final int RESOURCE_PREVIEW_BROWSER_PREFERRED_WIDTH = 750;
+  public static final int RESOURCE_PREVIEW_BROWSER_PREFERRED_HEIGHT = 600;
+
+  public static final String ACTION_FILTER_FOUND_SERVICES = APP_PREFIX + "filterFoundServices:";
+  public static final String ACTION_FILTER_BY_CATEGORY = APP_PREFIX + "filterByCategory:";
+  public static final String ACTION_SHOW_IN_WEB_BROWSER = APP_PREFIX + "showInWebBrowser:";
+  public static final String ACTION_SHOW_TAG_SELECTION_DIALOG = APP_PREFIX + "showTagSelectionDialgog";
+  public static final String ACTION_PREVIEW_CURRENT_FILTER = APP_PREFIX + "previewCurrentFilter";
+  public static final String ACTION_PREVIEW_RESOURCE = APP_PREFIX + "preview:";
+  public static final String ACTION_PREVIEW_SOAP_OPERATION_AFTER_LOOKUP = APP_PREFIX + "previewSoapOperationAfterLookup:";
+  public static final String ACTION_PREVIEWED_SERVICE_HEALTH_CHECK = APP_PREFIX + "previewedServiceHealthCheck";
+  public static final String ACTION_TAG_SEARCH_PREFIX = APP_PREFIX + "tag:";
+
+
+
+  public static final String CONFIG_FILE_FOLDER_WHEN_RUNNING_STANDALONE = ".Taverna2-ServiceCatalogue Plugin";
+
+
+
+  // ---------------------------- CONTEXTUAL VIEWS --------------------------------
+
+  // this value currently makes contextual views generated by this
+  // plugin the to be the last in the list
+  public static final int CONTEXTUAL_VIEW_PREFERRED_POSITION = 600;
+
+
+
+  // ------------------------------------------------------------------------------
+
+  /*
+   * Some of the settings are determined during the runtime - hence are non-final.
+   *
+   * These are set in MainComponent.initialiseEnvironment()
+   */
+
+  public static File CONFIG_FILE_FOLDER = new File(ApplicationRuntime.getInstance().getApplicationHomeDir(), "conf");
+  public static File LOG_FILE_FOLDER = new File(ApplicationRuntime.getInstance().getApplicationHomeDir(), "logs");
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/HTTPMethodInterpreter.java
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/HTTPMethodInterpreter.java b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/HTTPMethodInterpreter.java
new file mode 100644
index 0000000..ecd4cf1
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/HTTPMethodInterpreter.java
@@ -0,0 +1,46 @@
+package net.sf.taverna.biocatalogue.model;
+
+import org.apache.log4j.Logger;
+import org.biocatalogue.x2009.xml.rest.HttpVerb;
+
+import net.sf.taverna.t2.activities.rest.RESTActivity.HTTP_METHOD;
+
+/**
+ * Very simple class for translating HTTP method values returned
+ * by the BioCatalogue API into the set of values that are used
+ * by the REST activity.
+ * 
+ * @author Sergejs Aleksejevs
+ */
+public class HTTPMethodInterpreter
+{
+  // deny instantiation of this class
+  private HTTPMethodInterpreter() { }
+  
+  public static HTTP_METHOD getHTTPMethodForRESTActivity(HttpVerb.Enum httpVerb)
+  {
+    switch (httpVerb.intValue()) {
+      case HttpVerb.INT_GET: return HTTP_METHOD.GET;
+      case HttpVerb.INT_POST: return HTTP_METHOD.POST;
+      case HttpVerb.INT_PUT: return HTTP_METHOD.PUT;
+      case HttpVerb.INT_DELETE: return HTTP_METHOD.DELETE;
+      default:
+        String errorMsg = "Unable to translate " + httpVerb.toString() + " to correct representation for REST activity;\n" +
+        		              "this HTTP method wasn't supported at the time of implementation.";
+        Logger.getLogger(HTTPMethodInterpreter.class).error(errorMsg);
+        throw new UnsupportedHTTPMethodException(errorMsg);
+    }
+  }
+  
+  
+  public static class UnsupportedHTTPMethodException extends IllegalArgumentException
+  {
+    public UnsupportedHTTPMethodException() {
+      /* empty constructor */
+    }
+    
+    public UnsupportedHTTPMethodException(String message) {
+      super(message);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/LoadingExpandedResource.java
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/LoadingExpandedResource.java b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/LoadingExpandedResource.java
new file mode 100644
index 0000000..cbd3f2e
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/LoadingExpandedResource.java
@@ -0,0 +1,41 @@
+package net.sf.taverna.biocatalogue.model;
+
+import org.biocatalogue.x2009.xml.rest.ResourceLink;
+import org.biocatalogue.x2009.xml.rest.impl.ResourceLinkImpl;
+
+/**
+ * @author Sergejs Aleksejevs
+ */
+public class LoadingExpandedResource extends ResourceLinkImpl
+{
+  private boolean nowLoading;
+  private ResourceLink associatedObj;
+  
+  public LoadingExpandedResource(ResourceLink associatedObj)
+  {
+    super(ResourceLink.type);
+    
+    this.associatedObj = associatedObj;
+    this.nowLoading = true;
+  }
+  
+  public ResourceLink getAssociatedObj() {
+    return associatedObj;
+  }
+  
+  public boolean isLoading() {
+    return (nowLoading);
+  }
+  public void setLoading(boolean isLoading) {
+    this.nowLoading = isLoading;
+  }
+  
+  public String getHref() {
+    return (associatedObj.getHref());
+  }
+  
+  public String getResourceName() {
+    return (associatedObj.getResourceName());
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/LoadingResource.java
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/LoadingResource.java b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/LoadingResource.java
new file mode 100644
index 0000000..a003075
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/LoadingResource.java
@@ -0,0 +1,39 @@
+package net.sf.taverna.biocatalogue.model;
+
+import org.biocatalogue.x2009.xml.rest.ResourceLink;
+import org.biocatalogue.x2009.xml.rest.impl.ResourceLinkImpl;
+
+/**
+ * @author Sergejs Aleksejevs
+ */
+public class LoadingResource extends ResourceLinkImpl
+{
+  private boolean nowLoading;
+  private ResourceLink associatedObj;
+  
+  public LoadingResource(String resourceURL, String resourceName) {
+    super(ResourceLink.type);
+    
+    associatedObj = ResourceLink.Factory.newInstance();
+    associatedObj.setHref(resourceURL);
+    associatedObj.setResourceName(resourceName);
+    
+    this.nowLoading = false;
+  }
+  
+  public String getHref() {
+    return (associatedObj.getHref());
+  }
+  
+  public String getResourceName() {
+    return (associatedObj.getResourceName());
+  }
+  
+  public boolean isLoading() {
+    return (nowLoading);
+  }
+  public void setLoading(boolean isLoading) {
+    this.nowLoading = isLoading;
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/Pair.java
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/Pair.java b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/Pair.java
new file mode 100644
index 0000000..b694db8
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/Pair.java
@@ -0,0 +1,30 @@
+package net.sf.taverna.biocatalogue.model;
+
+/**
+ * Trivial class to represent a generic pair of objects.
+ * Any types of objects can be used.
+ * 
+ * @author Sergejs Aleksejevs
+ *
+ * @param <T1> Type of the first object.
+ * @param <T2> Type of the second object.
+ */
+public class Pair<T1,T2>
+{
+  private final T1 firstObject;
+  private final T2 secondObject;
+
+  public Pair(T1 firstObject, T2 secondObject) {
+    this.firstObject = firstObject;
+    this.secondObject = secondObject;
+  }
+  
+  public T1 getFirstObject() {
+    return firstObject;
+  }
+  
+  public T2 getSecondObject() {
+    return secondObject;
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-workbench/blob/52fd79dd/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/Resource.java
----------------------------------------------------------------------
diff --git a/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/Resource.java b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/Resource.java
new file mode 100644
index 0000000..3095863
--- /dev/null
+++ b/taverna-perspective-biocatalogue/src/main/java/net/sf/taverna/biocatalogue/model/Resource.java
@@ -0,0 +1,506 @@
+package net.sf.taverna.biocatalogue.model;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.Icon;
+import javax.swing.JOptionPane;
+import javax.swing.ListCellRenderer;
+
+import net.sf.taverna.biocatalogue.model.connectivity.BeansForJSONLiteAPI;
+import net.sf.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
+import net.sf.taverna.biocatalogue.ui.search_results.RESTMethodListCellRenderer;
+import net.sf.taverna.biocatalogue.ui.search_results.SOAPOperationListCellRenderer;
+import net.sf.taverna.biocatalogue.ui.search_results.ServiceListCellRenderer;
+import net.sf.taverna.t2.workbench.MainWindow;
+
+import org.apache.log4j.Logger;
+import org.biocatalogue.x2009.xml.rest.Registry;
+import org.biocatalogue.x2009.xml.rest.ResourceLink;
+import org.biocatalogue.x2009.xml.rest.RestMethod;
+import org.biocatalogue.x2009.xml.rest.RestMethods;
+import org.biocatalogue.x2009.xml.rest.Service;
+import org.biocatalogue.x2009.xml.rest.ServiceProvider;
+import org.biocatalogue.x2009.xml.rest.Services;
+import org.biocatalogue.x2009.xml.rest.SoapOperation;
+import org.biocatalogue.x2009.xml.rest.SoapOperations;
+import org.biocatalogue.x2009.xml.rest.User;
+
+/**
+ * @author Sergejs Aleksejevs
+ */
+public class Resource
+{
+  /**
+   * A single point of definition of the types of resources that the BioCatalogue plugin
+   * "knows" about. This enum provides various details about resource types -
+   * display names for single items of that type, names of collections of items of that
+   * type, icons to represent the items of a particular type, etc.
+   * 
+   * @author Sergejs Aleksejevs
+   */
+  public static enum TYPE
+  {
+    // the order is important - all these types will appear in the user interface
+    // in the same order as listed here
+    @SuppressWarnings("serial")
+	SOAPOperation (SoapOperation.class, SoapOperations.class, BeansForJSONLiteAPI.SOAPOperationsIndex.class, "WSDL service", "WSDL services",
+                   "WSDL services can be directly imported into the current workflow or Service Panel",
+                   ResourceManager.getIconFromTaverna(ResourceManager.SOAP_OPERATION_ICON), true, true, true, false, true, true, true, true,
+                   SOAPOperationListCellRenderer.class, BioCatalogueClient.API_SOAP_OPERATIONS_URL,
+                   new HashMap<String,String>() {{
+                   }},
+                   new HashMap<String,String>(BioCatalogueClient.API_INCLUDE_ANCESTORS) {{
+                     put(BioCatalogueClient.API_PER_PAGE_PARAMETER, ""+BioCataloguePluginConstants.API_DEFAULT_REQUESTED_SOAP_OPERATION_COUNT_PER_PAGE);
+                   }},
+                   BioCataloguePluginConstants.API_DEFAULT_REQUESTED_SOAP_OPERATION_COUNT_PER_PAGE,
+                   BioCatalogueClient.API_SOAP_OPERATION_FILTERS_URL),
+                   
+    @SuppressWarnings("serial")
+	RESTMethod    (RestMethod.class, RestMethods.class, BeansForJSONLiteAPI.RESTMethodsIndex.class, "REST service", "REST services",
+                   "REST services can be directly imported into the current workflow or Service Panel",
+                   ResourceManager.getIconFromTaverna(ResourceManager.REST_METHOD_ICON), true, true, true, false, true, false, true, true,
+                   RESTMethodListCellRenderer.class, BioCatalogueClient.API_REST_METHODS_URL,
+                   new HashMap<String,String>() {{
+                   }},
+                   new HashMap<String,String>(BioCatalogueClient.API_INCLUDE_ANCESTORS) {{
+                     put(BioCatalogueClient.API_PER_PAGE_PARAMETER, ""+BioCataloguePluginConstants.API_DEFAULT_REQUESTED_REST_METHOD_COUNT_PER_PAGE);
+                   }},
+                   BioCataloguePluginConstants.API_DEFAULT_REQUESTED_REST_METHOD_COUNT_PER_PAGE,
+                   BioCatalogueClient.API_REST_METHOD_FILTERS_URL); //,
+                   
+    // TODO - the following resource types have been disabled, as no actions for them can be done yet
+    //        -- they are still to be implemented; if the following types are uncommented, they will be
+    //        automatically searchable and visible in BioCatalogue Exploration tab; ListCellRenderers, however,
+    //        would need to be added first.
+//    @SuppressWarnings("serial")
+//	Service       (Service.class, Services.class, BeansForJSONLiteAPI.ServicesIndex.class, "Web service", "Web services",
+//                   "<html>Web services represent collections of WSDL services or REST services.<br>" +
+//                         "They cannot be directly imported into the current workflow or Service Panel,<br>" +
+//                         "but they may contain much more information about individual WSDL or REST<br>" +
+//                         "services and also provide some context for their usage.</html>",
+//                   ResourceManager.getImageIcon(ResourceManager.SERVICE_ICON), true, true, true, false, false, false, true,
+//                   ServiceListCellRenderer.class, BioCatalogueClient.API_SERVICES_URL, 
+//                   new HashMap<String,String>(BioCatalogueClient.API_INCLUDE_SUMMARY) {{
+//                   }},
+//                   new HashMap<String,String>() {{
+//                     put(BioCatalogueClient.API_PER_PAGE_PARAMETER, ""+BioCataloguePluginConstants.API_DEFAULT_REQUESTED_WEB_SERVICE_COUNT_PER_PAGE);
+//                   }},
+//                   BioCataloguePluginConstants.API_DEFAULT_REQUESTED_WEB_SERVICE_COUNT_PER_PAGE,
+//                   BioCatalogueClient.API_SERVICE_FILTERS_URL),
+//                   
+//    ServiceProvider (ServiceProvider.class, ServiceProviders.class, BeansForJSONLiteAPI.ServiceProvidersIndex.class, "Service Provider", "Service Providers", "",
+//                     ResourceManager.getImageIcon(ResourceManager.SERVICE_PROVIDER_ICON), false, false, false, false, false, false, false,
+//                     ServiceProviderListCellRenderer.class, BioCatalogueClient.API_SERVICE_PROVIDERS_URL,
+//                     new HashMap<String,String>() {{
+//                     }},
+//                     new HashMap<String,String>() {{
+//                       put(BioCatalogueClient.API_PER_PAGE_PARAMETER, ""+BioCataloguePluginConstants.API_DEFAULT_REQUESTED_SERVICE_PROVIDER_COUNT_PER_PAGE);
+//                     }},
+//                     BioCataloguePluginConstants.API_DEFAULT_REQUESTED_SERVICE_PROVIDER_COUNT_PER_PAGE,
+//                     null),
+//                     
+//    User          (User.class, Users.class, BeansForJSONLiteAPI.UsersIndex.class, "User", "Users", "",
+//                   ResourceManager.getImageIcon(ResourceManager.USER_ICON), false, false, true, false, false, false, false,
+//                   UserListCellRenderer.class, BioCatalogueClient.API_USERS_URL,
+//                   new HashMap<String,String>() {{
+//                   }},
+//                   new HashMap<String,String>() {{
+//                     put(BioCatalogueClient.API_PER_PAGE_PARAMETER, ""+BioCataloguePluginConstants.API_DEFAULT_REQUESTED_USER_COUNT_PER_PAGE);
+//                   }},
+//                   BioCataloguePluginConstants.API_DEFAULT_REQUESTED_USER_COUNT_PER_PAGE,
+//                   BioCatalogueClient.API_USER_FILTERS_URL);
+    
+    
+    @SuppressWarnings("unchecked")
+	private Class xmlbeansGeneratedClass;
+    @SuppressWarnings("unchecked")
+	private Class xmlbeansGeneratedCollectionClass;
+    private Class<?> jsonLiteAPIBindingBeanClass;
+    private String resourceTypeName;
+    private String resourceCollectionName;
+    private String resourceTabTooltip;
+    private Icon icon;
+    private boolean defaultType;
+    private boolean suitableForTagSearch;
+    private boolean suitableForFiltering;
+    private boolean suitableForOpeningInPreviewBrowser;
+    private boolean suitableForAddingToServicePanel;
+    private boolean suitableForAddingToWorkflowDiagram;
+    private boolean suitableForHealthCheck;
+    private Class<? extends ListCellRenderer> resultListingCellRendererClass;
+    private String apiResourceCollectionIndex;
+    private Map<String,String> apiResourceCollectionIndexSingleExpandedResourceAdditionalParameters;
+    private Map<String,String> apiResourceCollectionIndexAdditionalParameters;
+    private int apiResourceCountPerIndexPage;
+    private String apiResourceCollectionFilters;
+	private final boolean suitableForAddingAllToServicePanel;
+    
+    @SuppressWarnings("unchecked")
+	TYPE(Class xmlbeansGeneratedClass, Class xmlbeansGeneratedCollectionClass, Class<?> jsonLiteAPIBindingBeanClass,
+        String resourceTypeName, String resourceCollectionName, String resourceTabTooltip, Icon icon,
+        boolean defaultType, boolean suitableForTagSearch, boolean suitableForFiltering, boolean suitableForOpeningInPreviewBrowser,
+        boolean suitableForAddingToServicePanel, boolean suitableForAddingAllToServicePanel, boolean suitableForAddingToWorkflowDiagram,
+        boolean suitableForHealthCheck, Class<? extends ListCellRenderer> resultListingCellRendererClass,
+        String apiResourceCollectionIndex, Map<String,String> apiResourceCollectionIndexSingleExpandedResourceAdditionalParameters,
+        Map<String,String> apiResourceCollectionIndexAdditionalParameters, int apiResourceCountPerIndexListingPage,
+        String apiResourceCollectionFilters)
+    {
+      this.xmlbeansGeneratedClass = xmlbeansGeneratedClass;
+      this.xmlbeansGeneratedCollectionClass = xmlbeansGeneratedCollectionClass;
+      this.jsonLiteAPIBindingBeanClass = jsonLiteAPIBindingBeanClass;
+      this.resourceTypeName = resourceTypeName;
+      this.resourceCollectionName = resourceCollectionName;
+      this.resourceTabTooltip = resourceTabTooltip;
+      this.icon = icon;
+      this.defaultType = defaultType;
+      this.suitableForTagSearch = suitableForTagSearch;
+      this.suitableForFiltering = suitableForFiltering;
+      this.suitableForOpeningInPreviewBrowser = suitableForOpeningInPreviewBrowser;
+      this.suitableForAddingToServicePanel = suitableForAddingToServicePanel;
+	this.suitableForAddingAllToServicePanel = suitableForAddingAllToServicePanel;
+      this.suitableForAddingToWorkflowDiagram = suitableForAddingToWorkflowDiagram;
+      this.suitableForHealthCheck = suitableForHealthCheck;
+      this.resultListingCellRendererClass = resultListingCellRendererClass;
+      this.apiResourceCollectionIndex = apiResourceCollectionIndex;
+      this.apiResourceCollectionIndexSingleExpandedResourceAdditionalParameters = apiResourceCollectionIndexSingleExpandedResourceAdditionalParameters;
+      this.apiResourceCollectionIndexAdditionalParameters = apiResourceCollectionIndexAdditionalParameters;
+      this.apiResourceCountPerIndexPage = apiResourceCountPerIndexListingPage;
+      this.apiResourceCollectionFilters = apiResourceCollectionFilters;
+    }
+    
+    
+    
+    @SuppressWarnings("unchecked")
+	public Class getXmlBeansGeneratedClass() {
+      return this.xmlbeansGeneratedClass;
+    }
+    
+    /**
+     * @return Class that represents collection of resources of this type,
+     *         as represented by XmlBeans.
+     */
+    @SuppressWarnings("unchecked")
+	public Class getXmlBeansGeneratedCollectionClass() {
+      return this.xmlbeansGeneratedCollectionClass;
+    }
+    
+    
+    /**
+     * @return Class of the bean to be used when de-serialising JSON
+     *         data received from the 'Lite' BioCatalogue JSON API's index
+     *         of resources of this type.  
+     */
+    public Class<?> getJsonLiteAPIBindingBeanClass() {
+      return this.jsonLiteAPIBindingBeanClass;
+    }
+    
+    
+    /**
+     * @return Display name of a type of a single item belonging to that type.
+     *         (E.g. 'User' or 'Service') 
+     */
+    public String getTypeName() {
+      return this.resourceTypeName;
+    }
+    
+    /**
+     * @return Display name of a collection of items of this type.
+     *         (E.g. 'Users' or 'Services').
+     */
+    public String getCollectionName() {
+      return this.resourceCollectionName;
+    }
+    
+    /**
+     * @return HTML-formatted string that can be used as a tooltip
+     *         for tabs in BioCatalogue Exploration tab of BioCatalogue
+     *         perspective.
+     */
+    public String getCollectionTabTooltip() {
+      return this.resourceTabTooltip;
+    }
+    
+    /**
+     * @return Small icon that represents this resource type.
+     */
+    public Icon getIcon() {
+      return this.icon;
+    }
+    
+    /**
+     * @return <code>true</code> - if used for search by default;<br/>
+     *         <code>false</code> - otherwise.
+     */
+    public boolean isDefaultSearchType() {
+      return this.defaultType;
+    }
+    
+    /**
+     * Resources not of all resource types can be searched for by tags (although every resource type
+     * can be searched for by a free-text query).
+     * 
+     * @return <code>true</code> if resources of this type can be searched for by tags,<br/>
+     *         <code>false</code> otherwise.
+     */
+    public boolean isSuitableForTagSearch() {
+      return this.suitableForTagSearch;
+    }
+    
+    /**
+     * Not all resource types are suitable for filtering - for example, there are no
+     * filters available for service providers in BioCatalogue.
+     * 
+     * @return <code>true</code> indicates that tab dedicated to displaying search
+     *         results of this resource type can have a filter tree.
+     */
+    public boolean isSuitableForFiltering() {
+      return this.suitableForFiltering;
+    }
+    
+    /**
+     * @return <code>true</code> indicates that "Preview" option can be made
+     *         available for items of this type, as preview factory would be implemented
+     *         for such resources.
+     */
+    public boolean isSuitableForOpeningInPreviewBrowser() {
+      return this.suitableForOpeningInPreviewBrowser;
+    }
+    
+    public boolean isSuitableForAddingToServicePanel() {
+      return this.suitableForAddingToServicePanel;
+    }
+    
+    public boolean isSuitableForAddingToWorkflowDiagram() {
+      return this.suitableForAddingToWorkflowDiagram;
+    }
+    
+    /**
+     * @return <code>true</code> indicates that monitoring data can be obtained
+     *         from BioCatalougue for this type of resource.
+     */
+    public boolean isSuitableForHealthCheck() {
+      return this.suitableForHealthCheck;
+    }
+    
+    
+    /**
+     * This method helps to defer instantiation of ListCellRenderers
+     * until they are first accessed - it is because construction of
+     * the renderers requires knowledge of all available resource types,
+     * therefore they cannot be instantiated until after Resource class
+     * has been fully loaded.
+     * 
+     * @return {@link ListCellRenderer} for this type of resources or
+     *         <code>null</code> if an error has occurred during
+     *         instantiation of required renderer.
+     */
+    public ListCellRenderer getResultListingCellRenderer() {
+      try {
+        return this.resultListingCellRendererClass.newInstance();
+      }
+      catch (Exception e) {
+        Logger.getLogger(Resource.class).error("Unable to instantiate search results ListCellRenderer for " +
+                                               this.getCollectionName(), e);
+        JOptionPane.showMessageDialog(MainWindow.getMainWindow(), 
+            "Taverna was unable to instantiate ListCellRenderer for " + this.getCollectionName() + ".\n\n" +
+            "This may make Taverna unstable.", "Service Catalogue Plugin", JOptionPane.ERROR_MESSAGE);
+        return null;
+      }
+    }
+    
+    /**
+     * @return URL in the BioCatalogue API that provides an index of the collection of
+     *         all resources of this type.
+     */
+    public String getAPIResourceCollectionIndex() {
+      return apiResourceCollectionIndex;
+    }
+    
+    /**
+     * @return Keys and values for any additional URL parameters that need to be included into the
+     *         BioCatalogue API requests that are made in order to fetch all necessary additional
+     *         details for a *single* expanded entry in the search results listing. 
+     */
+    public Map<String,String> getResourceCollectionIndexSingleExpandedResourceAdditionalParameters() {
+      return apiResourceCollectionIndexSingleExpandedResourceAdditionalParameters;
+    }
+    
+    /**
+     * @return Keys and values for any additional URL parameters that need to be included into the
+     *         requests sent to filtered indexes of collections of this type in the BioCatalogue API.
+     */
+    public Map<String,String> getAPIResourceCollectionIndexAdditionalParameters() {
+      return apiResourceCollectionIndexAdditionalParameters;
+    }
+    
+    /**
+     * @return Number of resources of this type that one page of search results from
+     *         the API will contain.
+     */
+    public int getApiResourceCountPerIndexPage() {
+      return apiResourceCountPerIndexPage;
+    }
+    
+    /**
+     * @return BioCatalogue API URL that provides a collection of filters for the
+     *         resource of this type. 
+     */
+    public String getAPIResourceCollectionFiltersURL() {
+      return apiResourceCollectionFilters;
+    }
+    
+    
+    /**
+     * This method is useful for adding / removing tabs into the results view - provides
+     * and index for the tabbed view to place a tab, relevant to a particular resource type.
+     * This helps to preserve the order of tabs after adding / removing them.
+     * 
+     * @return Zero-based index of this resource type in the <code>RESOURCE_TYPE</code> enum or 
+     *         <code>-1</code> if not found (which is impossible under normal conditions).
+     */
+    public int index()
+    {
+      TYPE[] values = TYPE.values();
+      for (int i = 0; i < values.length; i++) {
+        if (this == values[i]) {
+          return (i);
+        }
+      }
+      return (-1);
+    }
+
+
+
+	/**
+	 * @return the suitableForAddingAllToServicePanel
+	 */
+	public boolean isSuitableForAddingAllToServicePanel() {
+		return suitableForAddingAllToServicePanel;
+	}
+    
+  };
+  
+  
+  
+  // ----------------------------- RESOURCE CLASS -------------------------------
+  
+  
+  // current resource data
+  private final TYPE resourceType;
+  private final String resourceURL;
+  private final String resourceTitle;
+  
+  
+  public Resource(String resourceURL, String resourceTitle)
+  {
+    this.resourceURL = extractPureResourceURLFromPreviewActionCommand(resourceURL);
+    this.resourceTitle = resourceTitle;
+    this.resourceType = getResourceTypeFromResourceURL(resourceURL);
+  }
+  
+  public TYPE getType() {
+    return resourceType;
+  }
+  
+  public String getURL() {
+    return resourceURL;
+  }
+
+  public String getTitle() {
+    return resourceTitle;
+  }
+  
+  
+  
+  public boolean equals(Object other)
+  {
+    if (other instanceof Resource)
+    {
+      // compare by all components
+      Resource otherRes = (Resource)other;
+      return (this.resourceType == otherRes.resourceType &&
+              this.resourceTitle.equals(otherRes.resourceTitle) &&
+              this.resourceURL.equals(otherRes.resourceURL));
+    }
+    else {
+      // other object is of different type
+      return (false);
+    }
+  }
+  
+  
+  /**
+   * @param url Either URL of the resource in BioCatalogue or preview action command
+   *            ({@link BioCataloguePluginConstants#ACTION_PREVIEW_RESOURCE}).
+   * @return Type of this resource according to the BioCatalogue URL that points to this
+   *         resource or <code>null</code> if the type of the resource couldn't be determined.
+   */
+  public static TYPE getResourceTypeFromResourceURL(String url)
+  {
+    String pureURL = extractPureResourceURLFromPreviewActionCommand(url);
+    
+//    if (pureURL.startsWith(BioCatalogueClient.API_SERVICES_URL))               return(TYPE.Service);
+//    else
+    if (pureURL.startsWith(BioCatalogueClient.API_SOAP_OPERATIONS_URL)) {
+    	return(TYPE.SOAPOperation);
+    }
+    if (pureURL.startsWith(BioCatalogueClient.API_REST_METHODS_URL)) {
+    	return(TYPE.RESTMethod);
+    }
+//    else if (pureURL.startsWith(BioCatalogueClient.API_SERVICE_PROVIDERS_URL)) return(TYPE.ServiceProvider);   // TODO - re-enable these lines as soon as ServiceProvider and User type are started to be used
+//    else if (pureURL.startsWith(BioCatalogueClient.API_USERS_URL))             return(TYPE.User);
+      return (null);
+  }
+  
+  
+  /**
+   * @param previewActionCommand Either resource preview action command or a 'pure' resource URL already.
+   * @return A "pure" resource URL in BioCatalogue with the action prefix
+   *         ({@link BioCataloguePluginConstants#ACTION_PREVIEW_RESOURCE}) removed. 
+   */
+  public static String extractPureResourceURLFromPreviewActionCommand(String previewActionCommand)
+  {
+    return (previewActionCommand.startsWith(BioCataloguePluginConstants.ACTION_PREVIEW_RESOURCE) ?
+            previewActionCommand.substring(BioCataloguePluginConstants.ACTION_PREVIEW_RESOURCE.length()) :
+            previewActionCommand);
+  }
+  
+  
+  /**
+   * @param resource
+   * @return Display name for listings of items.
+   */
+  public static String getDisplayNameForResource(ResourceLink resource)
+  {
+    if (resource instanceof SoapOperation) {
+      return ((SoapOperation)resource).getName();
+    }
+    else if (resource instanceof RestMethod)
+    {
+      RestMethod restMethod = (RestMethod)resource;
+      return (restMethod.getName() == null || restMethod.getName().length() == 0 ?
+              restMethod.getEndpointLabel() :
+              restMethod.getName());
+    }
+    else if (resource instanceof Service) {
+      return ((Service)resource).getName();
+    }
+    else if (resource instanceof ServiceProvider) {
+      return ((ServiceProvider)resource).getName();
+    }
+    else if (resource instanceof User) {
+      return ((User)resource).getName();
+    }
+    else if (resource instanceof Registry) {
+      return ((Registry)resource).getName();
+    }
+    else if (resource instanceof LoadingResource) {
+      return (resource.getResourceName());
+    }
+    else {
+      return ("ERROR: ITEM NOT RECOGNISED - Item is of known generic type from the Service Catalogue Plugin, but not specifically recognised" + resource.toString());
+    }
+  }
+  
+}