removed taverna-perspective-biocatalogue
Now maintained outside ASF at
https://github.com/taverna-extras/taverna-perspective-biocatalogue
Because:
* Unclear license/attribution for several resources
* not fully updated for Taverna Workbench 3.x (e.g. missing OSGi
service declarations, not using SCUFL2 model)
diff --git a/NOTICE b/NOTICE
index 852e947..5dd9b91 100644
--- a/NOTICE
+++ b/NOTICE
@@ -119,41 +119,3 @@
nuclear facility.
---------------------------------------------------------
-incubator-taverna-workbench/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/soap_rest_multitype_unknown.pdn
-
-TODO: License should be clarified
-
----------------------------------------------------------
-incubator-taverna-workbench/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/
-
-Source: http://www.famfamfam.com/lab/icons/silk/
-
-Created by Mark James
-Licensed as Creative Commons Attribution 3.0 License
-http://creativecommons.org/licenses/by/3.0/
-
----------------------------------------------------------
-
-taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/biocatalogue_styles.css
-taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/styles.css
-taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/test.html
-taverna-perspective-myexperiment/src/main/resources/org/apache/taverna/ui/perspectives/myexperiment/styles.css
-
-TODO: License should be clarified
-
---------------
-taverna-perspective-biocatalogue/src/main/xsd/dcterms.xsd
-taverna-perspective-biocatalogue/src/main/xsd/dc.xsd
-
-TODO: License should be clarified
-Derived from http://dublincore.org/schemas/xmls/qdc/2006/01/06/dc.xsd
-http://dublincore.org/schemas/xmls/qdc/2006/01/06/dcterms.xsd
-
---------------
-
-taverna-perspective-biocatalogue/src/main/xsd/xlink.xsd
-
-From http://www.loc.gov/standards/mets/xlink.xsd
-
-TODO: License should be clarified
-
diff --git a/pom.xml b/pom.xml
index d7a8308..1fca2e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -72,7 +72,6 @@
<module>taverna-menu-impl</module>
<module>taverna-menu-items</module>
<module>taverna-parallelize-ui</module>
- <module>taverna-perspective-biocatalogue</module>
<module>taverna-perspective-design</module>
<module>taverna-perspective-myexperiment</module>
<module>taverna-plugin-manager</module>
@@ -133,9 +132,6 @@
<exclude>**/*.json</exclude>
<!-- License details are mentioned in NOTICE ... -->
<exclude>**/src/main/jjtree/dotparser.jjt</exclude>
- <!-- Can't add license headers to a text file -->
- <exclude>**/src/main/help/Index-TOC-Map-Additions.txt</exclude>
- <exclude>**/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/*/*.pdn</exclude>
</excludes>
</configuration>
</plugin>
diff --git a/taverna-perspective-biocatalogue/lib/core-renderer.jar b/taverna-perspective-biocatalogue/lib/core-renderer.jar
deleted file mode 100644
index 871fabf..0000000
--- a/taverna-perspective-biocatalogue/lib/core-renderer.jar
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/pom.xml b/taverna-perspective-biocatalogue/pom.xml
deleted file mode 100644
index 929c3b3..0000000
--- a/taverna-perspective-biocatalogue/pom.xml
+++ /dev/null
@@ -1,206 +0,0 @@
-<?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>apache-taverna-workbench</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
- </parent>
- <artifactId>taverna-perspective-biocatalogue</artifactId>
- <name>Apache Taverna BioCatalogue Perspective</name>
- <repositories>
- <repository>
- <!-- FIXME: Avoid this 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>taverna-workflowmodel-impl</artifactId>
- <version>${taverna.engine.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.parent.groupId}</groupId>
- <artifactId>taverna-menu-api</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.parent.groupId}</groupId>
- <artifactId>taverna-file-api</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <dependency>
- <groupId>${project.parent.groupId}</groupId>
- <artifactId>taverna-ui</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <!-- required for providing contextual views in the bottom-left area of
- Design perspective -->
- <dependency>
- <groupId>${project.parent.groupId}</groupId>
- <artifactId>taverna-contextual-views-api</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <!-- required for inserting a SOAP processor into the current workflow -->
- <dependency>
- <groupId>org.apache.taverna.workbench.commonactivities</groupId>
- <artifactId>taverna-wsdl-activity-ui</artifactId>
- <version>${taverna.commonactivities.version}</version>
- </dependency>
- <!-- required for importing REST processors into the current workflow -->
- <dependency>
- <groupId>org.apache.taverna.workbench.commonactivities</groupId>
- <artifactId>taverna-rest-activity-ui</artifactId>
- <version>${taverna.commonactivities.version}</version>
- </dependency>
- <!-- required for inserting a processor into the current workflow -->
- <dependency>
- <groupId>${project.parent.groupId}</groupId>
- <artifactId>taverna-workflow-view</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <!-- required registering with and opening help window -->
- <dependency>
- <groupId>${project.parent.groupId}</groupId>
- <artifactId>taverna-helper</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.taverna.osgi</groupId>
- <artifactId>taverna-app-configuration-api</artifactId>
- <version>${taverna.osgi.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jdom</groupId>
- <artifactId>com.springsource.org.jdom</artifactId>
- <version>${jdom.version}</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlbeans</groupId>
- <artifactId>com.springsource.org.apache.xmlbeans</artifactId>
- <version>${xmlbeans.version}</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>
- <dependency>
- <groupId>org.apache.taverna.commonactivities</groupId>
- <artifactId>taverna-rest-activity</artifactId>
- <version>2.1.0-incubating-SNAPSHOT</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.taverna.commonactivities</groupId>
- <artifactId>taverna-wsdl-activity</artifactId>
- <version>2.1.0-incubating-SNAPSHOT</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.taverna.workbench</groupId>
- <artifactId>taverna-activity-palette-impl</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.taverna.ui-activities</groupId>
- <artifactId>taverna-rest-activity-ui</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
- <type>jar</type>
- </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>
- <packaging>bundle</packaging>
-</project>
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
deleted file mode 100644
index ca5a053..0000000
--- a/taverna-perspective-biocatalogue/schema_compilation/move_scomp_results_into_project.bat
+++ /dev/null
@@ -1,47 +0,0 @@
-@echo off
-
-goto LicenseEnd
-
- 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.
-
-:LicenseEnd
-
-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
diff --git a/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web.bat b/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web.bat
deleted file mode 100644
index 451d8f2..0000000
--- a/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web.bat
+++ /dev/null
@@ -1,27 +0,0 @@
-@echo off
-
-goto LicenseEnd
-
- 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.
-
-:LicenseEnd
-
-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
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
deleted file mode 100644
index ab95ff9..0000000
--- a/taverna-perspective-biocatalogue/schema_compilation/scomp_compile_from_web_to_jar.bat
+++ /dev/null
@@ -1,27 +0,0 @@
-@echo off
-
-goto LicenseEnd
-
- 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.
-
-:LicenseEnd
-
-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
diff --git a/taverna-perspective-biocatalogue/src/main/doc/BioCatalogue Plugin Documentation.odt b/taverna-perspective-biocatalogue/src/main/doc/BioCatalogue Plugin Documentation.odt
deleted file mode 100644
index 85056d7..0000000
--- a/taverna-perspective-biocatalogue/src/main/doc/BioCatalogue Plugin Documentation.odt
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 8d6c953..0000000
--- a/taverna-perspective-biocatalogue/src/main/help/Index-TOC-Map-Additions.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-/* 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
diff --git a/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-features.html b/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-features.html
deleted file mode 100644
index bce2b88..0000000
--- a/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-features.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<html>
-<!--
- 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.
--->
- <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>
diff --git a/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-feedback.html b/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-feedback.html
deleted file mode 100644
index a44c698..0000000
--- a/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin-feedback.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<html>
-<!--
- 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.
--->
- <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>
diff --git a/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin.html b/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin.html
deleted file mode 100644
index cc622ab..0000000
--- a/taverna-perspective-biocatalogue/src/main/help/biocatalogue-plugin.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<html>
-<!--
- 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.
--->
- <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>
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/BioCataloguePluginConstants.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/BioCataloguePluginConstants.java
deleted file mode 100644
index 6a8275f..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/BioCataloguePluginConstants.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-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");
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/HTTPMethodInterpreter.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/HTTPMethodInterpreter.java
deleted file mode 100644
index b82960a..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/HTTPMethodInterpreter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-import org.apache.log4j.Logger;
-import org.biocatalogue.x2009.xml.rest.HttpVerb;
-
-import org.apache.taverna.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);
- }
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/LoadingExpandedResource.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/LoadingExpandedResource.java
deleted file mode 100644
index 083c380..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/LoadingExpandedResource.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-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());
- }
-}
-
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/LoadingResource.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/LoadingResource.java
deleted file mode 100644
index dd04723..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/LoadingResource.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-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;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Pair.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Pair.java
deleted file mode 100644
index 2ee9ed1..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Pair.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-/**
- * 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;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Resource.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Resource.java
deleted file mode 100644
index 75adb28..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Resource.java
+++ /dev/null
@@ -1,522 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.swing.Icon;
-import javax.swing.JOptionPane;
-import javax.swing.ListCellRenderer;
-
-import org.apache.taverna.biocatalogue.model.connectivity.BeansForJSONLiteAPI;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.biocatalogue.ui.search_results.RESTMethodListCellRenderer;
-import org.apache.taverna.biocatalogue.ui.search_results.SOAPOperationListCellRenderer;
-import org.apache.taverna.biocatalogue.ui.search_results.ServiceListCellRenderer;
-import org.apache.taverna.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());
- }
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/ResourceManager.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/ResourceManager.java
deleted file mode 100644
index c273f87..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/ResourceManager.java
+++ /dev/null
@@ -1,342 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.image.BufferedImage;
-import java.net.URL;
-import java.util.HashMap;
-
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-
-import org.apache.taverna.activities.rest.ui.servicedescription.RESTActivityIcon;
-import org.apache.taverna.activities.wsdl.servicedescriptions.WSDLActivityIcon;
-import org.apache.taverna.ui.perspectives.biocatalogue.BioCataloguePerspective;
-
-/**
- * This class will be a single point of lookup of all resource files.
- * (Icons, images, CSS files, etc).
- *
- * @author Sergejs Aleksejevs
- */
-public class ResourceManager
-{
- // subfolders, where some icons / other resources are kept
- public static final String FAMFAMFAM_PATH = "famfamfam_silk/"; // free collection of icons
- public static final String SERVICE_ICONS_PATH = "service_icons/"; // icons related to web services (e.g. service types)
- public static final String FOLDS_PATH = "folds/"; // icons for 'folding' menus (like 'Search for...')
- public static final String TRISTATE_TREE_ICONS_PATH = "tristate_checkbox/"; // icons for the tri-state filtering tree
-
- // all known resources to follow
- public static final int FAVICON = 1;
-
- public static final int INFORMATION_ICON_LARGE = 10;
-
- public static final int SPINNER_STILL = 20;
- public static final int SPINNER = 21;
- public static final int BAR_LOADER_GREY = 25;
- public static final int BAR_LOADER_GREY_STILL = 26;
- public static final int BAR_LOADER_ORANGE = 30;
- public static final int BAR_LOADER_ORANGE_STILL = 31;
-
- public static final int FOLD_ICON = 40;
- public static final int UNFOLD_ICON = 41;
- public static final int FOLD_ICON_16x16 = 42;
- public static final int UNFOLD_ICON_16x16 = 43;
-
- public static final int SERVICE_TYPE_SOAP_ICON = 50;
- public static final int SERVICE_TYPE_REST_ICON = 51;
- public static final int SERVICE_TYPE_MULTITYPE_ICON = 65;
- public static final int SERVICE_TYPE_UNKNOWN_ICON = 70;
-
- public static final int TRISTATE_CHECKBOX_CHECKED_ICON = 80;
- public static final int TRISTATE_CHECKBOX_PARTIAL_ICON = 82;
- public static final int TRISTATE_CHECKBOX_UNCHECKED_ICON = 85;
- public static final int UNCHECKED_ICON = 86;
-
- public static final int SERVICE_STATUS_PASSED_ICON = 100;
- public static final int SERVICE_STATUS_PASSED_ICON_LARGE = 101;
- public static final int SERVICE_STATUS_WARNING_ICON = 110;
- public static final int SERVICE_STATUS_WARNING_ICON_LARGE = 111;
- public static final int SERVICE_STATUS_FAILED_ICON = 120;
- public static final int SERVICE_STATUS_FAILED_ICON_LARGE = 121;
- public static final int SERVICE_STATUS_UNCHECKED_ICON = 130;
- public static final int SERVICE_STATUS_UNCHECKED_ICON_LARGE = 131;
- public static final int SERVICE_STATUS_UNKNOWN_ICON = 140;
-
- public static final int UNKNOWN_RESOURCE_TYPE_ICON = 200;
- public static final int USER_ICON = 205;
- public static final int REGISTRY_ICON = 210;
- public static final int SERVICE_PROVIDER_ICON = 215;
- public static final int SERVICE_ICON = 220;
- public static final int SOAP_OPERATION_ICON = 225;
- public static final int REST_METHOD_ICON = 227;
- public static final int SERVICE_CATEGORY_ICON = 230;
- public static final int WSDL_DOCUMENT_ICON = 235;
- public static final int TAG_ICON = 240;
-
- public static final int OPEN_IN_BIOCATALOGUE_ICON = 310;
- public static final int SEARCH_ICON = 315;
- public static final int HISTORY_ICON = 320;
- public static final int REFRESH_ICON = 330;
- public static final int FAVOURITE_ICON = 335;
- public static final int TICK_ICON = 340;
- public static final int CROSS_ICON = 341;
- public static final int WARNING_ICON = 342;
- public static final int ERROR_ICON = 343;
- public static final int SAVE_ICON = 345;
- public static final int DELETE_ITEM_ICON = 350;
- public static final int CLEAR_ICON = 355;
- public static final int LOCKED_ICON = 360;
- public static final int UNLOCKED_ICON = 365;
-
- public static final int BACK_ICON = 370;
- public static final int FORWARD_ICON = 375;
- public static final int FILTER_ICON = 380;
- public static final int PREVIEW_ICON = 385;
- public static final int SUGGESTION_TO_USER_ICON = 390;
- public static final int ADD_PROCESSOR_TO_WORKFLOW_ICON = 395;
- public static final int ADD_PROCESSOR_AS_FAVOURITE_ICON = 396;
- public static final int EXECUTE_HEALTH_CHECK_ICON = 397;
- public static final int ADD_ALL_SERVICES_AS_FAVOURITE_ICON = 398;
-
- public static final int SELECT_ALL_ICON = 400;
- public static final int DESELECT_ALL_ICON = 405;
- public static final int EXPAND_ALL_ICON = 410;
- public static final int COLLAPSE_ALL_ICON = 420;
-
- public static final int SORT_BY_NAME_ICON = 450;
- public static final int SORT_BY_COUNTS_ICON = 455;
-
- public static final int STYLES_CSS = 1000;
-
-
- /**
- * Simple method to retrieve relative path of a required resource.
- */
- public static String getResourceRelPath(int resourceId)
- {
- String resPath = "";
-
- switch (resourceId) {
- case FAVICON: resPath += "favicon.png";
- break;
- case INFORMATION_ICON_LARGE: resPath += "info-sphere-35.png";
- break;
- case SPINNER_STILL: resPath += "ajax-loader-still.gif";
- break;
- case SPINNER: resPath += "ajax-loader.gif";
- break;
- case BAR_LOADER_GREY: resPath += "ajax-loader-grey-bert2.gif";
- break;
- case BAR_LOADER_GREY_STILL: resPath += "ajax-loader-grey-bert2-still.png";
- break;
- case BAR_LOADER_ORANGE: resPath += "ajax-loader-orange-bert2.gif";
- break;
- case BAR_LOADER_ORANGE_STILL: resPath += "ajax-loader-orange-bert2-still.png";
- break;
- case FOLD_ICON: resPath += FOLDS_PATH + "fold.png";
- break;
- case UNFOLD_ICON: resPath += FOLDS_PATH + "unfold.png";
- break;
- case FOLD_ICON_16x16: resPath += FOLDS_PATH + "fold_16x16.png";
- break;
- case UNFOLD_ICON_16x16: resPath += FOLDS_PATH + "unfold_16x16.png";
- break;
- case SERVICE_TYPE_SOAP_ICON: resPath += SERVICE_ICONS_PATH + "service_type_soap.png";
- break;
- case SERVICE_TYPE_REST_ICON: resPath += SERVICE_ICONS_PATH + "service_type_rest.png";
- break;
- case SERVICE_TYPE_MULTITYPE_ICON: resPath += SERVICE_ICONS_PATH + "service_type_multitype.png";
- break;
- case SERVICE_TYPE_UNKNOWN_ICON: resPath += SERVICE_ICONS_PATH + "service_type_unknown.png";
- break;
- case SERVICE_STATUS_PASSED_ICON: resPath += FAMFAMFAM_PATH + "accept.png";
- break;
- case SERVICE_STATUS_PASSED_ICON_LARGE: resPath += "tick-sphere-35.png";
- break;
- case SERVICE_STATUS_WARNING_ICON: resPath += FAMFAMFAM_PATH + "error.png";
- break;
- case SERVICE_STATUS_WARNING_ICON_LARGE: resPath += "pling-sphere-35.png";
- break;
- case SERVICE_STATUS_FAILED_ICON: resPath += FAMFAMFAM_PATH + "exclamation.png";
- break;
- case SERVICE_STATUS_FAILED_ICON_LARGE: resPath += "cross-sphere-35.png";
- break;
- case SERVICE_STATUS_UNCHECKED_ICON: resPath += FAMFAMFAM_PATH + "help.png";
- break;
- case SERVICE_STATUS_UNCHECKED_ICON_LARGE: resPath += "query-sphere-35.png";
- break;
- case SERVICE_STATUS_UNKNOWN_ICON: resPath += FAMFAMFAM_PATH + "grey_circle.png";
- break;
- case TRISTATE_CHECKBOX_CHECKED_ICON: resPath += TRISTATE_TREE_ICONS_PATH + "tristate_checkbox_checked.png";
- break;
- case TRISTATE_CHECKBOX_PARTIAL_ICON: resPath += TRISTATE_TREE_ICONS_PATH + "tristate_checkbox_partial.png";
- break;
- case TRISTATE_CHECKBOX_UNCHECKED_ICON: resPath += TRISTATE_TREE_ICONS_PATH + "tristate_checkbox_unchecked.png";
- break;
- case UNCHECKED_ICON: resPath += "unchecked.png";
- break;
- case UNKNOWN_RESOURCE_TYPE_ICON: resPath += FAMFAMFAM_PATH + "grey_circle.png";
- break;
- case USER_ICON: resPath += FAMFAMFAM_PATH + "user.png";
- break;
- case REGISTRY_ICON: resPath += FAMFAMFAM_PATH + "remote_resource.png";
- break;
- case SERVICE_PROVIDER_ICON: resPath += FAMFAMFAM_PATH + "chart_organisation.png";
- break;
- case SERVICE_ICON: resPath += "favicon.png";
- break;
- case SOAP_OPERATION_ICON: resPath += FAMFAMFAM_PATH + "plugin.png";
- break;
- case REST_METHOD_ICON: resPath += FAMFAMFAM_PATH + "plugin.png";
- break;
- case SERVICE_CATEGORY_ICON: resPath += FAMFAMFAM_PATH + "text_list_numbers.png";
- break;
- case TAG_ICON: resPath += FAMFAMFAM_PATH + "tag_blue.png";
- break;
- case WSDL_DOCUMENT_ICON: resPath += FAMFAMFAM_PATH + "page_white_code.png";
- break;
- case OPEN_IN_BIOCATALOGUE_ICON: resPath += FAMFAMFAM_PATH + "magnifier.png";
- break;
- case SEARCH_ICON: resPath += FAMFAMFAM_PATH + "magnifier.png";
- break;
- case HISTORY_ICON: resPath += FAMFAMFAM_PATH + "folder_explore.png";
- break;
- case REFRESH_ICON: resPath += FAMFAMFAM_PATH + "arrow_refresh.png";
- break;
- case FAVOURITE_ICON: resPath += FAMFAMFAM_PATH + "star.png";
- break;
- case TICK_ICON: resPath += FAMFAMFAM_PATH + "tick.png";
- break;
- case CROSS_ICON: resPath += FAMFAMFAM_PATH + "cross.png";
- break;
- case WARNING_ICON: resPath += FAMFAMFAM_PATH + "error.png";
- break;
- case ERROR_ICON: resPath += FAMFAMFAM_PATH + "exclamation.png";
- break;
- case SAVE_ICON: resPath += FAMFAMFAM_PATH + "disk.png";
- break;
- case DELETE_ITEM_ICON: resPath += FAMFAMFAM_PATH + "cross.png";
- break;
- case CLEAR_ICON: resPath += "trash.png";
- break;
- case LOCKED_ICON: resPath += FAMFAMFAM_PATH + "lock.png";
- break;
- case UNLOCKED_ICON: resPath += FAMFAMFAM_PATH + "lock_open.png";
- break;
- case BACK_ICON: resPath += FAMFAMFAM_PATH + "arrow_left.png";
- break;
- case FORWARD_ICON: resPath += FAMFAMFAM_PATH + "arrow_right.png";
- break;
- case FILTER_ICON: resPath += FAMFAMFAM_PATH + "arrow_join (flipped vertically).png";
- break;
- case PREVIEW_ICON: resPath += FAMFAMFAM_PATH + "magnifier.png";
- break;
- case SUGGESTION_TO_USER_ICON: resPath += FAMFAMFAM_PATH + "lightbulb.png";
- break;
- case ADD_PROCESSOR_TO_WORKFLOW_ICON: resPath += "open_in_BioCatalogue.png";
- break;
- case ADD_PROCESSOR_AS_FAVOURITE_ICON: resPath += FAMFAMFAM_PATH + "star.png";
- break;
- case ADD_ALL_SERVICES_AS_FAVOURITE_ICON:resPath += FAMFAMFAM_PATH + "multiple_star.png";
- break;
- case EXECUTE_HEALTH_CHECK_ICON: resPath += FAMFAMFAM_PATH + "information.png";
- break;
- case SELECT_ALL_ICON: resPath += FAMFAMFAM_PATH + "tick.png";
- break;
- case DESELECT_ALL_ICON: resPath += FAMFAMFAM_PATH + "cross.png";
- break;
- case EXPAND_ALL_ICON: resPath += FAMFAMFAM_PATH + "text_linespacing.png";
- break;
- case COLLAPSE_ALL_ICON: resPath += FAMFAMFAM_PATH + "text_linespacing (collapse).png";
- break;
- case SORT_BY_NAME_ICON: resPath += FAMFAMFAM_PATH + "style.png";
- break;
- case SORT_BY_COUNTS_ICON: resPath += FAMFAMFAM_PATH + "sum.png";
- break;
- case STYLES_CSS: resPath += "styles.css";
- break;
- default: return (null);
- }
-
- return (resPath);
- }
-
-
- private static URL getResourceLocalURL(int resourceId) {
- return (BioCataloguePerspective.class.getResource(getResourceRelPath(resourceId)));
- }
-
- private static HashMap<Integer, ImageIcon> iconMap = new HashMap<Integer, ImageIcon>();
-
- public static ImageIcon getImageIcon(int iconId)
- {
- ImageIcon result = iconMap.get(iconId);
- if (result == null) {
- result = new ImageIcon(getResourceLocalURL(iconId));
- iconMap.put(iconId, result);
- }
- return result;
- }
-
- public static ImageIcon getImageIcon(URL resourceLocalURL) {
- return (new ImageIcon(resourceLocalURL));
- }
-
-
- public static Icon getIconFromTaverna(int iconId) {
- switch (iconId) {
- case SOAP_OPERATION_ICON: return (WSDLActivityIcon.getWSDLIcon());
- case REST_METHOD_ICON: return (RESTActivityIcon.getRESTActivityIcon());
- default: return (drawMissingIcon());
- }
- }
-
-
- /**
- * This method would be called by other methods in this class
- * when they were unable to load requested icon.
- *
- * @return A 16x16 pixel icon that represents a missing icon -
- * a red cross.
- */
- private static ImageIcon drawMissingIcon()
- {
- int w = 16;
- int h = 16;
- GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice gd = ge.getDefaultScreenDevice();
- GraphicsConfiguration gc = gd.getDefaultConfiguration();
-
- BufferedImage image = gc.createCompatibleImage(w, h, BufferedImage.TYPE_INT_ARGB);
- Graphics2D g = image.createGraphics();
- g.setColor(Color.RED);
- g.setStroke(new BasicStroke(3, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
- g.drawLine(4, 4, 12, 12);
- g.drawLine(12, 4, 4, 12);
- g.dispose();
-
- return new ImageIcon(image);
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/ResourcePreviewContent.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/ResourcePreviewContent.java
deleted file mode 100644
index 1aa5102..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/ResourcePreviewContent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-
-/**
- * Helper class to hold all data about the generated preview.
- *
- * @author Sergejs Aleksejevs
- */
-public class ResourcePreviewContent
-{
- private Resource resource;
- private JComponent jcContent;
-
- public ResourcePreviewContent(Resource resource, JComponent content)
- {
- this.resource = resource;
- this.jcContent = content;
- }
-
- public Resource getResource() {
- return(this.resource);
- }
-
- public JComponent getContent() {
- return(this.jcContent);
- }
-
-
- public static ResourcePreviewContent createDummyInstance()
- {
- Resource r = new Resource(BioCatalogueClient.API_USERS_URL + "/1", "Dummy user");
- return (new ResourcePreviewContent(r, new JLabel("dummy content - JLabel")));
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapOperationIdentity.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapOperationIdentity.java
deleted file mode 100644
index 30b6633..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapOperationIdentity.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-/**
- * Identifies a SOAP operation (or "processor" in Taverna terms)
- * in the most straightforward way - by WSDL location and operation name.
- *
- * @author Sergejs Aleksejevs
- */
-public class SoapOperationIdentity extends SoapServiceIdentity
-{
- public static final String ACTION_STRING_SEPARATOR = "===";
-
- private final String operationName;
- private final String description;
-
- public SoapOperationIdentity(String wsdlLocation, String operationName, String description) {
- super(wsdlLocation);
- this.operationName = operationName;
- this.description = description;
- }
-
- public SoapOperationIdentity(Object errorDetails) {
- super(errorDetails);
- this.operationName = null;
- this.description = null;
- }
-
- public String getOperationName() {
- return operationName;
- }
-
- public String getDescription() {
- return description;
- }
-
-
- /**
- * @return String that can be placed into an action command (i.e. into JClickableLabel)
- * to identify a SOAP operation - WSDL location and operation name are concatenated
- * with <code>SoapOperationIdentity.ACTION_STRING_SEPARATOR</code>.
- */
- public String toActionString() {
- return (getWsdlLocation() + ACTION_STRING_SEPARATOR + this.operationName);
- }
-
-
- /**
- * @param actionString String that includes WSDL location appended by
- * <code>SoapOperationIdentity.ACTION_STRING_SEPARATOR</code>
- * and by the operation name of a SOAP operations.
- * <br/>
- * The action string may either contain only WSDL location and operation
- * name (which are joined by a specified separator) OR the action string
- * may start from <code>BioCataloguePluginConstants.ACTION_PREVIEW_SOAP_OPERATION_AFTER_LOOKUP</code>.
- * @return Instance of this class initialised with the values from the <code>actionString</code>
- * or <code>null</code> if an error occurred.
- */
- public static SoapOperationIdentity fromActionString(String actionString)
- {
- if (actionString == null) return (null);
-
- // remove the prefix if it is present
- if (actionString.startsWith(BioCataloguePluginConstants.ACTION_PREVIEW_SOAP_OPERATION_AFTER_LOOKUP)) {
- actionString = actionString.substring(BioCataloguePluginConstants.ACTION_PREVIEW_SOAP_OPERATION_AFTER_LOOKUP.length());
- }
-
- String[] parts = actionString.split(ACTION_STRING_SEPARATOR);
- if (parts == null || parts.length != 2 ||
- parts[0].length() == 0 || parts[1].length() == 0)
- {
- return (null);
- }
-
- return (new SoapOperationIdentity(parts[0], parts[1], null));
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapOperationPortIdentity.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapOperationPortIdentity.java
deleted file mode 100644
index acb9b54..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapOperationPortIdentity.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-public class SoapOperationPortIdentity extends SoapOperationIdentity
-{
- private String portName;
- private boolean isInput;
-
- public SoapOperationPortIdentity(String wsdlLocation, String operationName, String portName, boolean isInput) {
- super(wsdlLocation, operationName, null);
- this.portName = portName;
- this.isInput = isInput;
- }
-
- public SoapOperationPortIdentity(Object errorDetails) {
- super(errorDetails);
- }
-
- public String getPortName() {
- return portName;
- }
-
- public boolean isInput() {
- return isInput;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapProcessorIdentity.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapProcessorIdentity.java
deleted file mode 100644
index 066f519..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapProcessorIdentity.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-/**
- * Identifies a SOAP Processor in Taverna terms. Adds a local name
- * attribute to the details available in <code>SoapOperationIdentity</code>.
- *
- * @author Sergejs Aleksejevs
- */
-public class SoapProcessorIdentity extends SoapOperationIdentity
-{
- private final String localName;
-
- public SoapProcessorIdentity(String wsdlLocation, String operationName, String localName) {
- super(wsdlLocation, operationName, null);
- this.localName = localName;
- }
-
- public SoapProcessorIdentity(Object errorDetails) {
- super(errorDetails);
- this.localName = null;
- }
-
- public String getLocalName() {
- return localName;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapServiceIdentity.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapServiceIdentity.java
deleted file mode 100644
index c80224f..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/SoapServiceIdentity.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-/**
- * Identifies a SOAP service in the most straightforward
- * way - by WSDL location.
- *
- * @author Sergejs Aleksejevs
- */
-public class SoapServiceIdentity
-{
- private final String wsdlLocation;
-
- // this variable holds an object that will be displayable
- private final Object errorDetails;
-
- public SoapServiceIdentity(String wsdlLocation) {
- this.wsdlLocation = wsdlLocation;
- this.errorDetails = null;
- }
-
- public SoapServiceIdentity(Object errorDetails) {
- this.errorDetails = errorDetails;
- this.wsdlLocation = null;
- }
-
- public String getWsdlLocation() {
- return (wsdlLocation);
- }
-
- public boolean hasError() {
- return (errorDetails != null);
- }
-
- /**
- * @return Returned object contains an object that may be displayed
- * in a JOptionPane or printed (in other words defining a
- * sensible way of displaying itself), which has details of
- * an error that has occurred which prevented from populating
- * this instance with the actual details of their SOAP service.
- */
- public Object getErrorDetails() {
- return (errorDetails);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Tag.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Tag.java
deleted file mode 100644
index 937304a..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Tag.java
+++ /dev/null
@@ -1,234 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-import java.io.Serializable;
-import java.util.Comparator;
-
-import org.apache.commons.lang.StringEscapeUtils;
-
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class Tag implements Serializable
-{
- private static final long serialVersionUID = 784872111173271581L;
-
- private String tagURI; // URI to use on BioCatalogue to fetch all tagged items
- private String tagNamespace; // namespace where this tag is defined
- private String tagDisplayName; // only the actual tag (for display within the tag cloud)
- private String fullTagName; // full tag name - including namespace
- private int itemCount; // count of tagged items
-
-
- /**
- * Constructs a Tag instance from primitive components.
- * All values are set directly, no internal inference made.
- *
- * @param tagURI
- * @param tagNamespace
- * @param tagDisplayName
- * @param fullTagName
- * @param itemCount
- */
- public Tag(String tagURI, String tagNamespace, String tagDisplayName, String fullTagName, int itemCount)
- {
- this.tagURI = tagURI;
- this.tagNamespace = tagNamespace;
- this.tagDisplayName = tagDisplayName;
- this.setFullTagName(fullTagName);
- this.itemCount = itemCount;
- }
-
-
- /**
- * Constructs Tag instance from an XML representation of the Tag from BioCatalogue API.
- *
- * @param xmlTag
- */
- public Tag(org.biocatalogue.x2009.xml.rest.Tag xmlTag)
- {
- // these values come directly from the XML data obtained via the API
- this.tagURI = xmlTag.getHref();
- this.fullTagName = xmlTag.getName();
- this.itemCount = xmlTag.getTotalItemsCount().intValue();
-
- // NB! Namespace and the display name need to be inferred 'manually'.
- // First - set the namespace; it's value is taken from the 'namespace'
- // attribute of the tag URI.
- this.tagNamespace = Util.extractURLParameter(this.tagURI, "namespace");
-
- // Now set the display name; if full tag name is not a part of any ontology,
- // display name will be identical to the full name.
- if (this.fullTagName.startsWith("<") && this.fullTagName.endsWith(">")) {
- int iStart = this.fullTagName.lastIndexOf('#') + 1;
- this.tagDisplayName = this.fullTagName.substring(iStart, this.fullTagName.length() - 1);
- }
- else {
- this.tagDisplayName = this.fullTagName;
- }
- }
-
-
- // *** Various getters and setters ***
-
- public void setTagURI(String tagURI) {
- this.tagURI = tagURI;
- }
-
- public String getTagURI() {
- return tagURI;
- }
-
-
- public void setTagNamespace(String tagNamespace) {
- this.tagNamespace = tagNamespace;
- }
-
- public String getTagNamespace() {
- return tagNamespace;
- }
-
-
- public void setTagDisplayName(String tagDisplayName) {
- this.tagDisplayName = tagDisplayName;
- }
-
- public String getTagDisplayName() {
- return tagDisplayName;
- }
-
-
- public void setFullTagName(String fullTagName) {
- this.fullTagName = fullTagName;
- }
-
- /**
- * @return Unique and unambiguous name of this tag on BioCatalogue:<br/>
- * <ul>
- * <li>for tags with no namespaces, they it is just plain text names;</li>
- * <li>for those with namespaces, it will have the following form:<br/>
- * "<code>< http://www.mygrid.org.uk/ontology#retrieving ></code>" (without spaces, though), where
- * the first part before the '#' symbol is the namespace and the second part
- * is the actual tag within that namespace.</li></ul>
- */
- public String getFullTagName() {
- return fullTagName;
- }
-
-
- public int getItemCount() {
- return itemCount;
- }
-
- public void setItemCount(int itemCount) {
- this.itemCount = itemCount;
- }
-
-
- // *** Tag Comparators ***
-
- public static class ReversePopularityComparator implements Comparator<Tag>
- {
- public ReversePopularityComparator() {
- super();
- }
-
- public int compare(Tag t1, Tag t2)
- {
- if (t1.getItemCount() == t2.getItemCount()) {
- // in case of the same popularity, compare by full tag names (which are unique)
- return (t1.getFullTagName().compareTo(t2.getFullTagName()));
- }
- else {
- // popularity isn't the same; arrange by popularity (more popular first)
- return (t2.getItemCount() - t1.getItemCount());
- }
- }
- }
-
-
- public static class AlphanumericComparator implements Comparator<Tag>
- {
- public AlphanumericComparator() {
- super();
- }
-
- public int compare(Tag t1, Tag t2) {
- // full tag names are unique on BioCatalogue
- return (t1.getFullTagName().compareTo(t2.getFullTagName()));
- }
- }
-
- public static class AlphabeticalIgnoreCaseComparator implements Comparator<Tag>
- {
- public AlphabeticalIgnoreCaseComparator() {
- super();
- }
-
- public int compare(Tag t1, Tag t2) {
- // full tag names are unique on BioCatalogue
- return (t1.getTagDisplayName().compareToIgnoreCase(t2.getTagDisplayName()));
- }
- }
-
- /**
- * This makes sure that things like instanceOf() and remove() in List interface
- * work properly - this way resources are treated to be the same if they store
- * identical data, rather than they simply hold the same reference.
- */
- public boolean equals(Object other) {
- // could only be equal to another Tag object, not anything else
- if (! (other instanceof Tag)) return (false);
-
- // 'other' object is a Tag; equality is based on the data stored
- // in the current and 'other' Tag instances
- Tag otherTag = (Tag)other;
- return (this.itemCount == otherTag.itemCount && this.fullTagName.equals(otherTag.fullTagName));
- }
-
-
- public String toString()
- {
- return ("Tag (" + this.fullTagName + ", " + this.itemCount + ")");
- }
-
-
- /**
- * This method is used to generate the tooltip to be shown over the tag
- * in the tagcloud. Shown text will contain the full tag name, namespace
- * and frequency.
- *
- * @return HTML encoded string ready to be put into the tooltip.
- */
- public String getTagCloudTooltip()
- {
- StringBuilder tooltip = new StringBuilder("<html>");
-
- tooltip.append(" <b>" + (this.fullTagName.length() > this.tagDisplayName.length() ? "Full tag" : "Tag") + ": </b>" + StringEscapeUtils.escapeHtml(this.fullTagName));
- if (this.tagNamespace != null && this.tagNamespace.length() > 0) {
- tooltip.append("<br> <b>Namespace: </b>" + StringEscapeUtils.escapeHtml(this.tagNamespace));
- }
- tooltip.append("<br> <b>Frequency: </b>" + this.itemCount);
- tooltip.append("</html>");
-
- return tooltip.toString();
- }
-
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Util.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Util.java
deleted file mode 100644
index d92b047..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Util.java
+++ /dev/null
@@ -1,809 +0,0 @@
-package org.apache.taverna.biocatalogue.model;
-/*
- * 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.
- */
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Font;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamClass;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.BorderFactory;
-import javax.swing.JLabel;
-
-import net.sf.taverna.raven.appconfig.ApplicationRuntime;
-import org.apache.taverna.ui.perspectives.biocatalogue.BioCataloguePerspective;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.log4j.Logger;
-
-/**
- * Class containing various reusable helper methods.
- *
- * @author Sergejs Aleksejevs
- */
-public class Util
-
-
-{
-
- private static Logger logger = Logger.getLogger(Util.class);
-
-
- /**
- * Makes sure that one component (for example, a window) is centered horizontally and vertically
- * relatively to the other component. This is achieved by aligning centers of the two components.
- *
- * This method can be used even if the 'dependentComponent' is larger than the 'mainComponent'. In
- * this case it is probably only useful for centering windows against each other rather than
- * components inside a container.
- *
- * Method also makes sure that the dependent component will not be placed above the screen's upper
- * edge and to the left of the left edge.
- */
- public static void centerComponentWithinAnother(Component mainComponent, Component dependentComponent)
- {
- int iMainComponentCenterX = (int)Math.round(mainComponent.getLocationOnScreen().getX() + (mainComponent.getWidth() / 2));
- int iPosX = iMainComponentCenterX - (dependentComponent.getWidth() / 2);
- if (iPosX < 0) iPosX = 0;
-
- int iMainComponentCenterY = (int)Math.round(mainComponent.getLocationOnScreen().getY() + (mainComponent.getHeight() / 2));
- int iPosY = iMainComponentCenterY - (dependentComponent.getHeight() / 2);
- if (iPosY < 0) iPosY = 0;
-
- dependentComponent.setLocation(iPosX, iPosY);
- }
-
-
- /**
- * The parameter is the class name to be processed; class name is likely to be in
- * the form <class_name>$<integer_value>, where the trailing part starting with
- * the $ sign indicates the anonymous inner class within the base class. This will
- * strip out that part of the class name to get the base class name.
- */
- public static String getBaseClassName(String strClassName)
- {
- // strip out the class name part after the $ sign; return
- // the original value if the dollar sign wasn't found
- String strResult = strClassName;
-
- int iDollarIdx = strResult.indexOf("$");
- if (iDollarIdx != -1) strResult = strResult.substring(0, iDollarIdx);
-
- return (strResult);
- }
-
-
- /**
- * Makes sure that the supplied string is no longer than provided length.
- */
- public static String ensureStringLength(String str, int iLength) {
- if (str.length() > iLength) str = str.substring(0, iLength) + " (...)";
- return (str);
- }
-
- /**
- * Makes sure that the supplied string doesn't have any lines (separated by HTML line break tag) longer
- * than specified; assumes that there are no line breaks in the source line.
- *
- * @param str The string to work with.
- * @param iLineLength Desired length of each line.
- * @param bIgnoreBrokenWords True if line breaks are to be inserted exactly each <code>iLineLength</code>
- * symbols (which will most likely cause broken words); false to insert line breaks
- * at the first space after <code>iLineLength</code> symbols since last line break.
- * @return New string with inserted HTML line breaks.
- */
- public static String ensureLineLengthWithinString(String str, int iLineLength, boolean bIgnoreBrokenWords)
- {
- StringBuilder out = new StringBuilder(str);
-
- // keep inserting line breaks from end of the line till the beginning until all done
- int iLineBreakPosition = 0;
- while (iLineBreakPosition >= 0 && iLineBreakPosition < out.length())
- {
- // insert line break either exactly at calculated position or
- iLineBreakPosition += iLineLength;
- iLineBreakPosition = (bIgnoreBrokenWords ?
- iLineBreakPosition :
- out.indexOf(" ", iLineBreakPosition));
-
- if (iLineBreakPosition > 0 && iLineBreakPosition < out.length()) {
- out.insert(iLineBreakPosition, "<br>");
- iLineBreakPosition += 4; // -- four is the length of "<br>"
- }
- }
-
- return (out.toString());
- }
-
-
- /**
- * This is a convenience method for calling
- * {@link Util#pluraliseNoun(String, long, boolean)}
- * with <code>false</code> as a value for third parameter.
- */
- public static String pluraliseNoun(String noun, long count) {
- return (pluraliseNoun(noun, count, false));
- }
-
- /**
- * Performs naive pluralisation of the supplied noun.
- *
- * @param noun Noun in a singular form.
- * @param count Number of occurrences of the item, for which the noun is provided.
- * @param forceAppendingSByDefault <code>true</code> to make sure that "y" -> "ies"
- * substitution is <b>not made</b>, but instead "s" is appended
- * to unmodified root of the noun.
- * @return Pluralised <code>noun</code>: with appended -s or -y replaced with -ies.
- */
- public static String pluraliseNoun(String noun, long count, boolean forceAppendingSByDefault)
- {
- if (count % 10 != 1 || count == 11) {
- if (!forceAppendingSByDefault && noun.endsWith("y")) {
- return (noun.substring(0, noun.length() - 1) + "ies"); // e.g. ENTRY -> ENTRIES
- }
- else {
- return (noun + "s"); // e.g. SHIP -> SHIPS
- }
- }
- else {
- // no need to pluralise - count is of the type 21, 31, etc..
- return noun;
- }
- }
-
-
- /**
- * Calculates time difference between two {@link Calendar} instances.
- *
- * @param earlier The "earlier" date.
- * @param later The "later" date.
- * @param maxDifferenceMillis The maximum allowed time difference between the two
- * {@link Calendar} instances, in milliseconds. If the calculated
- * difference will exceed <code>maxDifferenceMillis</code>,
- * <code>null</code> will be returned. If this parameter has
- * a value <code>less or equal to zero</code>, any time difference
- * between the {@link Calendar} instances will be permitted.
- * @return String in the form "XX seconds|minutes|hours|days ago". Proper pluralisation will
- * be performed on the name of the time unit. <code>null</code> will be returned in
- * cases where one of the {@link Calendar} instances is <code>null</code>, time
- * difference between the provided instances is greater than <code>maxDifferenceMillis</code>
- * or <code>earlier</code> date is not really earlier than <code>later</code> one.
- */
- public static String getAgoString(Calendar earlier, Calendar later, long maxDifferenceMillis)
- {
- // one of the dates is missing
- if (earlier == null || later == null) {
- return null;
- }
-
- if (earlier.before(later)) {
- long differenceMillis = later.getTimeInMillis() - earlier.getTimeInMillis();
-
- if (maxDifferenceMillis <= 0 || (maxDifferenceMillis > 0 && differenceMillis <= maxDifferenceMillis))
- {
- long result = 0;
- String unitName = "";
-
- if (differenceMillis < 60 * 1000) {
- result = differenceMillis / 1000;
- unitName = "second";
- }
- else if (differenceMillis < 60 * 60 * 1000) {
- result = differenceMillis / (60 * 1000);
- unitName = "minute";
- }
- else if (differenceMillis < 24 * 60 * 60 * 1000) {
- result = differenceMillis / (60 * 60 * 1000);
- unitName = "hour";
- }
- else {
- result = differenceMillis / (24 * 60 * 60 * 1000);
- unitName = "day";
- }
-
- return (result + " " + Util.pluraliseNoun(unitName, result, true) + " ago");
- }
- else {
- // the difference is too large - larger than the supplied threshold
- return null;
- }
- }
- else {
- // the "later" date is not really later than the "earlier" one
- return null;
- }
- }
-
-
- /**
- * Joins the set of tokens in the provided list into a single string.
- * This method is a shorthand for {@link Util#join(List, String, String, String)}.
- *
- * @param tokens List of strings to join.
- * @param separator Separator to insert between individual strings.
- * @return String of the form <code>[token1][separator][token2][separator]...[tokenN]</code>
- */
- public static String join(List<String> tokens, String separator) {
- return (join(tokens, null, null, separator));
- }
-
- /**
- * Joins the set of tokens in the provided list into a single string.
- *
- * Any empty strings or <code>null</code> entries in the <code>tokens</code> list
- * will be removed to achieve a better resulting joined string.
- *
- * @param tokens List of strings to join.
- * @param prefix String to prepend to each token.
- * @param suffix String to append to each token.
- * @param separator Separator to insert between individual strings.
- * @return String of the form <code>[prefix][token1][suffix][separator][prefix][token2][suffix][separator]...[prefix][tokenN][suffix]</code>
- * <br/><br/>
- * Example: call <code>join(["cat","sat","on","the","mat"], "[", "]", ", ")</code> results in the following output:
- * <code>"[cat], [sat], [on], [the], [mat]"</code>
- */
- public static String join(List<String> tokens, String prefix, String suffix, String separator)
- {
- if (tokens == null) {
- // nothing to join
- return (null);
- }
-
- // list of strings is not empty, but some pre-processing is necessary
- // to remove any empty strings that may be there
- for (int i = tokens.size() - 1; i >= 0; i--) {
- if (tokens.get(i) == null || tokens.get(i).length() == 0) {
- tokens.remove(i);
- }
- }
-
- // now start the actual processing, but it may be the case that all strings
- // were empty and we now have an empty list
- if (tokens.isEmpty()) {
- // nothing to join - just return an empty string
- return ("");
- }
- else {
- // there are some tokens -- perform the joining
- String effectivePrefix = (prefix == null ? "" : prefix);
- String effectiveSuffix = (suffix == null ? "" : suffix);
- String effectiveSeparator = (separator == null ? "" : separator);
-
- StringBuilder result = new StringBuilder();
- for (int i = 0; i < tokens.size(); i++) {
- result.append(effectivePrefix + tokens.get(i) + effectiveSuffix);
- result.append(i == tokens.size() - 1 ? "" : effectiveSeparator);
- }
-
- return (result.toString());
- }
- }
-
- /**
- * Determines whether the plugin is running as a standalone JFrame or inside Taverna Workbench.
- * This is a naive test, based only on the fact that Taverna uses Raven ApplicationRuntime.
- */
- public static boolean isRunningInTaverna()
- {
- try {
- // ApplicationRuntime class is defined within Taverna API. If this is available,
- // it should mean that the plugin runs within Taverna.
- ApplicationRuntime.getInstance();
- return true;
- }
- catch (NoClassDefFoundError e) {
- return false;
- }
- }
-
-
- // === STRIPPING OUT HTML FROM STRINGS ===
-
- public static String prepareStringForComponent(String source) {
- return "<html>" + StringEscapeUtils.escapeHtml(source) + "</html>";
- }
-
-
- /*
- * === The following section is providing URL handling methods. ===
- */
-
- /**
- * See: {@link Util#appendStringBeforeParametersOfURL(String, String, boolean)}
- *
- * Assumes the last parameter as false, so that the URL encoding will be done.
- */
- public static String appendStringBeforeParametersOfURL(String url, String strToAppend) {
- return (appendStringBeforeParametersOfURL(url, strToAppend, false));
- }
-
- /**
- * Tiny helper to strip out all HTML tags. This will not leave any HTML tags
- * at all (so that the content can be displayed in DialogTextArea - and the
- * like - components. This helps to present HTML content inside JAVA easier.
- */
- public static String stripAllHTML(String source) {
- // don't do anything if not string is provided
- if (source == null)
- return ("");
-
- // need to preserve at least all line breaks
- // (ending and starting paragraph also make a line break)
- source = source.replaceAll("</p>[\r\n]*<p>", "<br/>");
- source = source.replaceAll("[\\s]+", " ");
- source = source.replaceAll("\\<br/?\\>", "\n");
- source = source.replaceAll("\n ", "\n");
-
- // strip all HTML
- source = source.replaceAll("\\<.*?\\>", ""); // any HTML tags
- source = source.replaceAll("&\\w{1,4};", ""); // this is for things like " ", ">", etc
-
- return (source);
- }
-
-
- /**
- * Appends given string at the end of the provided URL just before the list of parameters in the url.
- *
- * For example, appending ".xml" to URL "http://www.sandbox.biocatalogue.org/services?tag=blast" will
- * yield "http://www.sandbox.biocatalogue.org/services.xml?tag=blast".
- *
- * No duplication checking is made - if the URL is already ending (before parameters) with the value of
- * the string to append, that string will still be appended.
- *
- * @param url URL to append the string to.
- * @param strToAppend The string to append. The value will be url-encode before appending.
- * @return New string containing modified <code>url</code> with the <code>strToAppend</code> appended
- * before the "query string" of the URL.
- */
- public static String appendStringBeforeParametersOfURL(String url, String strToAppend, boolean ignoreURLEncoding)
- {
- StringBuilder modifiedURL = new StringBuilder(url);
-
- int iPositionToInsertProvidedString = modifiedURL.indexOf("?");
- if (iPositionToInsertProvidedString == -1) iPositionToInsertProvidedString = modifiedURL.length();
-
- String stringToInsert = (ignoreURLEncoding ? strToAppend : Util.urlEncodeQuery(strToAppend));
- modifiedURL.insert(iPositionToInsertProvidedString, stringToInsert);
-
- return (modifiedURL.toString());
- }
-
-
- /**
- * This method takes a collection of name-value pairs in the form of a map.
- * It then adds all parameters from this map to the provided URL.
- *
- * If any parameter has the same name as was already present in the URL, the new value
- * will replace the existing one.
- *
- * The implementation of this method is not particularly efficient - it makes a
- * lot of overhead, but it's fine for non-intensive usage.
- *
- * @param url The URL to add a new parameter to.
- * @param Map of parameters to add to the URL. Keys and values of the map are the names and values for URL parameters.
- * @return New string which is the original <code>url</code> with all provided
- * parameters (in the form <code>name</code>=<code>value</code> pair) added to it.
- */
- public static String appendAllURLParameters(String url, Map<String,String> parameterMap)
- {
- if (parameterMap == null || parameterMap.size() == 0) {
- // nothing to add, return the same URL
- return (url);
- }
- else {
- // just call an overloaded method which has the main logic
- // to do this action for each name-value pair in the map
- String out = url;
- for (Map.Entry<String,String> anotherParameter : parameterMap.entrySet()) {
- out = appendURLParameter(out, anotherParameter);
- }
- return (out);
- }
- }
-
-
-
- /**
- * This method takes a string representation of a URL and a name-value pair
- * of strings - in the form of Map.Entry instance to add to the URL as a new parameter.
- *
- * If parameter with the same name was already present in the URL, the new value
- * will replace the existing one.
- *
- * @param url The URL to add a new parameter to.
- * @param Map.Entry instance containing the name & the value for the parameter to add.
- * @return New string which is the original <code>url</code> with the desired
- * parameter (<code>name</code>=<code>value</code> pair) added to it.
- */
- public static String appendURLParameter(String url, Map.Entry<String,String> parameter)
- {
- if (parameter == null) {
- // nothing to add, return the same URL
- return (url);
- }
- else {
- // just call an overloaded method which has the main logic to do this action
- return (appendURLParameter(url, parameter.getKey(), parameter.getValue()));
- }
- }
-
-
- /**
- * This method takes a string representation of a URL and a name-value pair
- * of strings to add to the URL as a new parameter.
- *
- * If parameter with the same name was already present in the URL, the new value
- * will replace the existing one.
- *
- * @param url The URL to add a new parameter to.
- * @param parameter String array with 2 elements - first element is the name
- * of the parameter to add, second - the value of the parameter.
- * @return New string which is the original <code>url</code> with the desired
- * parameter (<code>name</code>=<code>value</code> pair) added to it.
- */
- public static String appendURLParameter(String url, String[] parameter)
- {
- if (parameter == null || parameter.length != 2) {
- // nothing to add, return the same URL
- return (url);
- }
- else {
- // just call an overloaded method which has the main logic to do this action
- return (appendURLParameter(url, parameter[0], parameter[1]));
- }
- }
-
-
- /**
- * This method takes a string representation of a URL and a name-value pair
- * of strings to add to the URL as a new parameter.
- *
- * If parameter with the same name was already present in the URL, the new value
- * will replace the existing one.
- *
- * @param url The URL to add a new parameter to.
- * @param name Name of the parameter to add.
- * @param value Value of the parameter to add.
- * @return New string which is the original <code>url</code> with the desired
- * parameter (<code>name</code>=<code>value</code> pair) added to it.
- */
- public static String appendURLParameter(String url, String name, String value)
- {
- // if name of the parameter is not given, ignore this request
- // (makes sense to return the same URL as the input in this case -
- // as appending "nothing" wouldn't make it any different)
- if (name == null || name.length() == 0) {
- return (url);
- }
-
- // do everything in the protected block
- try
- {
- // parse the parameters of the given URL
- Map<String,String> urlParameters = extractURLParameters(url);
- if (urlParameters == null) {
- // there were no parameters in the original URL, create new map
- urlParameters = new HashMap<String,String>();
- }
-
- // add the new parameter (this will replace a parameter with identical
- // name if it was already present in the map)
- urlParameters.put(name, value);
-
- // parse the URL string into the URL object to extract original query string
- URL theURL = new URL(url);
- String originalQueryString = theURL.getQuery();
-
- // prepare the basis for the new URL to return
- String newUrl = null;
- if (originalQueryString != null) {
- // replace the original query string with empty space to
- // give way for appending the new query string
- newUrl = url.replace(originalQueryString, "");
- }
- else {
- // there were no parameters in the original URL
- newUrl = url + "?";
- }
-
- // append the new query string
- newUrl += constructURLQueryString(urlParameters);
-
- return (newUrl);
- }
- catch (Exception e)
- {
- logger.error("\nCouldn't append parameter ('" + name + "', '" + value + "') to the URL: " + url, e);
- return (null);
- }
- }
-
-
- /**
- * Extracts a value of a specific parameter from the supplied URL.
- *
- * @param url The URL to extract the parameter from.
- * @param parameterName Name of the URL parameter to extract the value for.
- * @return Value of the parameter with <code>parameterName</code> in the given <code>url</code>.
- * If the parameter with specified name is not found in the given <code>url</code>,
- * <code>null</code> is returned instead.
- */
- public static String extractURLParameter(String url, String parameterName)
- {
- // both URL and the name of the required parameter must be supplied
- if (url == null || url.length() == 0 || parameterName == null || parameterName.length() == 0) return null;
-
- Map<String,String> urlParameters = extractURLParameters(url);
- if (urlParameters != null) {
- // the URL has some parameters; check what's the value of the desired parameter
- return (urlParameters.get(parameterName));
- }
- else {
- // the URL doesn't contain any parameters
- return (null);
- }
- }
-
-
- /**
- * Extracts the query string from the provided URL. Parses this query string into
- * a map of parameters.
- *
- * All parameters (both names and values) will have special characters unescaped
- * (i.e. decoded from the standard url-encoding) and can be used directly.
- *
- * @param url The string representation of the URL to parse.
- */
- public static Map<String,String> extractURLParameters(String url)
- {
- try {
- // extract the query part of the supplied URL
- URL theURL = new URL(url);
- String queryString = theURL.getQuery();
-
- // prepare storage for output
- Map<String,String> parameterMap = null;
-
- // extract each name-value pair from query string (if any are specified in the URL)
- if (queryString != null && queryString.length() > 0)
- {
- // only initialise if there are some parameters
- parameterMap = new HashMap<String,String>();
-
- for (String parameter : queryString.split("&")) {
- String[] nameValueArr = parameter.split("=");
-
- String name = nameValueArr[0]; // parameter name must always be present
- String value = (nameValueArr.length == 2 ? nameValueArr[1] : null); // could be that parameter value is not set (e.g. "q=") - insert null then
-
- // decode possible special characters
- name = urlDecodeQuery(name);
- if (value != null) value = urlDecodeQuery(value);
-
- parameterMap.put(name, value);
- }
- }
-
- return (parameterMap);
- }
- catch (MalformedURLException e)
- {
- // some problem occurred - report it; can't return any data in this case
- logger.error("Couldn't parse parameters of a URL: " + url + "; details below:", e);
- return null;
- }
- }
-
-
- /**
- * This method is the opposite for <code>extractURLParameters(String url)</code>.
- * It takes a map of parameters, performs URL-encoding of each and assembles them
- * into a query string.
- *
- * The query string then can be added to the <code>URL</code> object by using standard
- * Java API.
- *
- * @param urlParameters Map of parameters to use in query string construction.
- * @return URL-encoded query string.
- */
- public static String constructURLQueryString(Map<String,String> urlParameters)
- {
- if (urlParameters != null) {
- StringBuilder queryString = new StringBuilder();
-
- // iterate through all parameters and reconstruct the query string
- for (Map.Entry<String,String> parameter : urlParameters.entrySet())
- {
- if (queryString.length() > 0) queryString.append("&"); // parameter separator
- queryString.append(urlEncodeQuery(parameter.getKey()) + "=" + urlEncodeQuery(parameter.getValue()));
- }
-
- return (queryString.toString());
- }
- else {
- return (null);
- }
- }
-
-
- /**
- * Prepares the string to serve as a part of url query to the server.
- * @param query The string that needs URL encoding.
- * @return URL encoded string that can be inserted into the request URL.
- */
- public static String urlEncodeQuery(String query)
- {
- // "fast exit" - if null supplied, just return an empty string;
- // this is because in the URLs we have "q=", rather than "q=null" - this will cater for such cases
- if (query == null) return ("");
-
- // encode the query
- String strRes = "";
- try {
- strRes = URLEncoder.encode(query, "UTF-8");
- }
- catch (UnsupportedEncodingException e) {
- // do nothing
- }
-
- return (strRes);
- }
-
-
- /**
- * Decodes a string which came as a part of of URL (e.g. a URL parameter). This converts
- * codes of escaped special characters back into those special characters.
- *
- * @param query The string that needs URL decoded.
- * @return Decoded string that will contain all the special characters.
- */
- public static String urlDecodeQuery(String query)
- {
- String strRes = "";
-
- try {
- strRes = URLDecoder.decode(query, "UTF-8");
- }
- catch (UnsupportedEncodingException e) {
- // do nothing
- }
-
- return (strRes);
- }
-
-
- /**
- * This method is "clones" an object supplied as an argument. It uses
- * serialisation to achieve this (as opposed to manually implementing deep
- * copying of all referenced objects in the graph of the provided object).
- * This technique is used to make sure that the new object will be exact
- * replica, but totally independent of the original one.
- *
- * Note that this code works ~100 times slower than it would do if deep copying
- * was implemented. However, this will not be used in tight loops (and in loops
- * at all), so for one-off tasks it is fine.
- *
- * @author Dave Miller<br/>
- * Original version of the code in this method is taken from
- * <a href="http://www.javaworld.com/javaworld/javatips/jw-javatip76.html?page=2">
- * http://www.javaworld.com/javaworld/javatips/jw-javatip76.html?page=2
- * </a> [accessed on 25/Feb/2010].
- * <br/><br/>
- *
- * @author Subhajit Dasgupta<br/>
- * Example of using an alternative class loader during object de-serialisation
- * was taken from
- * <a href="http://blogs.sun.com/adventures/entry/desrializing_objects_custom_class_loaders">
- * http://blogs.sun.com/adventures/entry/desrializing_objects_custom_class_loaders
- * </a> [accessed on 29/Mar/2010].
- *
- * @return Deep copy of the provided object. If deep copying doesn't succeed,
- * <code>null</code> is returned.
- */
- public static Object deepCopy(Object objectToCopy)
- {
- // a "safety net" - a class loader of BioCatalogue perspective may be used in
- // de-serialisation process to make sure that all classes are recognised
- // (system class loader may not be able to "see" all BioCatalogue plugin's files,
- // but just those in Taverna's /lib folder)
- final ClassLoader[] customClassLoaders = new ClassLoader[] { BioCataloguePerspective.class.getClassLoader() };
-
- try
- {
- ObjectOutputStream oos = null;
- ObjectInputStream ois = null;
- try
- {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- oos = new ObjectOutputStream(bos);
-
- // serialise and pass the object
- oos.writeObject(objectToCopy);
- oos.flush();
-
- // read and return the new object
- ByteArrayInputStream bin = new ByteArrayInputStream(bos.toByteArray());
- ois = new ObjectInputStream(bin) {
- /**
- * <code>resolveClass()</code> method is overridden to make use of
- * custom ClassLoader in the de-serialisation process.
- * <br/>
- * This is needed to make sure that the ClassLoader of the BioCatalogue
- * perspective is used as opposed to the system ClassLoader which will
- * only be able to see classes from Taverna's /lib folder.
- */
- protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException
- {
- String className = desc.getName();
- try {
- // attempt to use default class loader
- return Class.forName(className);
- }
- catch (ClassNotFoundException exc)
- {
- // default class loader was unable to locate a required class -
- // attempt to use one of the provided class loaders
- for (ClassLoader cl : customClassLoaders) {
- try {
- return cl.loadClass(className);
- }
- catch (ClassNotFoundException e) {
- /* do nothing here - there may be other class loaders to try */
- }
- }
- // none of the class loaders was able to recognise the currently
- // de-serialised class, so it's indeed an exception
- throw new ClassNotFoundException(className +
- " -- neither system, nor alternative class loaders were able to load this class");
- }
- }
- };
- return ois.readObject();
- }
- catch(Exception e)
- {
- logger.error("Could not perform deep copy of " + objectToCopy.getClass() + " instance", e);
- }
- finally
- {
- oos.close();
- ois.close();
- }
- }
- catch (Exception e) {
- logger.error("Could not close object streams during deep copy of " + objectToCopy.getClass() + " instance");
- }
-
- // Error occurred - couldn't produce the deep copy...
- return null;
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BeanForPOSTToFilteredIndex.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BeanForPOSTToFilteredIndex.java
deleted file mode 100644
index ea04d07..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BeanForPOSTToFilteredIndex.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.taverna.biocatalogue.model.connectivity;
-/*
- * 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.
- */
-
-import java.util.Map;
-
-/**
- *
- * @author Sergejs Aleksejevs
- */
-public class BeanForPOSTToFilteredIndex
-{
- public Map<String, String[]> filters;
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BeansForJSONLiteAPI.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BeansForJSONLiteAPI.java
deleted file mode 100644
index 42481d8..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BeansForJSONLiteAPI.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.apache.taverna.biocatalogue.model.connectivity;
-/*
- * 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.
- */
-
-
-/**
- * Binding beans for GSON library to instantiate objects
- * from JSON data obtained from the 'Lite' version of the
- * BioCatalogue JSON API.
- *
- * @author Sergejs Aleksejevs
- */
-public class BeansForJSONLiteAPI
-{
-
- public static abstract class ResourceIndex
- {
- public ResourceIndex() { }
- public abstract ResourceLinkWithName[] getResources();
- }
-
-
- public static class SOAPOperationsIndex extends ResourceIndex {
- public SOAPOperationsIndex() { }
- public ResourceLinkWithName[] soap_operations;
-
- public ResourceLinkWithName[] getResources() {
- return soap_operations;
- }
- }
-
- public static class RESTMethodsIndex extends ResourceIndex {
- public RESTMethodsIndex() { }
- public ResourceLinkWithName[] rest_methods;
-
- public ResourceLinkWithName[] getResources() {
- return rest_methods;
- }
- }
-
- public static class ServicesIndex extends ResourceIndex {
- public ServicesIndex() { }
- public ResourceLinkWithName[] services;
-
- public ResourceLinkWithName[] getResources() {
- return services;
- }
- }
-
- public static class ServiceProvidersIndex extends ResourceIndex {
- public ServiceProvidersIndex() { }
- public ResourceLinkWithName[] service_providers;
-
- public ResourceLinkWithName[] getResources() {
- return service_providers;
- }
- }
-
- public static class UsersIndex extends ResourceIndex {
- public UsersIndex() { }
- public ResourceLinkWithName[] users;
-
- public ResourceLinkWithName[] getResources() {
- return users;
- }
- }
-
-
-
- public static class ResourceLinkWithName
- {
- private ResourceLinkWithName() { }
-
- private String resource;
- private String name;
-
- public String getURL() {
- return (this.resource);
- }
-
- public String getName() {
- return (this.name);
- }
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BioCatalogueAPIRequest.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BioCatalogueAPIRequest.java
deleted file mode 100644
index 0cf892a..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BioCatalogueAPIRequest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.taverna.biocatalogue.model.connectivity;
-/*
- * 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.
- */
-
-/**
- * A class to wrap BioCatalogue API requests - will include
- * the type (GET, POST, etc), URL and the data to send
- * if that's a POST / PUT request.
- *
- * @author Sergejs Aleksejevs
- */
-public class BioCatalogueAPIRequest
-{
- public static enum TYPE {
- GET,
- POST,
- PUT,
- DELETE
- }
-
-
- private TYPE requestType;
- private String url;
- private String data;
-
-
- public BioCatalogueAPIRequest(TYPE requestType, String url, String data) {
- this.requestType = requestType;
- this.url = url;
- this.data = data;
- }
-
-
- public TYPE getRequestType() {
- return requestType;
- }
-
- public String getURL(){
- return url;
- }
- public void setURL(String url) {
- this.url = url;
- }
-
- public String getData(){
- return data;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BioCatalogueClient.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BioCatalogueClient.java
deleted file mode 100644
index b1c3e67..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/BioCatalogueClient.java
+++ /dev/null
@@ -1,801 +0,0 @@
-package org.apache.taverna.biocatalogue.model.connectivity;
-/*
- * 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.
- */
-
-import java.io.*;
-import java.net.*;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.taverna.biocatalogue.model.BioCataloguePluginConstants;
-import org.apache.taverna.biocatalogue.model.Pair;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.biocatalogue.model.SoapOperationPortIdentity;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.biocatalogue.model.connectivity.BeansForJSONLiteAPI.ResourceIndex;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.config.BioCataloguePluginConfiguration;
-
-import org.apache.log4j.Logger;
-import org.biocatalogue.x2009.xml.rest.Annotations;
-import org.biocatalogue.x2009.xml.rest.AnnotationsDocument;
-import org.biocatalogue.x2009.xml.rest.CollectionCoreStatistics;
-import org.biocatalogue.x2009.xml.rest.Filters;
-import org.biocatalogue.x2009.xml.rest.FiltersDocument;
-import org.biocatalogue.x2009.xml.rest.ResourceLink;
-import org.biocatalogue.x2009.xml.rest.RestMethod;
-import org.biocatalogue.x2009.xml.rest.RestMethodDocument;
-import org.biocatalogue.x2009.xml.rest.RestMethods;
-import org.biocatalogue.x2009.xml.rest.RestMethodsDocument;
-import org.biocatalogue.x2009.xml.rest.Search;
-import org.biocatalogue.x2009.xml.rest.SearchDocument;
-import org.biocatalogue.x2009.xml.rest.Service;
-import org.biocatalogue.x2009.xml.rest.ServiceDocument;
-import org.biocatalogue.x2009.xml.rest.ServiceProvider;
-import org.biocatalogue.x2009.xml.rest.ServiceProviderDocument;
-import org.biocatalogue.x2009.xml.rest.ServiceProviders;
-import org.biocatalogue.x2009.xml.rest.ServiceProvidersDocument;
-import org.biocatalogue.x2009.xml.rest.Services;
-import org.biocatalogue.x2009.xml.rest.ServicesDocument;
-import org.biocatalogue.x2009.xml.rest.SoapInput;
-import org.biocatalogue.x2009.xml.rest.SoapInputDocument;
-import org.biocatalogue.x2009.xml.rest.SoapOperation;
-import org.biocatalogue.x2009.xml.rest.SoapOperationDocument;
-import org.biocatalogue.x2009.xml.rest.SoapOperations;
-import org.biocatalogue.x2009.xml.rest.SoapOperationsDocument;
-import org.biocatalogue.x2009.xml.rest.SoapOutput;
-import org.biocatalogue.x2009.xml.rest.SoapOutputDocument;
-import org.biocatalogue.x2009.xml.rest.SoapService;
-import org.biocatalogue.x2009.xml.rest.SoapServiceDocument;
-import org.biocatalogue.x2009.xml.rest.Tag;
-import org.biocatalogue.x2009.xml.rest.TagDocument;
-import org.biocatalogue.x2009.xml.rest.Tags;
-import org.biocatalogue.x2009.xml.rest.TagsDocument;
-import org.biocatalogue.x2009.xml.rest.User;
-import org.biocatalogue.x2009.xml.rest.UserDocument;
-import org.biocatalogue.x2009.xml.rest.Users;
-import org.biocatalogue.x2009.xml.rest.UsersDocument;
-
-import com.google.gson.Gson;
-
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class BioCatalogueClient
-{
- // ******* CONSTANTS *******
- // plugin details
- public static final String PLUGIN_VERSION = "0.1.1";
- public static final String PLUGIN_USER_AGENT = "Taverna2-ServiceCatalogue-plugin/" +
- PLUGIN_VERSION +
- " Java/" + System.getProperty("java.version");
-
- public static final String XML_MIME_TYPE = "application/xml";
- public static final String JSON_MIME_TYPE = "application/json";
- public static final String LITE_JSON_MIME_TYPE = "application/biocat-lite+json";
-
- public static final String XML_DATA_FORMAT = ".xml";
- public static final String JSON_DATA_FORMAT = ".json";
- public static final String LITE_JSON_DATA_FORMAT = ".bljson";
-
-
-
- // API URLs
- public static final String DEFAULT_API_SANDBOX_BASE_URL = "http://sandbox.biocatalogue.org";
- public static final String DEFAULT_API_TEST_SERVER_BASE_URL = "http://test.biocatalogue.org";
- public static final String DEFAULT_API_LIVE_SERVER_BASE_URL = "http://www.biocatalogue.org";
-
- private static String BASE_URL; // BioCatalogue base URL to use (can be updated at runtime)
-
- public static String API_REGISTRIES_URL;
- public static String API_SERVICE_PROVIDERS_URL;
- public static String API_USERS_URL;
- public static String API_USER_FILTERS_URL;
- public static String API_SERVICES_URL;
- public static String API_SERVICE_FILTERS_URL;
- public static String API_SOAP_OPERATIONS_URL;
- public static String API_SOAP_OPERATION_FILTERS_URL;
- public static String API_REST_METHODS_URL;
- public static String API_REST_METHOD_FILTERS_URL;
- public static String API_TAG_CLOUD_URL;
- public static String API_SEARCH_URL;
- public static String API_LOOKUP_URL;
-
- // URL modifiers
- public static final Map<String,String> API_INCLUDE_SUMMARY = Collections.singletonMap("include","summary"); // for fetching Service
- public static final Map<String,String> API_INCLUDE_ANCESTORS = Collections.singletonMap("include", "ancestors,inputs,outputs"); // for fetching SOAP Operations and REST Methods
- public static final String[] API_SORT_BY_NAME = {"sort","name"}; // for tag cloud
- public static final String[] API_SORT_BY_COUNTS = {"sort","counts"}; // for tag cloud
- public static final String[] API_ALSO_INPUTS_OUTPUTS = {"also","inputs,outputs"}; // for annotations on SOAP operation
-
- public static final String API_PER_PAGE_PARAMETER = "per_page";
- public static final String API_PAGE_PARAMETER = "page";
- public static final String API_LIMIT_PARAMETER = "limit";
- public static final String API_SERVICE_MONITORING_URL_SUFFIX = "/monitoring";
- public static final String API_FILTERED_INDEX_SUFFIX = "/filtered_index";
-
- // API Request scope
- public static final String API_SCOPE_PARAMETER = "scope";
- public static final String API_SCOPE_SOAP_OPERATIONS = "soap_operations";
- public static final String API_SCOPE_REST_METHODS = "rest_methods";
- public static final String API_SCOPE_SERVICES = "services";
- public static final String API_SCOPE_SERVICE_PROVIDERS = "service_providers";
- public static final String API_SCOPE_REGISTRIES = "registries";
- public static final String API_SCOPE_USERS = "users";
-
- public static final String API_TAG_PARAMETER = "tag";
-
- public static final String API_LOOKUP_WSDL_LOCATION_PARAMETER = "wsdl_location";
- public static final String API_LOOKUP_OPERATION_NAME_PARAMETER = "operation_name";
- public static final String API_LOOKUP_SOAP_INPUT_NAME_PARAMETER = "input_name";
- public static final String API_LOOKUP_SOAP_OUTPUT_NAME_PARAMETER = "output_name";
-
-
- // *************************
-
- // universal date formatters
- private static final DateFormat DATE_FORMATTER = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy");
- private static final DateFormat SHORT_DATE_FORMATTER = new SimpleDateFormat("HH:mm 'on' dd/MM/yyyy");
- private static final DateFormat API_LOGGING_TIMESTAMP_FORMATTER = DateFormat.getDateTimeInstance();
-
-
- // SETTINGS
- private Properties iniSettings; // settings that are read/stored from/to INI file
-
- private File fAPIOperationLog;
- private PrintWriter pwAPILogWriter;
-
- // the logger
- private Logger logger = Logger.getLogger(BioCatalogueClient.class);
-
- private static BioCatalogueClient INSTANCE;
-
- // default constructor
- private BioCatalogueClient()
- {
- // TODO: load any config settings (if necessary)
-
- // load the BioCatalogue API base URL from the plugin's configuration settings
- this.setBaseURL(BioCataloguePluginConfiguration.getInstance().
- getProperty(BioCataloguePluginConfiguration.SERVICE_CATALOGUE_BASE_URL));
-
- // open API operation log file, if necessary
- if (BioCataloguePluginConstants.PERFORM_API_RESPONSE_TIME_LOGGING ||
- BioCataloguePluginConstants.PERFORM_API_XML_DATA_BINDING_TIME_LOGGING )
- {
- try {
- BioCataloguePluginConstants.LOG_FILE_FOLDER.mkdirs(); // just in case this log file was never written - create the folder as well
- fAPIOperationLog = new File(BioCataloguePluginConstants.LOG_FILE_FOLDER,
- BioCataloguePluginConstants.API_OPERATION_LOG_FILENAME);
- pwAPILogWriter = new PrintWriter(new FileOutputStream(fAPIOperationLog, true), true); // auto-flush makes sure that even if app crashes, log will not be lost
- }
- catch (NullPointerException e) {
- pwAPILogWriter = new PrintWriter(System.out, true);
- logger.error("ERROR: Folder to log API operation details is unknown (using System.out instead)... Details:", e);
- }
- catch (FileNotFoundException e) {
- logger.error("ERROR: Couldn't open API operation log file... Details:", e);
- }
- }
- }
-
- public static synchronized BioCatalogueClient getInstance() {
- if (INSTANCE == null) {
- INSTANCE = new BioCatalogueClient();
- }
- return INSTANCE;
- }
-
-
- public String getBaseURL() {
- return this.BASE_URL;
- }
-
- /**
- * Updates the base API URL and also
- * updates derived URLs of sub-URLs
- * (e.g. BASE_URL + /services, etc)
- *
- * @param baseURL The new value for the BioCatalogue API base URL.
- */
- public void setBaseURL(String baseURL)
- {
- // make sure the base URL doesn't have a slash at the end
- // (otherwise double slashes may occur during URL manipulation)
- while (baseURL.endsWith("/")) { baseURL = baseURL.substring(0, baseURL.length() - 1); }
-
- this.BASE_URL = baseURL;
-
- API_REGISTRIES_URL = BASE_URL + "/registries";
- API_SERVICE_PROVIDERS_URL = BASE_URL + "/service_providers";
- API_USERS_URL = BASE_URL + "/users";
- API_USER_FILTERS_URL = API_USERS_URL + "/filters";
- API_SERVICES_URL = BASE_URL + "/services";
- API_SERVICE_FILTERS_URL = API_SERVICES_URL + "/filters";
- API_SOAP_OPERATIONS_URL = BASE_URL + "/soap_operations";
- API_SOAP_OPERATION_FILTERS_URL = API_SOAP_OPERATIONS_URL + "/filters";
- API_REST_METHODS_URL = BASE_URL + "/rest_methods";
- API_REST_METHOD_FILTERS_URL = API_REST_METHODS_URL + "/filters";
- API_TAG_CLOUD_URL = BASE_URL + "/tags";
- API_SEARCH_URL = BASE_URL + "/search";
- API_LOOKUP_URL = BASE_URL + "/lookup";
- }
-
- public File getAPIOperationLog() {
- return fAPIOperationLog;
- }
-
- public PrintWriter getAPILogWriter() {
- return pwAPILogWriter;
- }
-
-
- // ************ METHODS FOR RETRIEVAL OF SPECIALISED OBJECT FROM THE API VIA XML ************
-
- public Annotations getBioCatalogueAnnotations(String strAnnotationsURL) throws Exception {
- return (parseAPIResponseStream(Annotations.class, doBioCatalogueGET(strAnnotationsURL)));
- }
-
- public Filters getBioCatalogueFilters(String strURL) throws Exception {
- return (parseAPIResponseStream(Filters.class, doBioCatalogueGET(strURL)));
- }
-
- public Services getBioCatalogueServices(String strURL) throws Exception {
- return (parseAPIResponseStream(Services.class, doBioCatalogueGET(strURL)));
- }
-
- public Service getBioCatalogueService(String serviceURL) throws Exception {
- return (parseAPIResponseStream(Service.class, doBioCatalogueGET(serviceURL)));
- }
-
- public Service getBioCatalogueServiceSummary(String serviceURL) throws Exception {
- return (parseAPIResponseStream(Service.class, doBioCatalogueGET(Util.appendAllURLParameters(serviceURL, API_INCLUDE_SUMMARY))));
- }
-
- public Service getBioCatalogueServiceMonitoringData(String serviceURL) throws Exception
- {
- return (parseAPIResponseStream(Service.class,
- doBioCatalogueGET(serviceURL + API_SERVICE_MONITORING_URL_SUFFIX))
- );
- }
-
- public SoapService getBioCatalogueSoapService(String soapServiceURL) throws Exception {
- return (parseAPIResponseStream(SoapService.class, doBioCatalogueGET(soapServiceURL)));
- }
-
- public SoapOperation getBioCatalogueSoapOperation(String soapOperationURL) throws Exception {
- return (parseAPIResponseStream(SoapOperation.class, doBioCatalogueGET(soapOperationURL)));
- }
-
- public RestMethod getBioCatalogueRestMethod(String restMethodURL) throws Exception {
- return (parseAPIResponseStream(RestMethod.class, doBioCatalogueGET(restMethodURL)));
- }
-
- public Search getBioCatalogueSearchData(String searchURL) throws Exception {
- return (parseAPIResponseStream(Search.class, doBioCatalogueGET(searchURL)));
- }
-
- public Tag getBioCatalogueTag(String searchByTagURL) throws Exception {
- return (parseAPIResponseStream(Tag.class, doBioCatalogueGET(searchByTagURL)));
- }
-
- public Tags getBioCatalogueTags(String tagsURL) throws Exception {
- return (parseAPIResponseStream(Tags.class, doBioCatalogueGET(tagsURL)));
- }
-
-
- public ResourceLink getBioCatalogueResource(Class<? extends ResourceLink> classOfResourceToFetch, String resourceURL) throws Exception {
- return (parseAPIResponseStream(classOfResourceToFetch, doBioCatalogueGET(resourceURL)));
- }
-
-
- public <T extends ResourceLink> Pair<CollectionCoreStatistics, List<T>> getListOfItemsFromResourceCollectionIndex(
- Class<T> classOfCollectionOfRequiredReturnedObjects, BioCatalogueAPIRequest filteringRequest) throws Exception
- {
- ResourceLink matchingItems = null;
- if (filteringRequest.getRequestType() == BioCatalogueAPIRequest.TYPE.GET) {
- matchingItems = parseAPIResponseStream(classOfCollectionOfRequiredReturnedObjects, doBioCatalogueGET(filteringRequest.getURL()));
- }
- else {
- matchingItems = parseAPIResponseStream(classOfCollectionOfRequiredReturnedObjects,
- doBioCataloguePOST_SendJSON_AcceptXML(filteringRequest.getURL(), filteringRequest.getData()));
- }
-
- CollectionCoreStatistics statistics = null;
-
- List<T> matchingItemList = new ArrayList<T>();
-
- // SOAP Operations
- if (classOfCollectionOfRequiredReturnedObjects.equals(SoapOperations.class)) {
- SoapOperations soapOperations = (SoapOperations)matchingItems;
- matchingItemList.addAll((Collection<? extends T>)(soapOperations.getResults().getSoapOperationList()));
- statistics = soapOperations.getStatistics();
- }
-
- // REST Methods
- else if (classOfCollectionOfRequiredReturnedObjects.equals(RestMethods.class)) {
- RestMethods restMethods = (RestMethods)matchingItems;
- matchingItemList.addAll((Collection<? extends T>)(restMethods.getResults().getRestMethodList()));
- statistics = restMethods.getStatistics();
- }
-
- // Services
- else if (classOfCollectionOfRequiredReturnedObjects.equals(Services.class)) {
- Services services = (Services)matchingItems;
- matchingItemList.addAll((Collection<? extends T>)(services.getResults().getServiceList()));
- statistics = services.getStatistics();
- }
-
- // Service Providers
- else if (classOfCollectionOfRequiredReturnedObjects.equals(ServiceProviders.class)) {
- ServiceProviders serviceProviders = (ServiceProviders)matchingItems;
- matchingItemList.addAll((Collection<? extends T>)(serviceProviders.getResults().getServiceProviderList()));
- statistics = serviceProviders.getStatistics();
- }
-
- // Users
- else if (classOfCollectionOfRequiredReturnedObjects.equals(Users.class)) {
- Users users = (Users)matchingItems;
- matchingItemList.addAll((Collection<? extends T>)(users.getResults().getUserList()));
- statistics = users.getStatistics();
- }
-
- // no such option - error
- else {
- return null;
- }
-
- return new Pair<CollectionCoreStatistics, List<T>>(statistics, matchingItemList);
- }
-
-
-
-
- /**
- * @param wsdlLocation
- * @param operationName
- * @return SoapOperation instance or <code>null</code> if nothing was found (or error occurred).
- * @throws Exception
- */
- public SoapOperation lookupSoapOperation(SoapOperationIdentity soapOperationDetails) throws Exception
- {
- // first of all check for any problems with input data
- if (soapOperationDetails == null || soapOperationDetails.hasError() ||
- soapOperationDetails.getWsdlLocation() == null || soapOperationDetails.getWsdlLocation().length() == 0 ||
- soapOperationDetails.getOperationName() == null || soapOperationDetails.getOperationName().length() == 0)
- {
- // something's not right - return null
- return (null);
- }
-
- String lookupURL = Util.appendURLParameter(API_LOOKUP_URL, API_LOOKUP_WSDL_LOCATION_PARAMETER, soapOperationDetails.getWsdlLocation());
- lookupURL = Util.appendURLParameter(lookupURL, API_LOOKUP_OPERATION_NAME_PARAMETER, soapOperationDetails.getOperationName());
-
- ServerResponseStream lookupResponse = doBioCatalogueGET(lookupURL);
- if (lookupResponse.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
- return null;
- }
- return (parseAPIResponseStream(SoapOperation.class, lookupResponse));
- }
-
-
- public <T extends ResourceLink> T lookupSoapOperationPort(Class<T> requiredResultClass, SoapOperationPortIdentity portDetails) throws Exception
- {
- // first of all check for any problems with port details
- if (portDetails == null || portDetails.hasError() ||
- portDetails.getWsdlLocation() == null || portDetails.getWsdlLocation().length() == 0 ||
- portDetails.getOperationName() == null || portDetails.getOperationName().length() == 0 ||
- portDetails.getPortName() == null || portDetails.getPortName().length() == 0)
- {
- // something's not right - return null
- return (null);
- }
-
- // now check that specified class matches the port type
- if (portDetails.isInput() && !requiredResultClass.equals(SoapInput.class) ||
- !portDetails.isInput() && !requiredResultClass.equals(SoapOutput.class))
- {
- return (null);
- }
-
- String lookupURL = Util.appendURLParameter(API_LOOKUP_URL, API_LOOKUP_WSDL_LOCATION_PARAMETER, portDetails.getWsdlLocation());
- lookupURL = Util.appendURLParameter(lookupURL, API_LOOKUP_OPERATION_NAME_PARAMETER, portDetails.getOperationName());
- if (portDetails.isInput()) {
- lookupURL = Util.appendURLParameter(lookupURL, API_LOOKUP_SOAP_INPUT_NAME_PARAMETER, portDetails.getPortName());
- }
- else {
- lookupURL = Util.appendURLParameter(lookupURL, API_LOOKUP_SOAP_OUTPUT_NAME_PARAMETER, portDetails.getPortName());
- }
-
- ServerResponseStream lookupResponse = doBioCatalogueGET(lookupURL);
- if (lookupResponse.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
- return null;
- }
- return (parseAPIResponseStream(requiredResultClass, lookupResponse));
- }
-
-
- public Service lookupParentService(SoapOperationIdentity soapOperationDetails) throws Exception
- {
- SoapOperation soapOperation = this.lookupSoapOperation(soapOperationDetails);
- if (soapOperation != null) {
- return (getBioCatalogueService(soapOperation.getAncestors().getService().getHref()));
- }
- else {
- // lookup didn't find the SOAP operation or there
- // was some problem with the input data
- return (null);
- }
- }
-
-
- public Service lookupParentServiceMonitoringData(SoapOperationIdentity soapOperationDetails) throws Exception
- {
- SoapOperation soapOperation = this.lookupSoapOperation(soapOperationDetails);
- if (soapOperation != null) {
- return (getBioCatalogueServiceMonitoringData(soapOperation.getAncestors().getService().getHref()));
- }
- else {
- // lookup didn't find the SOAP operation or there
- // was some problem with the input data
- return (null);
- }
- }
-
-
- // ************ METHODS FOR RETRIEVAL OF SPECIALISED OBJECT FROM THE API VIA LITE JSON ************
-
- public BeansForJSONLiteAPI.ResourceIndex getBioCatalogueResourceLiteIndex(TYPE resourceType, String resourceIndexURL) throws Exception
- {
- ServerResponseStream response = doBioCatalogueGET_LITE_JSON(resourceIndexURL);
-
- Gson gson = new Gson();
- return (ResourceIndex)(gson.fromJson(new InputStreamReader(response.getResponseStream()), resourceType.getJsonLiteAPIBindingBeanClass()));
- }
-
-
- public BeansForJSONLiteAPI.ResourceIndex postBioCatalogueResourceLiteIndex(TYPE resourceType, String resourceIndexURL, String postData) throws Exception
- {
- ServerResponseStream response = doBioCataloguePOST_SendJSON_AcceptLITEJSON(resourceIndexURL, postData);
-
- Gson gson = new Gson();
- return (ResourceIndex)(gson.fromJson(new InputStreamReader(response.getResponseStream()), resourceType.getJsonLiteAPIBindingBeanClass()));
- }
-
-
- // ************ GENERIC API CONNECTIVITY METHODS ************
-
- /**
- * Generic method to issue GET requests to BioCatalogue server.
- *
- * This is a convenience method to be used instead of {@link BioCatalogueClient#doBioCatalogueGET_XML(String)}.
- *
- * @param strURL The URL on BioCatalogue to issue GET request to.
- * @return TODO
- * @throws Exception
- */
- public ServerResponseStream doBioCatalogueGET(String strURL) throws Exception {
- return (doBioCatalogueGET_XML(strURL));
- }
-
- public ServerResponseStream doBioCatalogueGET_XML(String strURL) throws Exception {
- return (doBioCatalogueGET(strURL, XML_MIME_TYPE, XML_DATA_FORMAT));
- }
-
- public ServerResponseStream doBioCatalogueGET_JSON(String strURL) throws Exception {
- return (doBioCatalogueGET(strURL, JSON_MIME_TYPE, JSON_DATA_FORMAT));
- }
-
- public ServerResponseStream doBioCatalogueGET_LITE_JSON(String strURL) throws Exception {
- return (doBioCatalogueGET(strURL, LITE_JSON_MIME_TYPE, LITE_JSON_DATA_FORMAT));
- }
-
-
- public ServerResponseStream doBioCatalogueGET(String strURL, String ACCEPT_HEADER, String REQUESTED_DATA_FORMAT) throws Exception
- {
- // TODO - HACK to speed up processing append .xml / .json / .bljson to all URLs to avoid LinkedData content negotiation
- strURL = Util.appendStringBeforeParametersOfURL(strURL, REQUESTED_DATA_FORMAT);
-
- // open server connection using provided URL (with no further modifications to it)
- URL url = new URL(strURL);
-
- Calendar requestStartedAt = Calendar.getInstance();
- HttpURLConnection conn = (HttpURLConnection) url.openConnection();
- conn.setRequestProperty("User-Agent", PLUGIN_USER_AGENT);
- conn.setRequestProperty("Accept", ACCEPT_HEADER);
-
-// if(LOGGED_IN) {
-// // if the user has "logged in", also add authentication details
-// conn.setRequestProperty("Authorization", "Basic " + AUTH_STRING);
-// }
-
- // fetch server's response
- ServerResponseStream serverResponse = doBioCatalogueReceiveServerResponse(conn, strURL, true);
-
- if (BioCataloguePluginConstants.PERFORM_API_RESPONSE_TIME_LOGGING) {
- logAPIOperation(requestStartedAt, "GET", serverResponse);
- }
- return (serverResponse);
- }
-
-
-
- public ServerResponseStream doBioCataloguePOST_SendJSON_AcceptXML(String strURL, String strDataBody) throws Exception {
- return (doBioCataloguePOST(strURL, strDataBody, JSON_MIME_TYPE, XML_MIME_TYPE, XML_DATA_FORMAT));
- }
-
- public ServerResponseStream doBioCataloguePOST_SendJSON_AcceptLITEJSON(String strURL, String strDataBody) throws Exception {
- return (doBioCataloguePOST(strURL, strDataBody, JSON_MIME_TYPE, LITE_JSON_MIME_TYPE, LITE_JSON_DATA_FORMAT));
- }
-
-
- /**
- * Generic method to execute POST requests to BioCatalogue server.
- *
- * @param strURL The URL on BioCatalogue to POST to.
- * @param strDataBody Body of the message to be POSTed to <code>strURL</code>.
- * @return An object containing server's response body as an InputStream and
- * a response code.
- * @param CONTENT_TYPE_HEADER MIME type of the sent data.
- * @param ACCEPT_HEADER MIME type of the data to be received.
- * @param REQUESTED_DATA_FORMAT
- * @throws Exception
- */
- public ServerResponseStream doBioCataloguePOST(String strURL, String strDataBody, String CONTENT_TYPE_HEADER,
- String ACCEPT_HEADER, String REQUESTED_DATA_FORMAT) throws Exception
- {
- // TODO - HACK to speed up processing append .xml / .json / .bljson to all URLs to avoid LinkedData content negotiation
- strURL = Util.appendStringBeforeParametersOfURL(strURL, REQUESTED_DATA_FORMAT);
-
- // open server connection using provided URL (with no further modifications to it)
- URL url = new URL (strURL);
-
- Calendar requestStartedAt = Calendar.getInstance();
- HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
- urlConn.setRequestMethod("POST");
- urlConn.setDoOutput(true);
- urlConn.setRequestProperty("User-Agent", PLUGIN_USER_AGENT);
- urlConn.setRequestProperty("Content-Type", CONTENT_TYPE_HEADER);
- urlConn.setRequestProperty("Accept", ACCEPT_HEADER);
-
- // prepare and POST XML data
- OutputStreamWriter out = new OutputStreamWriter(urlConn.getOutputStream());
- out.write(strDataBody);
- out.close();
-
-
- // fetch server's response
- ServerResponseStream serverResponse = doBioCatalogueReceiveServerResponse(urlConn, strURL, false);
-
- if (BioCataloguePluginConstants.PERFORM_API_RESPONSE_TIME_LOGGING) {
- logAPIOperation(requestStartedAt, "POST", serverResponse);
- }
- return (serverResponse);
- }
-
-
- /**
- * Generic method to execute DELETE requests to myExperiment server.
- * This is only to be called when a user is logged in.
- *
- * @param strURL The URL on myExperiment to direct DELETE request to.
- * @return An object containing XML Document with server's response body and
- * a response code. Response body XML document might be null if there
- * was an error or the user wasn't authorised to perform a certain action.
- * Response code will always be set.
- * @throws Exception
- */
- /*public ServerResponse doMyExperimentDELETE(String strURL) throws Exception
- {
- // open server connection using provided URL (with no modifications to it)
- URL url = new URL(strURL);
- HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-
- // "tune" the connection
- conn.setRequestMethod("DELETE");
- conn.setRequestProperty("User-Agent", PLUGIN_USER_AGENT);
- conn.setRequestProperty("Authorization", "Basic " + AUTH_STRING);
-
- // check server's response
- return (doMyExperimentReceiveServerResponse(conn, strURL, true));
- }*/
-
-
- /**
- * A common method for retrieving BioCatalogue server's response for both
- * GET and POST requests.
- *
- * @param conn Instance of the established URL connection to poll for server's response.
- * @param strURL The URL on BioCatalogue with which the connection is established.
- * @param bIsGetRequest Flag for identifying type of the request. True when the current
- * connection executes GET request; false when it executes a POST / DELETE request.
- * @return TODO
- */
- @SuppressWarnings("unchecked")
- private ServerResponseStream doBioCatalogueReceiveServerResponse(HttpURLConnection conn, String strURL, boolean bIsGETRequest) throws Exception
- {
- int iResponseCode = conn.getResponseCode();
-
- switch (iResponseCode)
- {
- case HttpURLConnection.HTTP_OK:
- // regular operation path - simply return the reference to the data input stream
- return (new ServerResponseStream(iResponseCode, conn.getInputStream(), strURL));
-
- case HttpURLConnection.HTTP_BAD_REQUEST:
- // this was a bad XML request - need full XML response to retrieve the error message from it;
- // Java throws IOException if getInputStream() is used when non HTTP_OK response code was received -
- // hence can use getErrorStream() straight away to fetch the error document
- return (new ServerResponseStream(iResponseCode, conn.getErrorStream(), strURL));
-
- case HttpURLConnection.HTTP_UNAUTHORIZED:
- // this content is not authorised for current user
- return (new ServerResponseStream(iResponseCode, null, strURL));
-
- case HttpURLConnection.HTTP_NOT_FOUND:
- // nothing was found at the provided URL
- return (new ServerResponseStream(iResponseCode, conn.getErrorStream(), strURL));
-
- default:
- // unexpected response code - raise an exception
- throw new IOException("Received unexpected HTTP response code (" + iResponseCode + ") while " +
- (bIsGETRequest ? "fetching data at " : "posting data to ") + strURL);
- }
- }
-
-
- /**
- * This method is here to make sure that *all* parsing of received input stream data
- * from the API is parsed ("bound") into Java objects in a central place - so it's
- * possible to measure performance of XmlBeans for various inputs.
- *
- * NB! There is a serious limitation in Java's generics. Generic methods cannot
- * access any of the static context of the classes of type parameters, because
- * it wasn't designed for this. The only purpose of type parameters is compile-time
- * type-checking.
- * This means that even though all classes that could potentially be supplied as a
- * type-parameter would have certain static functionality, it's not possible to access
- * that through using the type-parameter like it's done in normal polymorhic situations.
- * Therefore, some switching based on the class of the type-parameter for this method is
- * done...
- *
- * @param <T>
- * @param classOfRequiredReturnedObject Class of the object that the caller expects to receive
- * after parsing provided server's response. For example,
- * a call to /tags.xml return the <pre>[tags]...[/tags]</pre>
- * document. <code>TagsDocument</code> should be used to access
- * its static factory and parse the input stream - the return
- * value will have type <code>Tags</code> -- <code>Tags.class</code>
- * is the required input value for this parameter in this situation then.
- * @param serverResponse This object should contain the input stream obtained from the API in return
- * to the call on some URL.
- * @return InputStream data parsed into the Java object of the supplied type [T].
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- private <T extends ResourceLink> T parseAPIResponseStream(Class<T> classOfRequiredReturnedObject, ServerResponseStream serverResponse) throws Exception
- {
- T parsedObject = null;
- InputStream xmlInputStream = serverResponse.getResponseStream();
-
- // choose a factory to parse the response and perform parsing
- Calendar parsingStartedAt = Calendar.getInstance();
- if (classOfRequiredReturnedObject.equals(Annotations.class)) {
- parsedObject = (T)AnnotationsDocument.Factory.parse(xmlInputStream).getAnnotations();
- }
- else if (classOfRequiredReturnedObject.equals(Filters.class)) {
- parsedObject = (T)FiltersDocument.Factory.parse(xmlInputStream).getFilters();
- }
- else if (classOfRequiredReturnedObject.equals(RestMethods.class)) {
- parsedObject = (T)RestMethodsDocument.Factory.parse(xmlInputStream).getRestMethods();
- }
- else if (classOfRequiredReturnedObject.equals(RestMethod.class)) {
- parsedObject = (T)RestMethodDocument.Factory.parse(xmlInputStream).getRestMethod();
- }
- else if (classOfRequiredReturnedObject.equals(Search.class)) {
- parsedObject = (T)SearchDocument.Factory.parse(xmlInputStream).getSearch();
- }
- else if (classOfRequiredReturnedObject.equals(Services.class)) {
- parsedObject = (T)ServicesDocument.Factory.parse(xmlInputStream).getServices();
- }
- else if (classOfRequiredReturnedObject.equals(Service.class)) {
- parsedObject = (T)ServiceDocument.Factory.parse(xmlInputStream).getService();
- }
- else if (classOfRequiredReturnedObject.equals(ServiceProviders.class)) {
- parsedObject = (T)ServiceProvidersDocument.Factory.parse(xmlInputStream).getServiceProviders();
- }
- else if (classOfRequiredReturnedObject.equals(ServiceProvider.class)) {
- parsedObject = (T)ServiceProviderDocument.Factory.parse(xmlInputStream).getServiceProvider();
- }
- else if (classOfRequiredReturnedObject.equals(SoapOperations.class)) {
- parsedObject = (T)SoapOperationsDocument.Factory.parse(xmlInputStream).getSoapOperations();
- }
- else if (classOfRequiredReturnedObject.equals(SoapOperation.class)) {
- parsedObject = (T)SoapOperationDocument.Factory.parse(xmlInputStream).getSoapOperation();
- }
- else if (classOfRequiredReturnedObject.equals(SoapService.class)) {
- parsedObject = (T)SoapServiceDocument.Factory.parse(xmlInputStream).getSoapService();
- }
- else if (classOfRequiredReturnedObject.equals(SoapInput.class)) {
- parsedObject = (T)SoapInputDocument.Factory.parse(xmlInputStream).getSoapInput();
- }
- else if (classOfRequiredReturnedObject.equals(SoapOutput.class)) {
- parsedObject = (T)SoapOutputDocument.Factory.parse(xmlInputStream).getSoapOutput();
- }
- else if (classOfRequiredReturnedObject.equals(Tags.class)) {
- parsedObject = (T)TagsDocument.Factory.parse(xmlInputStream).getTags();
- }
- else if (classOfRequiredReturnedObject.equals(Tag.class)) {
- parsedObject = (T)TagDocument.Factory.parse(xmlInputStream).getTag();
- }
- else if (classOfRequiredReturnedObject.equals(Users.class)) {
- parsedObject = (T)UsersDocument.Factory.parse(xmlInputStream).getUsers();
- }
- else if (classOfRequiredReturnedObject.equals(User.class)) {
- parsedObject = (T)UserDocument.Factory.parse(xmlInputStream).getUser();
- }
-
-
- // log the operation if necessary
- if (BioCataloguePluginConstants.PERFORM_API_XML_DATA_BINDING_TIME_LOGGING) {
- logAPIOperation(parsingStartedAt, null, serverResponse);
- }
-
- return (parsedObject);
- }
-
-
- // ************ HELPERS ************
-
- public static DateFormat getDateFormatter() {
- return(BioCatalogueClient.DATE_FORMATTER);
- }
-
- public static DateFormat getShortDateFormatter() {
- return(BioCatalogueClient.SHORT_DATE_FORMATTER);
- }
-
-
- /**
- * This is a helper to facilitate performance monitoring of the API usage.
- *
- * @param opearationStartedAt Instance of Calendar initialised with the date/time value of
- * when the logged operation was started.
- * @param requestType "GET" or "POST" to indicate that this was the actual URL connection with the BioCatalogue server
- * to fetch some data; <code>null</code> to indicate an xml-binding operation using XmlBeans.
- * @param serverResponse Will be used to extract the request URL.
- */
- private void logAPIOperation(Calendar opearationStartedAt, String requestType, ServerResponseStream serverResponse)
- {
- // just in case check that the writer was initialised
- if (pwAPILogWriter != null) {
- pwAPILogWriter.println(API_LOGGING_TIMESTAMP_FORMATTER.format(opearationStartedAt.getTime()) + ", " +
- (System.currentTimeMillis() - opearationStartedAt.getTimeInMillis()) + ", " +
- (requestType == null ? "xml_parsing" : requestType) + ", " +
- serverResponse.getRequestURL());
- }
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/ServerResponse.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/ServerResponse.java
deleted file mode 100644
index 32cd2fe..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/ServerResponse.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.apache.taverna.biocatalogue.model.connectivity;
-/*
- * 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.
- */
-
-import org.apache.taverna.biocatalogue.model.Util;
-
-/**
- * @author Sergejs Aleksejevs
- */
-public abstract class ServerResponse
-{
- // this code is to be used when a local failure is encountered and the
- // server response is a blank / invalid one
- public static int LOCAL_FAILURE_CODE = -1;
-
- // server response code - in theory should correspond to HTTP response codes
- private int iResponseCode;
-
- // URL that was used to make the request
- private String requestURL;
-
-
- public ServerResponse() {
- // do nothing - empty constructor
- }
-
- public ServerResponse(int responseCode, String requestURL) {
- super();
- this.iResponseCode = responseCode;
- this.requestURL = Util.urlDecodeQuery(requestURL);
- }
-
-
- public int getResponseCode() {
- return (this.iResponseCode);
- }
-
- public String getRequestURL() {
- return requestURL;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/ServerResponseStream.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/ServerResponseStream.java
deleted file mode 100644
index eb30e35..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/connectivity/ServerResponseStream.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.apache.taverna.biocatalogue.model.connectivity;
-/*
- * 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.
- */
-
-import java.io.InputStream;
-
-/**
- * This class is a custom version of ServerResponse which contains the
- * InputStream with the the actual server response data.
- *
- * @author Sergejs Aleksejevs
- */
-public class ServerResponseStream extends ServerResponse
-{
- private InputStream responseStream;
-
- public ServerResponseStream(int responseCode, InputStream serverResponseStream, String requestURL)
- {
- super(responseCode, requestURL);
- this.setResponseStream(serverResponseStream);
- }
-
- public void setResponseStream(InputStream responseStream)
- {
- this.responseStream = responseStream;
- }
-
- public InputStream getResponseStream()
- {
- return responseStream;
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchEngine.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchEngine.java
deleted file mode 100644
index 4eed1f0..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchEngine.java
+++ /dev/null
@@ -1,237 +0,0 @@
-package org.apache.taverna.biocatalogue.model.search;
-/*
- * 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.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-
-//import javax.annotation.Resource;
-
-import org.apache.log4j.Logger;
-import org.biocatalogue.x2009.xml.rest.CollectionCoreStatistics;
-import org.biocatalogue.x2009.xml.rest.ResourceLink;
-
-import com.google.gson.Gson;
-
-import org.apache.taverna.biocatalogue.model.Pair;
-import org.apache.taverna.biocatalogue.model.Tag;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.biocatalogue.model.connectivity.BeanForPOSTToFilteredIndex;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueAPIRequest;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.biocatalogue.model.connectivity.BeansForJSONLiteAPI.ResourceIndex;
-import org.apache.taverna.biocatalogue.model.search.SearchInstance.TYPE;
-import org.apache.taverna.biocatalogue.ui.search_results.SearchResultsRenderer;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-
-import org.apache.taverna.biocatalogue.model.Resource;
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class SearchEngine
-{
- private static Logger logger = Logger.getLogger(SearchEngine.class);
-
- protected SearchInstance searchInstance;
- protected final BioCatalogueClient client;
- protected final SearchInstanceTracker activeSearchInstanceTracker;
- protected final CountDownLatch doneSignal;
- protected final SearchResultsRenderer renderer;
-
-
- public SearchEngine(SearchInstance searchInstance,
- SearchInstanceTracker activeSearchInstanceTracker,
- CountDownLatch doneSignal,
- SearchResultsRenderer renderer)
- {
-
- this.searchInstance = searchInstance;
- this.client = BioCatalogueClient.getInstance();
- this.activeSearchInstanceTracker = activeSearchInstanceTracker;
- this.doneSignal = doneSignal;
- this.renderer = renderer;
- }
-
-
-
- /**
- * @return <code>true</code> if the thread launched by this search engine is still
- * the one treated as 'active' in the context of the user actions in the plugin;<br/>
- * <code>false</code> - otherwise.
- */
- protected boolean isCurrentSearch() {
- return (activeSearchInstanceTracker.isCurrentSearchInstance(
- this.searchInstance.getResourceTypeToSearchFor(), searchInstance));
- }
-
-
-
- /**
- * Primary API request is the one that is *generated* when the search is first executed --
- * for further requests (like fetching more data) it won't be fully generated, but rather
- * will be derived from this primary one.
- */
- protected BioCatalogueAPIRequest generateSearchRequest() {
- return (generateSearchRequest(searchInstance.getSearchType()));
- }
-
- protected BioCatalogueAPIRequest generateSearchRequest(TYPE searchType)
- {
- // construct search request to execute on BioCatalogue server
- BioCatalogueAPIRequest.TYPE requestType = BioCatalogueAPIRequest.TYPE.GET;
- String requestURL = null;
- String requestData = null;
-
- switch (searchType) {
- case QuerySearch:
- requestURL = Util.appendURLParameter(searchInstance.getResourceTypeToSearchFor().getAPIResourceCollectionIndex(), "q", searchInstance.getSearchString());
- break;
-
- case TagSearch:
- List<String> tags = new ArrayList<String>();
- for (Tag t : searchInstance.getSearchTags()) {
- tags.add(t.getFullTagName());
- }
- String tagParamValue = Util.join(tags, "[", "]", ",");
- requestURL = Util.appendURLParameter(searchInstance.getResourceTypeToSearchFor().getAPIResourceCollectionIndex(), "tag", tagParamValue);
- break;
-
- case Filtering:
- requestType = BioCatalogueAPIRequest.TYPE.POST;
-
- // get search URL for the 'base' search upon which the filtering is based
- requestURL = generateSearchRequest(searchInstance.getServiceFilteringBasedOn()).getURL();
- requestURL = Util.appendStringBeforeParametersOfURL(requestURL, BioCatalogueClient.API_FILTERED_INDEX_SUFFIX, true);
-
- // the base URL was prepared, now prepare filtering parameters as POST data
- BeanForPOSTToFilteredIndex dataBean = new BeanForPOSTToFilteredIndex();
- dataBean.filters = searchInstance.getFilteringSettings().getFilteringURLParameters();
- Gson gson = new Gson();
- requestData = gson.toJson(dataBean);
- break;
- }
-
- // make sure that the URL was generated
- if (requestURL == null) {
- logger.error("Primary search URL couldn't be generated; Search engine must have encountered " +
- "an unexpected search instance type: " + searchInstance.getSearchType());
- return (null);
- }
-
- // Sort by name (for REST and SOAP only at the moment. Parent Web services do not have the sort by name facility yet.)
-// if (!searchInstance.getResourceTypeToSearchFor().equals(net.sf.taverna.biocatalogue.model.Resource.TYPE.Service)){
- requestURL = Util.appendURLParameter(requestURL, "sort_by", "name");
- requestURL = Util.appendURLParameter(requestURL, "sort_order", "asc");
- requestURL = Util.appendURLParameter(requestURL, "include", "ancestors");
-// }
- logger.info("Service Catalogue Plugin: Request URL for search: " + requestURL);
-
- // append some search-type-independent parameters and return the URL
- requestURL = Util.appendAllURLParameters(requestURL, searchInstance.getResourceTypeToSearchFor().getAPIResourceCollectionIndexAdditionalParameters());
- return (new BioCatalogueAPIRequest(requestType, requestURL, requestData));
- }
-
-
-
- public void startNewSearch()
- {
- // construct API request for this search
- BioCatalogueAPIRequest searchRequest = generateSearchRequest();
-
- // perform the actual search operation
- try
- {
- ResourceIndex resourceIndex = null;
- if (searchRequest.getRequestType() == BioCatalogueAPIRequest.TYPE.GET) {
- resourceIndex = client.getBioCatalogueResourceLiteIndex(searchInstance.getResourceTypeToSearchFor(), searchRequest.getURL());
- }
- else {
- // can only be POST then!
- resourceIndex = client.postBioCatalogueResourceLiteIndex(searchInstance.getResourceTypeToSearchFor(), searchRequest.getURL(), searchRequest.getData());
- }
- SearchResults searchResults = new SearchResults(searchInstance.getResourceTypeToSearchFor(), resourceIndex);
-
- // only update search results of the associated search instance if the caller thread of
- // this operation is still active - synchronisation helps to make sure that the results
- // will definitely only be rendered if the current search instance is definitely active:
- // this way searches finishing in quick succession will 'flash' the results for a short
- // while before being updated, but that will happen in the correct order
- synchronized (activeSearchInstanceTracker) {
- if (isCurrentSearch()) {
- searchInstance.setSearchResults(searchResults);
- renderer.renderInitialResults(searchInstance);
- }
- }
- }
- catch (Exception e) {
- logger.error("ERROR: Couldn't execute initial phase of a search by query, details below:", e);
- }
-
- // no matter if search was completed or interrupted by a new search, notify the caller // FIXME - is this needed?
- searchCompleteNotifyCaller();
- }
-
-
- @SuppressWarnings("unchecked")
- public void fetchMoreResults(int resultPageNumber)
- {
- if (resultPageNumber < 1 || resultPageNumber > searchInstance.getSearchResults().getTotalResultPageNumber()) {
- logger.error("Prevented attempt to fetch an invalid result page: " + resultPageNumber + ". Returning...");
- return;
- }
-
- // construct search URL to hit on BioCatalogue server --
- // it is exactly as the one for the initial search, but with a page number
- // parameter being added
- BioCatalogueAPIRequest searchRequest = generateSearchRequest();
- searchRequest.setURL(Util.appendURLParameter(searchRequest.getURL(), BioCatalogueClient.API_PAGE_PARAMETER, ""+resultPageNumber));
-
- // fetch required result page
- try
- {
- Pair<CollectionCoreStatistics,List<ResourceLink>> newResultBatch = client.getListOfItemsFromResourceCollectionIndex(
- searchInstance.getResourceTypeToSearchFor().getXmlBeansGeneratedCollectionClass(), searchRequest);
-
- int firstNewEntryIndex = searchInstance.getSearchResults().getFirstItemIndexOn(resultPageNumber);
- searchInstance.getSearchResults().addSearchResults(newResultBatch.getSecondObject(), firstNewEntryIndex);
-
- // only update search results of the associated search instance if the caller thread of
- // this operation is still active
- if (isCurrentSearch()) {
- renderer.renderFurtherResults(searchInstance, firstNewEntryIndex, searchInstance.getResourceTypeToSearchFor().getApiResourceCountPerIndexPage());
- }
- }
- catch (Exception e) {
- // FIXME
- }
-
-
- // no matter if search was completed or interrupted by a new search, notify the caller // FIXME - is this needed?
- searchCompleteNotifyCaller();
- }
-
-
- /**
- * This method is used for notifying the object that has started the
- * search of this particular search operation being complete.
- */
- protected void searchCompleteNotifyCaller() {
- this.doneSignal.countDown();
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchInstance.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchInstance.java
deleted file mode 100644
index ac4f8b6..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchInstance.java
+++ /dev/null
@@ -1,506 +0,0 @@
-package org.apache.taverna.biocatalogue.model.search;
-/*
- * 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.
- */
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-
-import javax.swing.Icon;
-
-import org.apache.taverna.biocatalogue.model.Resource;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.Tag;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.biocatalogue.ui.search_results.SearchResultsRenderer;
-
-
-/**
- * Class to hold settings for search instance. Objects of this type will
- * be used to re-run a search instance at a later time -- or to apply
- * filtering onto a previously executed search.
- *
- * @author Sergejs Aleksejevs
- */
-public class SearchInstance implements Comparable<SearchInstance>, Serializable
-{
- private static final long serialVersionUID = -5236966374301885370L;
-
- // CONSTANTS
- public static enum TYPE
- {
- QuerySearch(ResourceManager.getImageIcon(ResourceManager.SEARCH_ICON)),
- TagSearch(ResourceManager.getImageIcon(ResourceManager.TAG_ICON)),
- Filtering(ResourceManager.getImageIcon(ResourceManager.FILTER_ICON));
-
- private Icon icon;
-
- /**
- * @param icon Icon to represent search instances in different listings
- * - for example in search history.
- */
- TYPE(Icon icon) {
- this.icon = icon;
- }
-
- /**
- * @return An icon that is most suitable to display search instance of this type in a UI component.
- */
- public Icon getIcon() {
- return this.icon;
- }
- }
-
-
-
- // SEARCH SETTINGS - for either search by query or search by tag
- private TYPE searchType;
- private final TYPE serviceFilteringBasedOn; // service filtering may be based on {@link TYPE.QuerySearch} or {@link TYPE.TagSearch}
- private final Resource.TYPE resourceTypeToSearchFor;
-
- private final String searchString;
- private final List<Tag> searchTags;
-
-
- // SERVICE FILTERING settings
- private ServiceFilteringSettings filteringSettings;
-
- // SEARCH RESULTS
- private transient SearchResults searchResults; // don't want to store search results when serialising...
-
-
-
- /**
- * Constructs a query search instance for finding instance of a specific resource type.
- *
- * @param searchString
- * @param resourceTypeToSearchFor
- */
- public SearchInstance(String searchString, Resource.TYPE resourceTypeToSearchFor)
- {
- this.searchType = TYPE.QuerySearch;
- this.serviceFilteringBasedOn = null;
-
- this.resourceTypeToSearchFor = resourceTypeToSearchFor;
-
- this.searchString = searchString;
- this.searchTags = null;
- }
-
-
-
- /**
- * Constructing a search instance for finding instance of a specific resource type by a single tag.
- *
- * @param searchTag
- * @param resourceTypeToSearchFor
- */
- public SearchInstance(Tag searchTag, Resource.TYPE resourceTypeToSearchFor)
- {
- this.searchType = TYPE.TagSearch;
- this.serviceFilteringBasedOn = null;
-
- this.resourceTypeToSearchFor = resourceTypeToSearchFor;
-
- this.searchTags = Collections.singletonList(searchTag);
- this.searchString = null;
- }
-
-
- /**
- * Constructing a search instance for finding instance of a specific resource type by a list of tags.
- *
- * @param searchTags
- * @param resourceTypeToSearchFor
- */
- public SearchInstance(List<Tag> searchTags, Resource.TYPE resourceTypeToSearchFor)
- {
- this.searchType = TYPE.TagSearch;
- this.serviceFilteringBasedOn = null;
-
- this.resourceTypeToSearchFor = resourceTypeToSearchFor;
-
- this.searchTags = searchTags;
- this.searchString = null;
- }
-
-
-
- /**
- * Constructing service filtering search instance.
- *
- * @param si SearchInstance to base the current on.
- * Can be either {@link TYPE#TagSearch} or {@link TYPE#QuerySearch} type of SearchInstance.
- * @param filteringSettings Filtering settings associated with this search instance.
- */
- public SearchInstance(SearchInstance si, ServiceFilteringSettings filteringSettings) throws IllegalArgumentException
- {
- if (!si.isTagSearch() && !si.isQuerySearch()) {
- throw new IllegalArgumentException("Cannot create Service Filtering search instance - " +
- "supplied base search instance must be either QuerySearch or TagSearch");
- }
-
- this.searchType = TYPE.Filtering;
- this.serviceFilteringBasedOn = si.searchType;
-
- this.resourceTypeToSearchFor = si.resourceTypeToSearchFor;
-
- // this search instance inherits search term (i.e. search query or the tag) from the supplied search instance
- this.searchString = si.isQuerySearch() ? si.searchString : null;
- this.searchTags = si.isTagSearch() ? si.searchTags : null;
-
- // also, store the filtering settings that are to be applied to the newly
- // created search instance
- this.filteringSettings = filteringSettings;
- }
-
-
- /**
- * Determines whether the two search instances are identical.
- */
- // TODO - fix the equals() method
- public boolean equals(Object other)
- {
- if (other instanceof SearchInstance)
- {
- SearchInstance s = (SearchInstance)other;
-
- boolean bSearchTypesMatch = (this.searchType == s.getSearchType());
- if (bSearchTypesMatch) {
- switch (this.searchType) {
- case QuerySearch: bSearchTypesMatch = this.searchString.equals(s.getSearchString()); break;
-
- case TagSearch: bSearchTypesMatch = this.searchTags.equals(s.getSearchTags()); break;
-
- case Filtering: bSearchTypesMatch = this.serviceFilteringBasedOn == s.getServiceFilteringBasedOn();
- if (bSearchTypesMatch) {
- if (this.serviceFilteringBasedOn == TYPE.QuerySearch) {
- bSearchTypesMatch = this.searchString.equals(s.getSearchString());
- }
- else {
- bSearchTypesMatch = this.searchTags.equals(s.getSearchTags());
- }
- }
- if (bSearchTypesMatch) {
- if (this.filteringSettings != null) {
- bSearchTypesMatch = this.filteringSettings.equals(s.getFilteringSettings());
- }
- else if (s.filteringSettings != null) {
- // other isn't null, this one is - so 'false'
- bSearchTypesMatch = false;
- }
- else {
- // both could be null
- bSearchTypesMatch = (this.filteringSettings == s.getFilteringSettings());
- }
- }
- break;
- default: bSearchTypesMatch = false;
- }
- }
-
- return (bSearchTypesMatch &&
- /* TODO re-enable this when limits are implemented -- this.iResultCountLimit == s.getResultCountLimit() && */
- this.resourceTypeToSearchFor == s.getResourceTypeToSearchFor());
- }
- else
- return (false);
- }
-
-
- public int compareTo(SearchInstance other)
- {
- if (this.equals(other)) return(0);
- else
- {
- // this will return results in the descending order - which is
- // fine, because the way this collection will be rendered will
- // eventually traverse it from the rear end first; so results
- // will be shown alphabetically
- return (-1 * this.toString().compareTo(other.toString()));
- }
- }
-
-
- /**
- * See {@link SearchInstance#getDescriptionStringForSearchStatus(SearchInstance)}
- */
- public String getDescriptionStringForSearchStatus() {
- return (getDescriptionStringForSearchStatus(this));
- }
-
-
- /**
- * @param si {@link SearchInstance} for which the method is executed.
- * @return String that can be used as a description of the provided {@link SearchInstance}
- * in the search status label. Returned strings may look like: <br/>
- * - <code>empty search string</code><br/>
- * - <code>query "[search_query]"</code><br/>
- * - <code>tag "[search_tag]"</code><br/>
- * - <code>tags "[tag1]", "[tag2]", "[tag3]"</code><br/>
- * - <code>query "[search_query]" and X filter(s)</code><br/>
- * - <code>tag "[search_tag]" and X filter(s)</code><br/>
- * - <code>tags "[tag1]", "[tag2]", "[tag3]" and X filter(s)</code><br/>
- */
- public static String getDescriptionStringForSearchStatus(SearchInstance si)
- {
- switch (si.searchType)
- {
- case QuerySearch: String searchQuery = si.getSearchTerm();
- return (searchQuery.length() == 0 ?
- "empty search string" :
- "query " + si.getSearchTerm());
-
- case TagSearch: return (Util.pluraliseNoun("tag", si.getSearchTags().size()) + " " + si.getSearchTerm());
-
- case Filtering: int filterNumber = si.getFilteringSettings().getNumberOfFilteringCriteria();
-
- SearchInstance tempBaseSI = si.deepCopy();
- tempBaseSI.searchType = si.getServiceFilteringBasedOn();
- return getDescriptionStringForSearchStatus(tempBaseSI) + " and " + filterNumber + " " + Util.pluraliseNoun("filter", filterNumber);
-
- default: return ("unexpected type of search");
- }
- }
-
-
- public String toString()
- {
- String out = "<html>";
-
- if (this.isQuerySearch() || this.isTagSearch()) {
- out += (this.isTagSearch() ? "Tag s" : "S") + "earch: '" + getSearchTerm() + "' [" + this.detailsAsString() + "]";
- }
- else if (this.isServiceFilteringSearch()) {
- out += "Filter:<br>" +
- (getSearchTerm().length() > 0 ? ("- based on " + (this.isQuerySearch() ? "term" : "tag") + " '" + getSearchTerm() + "'<br>") : "") +
- "- scope: " + detailsAsString() + "<br>" +
- "- " + this.filteringSettings.detailsAsString();
- }
-
- out += "</html>";
-
- return (out);
- }
-
-
- /**
- * @return A string representation of search settings held in this object;
- * actual search value (string/tag) are ignored - this only affects
- * types to search and the number of objects to fetch.
- */
- public String detailsAsString()
- {
- // include the name of the resource type collection that is to be / was searched for
- String str = this.getResourceTypeToSearchFor().getCollectionName();
-
- // add the rest to the string representation of the search instance
- str = str /* TODO re-enable when limits are implemented -- "; limit: " + this.iResultCountLimit +*/;
-
- return (str);
- }
-
-
-
- // ***** Getters for all fields *****
-
- /**
- * @return Type of this search instance.
- */
- public TYPE getSearchType() {
- return (this.searchType);
- }
-
-
- /**
- * @return True if this search settings instance describes a search by tag.
- */
- public boolean isTagSearch() {
- return (this.searchType == TYPE.TagSearch);
- }
-
-
- /**
- * @return True if this search settings instance describes a search by query.
- */
- public boolean isQuerySearch() {
- return (this.searchType == TYPE.QuerySearch);
- }
-
-
- /**
- * @return True if this search settings instance describes service filtering operation.
- */
- public boolean isServiceFilteringSearch() {
- return (this.searchType == TYPE.Filtering);
- }
-
-
- /**
- * Allows to test which type of search this filtering operation is based on -- any filtering
- * operation can be:
- * <li>derived from an initial search by tag(s) or by free-text query</li>
- * <li>or can be just a standalone filtering operation, where filtering criteria are
- * applied to all resources of the specified type, without prior search.</li>
- *
- * @return Value {@link TYPE#QuerySearch} or {@link TYPE#TagSearch} if this filtering operation has a known "parent",<br/>
- * <code>null</code> if this is a proper search (not a filtering!) operation, or
- * if this filtering operation was not based on any search.
- */
- public TYPE getServiceFilteringBasedOn() {
- return serviceFilteringBasedOn;
- }
-
-
- public Resource.TYPE getResourceTypeToSearchFor() {
- return this.resourceTypeToSearchFor;
- }
-
-
- /**
- * @return Search string; only valid when SearchSettings object holds data about a search by query, not a tag search.
- */
- public String getSearchString() {
- return searchString;
- }
-
- public List<Tag> getSearchTags() {
- return searchTags;
- }
-
- /**
- * This method is to be used when the type of search is not checked - in
- * case of query search the method returns the search string, otherwise
- * the tag(s) that is to be searched.
- *
- * @return The value will be returned in double quotes.
- */
- public String getSearchTerm()
- {
- if (this.searchType == TYPE.QuerySearch || this.serviceFilteringBasedOn == TYPE.QuerySearch) {
- return (this.searchString.length() == 0 ?
- "" :
- "\"" + this.searchString + "\"");
- }
- else {
- List<String> tagDisplayNames = new ArrayList<String>();
- for (Tag t : this.searchTags) {
- tagDisplayNames.add(t.getTagDisplayName());
- }
- return (Util.join(tagDisplayNames, "\"", "\"", ", "));
- }
- }
-
-
- public ServiceFilteringSettings getFilteringSettings() {
- return filteringSettings;
- }
- public void setFilteringSettings(ServiceFilteringSettings filteringSettings) {
- this.filteringSettings = filteringSettings;
- }
-
-
- public SearchResults getSearchResults() {
- return searchResults;
- }
- public void setSearchResults(SearchResults searchResults) {
- this.searchResults = searchResults;
- }
-
- /**
- * @return True if search results are available;
- * False if no search results are available - probably search hasn't been carried out yet.
- */
- public boolean hasSearchResults() {
- return (searchResults != null);
- }
-
- /**
- * @return True if this is a new search; false otherwise.
- * (Search is currently treated as new if there are no search results available yet.)
- */
- public boolean isNewSearch() {
- return (!hasSearchResults());
- }
-
- /**
- * Removes any previous search results; after execution of
- * this method this search instance is treated as "new search".
- */
- public void clearSearchResults() {
- this.searchResults = null;
- }
-
-
-
-
- // *** Methods that call SearchEngine in order to start new / resume result fetching for a previous search ***
- //
- // They are used to relay external calls to these methods to the underlying instance
- // of SearchEngine which will perform the actual search operations for this search instance.
-
- /**
- * @param activeSearchInstanceTracker Tracker of current search instances for different resource types -
- * aids in early termination of older searches.
- * @param doneSignal Means of notifying the parentSeachThread of completing the requested search operation.
- * The parent thread will block until doneSignal is activated.
- * @param renderer {@link SearchResultsRenderer} that will render results of this search.
- */
- public void startNewSearch(SearchInstanceTracker activeSearchInstanceTracker,
- CountDownLatch doneSignal, SearchResultsRenderer renderer)
- {
- new SearchEngine(this, activeSearchInstanceTracker, doneSignal, renderer).startNewSearch();
- }
-
-
- /**
- * @param activeSearchInstanceTracker Tracker of current search instances for different resource types -
- * aids in early termination of older searches.
- * @param doneSignal Means of notifying the parentSeachThread of completing the requested search operation.
- * The parent thread will block until doneSignal is activated.
- * @param renderer {@link SearchResultsRenderer} that will render results of this search.
- * @param resultPageNumber
- */
- public void fetchMoreResults(SearchInstanceTracker activeSearchInstanceTracker,
- CountDownLatch doneSignal, SearchResultsRenderer renderer, int resultPageNumber)
- {
- new SearchEngine(this, activeSearchInstanceTracker, doneSignal, renderer).fetchMoreResults(resultPageNumber);
- }
-
-
-
-
- /**
- * Used in the plugin, for example, to transfer search results from Search tab to
- * Filtering tab. This way both tabs will remain completely independent.
- *
- * @return Deep copy of this SearchInstance object. If deep copying doesn't succeed,
- * <code>null</code> is returned.
- */
- public SearchInstance deepCopy() {
- return (SearchInstance)Util.deepCopy(this);
- }
-
- public boolean isEmptySearch() {
- return ((searchString == null) || searchString.isEmpty()) &&
- ((searchTags == null) || searchTags.isEmpty()) &&
- ((filteringSettings == null) || (filteringSettings.getNumberOfFilteringCriteria() == 0));
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchInstanceTracker.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchInstanceTracker.java
deleted file mode 100644
index c91ce36..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchInstanceTracker.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.apache.taverna.biocatalogue.model.search;
-/*
- * 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.
- */
-
-import org.apache.taverna.biocatalogue.model.Resource;
-
-/**
- * Implementations of this interface will keep track of
- * current search instances for different resource types
- * (under assumption that {@link SearchInstance} classes
- * can only deal with one resource type per instance).
- *
- * In the BioCatalogue plugin it is one of the UI components
- * that needs to keep track of active search instances. This
- * interface helps to decouple the search engine model from the
- * UI.
- *
- * @author Sergejs Aleksejevs
- */
-public interface SearchInstanceTracker
-{
- /**
- * Clears all records of previous search instances.
- */
- public void clearPreviousSearchInstances();
-
- /**
- * Registers an instance of {@link SearchInstance} class
- * as a current one for a specific resource type.
- *
- * Repeated calls to this method with the same parameter
- * should overwrite old values.
- *
- * @param searchType Resource type to associate the registered
- * {@link SearchInstance} with.
- */
- public void registerSearchInstance(Resource.TYPE searchType, SearchInstance searchInstance);
-
-
- /**
- * Tests if provided {@link SearchInstance} is registered as the
- * current one.
- *
- * @param searchType Resource type to perform the test for.
- * @param searchInstance {@link SearchInstance} object that is expected to be
- * the current search instance for the specified resource type.
- * @return <code>true</code> - if the provided <code>searchInstance</code> is indeed
- * currently registered as the active one for the given resouce type;<br/>
- * <code>false</code> - otherwise.
- */
- public boolean isCurrentSearchInstance(Resource.TYPE searchType, SearchInstance searchInstance);
-
-
- /**
- * @param searchType
- * @return Currently active {@link SearchInstance} object for the specified resource type.
- */
- public SearchInstance getCurrentSearchInstance(Resource.TYPE searchType);
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchOptions.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchOptions.java
deleted file mode 100644
index b3b4a1e..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchOptions.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.taverna.biocatalogue.model.search;
-/*
- * 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.
- */
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.taverna.biocatalogue.model.Tag;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.ui.SearchOptionsPanel;
-
-/**
- * Instances of this class can store the state of the
- * {@link SearchOptionsPanel} / {@link TagSelectionDialog} in
- * order to help instantiate {@link SearchInstance} objects.
- *
- * @author Sergejs Aleksejevs
- */
-public class SearchOptions
-{
- private SearchInstance preconfiguredSearchInstance;
- private SearchInstance.TYPE searchType;
- private String searchString;
- private List<Tag> searchTags;
- private List<TYPE> resourceTypesToSearchFor;
-
- public SearchOptions(String searchString, List<TYPE> searchTypes) {
- this.preconfiguredSearchInstance = null;
- this.searchType = SearchInstance.TYPE.QuerySearch;
- this.searchString = searchString;
- this.searchTags = null;
- this.resourceTypesToSearchFor = searchTypes;
- }
-
- public SearchOptions(List<Tag> searchTags, List<TYPE> searchTypes) {
- this.preconfiguredSearchInstance = null;
- this.searchType = SearchInstance.TYPE.TagSearch;
- this.searchString = null;
- this.searchTags = searchTags;
- this.resourceTypesToSearchFor = searchTypes;
- }
-
- public SearchOptions(SearchInstance preconfiguredSearchInstance) {
- this.preconfiguredSearchInstance = preconfiguredSearchInstance;
- this.searchType = preconfiguredSearchInstance.getSearchType();
- this.searchString = preconfiguredSearchInstance.getSearchString();
- this.searchTags = preconfiguredSearchInstance.getSearchTags();
- this.resourceTypesToSearchFor = Collections.singletonList(preconfiguredSearchInstance.getResourceTypeToSearchFor());
- }
-
-
- public SearchInstance getPreconfiguredSearchInstance() {
- return preconfiguredSearchInstance;
- }
-
- public SearchInstance.TYPE getSearchType() {
- return searchType;
- }
-
- public String getSearchString() {
- return searchString;
- }
-
- public List<Tag> getSearchTags() {
- return searchTags;
- }
-
- public List<TYPE> getResourceTypesToSearchFor() {
- return resourceTypesToSearchFor;
- }
-
-}
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchResults.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchResults.java
deleted file mode 100644
index 3263653..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/SearchResults.java
+++ /dev/null
@@ -1,230 +0,0 @@
-package org.apache.taverna.biocatalogue.model.search;
-/*
- * 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.
- */
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.taverna.biocatalogue.model.LoadingResource;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.model.connectivity.BeansForJSONLiteAPI;
-import org.apache.taverna.biocatalogue.model.connectivity.BeansForJSONLiteAPI.ResourceIndex;
-import org.apache.taverna.biocatalogue.model.connectivity.BeansForJSONLiteAPI.ResourceLinkWithName;
-
-import org.apache.log4j.Logger;
-
-import org.biocatalogue.x2009.xml.rest.ResourceLink;
-
-
-/**
- * Generic class for any kinds of search results.
- *
- * @author Sergejs Aleksejevs
- */
-public class SearchResults implements Serializable
-{
- private static final long serialVersionUID = 6994685875323246165L;
-
- private transient Logger logger; // don't want to serialise the logger...
-
- private final TYPE typeOfResourcesInTheResultSet;
- private final int totalResultCount;
-
- // Data store for found items
- protected ArrayList<ResourceLink> foundItems;
- private int fullyFetchedItemCount;
-
-
-
- public SearchResults(TYPE typeOfResourcesInTheResultSet, BeansForJSONLiteAPI.ResourceIndex resourceIndex)
- {
- this.typeOfResourcesInTheResultSet = typeOfResourcesInTheResultSet;
- this.totalResultCount = resourceIndex.getResources().length;
- this.fullyFetchedItemCount = 0;
-
- this.logger = Logger.getLogger(this.getClass());
-
- initialiseSearchResultCollection(resourceIndex);
- }
-
-
- /**
- * The collection of results is initialised to cater for the expected number of
- * values - placeholder with just a name and URL for each of the expected result entries is stored.
- *
- * @param resourceIndex
- */
- protected void initialiseSearchResultCollection(ResourceIndex resourceIndex)
- {
- foundItems = new ArrayList<ResourceLink>();
- foundItems.ensureCapacity(getTotalMatchingItemCount());
-
- ResourceLinkWithName resourceLink = null;
- for (int i = 0; i < getTotalMatchingItemCount(); i++) {
- resourceLink = resourceIndex.getResources()[i];
- this.foundItems.add(new LoadingResource(resourceLink.getURL(), resourceLink.getName()));
- }
- }
-
-
- public synchronized void addSearchResults(List<ResourceLink> searchResultsData, int positionToStartAddingResults)
- {
- // only update a specific portion of results
- for (int i = 0; i < searchResultsData.size(); i++) {
- this.foundItems.set(i + positionToStartAddingResults, searchResultsData.get(i));
- }
-
- fullyFetchedItemCount += searchResultsData.size();
- }
-
-
- public TYPE getTypeOfResourcesInTheResultSet() {
- return typeOfResourcesInTheResultSet;
- }
-
-
- /**
- * @return List of resources that have matched the search query
- * and/or specified filtering criteria.
- */
- public List<ResourceLink> getFoundItems() {
- return (this.foundItems);
- }
-
-
- /**
- * @return Number of resources that have matched the search query
- * (and/or specified filtering criteria) that have already been
- * fetched.
- */
- public int getFetchedItemCount() {
- return (this.fullyFetchedItemCount);
- }
-
-
- /**
- * @return Total number of resources that have matched the search query
- * (and/or specified filtering criteria) - most of these will
- * likely not be fetched yet.
- */
- public int getTotalMatchingItemCount() {
- return (this.totalResultCount);
- }
-
-
- /**
- * @return Total number of pages in the current result set.
- */
- public int getTotalResultPageNumber() {
- int numberOfResourcesPerPageForThisResourceType = this.getTypeOfResourcesInTheResultSet().getApiResourceCountPerIndexPage();
- return (int)(Math.ceil((double)getTotalMatchingItemCount() / numberOfResourcesPerPageForThisResourceType));
- }
-
-
- /**
- * List of matching items will be partial and populated sequentially
- * based on user actions. Therefore, this method helps to check
- * which list entries are still not populated.
- *
- * @param startIndex Beginning of the range to check.
- * @param endIndex End of the range to check.
- * @return Zero-based index of the first entry in the list of
- * matching resources that hasn't been fetched yet.
- * Will return <code>-1</code> if the provided range
- * parameters are incorrect or if all items in the
- * specified range are already available.
- */
- public int getFirstMatchingItemIndexNotYetFetched(int startIndex, int endIndex)
- {
- // check the specified range is correct
- if (startIndex < 0 || endIndex > getTotalMatchingItemCount() - 1) {
- return (-1);
- }
-
- // go through the search results in the specified range
- // in an attempt to find an item that hasn't been fetched
- // just yet
- for (int i = startIndex; i <= endIndex; i++) {
- ResourceLink item = this.foundItems.get(i);
- if (item != null && item instanceof LoadingResource && !((LoadingResource)item).isLoading()) {
- return (i);
- }
- }
-
- // apparently, all items in the provided range are fetched
- return (-1);
- }
-
-
-
- /**
- * @param matchingItemIndex Index of the matching item from search results.
- * @return Index (starting from "1") of page in the search results, where
- * the matching item with a specified index is located. If the
- * <code>matchingItemIndex</code> is wrong, <code>-1</code> is returned.
- */
- public int getMatchingItemPageNumberFor(int matchingItemIndex)
- {
- // check the specified index is correct
- if (matchingItemIndex < 0 || matchingItemIndex > getTotalMatchingItemCount() - 1) {
- return (-1);
- }
-
- int resultsPerPageForThisType = this.getTypeOfResourcesInTheResultSet().getApiResourceCountPerIndexPage();
- return (matchingItemIndex / resultsPerPageForThisType + 1);
- }
-
-
- /**
- * @param resultPageNumber Number of the page, for which the calculations are to be done.
- * @return Index of the first result entry on the specified result page. If <code>resultPageNumber</code>
- * is less than <code>1</code> or greater than the total number of pages in the result set,
- * a value of <code>-1</code> will be returned.
- */
- public int getFirstItemIndexOn(int resultPageNumber)
- {
- // page number must be in a valid range - starting with 1..onwards
- if (resultPageNumber < 1 || resultPageNumber > getTotalResultPageNumber()) {
- return (-1);
- }
-
- int numberOfResourcesPerPageForThisResourceType = this.getTypeOfResourcesInTheResultSet().getApiResourceCountPerIndexPage();
- return ((resultPageNumber - 1) * numberOfResourcesPerPageForThisResourceType);
- }
-
-
-
- /**
- * Mainly for testing - outputs number of search results per item type.
- */
- public String toString()
- {
- // FIXME
-
-// StringBuilder out = new StringBuilder("Breakdown of item counts by type:\n");
-// for (Map.Entry<Integer,String> itemTypeNamePair : Resource.ALL_SUPPORTED_RESOURCE_COLLECTION_NAMES.entrySet()) {
-// out.append(itemTypeNamePair.getValue() + ": " +getFetchedItemCount(itemTypeNamePair.getKey()) +
-// "/" + getTotalItemCount(itemTypeNamePair.getKey()) + "\n");
-// }
-//
-// return (out.toString());
-
- return ("search results... not implemented!!!");
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/ServiceFilteringSettings.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/ServiceFilteringSettings.java
deleted file mode 100644
index 30570ad..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/search/ServiceFilteringSettings.java
+++ /dev/null
@@ -1,200 +0,0 @@
-package org.apache.taverna.biocatalogue.model.search;
-/*
- * 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.
- */
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.tree.TreePath;
-
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.biocatalogue.ui.filtertree.FilterTreeNode;
-import org.apache.taverna.biocatalogue.ui.tristatetree.JTriStateTree;
-
-/**
- * This class provides functionality to deal with service filtering settings.
- * Particularly used to save the current state of the filtering tree as a
- * favourite filter.
- *
- * Instances of this class hold all necessary information to restore the
- * filtering state at a later point.
- *
- * @author Sergejs Aleksejevs
- */
-public class ServiceFilteringSettings implements Comparable<ServiceFilteringSettings>, Serializable
-{
- private static final long serialVersionUID = -5706169924295062628L;
-
- private String filterName;
- private int filteringCriteriaNumber;
- private List<TreePath> filterTreeRootsOfCheckedPaths;
-
-
-
- /**
- * Stores current filtering selection in the provided JTriStateTree
- * instance into the instance of this class.
- *
- * @param filterTree The JTriStateTree instance to get the current selection from.
- */
- public ServiceFilteringSettings(JTriStateTree filterTree)
- {
- this(null, filterTree);
- }
-
-
- /**
- * Stores current filtering selection in the provided JTriStateTree
- * instance into the instance of this class.
- *
- * @param filterName The name to associate with this filter.
- * @param filterTree The JTriStateTree instance to get the current selection from.
- */
- @SuppressWarnings("unchecked")
- public ServiceFilteringSettings(String filterName, JTriStateTree filterTree)
- {
- this.filterName = filterName;
-
- this.filteringCriteriaNumber = filterTree.getLeavesOfCheckedPaths().size();
-
- // a deep copy of the data from the filter tree is created, so that the data stored in this instance
- // is fully independent of the filter tree itself; therefore local copy of this data may be modified
- // as needed and will not affect the main filter (and vice versa)
- this.filterTreeRootsOfCheckedPaths = (List<TreePath>)Util.deepCopy(filterTree.getRootsOfCheckedPaths());
- }
-
-
- /**
- * Analyses the filter tree and produces part of the request URL containing settings regarding filters.
- */
- @SuppressWarnings("unchecked")
- public Map<String,String[]> getFilteringURLParameters()
- {
- // analyse filter tree to get checked elements
- Map<String,HashSet<String>> selections = new HashMap<String,HashSet<String>>();
-
- // cycle through the deepest selected nodes;
- // NB! the CheckboxTree acts in a way that if A contains B,C --
- // 1) if only B is checked, tp.getLastPathComponent() will be B;
- // 2) if both B,C are checked, tp.getLastPathComponent() will be A;
- for (TreePath selectedRootNodePath : getFilterTreeRootsOfCheckedPaths()) {
- FilterTreeNode selectedNode = (FilterTreeNode)selectedRootNodePath.getLastPathComponent();
-
- // identify affected nodes
- HashSet<FilterTreeNode> affectedNodes = new HashSet<FilterTreeNode>();
- if (selectedNode.isFilterCategory()) {
- // case as in example 2) -- need to "extract" nodes that are one level deeper
- for (Enumeration children = selectedNode.children(); children.hasMoreElements(); ) {
- affectedNodes.add((FilterTreeNode)children.nextElement());
- }
- }
- else {
- // case as in example 1)
- affectedNodes.add(selectedNode);
- }
-
- // walk through the identified collection of nodes and build the data structure with URL values
- for (FilterTreeNode node : affectedNodes) {
- if (selections.containsKey(node.getType())) {
- selections.get(node.getType()).add(node.getUrlValue());
- }
- else {
- HashSet<String> newSet = new HashSet<String>();
- newSet.add(node.getUrlValue());
-
- selections.put(node.getType(), newSet);
- }
- }
- }
-
-
- // now use the constructed set of data to build the map of filtering URL parameters
- Map<String,String[]> filterUrlParameters = new HashMap<String,String[]>();
- for(String key : selections.keySet())
- {
- List<String> categoryValues = new ArrayList<String>();
- for (String value : selections.get(key)) {
- categoryValues.add(value);
- }
-
- filterUrlParameters.put(key, categoryValues.toArray(new String[0]));
- }
-
- return (filterUrlParameters);
- }
-
-
- // *** Getters ***
-
- public String getFilterName() {
- return (this.filterName == null || filterName.length() == 0 ? "untitled filter" : this.filterName);
- }
-
- public List<TreePath> getFilterTreeRootsOfCheckedPaths() {
- return filterTreeRootsOfCheckedPaths;
- }
-
- /**
- * @return Number of filtering criteria within the current filter.
- */
- public int getNumberOfFilteringCriteria() {
- return filteringCriteriaNumber;
- }
-
- // *** End of getters ***
-
-
- public boolean equals(Object other)
- {
- if (other instanceof ServiceFilteringSettings)
- {
- ServiceFilteringSettings o = (ServiceFilteringSettings)other;
- return (this.filterName.equals(o.filterName) &&
- this.filterTreeRootsOfCheckedPaths.equals(o.filterTreeRootsOfCheckedPaths));
- }
- else {
- return false;
- }
- }
-
-
- public int compareTo(ServiceFilteringSettings other)
- {
- int iOrdering = this.filterName.compareTo(other.filterName);
- if (iOrdering == 0) {
- iOrdering = this.getNumberOfFilteringCriteria() - other.getNumberOfFilteringCriteria();
- }
-
- // inverse order, as the traversal of lists in the favourite filters panel is
- // done this way round
- return (-1 * iOrdering);
- }
-
-
- public String toString() {
- return ("Filter: '" + getFilterName() + "' [" + detailsAsString() + "]");
- }
-
- public String detailsAsString() {
- return (getNumberOfFilteringCriteria() + " filtering criteria");
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/AnnotationBean.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/AnnotationBean.java
deleted file mode 100644
index d1d8dca..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/AnnotationBean.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-
-public class AnnotationBean
-{
- public AnnotationBean() { }
-
- public String self;
- private int version;
- private String created;
- public Annotatable annotatable;
- private Source source;
- private Attribute attribute;
- private Value value;
-
-
- public static class Annotatable
- {
- private Annotatable() { }
-
- private String name;
- public String resource;
- private String type;
- }
-
- public static class Source
- {
- private Source() { }
-
- private String name;
- private String resource;
- private String type;
- }
-
- public static class Attribute
- {
- private Attribute() { }
-
- private String name;
- private String resource;
- private String identifier;
- }
-
- public static class Value
- {
- private Value() { }
-
- private String resource;
- private String type;
- private String content;
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/DrawDefaultIconTest.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/DrawDefaultIconTest.java
deleted file mode 100644
index d6acb16..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/DrawDefaultIconTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.image.BufferedImage;
-
-import javax.swing.ImageIcon;
-import javax.swing.JOptionPane;
-
-public class DrawDefaultIconTest {
-
- /**
- * @param args
- */
- public static void main(String[] args)
- {
- int w = 16;
- int h = 16;
- GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
- GraphicsDevice gd = ge.getDefaultScreenDevice();
- GraphicsConfiguration gc = gd.getDefaultConfiguration();
-
- BufferedImage image = gc.createCompatibleImage(w, h, BufferedImage.TYPE_INT_ARGB);
- Graphics2D g = image.createGraphics();
- g.setColor(Color.RED);
- g.setStroke(new BasicStroke(3, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER));
- g.drawLine(4, 4, 12, 12);
- g.drawLine(12, 4, 4, 12);
- g.dispose();
-
- JOptionPane.showMessageDialog(null, new ImageIcon(image));
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/GSONTest.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/GSONTest.java
deleted file mode 100644
index ade0309..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/GSONTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import com.google.gson.Gson;
-
-public class GSONTest
-{
-
- public static void main(String[] args) throws Exception
- {
- String json = "[{\"annotatable\":{\"name\":\"IndexerService\",\"resource\":\"http://sandbox.biocatalogue.org/services/2158\",\"type\":\"Service\"},\"self\":\"http://sandbox.biocatalogue.org/annotations/47473\",\"value\":{\"resource\":\"http://sandbox.biocatalogue.org/tags/indexing\",\"type\":\"Tag\",\"content\":\"indexing\"},\"version\":1,\"created\":\"2010-01-13T09:24:04Z\",\"source\":{\"name\":\"Marco Roos\",\"resource\":\"http://sandbox.biocatalogue.org/users/48\",\"type\":\"User\"},\"attribute\":{\"name\":\"Tag\",\"resource\":\"http://sandbox.biocatalogue.org/annotation_attributes/2\",\"identifier\":\"http://www.biocatalogue.org/attribute#Category\"}}]";
-
- Gson gson = new Gson();
- AnnotationBean[] a = gson.fromJson(json, AnnotationBean[].class);
-
- System.out.println("Self URL: " + a[0].self);
- System.out.println("Annotatable resource: " + a[0].annotatable.resource);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/GSONTest_exportingJSON.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/GSONTest_exportingJSON.java
deleted file mode 100644
index 3fce711..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/GSONTest_exportingJSON.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.taverna.biocatalogue.model.connectivity.BeanForPOSTToFilteredIndex;
-
-import com.google.gson.Gson;
-
-public class GSONTest_exportingJSON
-{
-
- /**
- * @param args
- */
- public static void main(String[] args)
- {
- Map<String, String[]> m = new HashMap<String, String[]>();
- m.put("a", new String[] {"b","c"});
- m.put("d", new String[] {"e","f"});
-
- BeanForPOSTToFilteredIndex b = new BeanForPOSTToFilteredIndex();
- b.filters = m;
-
- Gson gson = new Gson();
- System.out.println(gson.toJson(b));
-
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/GSONTest_forSoapOperationsIndex.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/GSONTest_forSoapOperationsIndex.java
deleted file mode 100644
index ae0409e..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/GSONTest_forSoapOperationsIndex.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import org.apache.taverna.biocatalogue.model.Resource;
-import org.apache.taverna.biocatalogue.model.connectivity.BeansForJSONLiteAPI;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-
-public class GSONTest_forSoapOperationsIndex
-{
-
- /**
- * @param args
- * @throws Exception
- */
- public static void main(String[] args) throws Exception
- {
- BioCatalogueClient client = BioCatalogueClient.getInstance();
-
- String url = BioCatalogueClient.API_SOAP_OPERATIONS_URL;
-// url = Util.appendURLParameter(url, "q", "blast");
- BeansForJSONLiteAPI.ResourceIndex soapOpIndex = client.getBioCatalogueResourceLiteIndex(Resource.TYPE.SOAPOperation, url);
-
- System.out.println("result count: " + soapOpIndex.getResources().length + "\n\n");
-// System.out.println(soapOpIndex.soap_operations[1].getName() + "\n" + soapOpIndex.soap_operations[1].getURL() + "\n\n");
-
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/JWaitDialogTest.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/JWaitDialogTest.java
deleted file mode 100644
index a9b815f..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/JWaitDialogTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import org.apache.taverna.biocatalogue.ui.JWaitDialog;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponent;
-
-public class JWaitDialogTest
-{
-
- public static void main(String[] args)
- {
- System.out.println("start test");
-
- final JWaitDialog jwd = new JWaitDialog(MainComponent.dummyOwnerJFrame, "Old title", "Please wait... Please wait... Please wait... Please wait...");
-
- // NB! Background process must be started before the modal dialog box
- // is made visible - otherwise processing freezes.
- new Thread("testing delayed update of JWaitDialog")
- {
- public void run()
- {
- // wait for some time
- try { Thread.sleep(3000); }
- catch (InterruptedException e) { /* do nothing */ }
-
- // update the dialog
- jwd.setTitle("New title");
- jwd.waitFinished("Great, all done!");
-
- System.out.println("end test");
- }
- }.start();
-
- jwd.setVisible(true);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/LinkedListEqualsTest.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/LinkedListEqualsTest.java
deleted file mode 100644
index 02d5d09..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/LinkedListEqualsTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import java.util.LinkedList;
-
-public class LinkedListEqualsTest
-{
- public static void main(String[] args)
- {
- LinkedList l = new LinkedList();
-
- String a = new String("test1");
- String b = new String("test2");
-
- System.out.println(a == b);
- System.out.println(a.equals(b));
-
- l.add(a);
- l.add(b);
-
- System.out.println(l);
- System.out.println(l.indexOf(a));
- System.out.println(l.indexOf(b));
-
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestAPICaller.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestAPICaller.java
deleted file mode 100644
index 4625e0a..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestAPICaller.java
+++ /dev/null
@@ -1,257 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import javax.swing.JFrame;
-import java.awt.Dimension;
-import javax.swing.JPanel;
-import java.awt.BorderLayout;
-import javax.swing.JTextField;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
-import javax.swing.JOptionPane;
-import javax.swing.JTextPane;
-import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
-
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-
-import java.awt.GridBagLayout;
-import java.awt.GridBagConstraints;
-import java.awt.Insets;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class TestAPICaller extends JFrame implements ActionListener {
-
- private JPanel jContentPane = null;
- private JTextField tfURL = null;
- private JButton bSubmitRequest = null;
- private JButton bClear = null;
- private JScrollPane spOutputPane = null;
- private JTextPane tpOutputPane = null;
-
- /**
- * This method initializes
- *
- */
- public TestAPICaller() {
- super();
- initialize();
- }
-
- /**
- * This method initializes this
- *
- */
- private void initialize() {
- this.setSize(new Dimension(515, 321));
- this.setTitle("Test Service Catalogue API Caller");
- this.setContentPane(getJContentPane());
-
- this.bSubmitRequest.setDefaultCapable(true);
- this.getRootPane().setDefaultButton(bSubmitRequest);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
- gridBagConstraints3.fill = GridBagConstraints.BOTH;
- gridBagConstraints3.gridwidth = 2;
- gridBagConstraints3.gridx = 0;
- gridBagConstraints3.gridy = 2;
- gridBagConstraints3.ipadx = 459;
- gridBagConstraints3.ipady = 182;
- gridBagConstraints3.weightx = 1.0;
- gridBagConstraints3.weighty = 1.0;
- gridBagConstraints3.insets = new Insets(4, 12, 9, 12);
- GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
- gridBagConstraints2.fill = GridBagConstraints.HORIZONTAL;
- gridBagConstraints2.gridy = 1;
- gridBagConstraints2.ipadx = 0;
- gridBagConstraints2.ipady = 0;
- gridBagConstraints2.insets = new Insets(0, 5, 7, 12);
- gridBagConstraints2.weightx = 0.5;
- gridBagConstraints2.gridx = 1;
- GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
- gridBagConstraints1.fill = GridBagConstraints.HORIZONTAL;
- gridBagConstraints1.gridy = 1;
- gridBagConstraints1.ipadx = 0;
- gridBagConstraints1.ipady = 0;
- gridBagConstraints1.insets = new Insets(0, 12, 7, 5);
- gridBagConstraints1.weightx = 0.5;
- gridBagConstraints1.gridx = 0;
- GridBagConstraints gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
- gridBagConstraints.gridwidth = 2;
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 0;
- gridBagConstraints.ipadx = 466;
- gridBagConstraints.weightx = 1.0;
- gridBagConstraints.ipady = 3;
- gridBagConstraints.insets = new Insets(13, 12, 8, 12);
- jContentPane = new JPanel();
- jContentPane.setLayout(new GridBagLayout());
- jContentPane.add(getTfURL(), gridBagConstraints);
- jContentPane.add(getBSubmitRequest(), gridBagConstraints1);
- jContentPane.add(getBClear(), gridBagConstraints2);
- jContentPane.add(getSpOutputPane(), gridBagConstraints3);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes tfURL
- *
- * @return javax.swing.JTextField
- */
- private JTextField getTfURL() {
- if (tfURL == null) {
- tfURL = new JTextField();
- tfURL.setText(BioCatalogueClient.DEFAULT_API_SANDBOX_BASE_URL);
- }
- return tfURL;
- }
-
- /**
- * This method initializes tfSubmitRequest
- *
- * @return javax.swing.JButton
- */
- private JButton getBSubmitRequest() {
- if (bSubmitRequest == null) {
- bSubmitRequest = new JButton();
- bSubmitRequest.setText("Submit Request");
- bSubmitRequest.addActionListener(this);
- }
- return bSubmitRequest;
- }
-
-
- /**
- * This method initializes bClear
- *
- * @return javax.swing.JButton
- */
- private JButton getBClear() {
- if (bClear == null) {
- bClear = new JButton();
- bClear.setText("Clear Output");
- bClear.addActionListener(this);
- }
- return bClear;
- }
-
-
- /**
- * This method initializes tpOutputPane
- *
- * @return javax.swing.JTextPane
- */
- private JTextPane getTpOutputPane() {
- if (tpOutputPane == null) {
- tpOutputPane = new JTextPane();
- tpOutputPane.setContentType("text/plain");
- }
- return tpOutputPane;
- }
-
-
- /**
- * This method initializes spOutputPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getSpOutputPane() {
- if (spOutputPane == null) {
- spOutputPane = new JScrollPane();
- spOutputPane.setViewportView(getTpOutputPane());
- }
- return spOutputPane;
- }
-
-
- // ACTION LISTENER
-
- public void actionPerformed(ActionEvent e) {
- if (e.getSource().equals(bSubmitRequest)) {
- tfURL.selectAll();
-
- // call the actual test method
- runBioCatalogueAPITest(tfURL.getText());
- }
- else if (e.getSource().equals(bClear)) {
- this.tpOutputPane.setText("");
- }
-
- }
-
-
- // ACTUAL TEST CLASS
-
- private void runBioCatalogueAPITest(String url) {
- final String urlFinal = url;
- new Thread("making request") {
- public void run() {
- tpOutputPane.setText("Initialising Service Catalogue client...");
- BioCatalogueClient client = null;
- try {
- client = BioCatalogueClient.getInstance();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- final StringBuilder text = new StringBuilder();
- try {
- tpOutputPane.setText("Sending request...");
- BufferedReader br = new BufferedReader(new InputStreamReader(client.doBioCatalogueGET(urlFinal).getResponseStream()));
- String str = "";
-
- while ((str = br.readLine()) != null) {
- text.append(str + "\n");
- }
-
- br.close();
- }
- catch (Exception e) {
- text.append(e);
- }
-
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- tpOutputPane.setText(text.toString());
- }
- });
- }
- }.start();
-
- }
-
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestDoubleUsageOfSameSwingElement.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestDoubleUsageOfSameSwingElement.java
deleted file mode 100644
index 6056550..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestDoubleUsageOfSameSwingElement.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
-import javax.swing.JFrame;
-
-public class TestDoubleUsageOfSameSwingElement extends JFrame
-{
- private String text = "abc";
- boolean bLowerCase = true;
-
- public TestDoubleUsageOfSameSwingElement()
- {
- final JButton bBtn = new JButton(text);
- bBtn.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- bLowerCase = !bLowerCase;
- bBtn.setText(bLowerCase ? text.toLowerCase() : text.toUpperCase());
- }
- });
-
- this.setLayout(new BorderLayout());
- this.add(bBtn, BorderLayout.WEST);
- this.add(bBtn, BorderLayout.EAST);
-
- this.pack();
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestUtilURLHandling.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestUtilURLHandling.java
deleted file mode 100644
index 473668d..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestUtilURLHandling.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import org.apache.taverna.biocatalogue.model.Util;
-
-public class TestUtilURLHandling
-{
- public static void main(String[] args)
- {
- String url1 = "http://sandbox.biocatalogue.org/search";
- String url2 = "http://sandbox.biocatalogue.org/search?";
- String url3 = "http://sandbox.biocatalogue.org/search?q=";
- String url4 = "http://sandbox.biocatalogue.org/search?q=franck";
- String url5 = "http://sandbox.biocatalogue.org/services?tag=%5Bbiology%5D";
- String url6 = "http://sandbox.biocatalogue.org/services?tag=%5B%3Chttp%3A%2F%2Fwww.mygrid.org.uk%2Fontology%23DDBJ%3E%5D";
-
-
- System.out.println("----------------------------");
- System.out.println("Extracting URL parameters:\n");
-
-
- System.out.println(url1 + "\nParameter map:\n" + Util.extractURLParameters(url1));
- System.out.println("Reconstructed query string from parameter map: " + Util.constructURLQueryString(Util.extractURLParameters(url1)) + "\n");
-
-
- System.out.println(url2 + "\nParameter map:\n" + Util.extractURLParameters(url2));
- System.out.println("Reconstructed query string from parameter map: " + Util.constructURLQueryString(Util.extractURLParameters(url2)) + "\n");
-
-
- System.out.println(url3 + "\nParameter map:\n" + Util.extractURLParameters(url3));
- System.out.println("Reconstructed query string from parameter map: " + Util.constructURLQueryString(Util.extractURLParameters(url3)) + "\n");
-
-
- System.out.println(url4 + "\nParameter map:\n" + Util.extractURLParameters(url4));
- System.out.println("Reconstructed query string from parameter map: " + Util.constructURLQueryString(Util.extractURLParameters(url4)) + "\n");
-
-
- System.out.println(url5 + "\nParameter map:\n" + Util.extractURLParameters(url5));
- System.out.println("Reconstructed query string from parameter map: " + Util.constructURLQueryString(Util.extractURLParameters(url5)) + "\n");
-
-
- System.out.println("\n\n----------------------------");
- System.out.println("Adding parameters:\n");
-
- String newUrl = Util.appendURLParameter(url1, "testParam", "testValue");
- System.out.println(url1 + "\n" + newUrl + "\n");
-
- newUrl = Util.appendURLParameter(url2, "testParam", "testValue");
- System.out.println(url2 + "\n" + newUrl + "\n");
-
- newUrl = Util.appendURLParameter(url3, "testParam", "testValue");
- System.out.println(url3 + "\n" + newUrl + "\n");
-
- newUrl = Util.appendURLParameter(url4, "testParam", "testValue");
- System.out.println(url4 + "\n" + newUrl + "\n");
-
- newUrl = Util.appendURLParameter(url5, "testParam", "testValue");
- System.out.println(url5 + "\n" + newUrl + "\n");
-
-
- System.out.println("\n\n----------------------------");
- System.out.println("Getting parameter values:\n");
-
- System.out.println("Value of '" + "testParam" + "' in the URL: " + url1 + " -- " + Util.extractURLParameter(url1, "testParam"));
- System.out.println("Value of '" + "testParam" + "' in the URL: " + url2 + " -- " + Util.extractURLParameter(url2, "testParam"));
- System.out.println("Value of '" + "q" + "' in the URL: " + url3 + " -- " + Util.extractURLParameter(url3, "q"));
- System.out.println("Value of '" + "q" + "' in the URL: " + url4 + " -- " + Util.extractURLParameter(url4, "q"));
- System.out.println("Value of '" + "tag" + "' in the URL: " + url5 + " -- " + Util.extractURLParameter(url5, "tag"));
-
-
- System.out.println("\n\n----------------------------");
- System.out.println("URL decoding:\n");
-
- System.out.println("Original URL: " + url6 + "\nDecoded URL: " + Util.urlDecodeQuery(url6));
-
-
- System.out.println("\n\n----------------------------");
- System.out.println("Appending a string before URL parameters:\n");
-
- String strToAppend = ".xml";
- System.out.println("Appending '" + strToAppend + "' in the URL: " + url1 + " -- " + Util.appendStringBeforeParametersOfURL(url1, strToAppend));
- System.out.println("Appending '" + strToAppend + "' in the URL: " + url2 + " -- " + Util.appendStringBeforeParametersOfURL(url2, strToAppend));
- System.out.println("Appending '" + strToAppend + "' in the URL: " + url3 + " -- " + Util.appendStringBeforeParametersOfURL(url3, strToAppend));
- System.out.println("Appending '" + strToAppend + "' in the URL: " + url4 + " -- " + Util.appendStringBeforeParametersOfURL(url4, strToAppend));
- System.out.println("Appending '" + strToAppend + "' in the URL: " + url5 + " -- " + Util.appendStringBeforeParametersOfURL(url5, strToAppend));
- System.out.println("Appending '" + strToAppend + "' in the URL: " + url6 + " -- " + Util.appendStringBeforeParametersOfURL(url6, strToAppend));
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestXHTMLRenderer.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestXHTMLRenderer.java
deleted file mode 100644
index 81b13a0..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/TestXHTMLRenderer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import java.awt.Container;
-import java.io.File;
-
-import javax.swing.JFrame;
-
-import org.xhtmlrenderer.simple.FSScrollPane;
-import org.xhtmlrenderer.simple.XHTMLPanel;
-
-public class TestXHTMLRenderer extends JFrame {
- public TestXHTMLRenderer() {
- try {
- init();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void init() throws Exception {
- Container contentPane = this.getContentPane();
-
- XHTMLPanel panel = new XHTMLPanel();
- panel.getSharedContext().getTextRenderer().setSmoothingThreshold(0); // Anti-aliasing for all font sizes
- panel.setDocument(new File("c:\\Temp\\MyExperiment\\T2 BioCatalogue Plugin\\BioCatalogue Plugin\\resources\\test.html"));
-
- FSScrollPane scroll = new FSScrollPane(panel);
- contentPane.add(scroll);
-
- this.setTitle("XHTML rendered test");
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.pack();
- this.setSize(1024, 768);
- }
-
-
- public static void main(String[] args) {
- JFrame f = new TestXHTMLRenderer();
- f.setVisible(true);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/WrappableJLabelTest.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/WrappableJLabelTest.java
deleted file mode 100644
index 5be8ae7..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/WrappableJLabelTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-public class WrappableJLabelTest extends JFrame
-{
- public WrappableJLabelTest() {
-
- // depending on the LayoutManager of the container, JLabel may
- // be resized or simply "cut off" on the edges - e.g. FlowLayout
- // cuts it off, BorderLayout does the resizing
- JPanel jpTestPanel = new JPanel(new BorderLayout());
- jpTestPanel.add(new JLabel("<html><span color=\"red\">a very long</span> text that <b>is just</b> " +
- "showing how the whole thing looks - will it wrap text or not; this " +
- "is the question</html>"), BorderLayout.CENTER);
-
- this.getContentPane().add(jpTestPanel);
-
- this.pack();
- }
-
- public static void main(String[] args)
- {
- WrappableJLabelTest f = new WrappableJLabelTest();
- f.setLocationRelativeTo(null);
- f.setPreferredSize(new Dimension(400, 300));
- f.setVisible(true);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/XStreamTest.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/XStreamTest.java
deleted file mode 100644
index 293ef9d..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/test/XStreamTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.apache.taverna.biocatalogue.test;
-/*
- * 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.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.io.xml.DomDriver;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-
-
-public class XStreamTest
-{
-
- public static void main(String[] args)
- {
- List<SoapOperationIdentity> processors = new ArrayList<SoapOperationIdentity>();
- processors.add(new SoapOperationIdentity("http://www.test.com/test.wsdl", "aa", null));
- processors.add(new SoapOperationIdentity("http://www.example.com/example.wsdl", "bb", null));
-
- XStream xstream = new XStream(new DomDriver());
- String xml = xstream.toXML(processors);
-
- System.out.println(xml);
-
- List<SoapOperationIdentity> processorsFromXML = (List<SoapOperationIdentity>)xstream.fromXML(xml);
- System.out.println("\n\n");
- System.out.println(processorsFromXML.get(0).getWsdlLocation() + " - " + processorsFromXML.get(0).getOperationName());
- System.out.println(processorsFromXML.get(1).getWsdlLocation() + " - " + processorsFromXML.get(1).getOperationName());
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/BioCatalogueExplorationTab.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/BioCatalogueExplorationTab.java
deleted file mode 100644
index e1b5162..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/BioCatalogueExplorationTab.java
+++ /dev/null
@@ -1,147 +0,0 @@
-package org.apache.taverna.biocatalogue.ui;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-
-import javax.swing.BorderFactory;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.LayoutFocusTraversalPolicy;
-
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.biocatalogue.ui.search_results.SearchResultsMainPanel;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponent;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-
-import org.apache.log4j.Logger;
-
-
-/**
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class BioCatalogueExplorationTab extends JPanel implements HasDefaultFocusCapability
-{
- private final MainComponent pluginPerspectiveMainComponent;
- private final BioCatalogueClient client;
- private final Logger logger;
-
-
- // COMPONENTS
- private BioCatalogueExplorationTab thisPanel;
-
- private SearchOptionsPanel searchOptionsPanel;
- private SearchResultsMainPanel tabbedSearchResultsPanel;
-
-
- public BioCatalogueExplorationTab()
- {
- this.thisPanel = this;
-
- this.pluginPerspectiveMainComponent = MainComponentFactory.getSharedInstance();
- this.client = BioCatalogueClient.getInstance();
- this.logger = Logger.getLogger(this.getClass());
-
- initialiseUI();
-
- // this is to make sure that search will get focused when this tab is opened
- // -- is a workaround to a bug in JVM
- setFocusCycleRoot(true);
- setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {
- public Component getDefaultComponent(Container cont) {
- return (thisPanel.getDefaultComponent());
- }
- });
- }
-
-
- private void initialiseUI()
- {
- this.tabbedSearchResultsPanel = new SearchResultsMainPanel();
- this.searchOptionsPanel = new SearchOptionsPanel(tabbedSearchResultsPanel);
-
-
- this.setLayout(new GridBagLayout());
- GridBagConstraints c = new GridBagConstraints();
-
- c.gridx = 0;
- c.gridy = 0;
- c.weightx = 0.0;
- c.anchor = GridBagConstraints.WEST;
- c.insets = new Insets(3,10,3,10);
- String baseString= "<html><b>Using service catalogue at </b>" + client.getBaseURL() + "</html>";
- this.add(new JLabel(baseString), c);
-
-
- c.gridx = 1;
- c.gridy = 0;
- c.weightx = 0.1;
- c.fill = GridBagConstraints.HORIZONTAL;
- c.anchor = GridBagConstraints.EAST;
- c.insets = new Insets(3,30,3,10);
-
- this.add(searchOptionsPanel, c);
-
- c.insets = new Insets(0,0,0,0);
- c.gridy++;
- c.gridx = 0;
- c.gridwidth = 2;
- c.weightx = c.weighty = 1.0;
- c.fill = GridBagConstraints.BOTH;
- c.anchor = GridBagConstraints.CENTER;
- this.add(tabbedSearchResultsPanel, c);
-
- this.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10));
- }
-
-
- public SearchResultsMainPanel getTabbedSearchResultsPanel() {
- return tabbedSearchResultsPanel;
- }
-
-
-
- // *** Callbacks for HasDefaultFocusCapability interface ***
-
- public void focusDefaultComponent() {
- this.searchOptionsPanel.focusDefaultComponent();
- }
-
- public Component getDefaultComponent() {
- return (this.searchOptionsPanel.getDefaultComponent());
- }
-
- // *********************************************************
-
-
- public static void main(String[] args) {
- JFrame f = new JFrame();
- f.getContentPane().add(new BioCatalogueExplorationTab());
- f.setSize(1000, 800);
- f.setLocationRelativeTo(null);
-
- f.setVisible(true);
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/HasDefaultFocusCapability.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/HasDefaultFocusCapability.java
deleted file mode 100644
index 1dc45f2..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/HasDefaultFocusCapability.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.taverna.biocatalogue.ui;
-/*
- * 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.
- */
-
-import java.awt.Component;
-
-/**
- * Indicates that the class which implements this interface will focus default
- * component (as if the component represented by that class was activated).
- *
- * @author Sergejs Aleksejevs
- */
-public interface HasDefaultFocusCapability
-{
- public void focusDefaultComponent();
- public Component getDefaultComponent();
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/JClickableLabel.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/JClickableLabel.java
deleted file mode 100644
index b6906e9..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/JClickableLabel.java
+++ /dev/null
@@ -1,188 +0,0 @@
-package org.apache.taverna.biocatalogue.ui;
-/*
- * 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.
- */
-
-import java.awt.Color;
-import java.awt.Cursor;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.util.EventListener;
-
-import javax.swing.BorderFactory;
-import javax.swing.Icon;
-import javax.swing.JLabel;
-import javax.swing.SwingUtilities;
-
-/**
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class JClickableLabel extends JLabel implements MouseListener
-{
- /**
- * Default height of the JClickableLabel - calculated based on 16-pixel
- * standard square icon and 3-pixel thick padding on top / bottom of element.
- */
- public static final int DEFAULT_HEIGHT = 22;
-
- public static final Color DEFAULT_REGULAR_FOREGROUND_COLOR = Color.BLUE;
- public static final Color DEFAULT_HOVER_FOREGROUND_COLOR = new Color(133, 53, 53);
-
-
- // This will hold the data which is relevant to processing the 'click' event on this label
- private final String strData;
-
- // This will hold a reference to ResourcePreviewBrowser instance that is supposed to process the clicks
- // on JClickableLabels
- private ActionListener clickHandler;
-
-
- private Color REGULAR_FOREGROUND_COLOR = DEFAULT_REGULAR_FOREGROUND_COLOR;
- private Color HOVER_FOREGROUND_COLOR = DEFAULT_HOVER_FOREGROUND_COLOR;
-
-
- public JClickableLabel(String strLabel, String strDataForAction, EventListener eventHandler)
- {
- this(strLabel, strDataForAction, eventHandler, null);
- }
-
- public JClickableLabel(String strLabel, String strDataForAction, EventListener eventHandler, Icon icon)
- {
- this(strLabel, strDataForAction, eventHandler, icon, SwingUtilities.LEFT);
- }
-
- public JClickableLabel(String strLabel, String strDataForAction, EventListener eventHandler, Icon icon, int horizontalAlignment)
- {
- this(strLabel, strDataForAction, eventHandler, icon, horizontalAlignment, null);
- }
-
- /**
- *
- * @param strLabel Textual label that will be visible in the UI.
- * @param strDataForAction Data that will be passed to eventHandler when click on the label is made.
- * @param eventHandler ActionListener that will process clicks on this label.
- * @param icon Icon to display in the label.
- * @param horizontalAlignment This is one of SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING
- * @param strTooltip Tooltip to show over the label - if none is provided (e.g. null value), the strLabel will be used as a tooltip.
- */
- public JClickableLabel(String strLabel, String strDataForAction, EventListener eventHandler, Icon icon, int horizontalAlignment, String strTooltip)
- {
- super(strLabel, icon, horizontalAlignment);
-
- this.strData = strDataForAction;
- this.clickHandler = (ActionListener)eventHandler;
-
- // empty border at the top and bottom will simulate "line-spacing"
- // (this is only needed when an icon is displayed)
- if (icon != null) {
- this.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
- }
-
- // the tooltip for now only shows the full label text
- this.setToolTipText(strTooltip == null ? strLabel : strTooltip);
- this.setForeground(REGULAR_FOREGROUND_COLOR);
- this.addMouseListener(this);
- }
-
-
- public void setRegularForegroundColor(Color regularForegroundColor)
- {
- REGULAR_FOREGROUND_COLOR = regularForegroundColor;
-
- // apply the new foreground color immediately
- this.setForeground(REGULAR_FOREGROUND_COLOR);
- }
-
- public Color getRegularForegroundColor() {
- return REGULAR_FOREGROUND_COLOR;
- }
-
-
- public void setHoverForegroundColor(Color hoverForegroundColor)
- {
- // will be applied the next time mouse hovers over this label
- HOVER_FOREGROUND_COLOR = hoverForegroundColor;
- }
-
- public Color getHoverForegroundColor() {
- return HOVER_FOREGROUND_COLOR;
- }
-
-
- /**
- * @return The "hidden" string value that is normally sent as an <code>ActionCommand</code>
- * within <code>ActionEvent</code> when JClickableLabel is clicked.
- */
- public String getData() {
- return (this.strData);
- }
-
-
- /**
- * @return String value of the label that this JClickableLabel would have in the UI.
- */
- public String toString() {
- return (this.getText());
- }
-
-
- /* This class extends JLabel, so it can't extend MouseAdapter;
- * therefore, empty methods will be added for not useful callbacks
- * from the MouseListener interface.
- */
- public void mouseClicked(MouseEvent e)
- {
- // call 'actionPerformed' method on the clickHandler instance that was supplied
- // on creation of the JClickableLabel instance
- this.clickHandler.actionPerformed(new ActionEvent(this, e.getID(), this.strData));
- }
-
- public void mouseEntered(MouseEvent e)
- {
- this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)) ;
- this.setForeground(HOVER_FOREGROUND_COLOR);
- }
-
- public void mouseExited(MouseEvent e)
- {
- this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)) ;
- this.setForeground(REGULAR_FOREGROUND_COLOR);
- }
-
- public void mousePressed(MouseEvent e)
- {
- // do nothing
- }
-
- public void mouseReleased(MouseEvent e)
- {
- // do nothing
- }
-
-
- /**
- * @return A dummy instance of JClickable label - only intended to
- * represent an object of this class; doesn't have a click handler,
- * so a click on it will result in a <code>NullPointerException</code>.
- */
- public static JClickableLabel getDummyInstance() {
- return (new JClickableLabel("dummy", "", null));
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/JWaitDialog.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/JWaitDialog.java
deleted file mode 100644
index 956635e..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/JWaitDialog.java
+++ /dev/null
@@ -1,250 +0,0 @@
-package org.apache.taverna.biocatalogue.ui;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-//import java.awt.Dimension;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import javax.swing.BorderFactory;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.UIManager;
-
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.workbench.MainWindow;
-
-/**
- * Creates a modal non-resizable dialog window.
- *
- * Intended to be used for operations that consume some
- * time, but the user must wait for them to complete before
- * proceeding.
- *
- * Initially the dialog shows a specified string message or
- * component and a "loader" bar - dynamic GIF image that
- * displays "activity" going on. At this stage the window
- * cannot be closed.
- *
- * When the operation completes, the caller notifies the dialog
- * that it has finished, provides a new message / component to
- * display and allows the dialog to be closed.
- *
- * If the operation doesn't complete within the specified time,
- * a timeout occurs and the dialog windows lets to close itself.
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class JWaitDialog extends JDialog
-{
- private static final int DEFAULT_TIMEOUT = 10000;
- private static final ImageIcon LOADER_ICON = ResourceManager.getImageIcon(ResourceManager.BAR_LOADER_ORANGE);
-
- private JPanel jpInformationPanel;
- private JLabel jlLoaderIcon;
-
- private JButton bOK;
- private JPanel jpOKButton;
-
- private Timer timeoutTimer;
- private boolean hasTimedOut;
-
-
- /**
- * Creates a new Wait Dialog with no parent and default timeout on
- * operation - <code>JWaitDialog.DEFAULT_TIMEOUT</code>.
- *
- * @param dialogTitle Title to set for the dialog window.
- * @param waitMessage Text to be displayed in the body of this dialog while
- * the user waits.
- */
- public JWaitDialog(String dialogTitle, String waitMessage) {
- this(null, dialogTitle, new JLabel(waitMessage, JLabel.CENTER), DEFAULT_TIMEOUT);
- }
-
-
- /**
- * Creates a new Wait Dialog with specified parent and default timeout on
- * operation - <code>JWaitDialog.DEFAULT_TIMEOUT</code>.
- *
- * @param owner Specified JFrame is set as an owner for this Wait Dialog.
- * @param dialogTitle Title to set for the dialog window.
- * @param waitMessage Text to be displayed in the body of this dialog while
- * the user waits.
- */
- public JWaitDialog(JFrame owner, String dialogTitle, String waitMessage) {
- this(owner, dialogTitle, new JLabel(waitMessage, JLabel.CENTER), DEFAULT_TIMEOUT);
- }
-
-
- /**
- * Creates a new Wait Dialog with specified parent and timeout on
- * operation.
- *
- * @param owner Specified JFrame is set as an owner for this Wait Dialog.
- * @param dialogTitle Title to set for the dialog window.
- * @param waitMessage Text to be displayed in the body of this dialog while
- * the user waits.
- * @param timeoutMillis Duration of the timeout on the operation - after this
- * time has passed the window will notify of the timeout
- * and allow to close itself. Value of 0 indicates that the timeout will never occur.
- */
- public JWaitDialog(JFrame owner, String dialogTitle, String waitMessage, int timeoutMillis) {
- this(owner, dialogTitle, new JLabel(waitMessage, JLabel.CENTER), timeoutMillis);
- }
-
-
- /**
- * Creates a new Wait Dialog with parent JFrame.
- *
- * @param owner Specified JFrame is set as an owner for this Wait Dialog.
- * @param dialogTitle Title to set for the dialog window.
- * @param waitInformationComponent Component to be shown in the body of this
- * dialog windows while the user waits for an operation to complete.
- * @param timeoutMillis Duration of the timeout on the operation - after this
- * time has passed the window will notify of the timeout
- * and allow to close itself. Value of 0 indicates that the timeout will never occur.
- */
- public JWaitDialog(JFrame owner, String dialogTitle, JComponent waitInformationComponent, int timeoutMillis)
- {
- super(owner);
- this.setModal(true);
- this.setTitle(dialogTitle);
-
- // this will show the wait message to the user
- jpInformationPanel = new JPanel(new GridLayout());
- jpInformationPanel.add(waitInformationComponent);
- jpInformationPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 10, 20));
-
- // some graphical indication that the loading activity is going on
- jlLoaderIcon = new JLabel(LOADER_ICON);
- jlLoaderIcon.setBorder(BorderFactory.createEmptyBorder(0, 20, 20, 20));
-
- // put components into the dialog box
- this.getContentPane().setLayout(new BorderLayout());
- this.getContentPane().add(jpInformationPanel, BorderLayout.CENTER);
- this.getContentPane().add(jlLoaderIcon, BorderLayout.SOUTH);
-
- this.pack();
- // Set the height of the dialog not to be more than 500; the message is in the scroll pane so that should be OK
- this.setSize(new Dimension(this.getPreferredSize().width, this.getPreferredSize().height > 500 ? 500 : this.getPreferredSize().height));
- // this.setResizable(false);
- this.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
-
- // center this window within the main Taverna Workbench window
- this.setLocationRelativeTo(MainWindow.getMainWindow());
-
-
- // start the timer - on timeout it will produce the
- // timeout message and allow to close the window
- hasTimedOut = false;
- if (timeoutMillis > 0)
- {
- timeoutTimer = new Timer();
- timeoutTimer.schedule(
- new TimerTask() {
- public void run() {
- waitFinished(new JLabel("<html><center>The operation did not complete within the " +
- "allocated time.</center></html>",
- UIManager.getIcon("OptionPane.warningIcon"), JLabel.CENTER));
- hasTimedOut = true;
- }
- },
- timeoutMillis);
- }
- }
-
-
- public void waitFinished(String resultMessage) {
- waitFinished(new JLabel(resultMessage, JLabel.CENTER));
- }
-
- public void waitFinished(JComponent resultInformationComponent)
- {
- // this prevents the real response to be set after the
- // timeout message was already displayed
- if (!hasTimedOut)
- {
- // first of all stop the timeout timer: if this
- // method was called by the application explicitly, not on
- // timeout, we don't want the timeout message to appear after that
- if (timeoutTimer != null) { timeoutTimer.cancel(); }
-
- // change the information component
- jpInformationPanel.removeAll();
- jpInformationPanel.add(resultInformationComponent);
-
- // the OK button will allow closing the window
- bOK = new JButton("OK");
- //bOK.setPreferredSize(new Dimension(LOADER_ICON.getIconWidth(), (int) (1.5 * LOADER_ICON.getIconHeight())));
- bOK.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- // just remove the window
- dispose();
- }
- });
- bOK.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_ENTER) {
- // a fallback mechanism - default button doesn't work for some reason
- // when the button is added into the dialog not in the constructor
- bOK.doClick();
- }
- }
- });
- bOK.setDefaultCapable(true);
- this.getRootPane().setDefaultButton(bOK);
-
- // wrap OK button into a panel to add empty borders
- jpOKButton = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
- jpOKButton.add(bOK);
- jpOKButton.setBorder(BorderFactory.createEmptyBorder(0, 20, 20 - (bOK.getPreferredSize().height - LOADER_ICON.getIconHeight()), 20));
-
-
- // add OK button instead of the loader icon
- this.getContentPane().remove(jlLoaderIcon);
- this.getContentPane().add(jpOKButton, BorderLayout.SOUTH);
- this.bOK.requestFocusInWindow();
-
- // re-enable (X) button in the title bar
- this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-
- // update the size of this window - as the inner sizes of components have
- // been likely to change; then center the dialog box within its parent
- this.pack();
- // Set the height of the dialog not to be more than 500; the message is in the scroll pane so that should be OK
- this.setSize(new Dimension(this.getPreferredSize().width, this.getPreferredSize().height > 500 ? 500 : this.getPreferredSize().height));
- this.setLocationRelativeTo(MainWindow.getMainWindow());
- }
- }
-
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/SearchOptionsPanel.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/SearchOptionsPanel.java
deleted file mode 100644
index 8d6c7c4..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/SearchOptionsPanel.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.apache.taverna.biocatalogue.ui;
-/*
- * 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.
- */
-
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.util.Arrays;
-
-import javax.swing.AbstractAction;
-import javax.swing.JButton;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-import javax.swing.event.CaretEvent;
-import javax.swing.event.CaretListener;
-
-import org.apache.taverna.biocatalogue.model.BioCataloguePluginConstants;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.model.search.SearchOptions;
-import org.apache.taverna.biocatalogue.ui.search_results.SearchResultsMainPanel;
-import org.apache.taverna.lang.ui.DeselectingButton;
-
-
-/**
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class SearchOptionsPanel extends JPanel implements HasDefaultFocusCapability
-{
- // COMPONENTS
- private SearchOptionsPanel thisPanel;
-
-private JTextField tfSearchQuery;
- private JButton bSearch;
-
- private final SearchResultsMainPanel tabbedSearchResultsPanel;
-
-
- public SearchOptionsPanel(SearchResultsMainPanel tabbedSearchResultsPanel)
- {
- super();
- this.thisPanel = this;
- this.tabbedSearchResultsPanel = tabbedSearchResultsPanel;
-
- this.initialiseUI();
- }
-
-
- private void initialiseUI()
- {
- this.setLayout(new GridBagLayout());
- GridBagConstraints c = new GridBagConstraints();
-
- c.gridx = 0;
- c.gridy = 0;
- c.weightx = 0.0;
- c.fill = GridBagConstraints.NONE;
-
-
- this.tfSearchQuery = new JTextField(30);
- this.tfSearchQuery.setToolTipText(
- "<html> Tips for creating search queries:<br>" +
- " 1) Use wildcards to make more flexible queries. Asterisk (<b>*</b>) matches any zero or more<br>" +
- " characters (e.g. <b><i>Seq*</i></b> would match <b><i>Sequence</i></b>), question mark (<b>?</b>) matches any single<br>" +
- " character (e.g. <b><i>Bla?t</i></b> would match <b><i>Blast</i></b>).<br>" +
- " 2) Enclose the <b><i>\"search query\"</i></b> in double quotes to make exact phrase matching, otherwise<br>" +
- " items that contain any (or all) words in the <b><i>search query</i></b> will be found.</html>");
-
- this.tfSearchQuery.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- tfSearchQuery.selectAll();
- }
- public void focusLost(FocusEvent e) { /* do nothing */ }
- });
- this.tfSearchQuery.addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- // ENTER pressed - start search by simulating "search" button click
- // (only do this if the "search" button was active at that moment)
- if (e.getKeyCode() == KeyEvent.VK_ENTER && bSearch.isEnabled()) {
- bSearch.doClick();
- }
- }
- });
- JButton jbClearSearch = new DeselectingButton(new AbstractAction("Clear") {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- tfSearchQuery.setText("");
- clearSearch();
- }}, "");
- jbClearSearch.setIcon(ResourceManager.getImageIcon(ResourceManager.CLEAR_ICON));
-
- this.add(jbClearSearch, c);
-
- c.gridx++;
- c.fill = GridBagConstraints.HORIZONTAL;
- c.weightx = 0.1;
- this.add(tfSearchQuery, c);
-
-
- // --- Search button ---
-
- c.gridx++;
- c.weightx = 0;
- c.fill = GridBagConstraints.NONE;
- c.anchor = GridBagConstraints.EAST;
- this.bSearch = new DeselectingButton("Search",
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (getSearchQuery().length() == 0) {
- clearSearch();
- }
- else {
- // search query available - collect data about the current search and execute it
- tabbedSearchResultsPanel.startNewSearch(thisPanel.getState());
- }
- }
- },
- tfSearchQuery.getToolTipText());
- this.bSearch.setIcon(ResourceManager.getImageIcon(ResourceManager.SEARCH_ICON));
- this.add(bSearch, c);
-
-}
-
- private void clearSearch() {
- tabbedSearchResultsPanel.clearSearch();
- thisPanel.focusDefaultComponent();
- }
-
- /**
- * Saves the current state of the search options into a single {@link SearchOptions} object.
- */
- public SearchOptions getState() {
- return (new SearchOptions(getSearchQuery(), Arrays.asList(TYPE.values())));
- }
-
-
- // *** GETTERS AND SETTERS ***
-
- public String getSearchQuery() {
- return (this.tfSearchQuery.getText().trim());
- }
- public void setSearchQuery(String strSearchQuery) {
- this.tfSearchQuery.setText(strSearchQuery);
- }
-
-
- // *** Callbacks for HasDefaultFocusCapability interface ***
-
- public void focusDefaultComponent() {
- this.tfSearchQuery.selectAll();
- this.tfSearchQuery.requestFocusInWindow();
- }
-
- public Component getDefaultComponent() {
- return(this.tfSearchQuery);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/filtertree/FilterTreeNode.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/filtertree/FilterTreeNode.java
deleted file mode 100644
index 956c54d..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/filtertree/FilterTreeNode.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.filtertree;
-/*
- * 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.
- */
-
-import org.apache.taverna.biocatalogue.ui.tristatetree.TriStateTreeNode;
-
-/**
- * This class allows storing two pieces of data relevant to content filtering
- * within the node of a tree. These values are kept hidden from the user and
- * are only used when the filtering is about to happen.
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class FilterTreeNode extends TriStateTreeNode
-{
- private String type;
- private String urlValue;
- final private boolean isFilterCategory;
-
-
- /**
- * This constructor is useful for root nodes, which need not have filter type / value.
- */
- public FilterTreeNode(Object userObject) {
- super(userObject);
-
- this.isFilterCategory = true;
- }
-
-
- /**
- * @param userObject As in the superclass (DefaultMutableTreeNode) - the object which represents the node in the UI
- * @param filterType Type of the filter - e.g. 'Service Categories' --> "cat"; 'Service Types' --> "t"
- * @param filterUrlValue Value that should be added to the URL to perform the filtering operation
- */
- public FilterTreeNode(Object userObject, String filterType, String filterUrlValue) {
- super(userObject);
-
- this.setType(filterType);
- this.setUrlValue(filterUrlValue);
- this.isFilterCategory = false;
- }
-
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getType() {
- return type;
- }
-
- public void setUrlValue(String urlValue) {
- this.urlValue = urlValue;
- }
-
-
- public String getUrlValue() {
- return urlValue;
- }
-
- /**
- * @return True if and only if this node is one of the "root" filter categories (not to be mixed with root of the filter tree).
- */
- public boolean isFilterCategory() {
- return isFilterCategory;
- }
-
-
- /**
- * @return <code>true</code> if the current {@link FilterTreeNode} represents a tag with a namespace
- * (i.e. an ontological term), whose full tag name looks like:
- * <code>< http://example.namespace.com#tag_display_name ></code>
- */
- public boolean isTagWithNamespaceNode() {
- return (this.getType() != null && this.getType().contains("tag") && this.getUrlValue().contains("#") &&
- this.getUrlValue().startsWith("<") && this.getUrlValue().endsWith(">"));
- }
-
-
- /**
- * Static wrapper for {@link FilterTreeNode#isTagWithNamespaceNode()}
- *
- * @param filterType
- * @param filterUrlValue
- * @return
- */
- public static boolean isTagWithNamespaceNode(String filterType, String filterUrlValue) {
- return (new FilterTreeNode("test_user_object", filterType, filterUrlValue).isTagWithNamespaceNode());
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/filtertree/FilterTreePane.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/filtertree/FilterTreePane.java
deleted file mode 100644
index a35a8da..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/filtertree/FilterTreePane.java
+++ /dev/null
@@ -1,364 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.filtertree;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.BorderFactory;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
-import javax.swing.JScrollPane;
-import javax.swing.JToolBar;
-import javax.swing.SwingUtilities;
-
-import org.apache.taverna.biocatalogue.model.BioCataloguePluginConstants;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.biocatalogue.model.search.SearchInstance;
-import org.apache.taverna.biocatalogue.model.search.ServiceFilteringSettings;
-import org.apache.taverna.biocatalogue.ui.tristatetree.JTriStateTree;
-import org.apache.taverna.biocatalogue.ui.tristatetree.TriStateTreeCheckingListener;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-import org.apache.taverna.workbench.icons.WorkbenchIcons;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.log4j.Logger;
-
-import org.biocatalogue.x2009.xml.rest.Filter;
-import org.biocatalogue.x2009.xml.rest.FilterGroup;
-import org.biocatalogue.x2009.xml.rest.FilterType;
-import org.biocatalogue.x2009.xml.rest.Filters;
-
-/**
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class FilterTreePane extends JPanel implements TriStateTreeCheckingListener
-{
- private TYPE resourceType;
- private String filtersURL;
- private BioCatalogueClient client;
- private Logger logger;
-
- private FilterTreePane thisPanel;
-
- private JToolBar tbFilterTreeToolbar;
-
- private JPanel jpFilters = null;
- private JFilterTree filterTree; // tree component to display filter selections
- private Filters filtersRoot; // last filters element which was received from the API
-
-
-
- public FilterTreePane(TYPE resourceType)
- {
- this.thisPanel = this;
-
- this.resourceType = resourceType;
- this.filtersURL = resourceType.getAPIResourceCollectionFiltersURL();
- this.client = BioCatalogueClient.getInstance();
- this.logger = Logger.getLogger(this.getClass());
-
- initialiseUI();
- loadFiltersAndBuildTheTree();
- }
-
-
- private void initialiseUI()
- {
- jpFilters = new JPanel();
- jpFilters.setBackground(Color.WHITE);
-
- JScrollPane spFilters = new JScrollPane(jpFilters);
- spFilters.setMinimumSize(new Dimension(235,0));
- spFilters.setPreferredSize(new Dimension(300,0));
- spFilters.getVerticalScrollBar().setUnitIncrement(BioCataloguePluginConstants.DEFAULT_SCROLL);
-
-
- tbFilterTreeToolbar = createTreeActionToolbar();
- resetTreeActionToolbar();
-
- this.setLayout(new BorderLayout());
- this.add(tbFilterTreeToolbar, BorderLayout.NORTH);
- this.add(spFilters, BorderLayout.CENTER);
- }
-
-
- /**
- * @return A toolbar that replicates all actions available in the contextual menu of
- * the filtering tree - mainly: saving current filter, reloading filter tree,
- * expanding/collapsing and selecting/deselecting everything in the tree.
- */
-private JToolBar createTreeActionToolbar()
- {
-
-
- // the actual toolbar - no actions are added to it yet: done in a separate method
- JToolBar tbTreeActions = new JToolBar(JToolBar.HORIZONTAL);
- tbTreeActions.setAlignmentX(RIGHT_ALIGNMENT);
- tbTreeActions.setBorderPainted(true);
- tbTreeActions.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
- tbTreeActions.setFloatable(false);
- return (tbTreeActions);
- }
-
-
- /**
- * Resets the action toolbar to the original state.
- */
- public void resetTreeActionToolbar()
- {
-
- tbFilterTreeToolbar.removeAll();
- tbFilterTreeToolbar.repaint();
- }
-
-
- /**
- * This method loads filter data from API and populates the view.
- */
- private void loadFiltersAndBuildTheTree()
- {
- SwingUtilities.invokeLater(new Runnable() {
- public void run()
- {
- resetTreeActionToolbar();
-
- jpFilters.removeAll();
- jpFilters.setLayout(new BorderLayout());
- jpFilters.add(new JLabel(" Loading filters..."), BorderLayout.NORTH);
- jpFilters.add(new JLabel(ResourceManager.getImageIcon(ResourceManager.BAR_LOADER_ORANGE)), BorderLayout.CENTER);
- thisPanel.validate();
- thisPanel.repaint(); // validate and repaint this component to make sure that
- // scroll bar around the filter tree placeholder panel disappears
- }
- });
-
- new Thread("Load filters") {
- public void run() {
- try {
- // load filter data
- filtersRoot = client.getBioCatalogueFilters(filtersURL);
-
- // Create root of the filter tree component
- FilterTreeNode root = new FilterTreeNode("root");
-
- // populate the tree via its root element
- for (FilterGroup fgroup : filtersRoot.getGroupList())
- {
- // attach filter group directly to the root node
- FilterTreeNode fgroupNode = new FilterTreeNode("<html><span style=\"color: black; font-weight: bold;\">" + StringEscapeUtils.escapeHtml(fgroup.getName().toString()) + "</span></html>");
- root.add(fgroupNode);
-
-
- // go through all filter types in this group and add them to the tree
- for (FilterType ftype : fgroup.getTypeList())
- {
- // if there's more than one filter type in the group, add the type node as another level of nesting
- // (otherwise, attach filters inside the single type directly to the group node)
- FilterTreeNode filterTypeNode = fgroupNode;
- if (fgroup.getTypeList().size() > 1) {
- filterTypeNode = new FilterTreeNode("<html><span style=\"color: black; font-weight: bold;\">" + StringEscapeUtils.escapeHtml(ftype.getName().toString()) + "</span></html>");
- fgroupNode.add(filterTypeNode);
- }
-
- // For some reason sorting the list of filters before inserting into tree
- // messes up the tree nodes
-// Collections.sort(ftype.getFilterList(), new Comparator<Filter>(){
-// @Override
-// public int compare(Filter f1, Filter f2) {
-// return (f1.getName().compareToIgnoreCase(f2.getName()));
-// }
-// });
- addFilterChildren(filterTypeNode, ftype.getUrlKey().toString(), ftype.getFilterList());
- }
- }
-
- // Create the tree view with the populated root
- filterTree = new JFilterTree(root);
- filterTree.setRootVisible(false); // don't want the root to be visible; not a standard thing, so not implemented within JTriStateTree
- filterTree.setLargeModel(true); // potentially can have many filters!
- filterTree.addCheckingListener(thisPanel);
-
-
- // insert the created tree view into the filters panel
- jpFilters.removeAll();
- jpFilters.setLayout(new GridLayout(0,1));
- jpFilters.add(filterTree);
- jpFilters.validate();
-
-
- // add actions from the contextual menu of the filter tree into the toolbar
- // that replicates those plus adds additional ones in this panel
- tbFilterTreeToolbar.removeAll();
- for (Action a : filterTree.getContextualMenuActions()) {
- tbFilterTreeToolbar.add(a);
- }
-
-
- // enable all actions
- filterTree.enableAllContextualMenuAction(true);
- }
- catch (Exception e) {
- logger.error("Failed to load filter tree from the following URL: " + filtersURL, e);
- }
- }
-
-
- /**
- * Recursive method to populate a node of the filter tree with all
- * sub-filters.
- *
- * Ontological terms will be underlined.
- *
- * @param root Tree node to add children to.
- * @param filterList A list of Filters to add to "root" as children.
- */
- private void addFilterChildren(FilterTreeNode root, String filterCategory, List<Filter> filterList) {
- for (Filter f : filterList) {
-
- // Is this an ontological term?
- String ontology = null;
- if (FilterTreeNode.isTagWithNamespaceNode(filterCategory, f
- .getUrlValue())) {
- String nameAndNamespace = f.getUrlValue().substring(1,
- f.getUrlValue().length() - 1);
- String[] namePlusNamespace = nameAndNamespace
- .split("#");
- ontology = JFilterTree
- .getOntologyFromNamespace(namePlusNamespace[0]);
- }
-
- FilterTreeNode fNode = new FilterTreeNode("<html><span color=\"black\"" /*(FilterTreeNode.isTagWithNamespaceNode(filterCategory, f.getUrlValue()) ? " style=\"text-decoration: underline;\"" : "") */ + ">" +
- StringEscapeUtils.escapeHtml(f.getName()) + " (" + f.getCount() + ")" + "</span>" +
- /*(FilterTreeNode.isTagWithNamespaceNode(filterCategory, f.getUrlValue()) ? "<span color=\"gray\"> ("+f.getCount().intValue()+")</span></html>" : "</html>"),*/
- (ontology != null ? "<span color=\"#3090C7\"> <"+ ontology +"></span></html>" : "</html>"),
- filterCategory, f.getUrlValue());
- addFilterChildren(fNode, filterCategory, f.getFilterList());
-
- // Insert the node into the (alphabetically) sorted children nodes
- List<FilterTreeNode> children = Collections.list(root.children());
- // Search for the index the new node should be inserted at
- int index = Collections.binarySearch(children, fNode,
- new Comparator<FilterTreeNode>() {
- @Override
- public int compare(FilterTreeNode o1,
- FilterTreeNode o2) {
- String str1 = ((String) o1.getUserObject())
- .toString();
- String str2 = ((String) o2.getUserObject())
- .toString();
- return (str1.compareToIgnoreCase(str2));
- }
- });
-
- if (index < 0){ // not found - index will be equal to -insertion-point -1
- index = -index - 1;
- }// else node with the same name found in the array - insert it at that position
- root.insert(fNode, index);
-
- //root.add(fNode);
- }
- }
- }.start();
- }
-
-
- /**
- * @param si Uses this SearchInstance to restore the checking
- * state of filtering criteria in the filter tree.
- */
- public void restoreFilteringSettings(SearchInstance si) {
- this.filterTree.restoreFilterCheckingSettings(si.getFilteringSettings().getFilterTreeRootsOfCheckedPaths());
- }
-
-
- /**
- * Clears any selections made in the filter tree -
- * i.e. both clears checked nodes and removes all tree path selections.
- */
- public void clearSelection() {
- // filter tree may not have been initialised yet, so perform a check
- if (this.filterTree != null)
- {
- // remove, then restore self as a listener - this is to avoid
- // receiving checking state change event
- this.filterTree.removeCheckingListener(thisPanel);
- this.filterTree.selectAllNodes(false);
- this.filterTree.clearSelection();
- this.filterTree.addCheckingListener(thisPanel);
- }
- }
-
-
- /**
- * Collapses all expanded nodes in the filter tree.
- */
- public void collapseAll() {
- // filter tree may not have been initialised yet, so perform a check
- if (this.filterTree != null) {
- this.filterTree.collapseAll();
- }
- }
-
- public void applyQueryString(final String queryString) {
- this.filtersURL = resourceType.getAPIResourceCollectionFiltersURL() + "?q=" + queryString;
- loadFiltersAndBuildTheTree();
- }
-
- /**
- * Used for making preferred height of the search status label
- * the same as the height of this toolbar.
- *
- * @return
- */
- public Dimension getTreeToolbarPreferredSize() {
- return this.tbFilterTreeToolbar.getPreferredSize();
- }
-
-
- // *** Callback for TriStateTreeCheckingListener ***
-
- /**
- * We start a new search as soon as checking state of the filter tree changes.
- */
- public void triStateTreeCheckingChanged(JTriStateTree source)
- {
- MainComponentFactory.getSharedInstance().getBioCatalogueExplorationTab().getTabbedSearchResultsPanel().
- startNewFiltering(resourceType, new ServiceFilteringSettings(filterTree));
- }
-
-
-public void reset() {
- this.filtersURL = resourceType.getAPIResourceCollectionFiltersURL();
- loadFiltersAndBuildTheTree();
-}
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/filtertree/JFilterTree.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/filtertree/JFilterTree.java
deleted file mode 100644
index 104df89..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/filtertree/JFilterTree.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.filtertree;
-/*
- * 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.
- */
-
-import java.awt.event.MouseEvent;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.taverna.biocatalogue.ui.tristatetree.JTriStateTree;
-import org.apache.taverna.biocatalogue.ui.tristatetree.TriStateTreeNode;
-
-/**
- * This subclass of {@link JTriStateTree} provides custom behaviour
- * for tooltips: ontological terms will now always get a tooltip that
- * displays the namespace for the tag, but plain text tags will still
- * behave as before - the way it is defined in the superclass (so that
- * the tooltip will only be shown if the tag does not fully fit into
- * the visible part of the {@link FilterTreePane}.
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class JFilterTree extends JTriStateTree
-{
-
- private static Map<String, String> nameSpaceToOntologyMap = new HashMap<String, String>(){
- {
- put("http://www.mygrid.org.uk/ontology", "mygrid-domain-ontology");
- put("http://www.mygrid.org.uk/mygrid-moby-service", "mygrid-service-ontology");
- }
- };
-
-
- public JFilterTree(TriStateTreeNode root) {
- super(root);
- }
-
-
- public String getToolTipText(MouseEvent e)
- {
- Object correspondingObject = super.getTreeNodeObject(e);
- if (correspondingObject != null && correspondingObject instanceof FilterTreeNode) {
- FilterTreeNode filterNode = (FilterTreeNode) correspondingObject;
-
- if (filterNode.isTagWithNamespaceNode())
- {
- String nameAndNamespace = filterNode.getUrlValue().substring(1, filterNode.getUrlValue().length() - 1);
- String[] namePlusNamespace = nameAndNamespace.split("#");
-
- return ("<html>" + namePlusNamespace[1] + " (<b>Namespace: </b>" + namePlusNamespace[0] + ")</html>");
- }
- }
-
- return super.getToolTipText(e);
- }
-
- public static String getOntologyFromNamespace(String namespace){
- if (namespace == null){
- return null;
- }
- else{
- if (nameSpaceToOntologyMap.containsKey(namespace)){
- return nameSpaceToOntologyMap.get(namespace);
- }
- else{
- return null;
- }
- }
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/ExpandableOnDemandLoadedListCellRenderer.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/ExpandableOnDemandLoadedListCellRenderer.java
deleted file mode 100644
index 2a3619e..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/ExpandableOnDemandLoadedListCellRenderer.java
+++ /dev/null
@@ -1,236 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.search_results;
-/*
- * 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.
- */
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.Rectangle;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.BorderFactory;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.ListCellRenderer;
-import javax.swing.SwingUtilities;
-
-import org.apache.taverna.biocatalogue.model.LoadingResource;
-import org.apache.taverna.biocatalogue.model.Resource;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-
-import org.biocatalogue.x2009.xml.rest.ResourceLink;
-
-
-/**
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public abstract class ExpandableOnDemandLoadedListCellRenderer extends JPanel implements ListCellRenderer
-{
- protected static final int DESCRIPTION_MAX_LENGTH_COLLAPSED = 90;
- protected static final int DESCRIPTION_MAX_LENGTH_EXPANDED = 500;
-
- protected static final int LINE_LENGTH = 90;
-
-
- protected static final int TOOLTIP_DESCRIPTION_LENGTH = 150;
- protected static final int TOOLTIP_LINE_LENGTH = 60;
-
- // list cells are not repainted by Swing by default - hence to use animated GIFs inside cells,
- // need to have a special class that takes care of changing the frames as necessary
- protected JLabel loaderBarAnimationOrange = new JLabel(ResourceManager.getImageIcon(ResourceManager.BAR_LOADER_ORANGE), JLabel.CENTER);
- protected JLabel loaderBarAnimationGrey = new JLabel(ResourceManager.getImageIcon(ResourceManager.BAR_LOADER_GREY), JLabel.CENTER);
- protected JLabel loaderBarAnimationGreyStill = new JLabel (ResourceManager.getImageIcon(ResourceManager.BAR_LOADER_GREY_STILL), JLabel.CENTER);
-
-
- protected JPanel thisPanel;
- private List<Class<? extends ResourceLink>> resourceClasses;
-
-
- protected JLabel jlExpand;
- protected static Rectangle expandRect;
-
- public ExpandableOnDemandLoadedListCellRenderer()
- {
- this.thisPanel = this;
-
- resourceClasses = new ArrayList<Class<? extends ResourceLink>>();
- try {
- for (Resource.TYPE resourceType : Resource.TYPE.values()) {
- resourceClasses.add(resourceType.getXmlBeansGeneratedClass());
- }
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
-
- public static Rectangle getExpandRect() {
- return (expandRect == null ? new Rectangle() : expandRect);
- }
-
-
- public Component getListCellRendererComponent(JList list, Object itemToRender, int itemIndex, boolean isSelected, boolean cellHasFocus)
- {
- // the same instance of the cell renderer is used for all cells, so
- // need to remove everything from the current panel to ensure clean
- // painting of the current cell
- this.removeAll();
-
- // GET THE DATA
-
- // LoadingResource is a placeholder for the detailed data on the resource --
- // it is being quickly fetched from the API and contanins just the name and the URL
- // of the actual resource;
- //
- // these entries will be placed into the list when the initial part of the search
- // is complete, further details will be loaded asynchronously and inserted into
- // the same area
- if (itemToRender instanceof LoadingResource) {
- prepareInitiallyLoadingEntry(itemToRender);
- }
-
- // real data about some resource: details, but in the collapsed form
- else if (isInstanceOfResourceType(itemToRender)) {
- prepareLoadedEntry(itemToRender, isSelected);
- }
-
- // error case - unknown resource...
- else {
- prepareUnknownResourceTypeEntry();
- }
-
-
- // MAKE SURE CELL SELECTION WORKS AS DESIRED
- if (shouldBeHidden(itemToRender)) {
- this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(3, 4, 3, 4, list.getBackground()),
- BorderFactory.createLineBorder(Color.DARK_GRAY)));
- setBackground(list.getBackground());
- setForeground(list.getBackground());
- }
- else if (isSelected) {
- this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(3, 4, 3, 4, list.getBackground()),
- BorderFactory.createLineBorder(Color.DARK_GRAY)));
- setBackground(Color.decode("#BAE8FF")); // very light blue colour
- setForeground(list.getSelectionForeground());
- } else {
- this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(3, 4, 3, 4, list.getBackground()),
- BorderFactory.createLineBorder(Color.DARK_GRAY)));
- setBackground(Color.WHITE);
- setForeground(list.getForeground());
- }
-
- this.revalidate();
-
- if (expandRect == null && jlExpand != null) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- expandRect = jlExpand.getBounds();
- expandRect.x -= Math.abs(thisPanel.getBounds().x);
- }
- });
- }
-
- return (this);
- }
-
-
- /**
- * This entry can be in one of two states:
- * -- containing only the name of the resource and NOT loading further details;
- * -- containing only the name of the resource and LOADING further details.
- *
- * @param itemToRender
- * @return
- */
- protected abstract GridBagConstraints prepareInitiallyLoadingEntry(Object itemToRender);
-
-
- /**
- *
- * @param itemToRender
- * @param isSelected
- * @param expandedView <code>true</code> to indicate that this method generates the top
- * fragment of the expanded list entry for this SOAP operation / REST method.
- * @return
- */
- protected abstract GridBagConstraints prepareLoadedEntry(Object itemToRender, boolean isSelected);
-
-
- private void prepareUnknownResourceTypeEntry()
- {
- this.setLayout(new GridBagLayout());
- GridBagConstraints c = new GridBagConstraints();
- c.anchor = GridBagConstraints.NORTHWEST;
- c.fill = GridBagConstraints.HORIZONTAL;
-
- c.gridx = 0;
- c.gridy = 0;
- c.weightx = 0;
- c.insets = new Insets(8, 6, 6, 3);
- this.add(new JLabel(ResourceManager.getImageIcon(ResourceManager.UNKNOWN_RESOURCE_TYPE_ICON)), c);
-
- c.gridx++;
- c.weightx = 1.0;
- c.insets = new Insets(8, 3, 6, 3);
- this.add(new JLabel("<html><font color=\"#FF0000\">ERROR: This item shoulnd't have been here...</font></html>"), c);
-
- c.gridx = 1;
- c.gridy++;
- c.gridheight = 1;
- c.weightx = 1.0;
- c.weighty = 0;
- c.insets = new Insets(3, 3, 3, 3);
- this.add(new JLabel(" "), c);
-
- c.gridy++;
- c.insets = new Insets(3, 3, 8, 3);
- this.add(new JLabel(" "), c);
- }
-
-
- private boolean isInstanceOfResourceType(Object itemToRender)
- {
- for (Class<? extends ResourceLink> resourceClass : resourceClasses) {
- if (resourceClass.isInstance(itemToRender)) {
- return (true);
- }
- }
-
- return (false);
- }
-
- protected TYPE determineResourceType(Object itemToRender) {
- if (itemToRender instanceof ResourceLink) {
- return (Resource.getResourceTypeFromResourceURL(((ResourceLink)itemToRender).getHref()));
- }
- else {
- return (null);
- }
- }
-
- abstract boolean shouldBeHidden(Object itemToRender);
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/RESTMethodListCellRenderer.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/RESTMethodListCellRenderer.java
deleted file mode 100644
index 7a3e894..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/RESTMethodListCellRenderer.java
+++ /dev/null
@@ -1,264 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.search_results;
-/*
- * 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.
- */
-
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.JLabel;
-
-import org.apache.taverna.biocatalogue.model.LoadingResource;
-import org.apache.taverna.biocatalogue.model.Resource;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.lang.ui.ReadOnlyTextArea;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.ServiceMonitoringStatusInterpreter;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.biocatalogue.x2009.xml.rest.RestMethod;
-import org.biocatalogue.x2009.xml.rest.RestParameter;
-import org.biocatalogue.x2009.xml.rest.RestRepresentation;
-import org.biocatalogue.x2009.xml.rest.Service;
-import org.biocatalogue.x2009.xml.rest.RestMethod.Ancestors;
-
-
-/**
- *
- *
- * @author Sergejs Aleksejevs
- */
-public class RESTMethodListCellRenderer extends ExpandableOnDemandLoadedListCellRenderer
-{
- private JLabel jlTypeIcon = new JLabel();
- private JLabel jlItemStatus = new JLabel();
- private JLabel jlItemTitle = new JLabel("X");
- private JLabel jlPartOf = new JLabel("X");
- private ReadOnlyTextArea jtDescription = new ReadOnlyTextArea(5, 80);
- private JLabel jlMethodType = new JLabel("X");
- private JLabel jlUrlTemplate = new JLabel("X");
- private JLabel jlMethodParameters = new JLabel("X");
- private JLabel jlInputRepresentations = new JLabel("X");
- private JLabel jlOutputRepresentations = new JLabel("X");
-
- private GridBagConstraints c;
-
- private static Resource.TYPE resourceType = Resource.TYPE.RESTMethod;
-
-
-
- public RESTMethodListCellRenderer() {
- jlItemTitle.setFont(jlItemTitle.getFont().deriveFont(Font.PLAIN, jlItemTitle.getFont().getSize() + 2));
- jtDescription.setOpaque(false);
- jtDescription.setLineWrap(true);
- jtDescription.setWrapStyleWord(true);
- }
-
-
-
- /**
- * This entry can be in one of two states:
- * -- containing only the name of the resource and NOT loading further details;
- * -- containing only the name of the resource and LOADING further details.
- *
- * @param itemToRender
- * @return
- */
- protected GridBagConstraints prepareInitiallyLoadingEntry(Object itemToRender)
- {
- LoadingResource resource = (LoadingResource)itemToRender;
-
- jlTypeIcon.setIcon(resourceType.getIcon());
- jlItemStatus.setIcon(ResourceManager.getImageIcon(ResourceManager.SERVICE_STATUS_UNCHECKED_ICON_LARGE));
-
- jlItemTitle.setText("<html>" + StringEscapeUtils.escapeHtml(Resource.getDisplayNameForResource(resource)) + "<font color=\"gray\"><i>- fetching more information</i></font></html>");
-
- jlPartOf.setText("");
- jtDescription.setText(" ");
- jlMethodType.setText(" ");
- jlUrlTemplate.setText(" ");
- jlMethodParameters.setText(" ");
- jlInputRepresentations.setText(" ");
- jlOutputRepresentations.setText(" ");
-
- return (arrangeLayout());
- }
-
-
- /**
- *
- * @param itemToRender
- * @param expandedView <code>true</code> to indicate that this method generates the top
- * fragment of the expanded list entry for this SOAP operation / REST method.
- * @return
- */
- protected GridBagConstraints prepareLoadedEntry(Object itemToRender, boolean selected)
- {
- RestMethod restMethod = (RestMethod)itemToRender;;
-
- Ancestors ancestors = restMethod.getAncestors();
- Service service = ancestors.getService();
- String title = "<html>" + StringEscapeUtils.escapeHtml(Resource.getDisplayNameForResource(restMethod));
-
- if (restMethod.isSetArchived() || service.isSetArchived()) {
- jlTypeIcon.setIcon(ResourceManager.getImageIcon(ResourceManager.WARNING_ICON));
- title = title + "<i> - this operation is archived and probably cannot be used</i></html>";
- }
- else {
- jlTypeIcon.setIcon(resourceType.getIcon());
- title = title + "</html>";
- }
-
- // service status
- jlItemStatus.setIcon(ServiceMonitoringStatusInterpreter.getStatusIcon(service, false));
- jlItemTitle.setText(title);
-
- jlPartOf.setText("<html><b>Part of: </b>" + restMethod.getAncestors().getRestService().getResourceName() + "</html>");
-
- String strDescription = (restMethod.getDescription() == null || restMethod.getDescription().length() == 0 ?
- "No description" :
- Util.stripAllHTML(restMethod.getDescription()));
- jtDescription.setText(strDescription);
-
- jlMethodType.setText("<html><b>HTTP Method: </b>" + StringEscapeUtils.escapeHtml(restMethod.getHttpMethodType().toString()) + "</html>");
- jlUrlTemplate.setText("<html><b>URL Template: </b>" + StringEscapeUtils.escapeHtml(restMethod.getUrlTemplate()) + "</html>");
-
- List<String> names = new ArrayList<String>();
- for (RestParameter restParameter : restMethod.getInputs().getParameters().getRestParameterList()) {
- names.add(restParameter.getName() + (restParameter.getIsOptional() ? " (optional)" : ""));
- }
-
- String methodParameters = "<b>" + names.size() + " " + Util.pluraliseNoun("Parameter", names.size()) + "</b>";
- if(names.size() > 0) {
- methodParameters += ": " + StringEscapeUtils.escapeHtml(Util.ensureLineLengthWithinString(Util.join(names, ", "), LINE_LENGTH, false));
- }
- methodParameters = "<html>" + methodParameters + "</html>";
- jlMethodParameters.setText(methodParameters);
-
- names.clear();
- for (RestRepresentation restRepresentation : restMethod.getInputs().getRepresentations().getRestRepresentationList()) {
- names.add(restRepresentation.getContentType());
- }
-
- String inputRepresentations = "<b>" + names.size() + " " + Util.pluraliseNoun("Input representation", names.size()) + "</b>";
- if(names.size() > 0) {
- inputRepresentations += ": " + StringEscapeUtils.escapeHtml(Util.ensureLineLengthWithinString(Util.join(names, ", "), LINE_LENGTH, false));
- }
- inputRepresentations = "<html>" + inputRepresentations + "</html>";
-
- jlInputRepresentations.setText(inputRepresentations);
-
- // output representations
- names.clear();
- for (RestRepresentation restRepresentation : restMethod.getOutputs().getRepresentations().getRestRepresentationList()) {
- names.add(restRepresentation.getContentType());
- }
-
- String outputRepresentations = "<b>" + names.size() + " " + Util.pluraliseNoun("Output representation", names.size()) + "</b>";
- if(names.size() > 0) {
- outputRepresentations += ": " + StringEscapeUtils.escapeHtml(Util.ensureLineLengthWithinString(Util.join(names, ", "), LINE_LENGTH, false));
- }
- outputRepresentations = "<html>" + outputRepresentations + "</html>";
-
- jlOutputRepresentations.setText(outputRepresentations);
-
- return (arrangeLayout());
- }
-
-
- /**
- * @return Final state of the {@link GridBagConstraints} instance
- * that was used to lay out components in the panel.
- */
- private GridBagConstraints arrangeLayout()
- {
- // POPULATE PANEL WITH PREPARED COMPONENTS
- this.setLayout(new GridBagLayout());
- c = new GridBagConstraints();
- c.anchor = GridBagConstraints.NORTHWEST;
- c.fill = GridBagConstraints.HORIZONTAL;
-
- c.gridx = 0;
- c.gridy = 0;
- c.weightx = 0;
- c.insets = new Insets(8, 6, 6, 3);
- this.add(jlTypeIcon, c);
-
- c.gridx++;
- c.weightx = 1.0;
- c.insets = new Insets(8, 3, 6, 3);
- this.add(jlItemTitle, c);
-
- c.gridx++;
- c.gridheight = 8;
- c.weightx = 0;
- c.weighty = 1.0;
- this.add(jlItemStatus, c);
-
- c.gridx = 1;
- c.gridy++;
- c.gridheight = 1;
- c.weightx = 1.0;
- c.weighty = 0;
- this.add(jlPartOf, c);
-
- c.fill = GridBagConstraints.NONE;
- c.gridy++;
- this.add(jtDescription, c);
-
- c.fill = GridBagConstraints.HORIZONTAL;
- c.gridy++;
- this.add(jlMethodType, c);
-
- c.gridy++;
- this.add(jlUrlTemplate, c);
-
- c.gridy++;
- this.add(jlMethodParameters, c);
-
- c.gridy++;
- this.add(jlInputRepresentations, c);
-
- c.gridy++;
- this.add(jlOutputRepresentations, c);
- return (c);
- }
-
-@Override
-boolean shouldBeHidden(Object itemToRender) {
- if (!(itemToRender instanceof RestMethod)) {
- return false;
- }
- RestMethod restMethod = (RestMethod)itemToRender;;
-
- Ancestors ancestors = restMethod.getAncestors();
- Service service = ancestors.getService();
- String title = Resource.getDisplayNameForResource(restMethod);
-
- if (restMethod.isSetArchived() || service.isSetArchived()) {
- return true;
- }
- else {
- return false;
- }
-
-}
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SOAPOperationListCellRenderer.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SOAPOperationListCellRenderer.java
deleted file mode 100644
index 4386d12..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SOAPOperationListCellRenderer.java
+++ /dev/null
@@ -1,273 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.search_results;
-/*
- * 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.
- */
-
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-
-import org.apache.taverna.biocatalogue.model.LoadingExpandedResource;
-import org.apache.taverna.biocatalogue.model.LoadingResource;
-import org.apache.taverna.biocatalogue.model.Resource;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.lang.ui.ReadOnlyTextArea;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.ServiceMonitoringStatusInterpreter;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.commons.lang.StringUtils;
-import org.biocatalogue.x2009.xml.rest.Service;
-import org.biocatalogue.x2009.xml.rest.ServiceTechnologyType;
-import org.biocatalogue.x2009.xml.rest.SoapInput;
-import org.biocatalogue.x2009.xml.rest.SoapOperation;
-import org.biocatalogue.x2009.xml.rest.SoapOutput;
-import org.biocatalogue.x2009.xml.rest.SoapService;
-import org.biocatalogue.x2009.xml.rest.Service.ServiceTechnologyTypes;
-import org.biocatalogue.x2009.xml.rest.ServiceTechnologyType.Enum;
-import org.biocatalogue.x2009.xml.rest.SoapOperation.Ancestors;
-
-
-/**
- *
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class SOAPOperationListCellRenderer extends ExpandableOnDemandLoadedListCellRenderer
-{
-
- private JLabel jlTypeIcon = new JLabel();
- private JLabel jlItemStatus = new JLabel();
- private JLabel jlItemTitle = new JLabel("X");
- private JLabel jlPartOf = new JLabel("X");
- private JLabel jlWsdlLocation = new JLabel("X");
- private ReadOnlyTextArea jtDescription = new ReadOnlyTextArea(5,80);
- private JLabel jlSoapInputs = new JLabel("X");
- private JLabel jlSoapOutputs = new JLabel("X");
-
- private GridBagConstraints c;
-
- private static Resource.TYPE resourceType = Resource.TYPE.SOAPOperation;
-
-
- public SOAPOperationListCellRenderer() {
- jlItemTitle.setFont(jlItemTitle.getFont().deriveFont(Font.PLAIN, jlItemTitle.getFont().getSize() + 2));
- jtDescription.setOpaque(false);
- jtDescription.setLineWrap(true);
- jtDescription.setWrapStyleWord(true);
- }
-
-
- /**
- * This entry can be in one of two states:
- * -- containing only the name of the resource and NOT loading further details;
- * -- containing only the name of the resource and LOADING further details.
- *
- * @param itemToRender
- * @return
- */
- protected GridBagConstraints prepareInitiallyLoadingEntry(Object itemToRender)
- {
- LoadingResource resource = (LoadingResource)itemToRender;
-
- jlTypeIcon.setIcon(resourceType.getIcon());
- jlItemStatus.setIcon(ResourceManager.getImageIcon(ResourceManager.SERVICE_STATUS_UNCHECKED_ICON_LARGE));
-
- jlItemTitle.setText("<html>" + StringEscapeUtils.escapeHtml(Resource.getDisplayNameForResource(resource)) + "<font color=\"gray\"><i>- fetching more information</i></font></html>");
-
- jlPartOf.setText(" ");
- jlWsdlLocation.setText(" ");
- jtDescription.setText("");
- jlSoapInputs.setText(" ");
- jlSoapOutputs.setText(" ");
-
- return (arrangeLayout());
- }
-
-
- /**
- *
- * @param itemToRender
- * @param selected
- * @param expandedView <code>true</code> to indicate that this method generates the top
- * fragment of the expanded list entry for this SOAP operation / REST method.
- * @return
- */
- protected GridBagConstraints prepareLoadedEntry(Object itemToRender, boolean selected)
- {
- SoapOperation soapOp = (SoapOperation)itemToRender;
-
- Ancestors ancestors = soapOp.getAncestors();
- SoapService soapService = ancestors.getSoapService();
- Service service = ancestors.getService();
- String title = StringEscapeUtils.escapeHtml(Resource.getDisplayNameForResource(soapOp));
-
- if (soapOp.isSetArchived() || service.isSetArchived()) {
- jlTypeIcon.setIcon(ResourceManager.getImageIcon(ResourceManager.WARNING_ICON));
- title = "<html>" + title + "<i> - this operation is archived and probably cannot be used</i></html>";
- } else if (isSoapLab(service)) {
- jlTypeIcon.setIcon(ResourceManager.getImageIcon(ResourceManager.WARNING_ICON));
- title = "<html>" + title + "<i> - this operation can only be used as part of a SoapLab service</i></html>";
- }
- else {
- jlTypeIcon.setIcon(resourceType.getIcon());
- title = "<html>" + title + "</html>";
- }
-
- // service status
- jlItemStatus.setIcon(ServiceMonitoringStatusInterpreter.getStatusIcon(service, false));
- jlItemTitle.setText(title);
-
- jlPartOf.setText("<html><b>Part of: </b>" + StringEscapeUtils.escapeHtml(soapOp.getAncestors().getSoapService().getResourceName()) + "</html>");
-
- jlWsdlLocation.setText("<html><b>WSDL location: </b>" + soapService.getWsdlLocation() + "</html>");
-
- String strDescription = (soapOp.getDescription() == null || soapOp.getDescription().length() == 0 ?
- "No description" :
- Util.stripAllHTML(soapOp.getDescription()));
-
- jtDescription.setText(strDescription);
-
- // add SOAP inputs
- List<String> names = new ArrayList<String>();
- for (SoapInput soapInput : soapOp.getInputs().getSoapInputList()) {
- names.add(soapInput.getName());
- }
-
- String soapInputs = "<b>" + names.size() + " " + Util.pluraliseNoun("Input", names.size()) + "</b>";
- if(names.size() > 0) {
- soapInputs += ": " + StringEscapeUtils.escapeHtml(Util.ensureLineLengthWithinString(Util.join(names, ", "), LINE_LENGTH, false));
- }
- soapInputs = "<html>" + soapInputs + "</html>";
- jlSoapInputs.setText(soapInputs);
-
- c.gridy++;
- this.add(jlSoapInputs, c);
-
-
- // add SOAP outputs
- names.clear();
- for (SoapOutput soapOutput : soapOp.getOutputs().getSoapOutputList()) {
- names.add(soapOutput.getName());
- }
-
- String soapOutputs = "<b>" + names.size() + " " + Util.pluraliseNoun("Output", names.size()) + "</b>";
- if(names.size() > 0) {
- soapOutputs += ": " + StringEscapeUtils.escapeHtml(Util.ensureLineLengthWithinString(Util.join(names, ", "), LINE_LENGTH, false));
- }
- soapOutputs = "<html>" + soapOutputs + "</html>";
- jlSoapOutputs.setText(soapOutputs);
-
- return (arrangeLayout());
- }
-
-
-private boolean isSoapLab(Service service) {
- boolean result = false;
- ServiceTechnologyTypes serviceTechnologyTypes = service.getServiceTechnologyTypes();
- if (serviceTechnologyTypes == null) {
- return result;
- }
- List<Enum> typeList = serviceTechnologyTypes.getTypeList();
- if (typeList == null) {
- return result;
- }
- result = typeList.contains(ServiceTechnologyType.SOAPLAB);
- return result;
-}
-
-
- /**
- * @return Final state of the {@link GridBagConstraints} instance
- * that was used to lay out components in the panel.
- */
- private GridBagConstraints arrangeLayout()
- {
- // POPULATE PANEL WITH PREPARED COMPONENTS
- this.setLayout(new GridBagLayout());
- c = new GridBagConstraints();
- c.anchor = GridBagConstraints.NORTHWEST;
- c.fill = GridBagConstraints.HORIZONTAL;
-
- c.gridx = 0;
- c.gridy = 0;
- c.weightx = 0;
- c.insets = new Insets(8, 6, 6, 3);
- this.add(jlTypeIcon, c);
-
- c.gridx++;
- c.weightx = 1.0;
- c.insets = new Insets(8, 3, 6, 3);
- this.add(jlItemTitle, c);
-
- c.gridx++;
- c.gridheight = 7;
- c.weightx = 0;
- c.weighty = 1.0;
- this.add(jlItemStatus, c);
-
- c.gridx = 1;
- c.gridy++;
- c.gridheight = 1;
- c.weightx = 0;
- c.weighty = 0;
- this.add(jlPartOf, c);
-
- c.gridy++;
- this.add(jlWsdlLocation, c);
-
- c.fill = GridBagConstraints.NONE;
- c.gridy++;
- this.add(jtDescription, c);
-
- c.fill = GridBagConstraints.HORIZONTAL;
- c.gridy++;
- this.add(jlSoapInputs, c);
-
- c.fill = GridBagConstraints.HORIZONTAL;
- c.gridy++;
- this.add(jlSoapOutputs, c);
-
- return (c);
- }
-
-@Override
-boolean shouldBeHidden(Object itemToRender) {
- if (!(itemToRender instanceof SoapOperation)) {
- return false;
- }
- SoapOperation soapOp = (SoapOperation) itemToRender;
- Ancestors ancestors = soapOp.getAncestors();
- Service service = ancestors.getService();
- if (soapOp.isSetArchived() || service.isSetArchived()) {
- return true;
- } else if (isSoapLab(service)) {
- return true;
- }
- else {
- return false;
- }
-
-}
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SearchResultsListingPanel.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SearchResultsListingPanel.java
deleted file mode 100644
index 2afd190..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SearchResultsListingPanel.java
+++ /dev/null
@@ -1,886 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.search_results;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Desktop;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.AdjustmentEvent;
-import java.awt.event.AdjustmentListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.net.URI;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.BorderFactory;
-import javax.swing.DefaultListModel;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
-import javax.swing.JScrollPane;
-import javax.swing.JToolBar;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListModel;
-import javax.swing.ListSelectionModel;
-import javax.swing.SwingUtilities;
-import javax.swing.event.ListDataListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import org.apache.taverna.biocatalogue.model.BioCataloguePluginConstants;
-import org.apache.taverna.biocatalogue.model.LoadingExpandedResource;
-import org.apache.taverna.biocatalogue.model.LoadingResource;
-import org.apache.taverna.biocatalogue.model.Resource;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.biocatalogue.model.search.SearchInstance;
-import org.apache.taverna.biocatalogue.ui.JWaitDialog;
-import net.sf.taverna.t2.lang.ui.ModelMap;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponent;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.Integration;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.ServiceHealthChecker;
-import org.apache.taverna.workbench.MainWindow;
-import org.apache.taverna.workbench.ModelMapConstants;
-import org.apache.taverna.workbench.ui.Workbench;
-import org.apache.taverna.workbench.ui.zaria.PerspectiveSPI;
-
-import org.apache.log4j.Logger;
-import org.biocatalogue.x2009.xml.rest.ResourceLink;
-import org.biocatalogue.x2009.xml.rest.RestMethod;
-import org.biocatalogue.x2009.xml.rest.Service;
-import org.biocatalogue.x2009.xml.rest.ServiceTechnologyType;
-
-/**
- * This class is responsible for producing search results listing panel. It only
- * shows a single listing for a specified type. Multiple types are handled by
- * having different tabs in {@link SearchResultsMainPanel} with instances of
- * this class in each.
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class SearchResultsListingPanel extends JPanel implements MouseListener,
- SearchResultsRenderer, MouseMotionListener {
- public static final int SEARCH_STATUS_TOOLTIP_LINE_LENGTH = 65;
-
- private static final Logger logger = Logger.getLogger(SearchResultsListingPanel.class);
- private final SearchResultsMainPanel parentMainSearchResultsPanel;
-
- // currently displayed search results
- SearchInstance searchInstance;
-
- // main UI components
- private SearchResultsListingPanel thisPanel;
- private DefaultListModel resultsListingModel;
- private JList jlResultsListing;
- private JScrollPane spResultsListing;
-
- // contextual menu
- private JPopupMenu contextualMenu;
- private Action addToServicePanelAction;
- private Action addToWorkflowDiagramAction;
- private Action openInBioCatalogueAction;
- private Action doHealthCheckAction;
- private Action addAllOperationsToServicePanelAction;
-
- // search status and actions on selected items in the list
- private JToolBar tbSelectedItemActions;
- protected JPanel jpSearchStatus;
- private JLabel jlSearchStatus;
-
- // this is used for previewing items from the result listing through
- // contextual menu -
- // value will be updated by mouse event accordingly
- private ResourceLink potentialObjectToPreview;
- private final TYPE typeToPreview;
-
- // Design perspective - some actions require switching to it
- PerspectiveSPI designPerspective;
-
- private ListCellRenderer listingCellRenderer;
-
- /**
- * @param typeToPreview
- * Resource type that will be previewed in this panel.
- * @param parentMainSearchResultsPanel
- * Reference to a "parent" of this panel - this is needed to
- * notify the main results panel with the
- */
- public SearchResultsListingPanel(TYPE typeToPreview,
- SearchResultsMainPanel parentMainSearchResultsPanel) {
- this.thisPanel = this;
-
- this.typeToPreview = typeToPreview;
- listingCellRenderer = this.typeToPreview
- .getResultListingCellRenderer();
- this.parentMainSearchResultsPanel = parentMainSearchResultsPanel;
- MainComponentFactory
- .getSharedInstance();
-
- initialiseUI();
-
- this.setPreferredSize(new Dimension(800, 400));
- }
-
- private void initialiseUI() {
-
- this.addToServicePanelAction = new AbstractAction(
- "Add to Service Panel",
- ResourceManager
- .getImageIcon(ResourceManager.ADD_PROCESSOR_AS_FAVOURITE_ICON)) {
- // Tooltip
- {
- this.putValue(SHORT_DESCRIPTION, "Add selected "
- + typeToPreview.getTypeName()
- + " to the Service Panel");
- }
-
- public void actionPerformed(ActionEvent e) {
- final JWaitDialog jwd = new JWaitDialog(
- MainComponent.dummyOwnerJFrame,
- "Service Catalogue Plugin - Adding "
- + typeToPreview.getTypeName(),
- "<html><center>Please wait for selected "
- + typeToPreview.getTypeName()
- + " details to be fetched from the Service Catalogue<br>"
- + "and to be added into the Service Panel.</center></html>");
-
- new Thread("Adding " + typeToPreview.getTypeName()
- + " into Service Panel") {
- public void run() {
- // if it is the expanded that we are looking at, need to extract
- // the 'associated' object
- ResourceLink processorResourceToAdd = (potentialObjectToPreview instanceof LoadingExpandedResource ? ((LoadingExpandedResource) potentialObjectToPreview)
- .getAssociatedObj()
- : potentialObjectToPreview);
-
- JComponent insertionOutcome = Integration
- .insertProcesorIntoServicePanel(processorResourceToAdd);
- jwd.waitFinished(insertionOutcome);
-
- // Switch to Design Perspective
- switchToDesignPerspective();
- }
- }.start();
-
- // NB! The modal dialog window needs to be made visible after
- // the background
- // process (i.e. adding a processor) has already been started!
- jwd.setVisible(true);
- }
- };
-
- // For a parent Web service, action to add all operations to the Service Panel.
- // Works for SOAP services at the moment.
- this.addAllOperationsToServicePanelAction = new AbstractAction(
- "Add all operations to Service Panel",
- ResourceManager
- .getImageIcon(ResourceManager.ADD_ALL_SERVICES_AS_FAVOURITE_ICON)) {
- // Tooltip
- {
- this.putValue(SHORT_DESCRIPTION, "Add all associated services to the Service Panel");
- }
-
- public void actionPerformed(ActionEvent e) {
- final JWaitDialog jwd = new JWaitDialog(
- MainComponent.dummyOwnerJFrame,
- "Service Catalogue Plugin - Adding "
- + typeToPreview.getTypeName(),
- "<html><center>Please wait for selected "
- + typeToPreview.getTypeName()
- + " details to be fetched from the Service Catalogue<br>"
- + "and to be added into the Service Panel.</center></html>");
-
- new Thread("Adding all operations of " + typeToPreview.getTypeName()
- + " to the Service Panel") {
- public void run() {
- // if it is the expanded that we are looking at, need to extract
- // the 'associated' object
- ResourceLink resourceLink = (potentialObjectToPreview instanceof LoadingExpandedResource ? ((LoadingExpandedResource) potentialObjectToPreview)
- .getAssociatedObj()
- : potentialObjectToPreview);
-
- JComponent insertionOutcome = Integration
- .insertAllOperationsIntoServicePanel(resourceLink);
- jwd.waitFinished(insertionOutcome);
-
- // Switch to Design Perspective
- switchToDesignPerspective();
- }
- }.start();
-
- // NB! The modal dialog window needs to be made visible after
- // the background
- // process (i.e. adding a processor) has already been started!
- jwd.setVisible(true);
- }
- };
-
- this.addToWorkflowDiagramAction = new AbstractAction(
- "Add to workflow",
- ResourceManager
- .getImageIcon(ResourceManager.ADD_PROCESSOR_TO_WORKFLOW_ICON)) {
- // Tooltip
- {
- this.putValue(SHORT_DESCRIPTION, "<html>Insert selected "
- + typeToPreview.getTypeName()
- + " into the current workflow</html>");
- }
-
- public void actionPerformed(ActionEvent e) {
- final JWaitDialog jwd = new JWaitDialog(
- MainComponent.dummyOwnerJFrame,
- "Service Catalogue Plugin - Adding "
- + typeToPreview.getTypeName(),
- "<html><center>Please wait for selected "
- + typeToPreview.getTypeName()
- + " details to be fetched from the Service Catalogue<br>"
- + "and to be added into the current workflow.</center></html>");
-
- new Thread("Adding " + typeToPreview.getTypeName()
- + " into workflow") {
- public void run() {
- // if it is the expanded that we are looking at, need to extract
- // the 'associated' object
- ResourceLink processorResourceToAdd = (potentialObjectToPreview instanceof LoadingExpandedResource ? ((LoadingExpandedResource) potentialObjectToPreview)
- .getAssociatedObj()
- : potentialObjectToPreview);
-
- JComponent insertionOutcome = Integration
- .insertProcessorIntoCurrentWorkflow(processorResourceToAdd);
- jwd.waitFinished(insertionOutcome);
-
- // Switch to Design Perspective
- switchToDesignPerspective();
- }
- }.start();
-
- // NB! The modal dialog window needs to be made visible after
- // the background
- // process (i.e. adding a processor) has already been started!
- jwd.setVisible(true);
- }
- };
-
- this.openInBioCatalogueAction = new AbstractAction(
- "Open in the Service Catalogue",
- ResourceManager
- .getImageIcon(ResourceManager.OPEN_IN_BIOCATALOGUE_ICON)) {
- // Tooltip
- {
- this.putValue(SHORT_DESCRIPTION, "<html>View selected "
- + typeToPreview.getTypeName()
- + " on the Service Catalogue Web site.<br>"
- + "This will open your standard Web browser.</html>");
- }
-
- public void actionPerformed(ActionEvent e) {
- String hrefString = potentialObjectToPreview.getHref();
- try {
- Desktop.getDesktop().browse(new URI(hrefString));
- }
- catch (Exception ex) {
- logger.error("Failed while trying to open the URL in a standard browser; URL was: " +
- hrefString + "\nException was: " + ex + "\n" + ex.getStackTrace());
- };
- }
- };
-
- this.doHealthCheckAction = new AbstractAction(
- "Check monitoring status",
- ResourceManager
- .getImageIcon(ResourceManager.EXECUTE_HEALTH_CHECK_ICON)) {
- // Tooltip
- {
- this
- .putValue(
- SHORT_DESCRIPTION,
- "<html>Fetch the latest monitoring data for selected "
- + typeToPreview.getTypeName()
- + ".<br>"
- + "Data will be obtained from the Service Catalogue and displayed in a popup window.</html>");
- }
-
- public void actionPerformed(ActionEvent e) {
- // if it is the expanded that we are looking at, need to extract
- // the 'associated' object
- ResourceLink resourceForHealthCheck = (potentialObjectToPreview instanceof LoadingExpandedResource ? ((LoadingExpandedResource) potentialObjectToPreview)
- .getAssociatedObj()
- : potentialObjectToPreview);
-
- ServiceHealthChecker.checkResource(resourceForHealthCheck);
- }
- };
-
- tbSelectedItemActions = new JToolBar(JToolBar.HORIZONTAL);
- tbSelectedItemActions.setBorderPainted(true);
- tbSelectedItemActions.setBorder(BorderFactory.createEmptyBorder(5, 5,
- 5, 3));
- tbSelectedItemActions.setFloatable(false);
- if (typeToPreview.isSuitableForAddingToServicePanel()) {
- tbSelectedItemActions.add(addToServicePanelAction);
- }
- if (typeToPreview.isSuitableForAddingAllToServicePanel()) {
- tbSelectedItemActions.add(addAllOperationsToServicePanelAction);
- }
- if (typeToPreview.isSuitableForAddingToWorkflowDiagram()) {
- tbSelectedItemActions.add(addToWorkflowDiagramAction);
- }
- if (typeToPreview.isSuitableForHealthCheck()) {
- tbSelectedItemActions.add(doHealthCheckAction);
- }
- tbSelectedItemActions.add(openInBioCatalogueAction);
-
- // *** Prepare search results status panel ***
-
- GridBagConstraints c = new GridBagConstraints();
- jpSearchStatus = new JPanel(new GridBagLayout());
- c.anchor = GridBagConstraints.WEST;
- c.weightx = 0;
- jpSearchStatus.add(tbSelectedItemActions, c);
-
- jlSearchStatus = new JLabel();
- jlSearchStatus.setIconTextGap(20);
- c.weightx = 1.0;
- c.insets = new Insets(0, 20, 0, 0);
- jpSearchStatus.add(jlSearchStatus, c);
-
- if (parentMainSearchResultsPanel.getFilterTreePaneFor(typeToPreview) != null) {
- Dimension preferredSize = new Dimension(200,
- parentMainSearchResultsPanel.getFilterTreePaneFor(
- typeToPreview).getTreeToolbarPreferredSize().height);
-
- // HACK: due to concurrency issues, sometimes this doesn't work
- // correctly -
- // to rectify the problem using the hard-coded value that was
- // correct at
- // the time of coding...
- if (preferredSize.height < 30) {
- preferredSize.height = 33;
- }
-
- jpSearchStatus.setPreferredSize(preferredSize);
- }
-
- // *** Create list to hold search results and wrap it into a scroll pane
- // ***
- resultsListingModel = new DefaultListModel();
- jlResultsListing = new JList(resultsListingModel);
- jlResultsListing.setDoubleBuffered(true);
- jlResultsListing.setCellRenderer(listingCellRenderer);
- jlResultsListing.addMouseListener(this);
- jlResultsListing.addMouseMotionListener(this);
- jlResultsListing.setBackground(thisPanel.getBackground());
-
- jlResultsListing.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jlResultsListing.addListSelectionListener(new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- if (!e.getValueIsAdjusting()) {
- // update value to be used in contextual menu click handler
- // to act on the just-selected entry
- potentialObjectToPreview = getResourceSelectedInJList();
-
- if (potentialObjectToPreview != null) {
-
- // only enable actions in the menu if the list entry
- // that is being
- // clicked on is beyond the initial 'loading' state
- boolean shown = !isListEntryOnlyWithInitialDetails(potentialObjectToPreview);
- boolean shownAndNotArchived = shown && !isArchived(potentialObjectToPreview);
- addToServicePanelAction
- .setEnabled(shownAndNotArchived);
- addAllOperationsToServicePanelAction
- .setEnabled(shownAndNotArchived && !(potentialObjectToPreview instanceof RestMethod));
- addToWorkflowDiagramAction
- .setEnabled(shownAndNotArchived);
- openInBioCatalogueAction
- .setEnabled(shown);
- doHealthCheckAction
- .setEnabled(shown);
-
- return;
- }
- }
-
- // disable actions if nothing is selected in the list or if
- // selection is still "adjusting"
- addToServicePanelAction.setEnabled(false);
- addAllOperationsToServicePanelAction.setEnabled(false);
- addToWorkflowDiagramAction.setEnabled(false);
- openInBioCatalogueAction.setEnabled(false);
- doHealthCheckAction.setEnabled(false);
- }
- });
-
- spResultsListing = new JScrollPane(jlResultsListing);
- spResultsListing.getVerticalScrollBar().addAdjustmentListener(
- new AdjustmentListener() {
- public void adjustmentValueChanged(AdjustmentEvent e) {
- if (!e.getValueIsAdjusting()) {
- // load missing details on adjusting the scroll bar
- //
- // only start loading more results in case if the
- // value is "not adjusting" -
- // this means that the mouse has been released and
- // is not dragging the scroll bar
- // any more, so effectively the user has stopped
- // scrolling
- checkAllEntriesInTheVisiblePartOfJListAreLoaded();
- }
- }
- });
-
- // tie components to the class panel itself
- this.resetSearchResultsListing(true);
-
- // *** Create CONTEXTUAL MENU ***
-
- contextualMenu = new JPopupMenu();
- if (typeToPreview.isSuitableForAddingToServicePanel()) {
- contextualMenu.add(addToServicePanelAction);
- contextualMenu.add(addAllOperationsToServicePanelAction);
- }
- if (typeToPreview.isSuitableForAddingToWorkflowDiagram()) {
- contextualMenu.add(addToWorkflowDiagramAction);
- }
- if (typeToPreview.isSuitableForHealthCheck()) {
- contextualMenu.add(doHealthCheckAction);
- }
- contextualMenu.add(openInBioCatalogueAction);
- }
-
- /**
- * Allows to set the search status by supplying the message to display.
- */
- protected void setSearchStatusText(final String statusString,
- final boolean spinnerActive) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- jlSearchStatus
- .setIcon(spinnerActive ? ResourceManager
- .getImageIcon(ResourceManager.BAR_LOADER_ORANGE)
- : null);
-
- jlSearchStatus.setText(statusString);
- jlSearchStatus.setToolTipText("<html>"
- + Util.ensureLineLengthWithinString(statusString,
- SEARCH_STATUS_TOOLTIP_LINE_LENGTH, false)
- + "</html>");
- }
- });
- }
-
- /**
- * This helper method is used to initialise this panel. Also invoked when
- * search results need to be cleared.
- *
- * @param showSuggestion
- * <code>true</code> should be used on first load of the panel -
- * in that case a suggestion would be displayed to perform a
- * search, tag search or start directly with filtering;<br/>
- * <code>false</code> to be used when resetting the panel after
- * perfoming the search, but not finding any results.
- */
- public void resetSearchResultsListing(boolean showSuggestion) {
- setSearchStatusText("No searches were made yet", false);
-
- String labelText = "<html><center>"
- + (showSuggestion ? "You can find "
- + this.typeToPreview.getCollectionName()
- + " by typing a search query."
- + (this.typeToPreview.isSuitableForFiltering() ? "<br><br>Alternatively, you can select some filters from the tree on the left."
- : "")
- : "There are no "
- + this.typeToPreview.getCollectionName()
- + " that match your search criteria<br><br>"
- + "Please try making the search query shorter or selecting fewer filters")
- + "</center></html>";
-
- JLabel jlMainLabel = new JLabel(labelText, JLabel.CENTER);
- jlMainLabel.setFont(jlMainLabel.getFont().deriveFont(Font.PLAIN, 16));
- jlMainLabel.setBorder(BorderFactory.createEtchedBorder());
-
- this.removeAll();
- this.setLayout(new BorderLayout(0, 0));
- this.add(jpSearchStatus, BorderLayout.NORTH);
- this.add(jlMainLabel, BorderLayout.CENTER);
- this.validate();
-
- // disable the toolbar actions
- this.addToServicePanelAction.setEnabled(false);
- this.addToWorkflowDiagramAction.setEnabled(false);
- this.openInBioCatalogueAction.setEnabled(false);
- this.doHealthCheckAction.setEnabled(false);
- this.addAllOperationsToServicePanelAction.setEnabled(false);
- }
-
- /**
- * Statistics will be rendered along with the collection of found items.
- *
- * @param searchInstance
- * SearchInstance containing search results to render.
- */
- public void renderResults(SearchInstance searchInstance) {
- // make the current search instance available globally within this class
- this.searchInstance = searchInstance;
-
- // stop spinner icon on the tab that is populated and add number of
- // results
- parentMainSearchResultsPanel.setDefaultIconForTab(typeToPreview);
- parentMainSearchResultsPanel.setDefaultTitleForTabWithSuffix(
- typeToPreview, " ("
- + searchInstance.getSearchResults()
- .getTotalMatchingItemCount() + ")");
-
- // if nothing was found - display notification and finish result
- // processing
- if (searchInstance.getSearchResults().getTotalMatchingItemCount() == 0) {
- resetSearchResultsListing(false);
-
- // must happen after resetting the listing, as it replaces the
- // default status text
- setSearchStatusText("No results found for "
- + searchInstance.getDescriptionStringForSearchStatus(),
- false);
- return;
- }
-
- // populate results
- if (searchInstance.getSearchResults().getTotalMatchingItemCount() > 0) {
- // populate the list box with users
-
- List<? extends ResourceLink> foundItems = searchInstance
- .getSearchResults().getFoundItems();
- for (ResourceLink item : foundItems) {
- resultsListingModel.addElement(item);
- }
- }
-
- // update the UI once contents are ready
- thisPanel.removeAll();
- thisPanel.setLayout(new BorderLayout(0, 0));
- thisPanel.add(jpSearchStatus, BorderLayout.NORTH);
- thisPanel.add(spResultsListing, BorderLayout.CENTER);
- thisPanel.repaint();
-
- // automatically start loading details for the first section of result
- // listing
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- checkAllEntriesInTheVisiblePartOfJListAreLoaded();
- }
- });
-
- // *** Also update status text ***
-
- setSearchStatusText("Search results for "
- + searchInstance.getDescriptionStringForSearchStatus(), false);
- }
-
- /**
- * Check if details are fetched for all result entries that are currently
- * visible in the JList.
- *
- * If some are not yet loaded, identifies the page in the index of
- * corresponding resources to fetch details.
- *
- * When done, recursively calls itself again to verify that no more entries
- * need further details loaded.
- */
- private void checkAllEntriesInTheVisiblePartOfJListAreLoaded() {
- int firstVisibleIndex = jlResultsListing.getFirstVisibleIndex();
-
- if (firstVisibleIndex >= 0) {
- int lastVisibleIndex = jlResultsListing.getLastVisibleIndex();
-
- final int firstNotFetchedMatchingItemIndex = searchInstance
- .getSearchResults().getFirstMatchingItemIndexNotYetFetched(
- firstVisibleIndex, lastVisibleIndex);
- final int pageToFetchNumber = searchInstance.getSearchResults()
- .getMatchingItemPageNumberFor(
- firstNotFetchedMatchingItemIndex);
-
- // check if found a valid page to load
- if (pageToFetchNumber != -1) {
- int numberOfResourcesPerPageForThisResourceType = searchInstance
- .getSearchResults().getTypeOfResourcesInTheResultSet()
- .getApiResourceCountPerIndexPage();
-
- int firstListIndexToLoad = searchInstance.getSearchResults()
- .getFirstItemIndexOn(pageToFetchNumber); // first
- // element
- // on the
- // page that
- // is about
- // to be
- // loaded
- int countToLoad = Math.min(
- numberOfResourcesPerPageForThisResourceType, // if the
- // last
- // page
- // isn't
- // full,
- // need
- // to
- // mark
- // less
- // items
- // than
- // the
- // full
- // page
- resultsListingModel.getSize() - firstListIndexToLoad);
-
- // mark the next "page" of items in the JList as "loading" -
- // but also mark them in the SearchResults backing list, so
- // that next calls to this listener are aware of the previous
- // items that were marked as "loading"
- for (int i = firstListIndexToLoad; i < firstListIndexToLoad
- + countToLoad; i++) {
- ((LoadingResource) searchInstance.getSearchResults()
- .getFoundItems().get(i)).setLoading(true);
- }
-
- // update the UI to show 'loading' state on relevant entries
- renderFurtherResults(searchInstance, firstListIndexToLoad,
- countToLoad);
-
- // now start loading data for the 'loading' entries
- final CountDownLatch latch = new CountDownLatch(1);
- new Thread("Search via the API") {
- public void run() {
- try {
- searchInstance.fetchMoreResults(
- parentMainSearchResultsPanel, latch,
- thisPanel, pageToFetchNumber);
- } catch (Exception e) {
- logger.error("Error while searching via the Service Catalogue API", e);
-
- }
- }
- }.start();
-
- // wait for the previous portion of results to load, then fetch
- // the next portion
- new Thread(
- "Fetch more another page of details for search results") {
- public void run() {
- try {
- latch.await();
- checkAllEntriesInTheVisiblePartOfJListAreLoaded();
- } catch (InterruptedException e) {
- logger
- .error(
- "Failed to wait for the previous page of results to load to check if "
- + "another one needs loading as well. Details in the attache exception.",
- e);
- }
- }
- }.start();
-
- }
- }
- }
-
- /**
- * Tests whether {@link ResourceLink} object corresponding to an entry in
- * the search results list is in the state where only the first (initial)
- * fragment of data was loaded (through BioCatalogue LITE JSON API) that
- * contains just the title + URL of the resource.
- *
- * @param resource
- * @return
- */
- private boolean isListEntryOnlyWithInitialDetails(ResourceLink resource) {
- return (resource instanceof LoadingResource);
- }
-
- private boolean isArchived(ResourceLink resource) {
- if (listingCellRenderer instanceof ExpandableOnDemandLoadedListCellRenderer) {
- ExpandableOnDemandLoadedListCellRenderer r = (ExpandableOnDemandLoadedListCellRenderer) listingCellRenderer;
- return r.shouldBeHidden(resource);
- }
- return false;
- }
-
-
- // ***** Callbacks for MouseListener *****
-
- public void mouseClicked(MouseEvent e) {
- }
-
- public void mouseEntered(MouseEvent e) { /* NOT IN USE */
- }
-
- public void mouseExited(MouseEvent e) { /* NOT IN USE */
- }
-
- public void mousePressed(MouseEvent e) {
- // checked in both mousePressed() & mouseReleased() for cross-platform
- // operation
- maybeShowPopupMenu(e);
- }
-
- public void mouseReleased(MouseEvent e) {
- // checked in both mousePressed() & mouseReleased() for cross-platform
- // operation
- maybeShowPopupMenu(e);
- }
-
- // ***** Callbacks for MouseMotionListener *****
-
- public void mouseMoved(MouseEvent e) {
- }
-
- public void mouseDragged(MouseEvent e) { /* do nothing */
- }
-
- /**
- * Gets the selected object from the specified list. Used for previewing
- * items through double-clicks and contextual menu.
- *
- * @return <code>null</code> if no selection in the list,
- * <code>ResourceLink</code> object that is currently selected
- * otherwise.
- */
- private ResourceLink getResourceSelectedInJList() {
- return (jlResultsListing.getSelectedIndex() == -1 ? null
- : (ResourceLink) jlResultsListing.getSelectedValue());
- }
-
- private void maybeShowPopupMenu(MouseEvent e) {
- if (e.getSource().equals(jlResultsListing) && e.isPopupTrigger()
- && jlResultsListing.locationToIndex(e.getPoint()) != -1) {
- // select the entry in the list that triggered the event to show
- // this popup menu
- jlResultsListing.setSelectedIndex(jlResultsListing
- .locationToIndex(e.getPoint()));
-
- // update value to be used in contextual menu click handler to act
- // on the just-selected entry
- potentialObjectToPreview = getResourceSelectedInJList();
-
- // show the contextual menu
- this.contextualMenu.show(e.getComponent(), e.getX(), e.getY());
- }
- }
-
- // *** Callbacks for SearchResultsRenderer ***
-
- public void renderInitialResults(final SearchInstance si) {
- // NB! critical to have UI update done within the invokeLater()
- // method - this is to prevent UI from 'flashing' and to
- // avoid concurrency-related errors
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- // make sure to remove any old results from the list model!
- resultsListingModel.clear();
-
- // display the partial search results
- logger.debug("Started rendering initial search results for "
- + si.getResourceTypeToSearchFor().getCollectionName());
- renderResults(si);
- logger.debug("Finished rendering initial search results for "
- + si.getResourceTypeToSearchFor().getCollectionName());
- }
- });
- }
-
- public void renderFurtherResults(SearchInstance si, int startIndex,
- int count) {
- renderFurtherResults(si, startIndex, count, false);
- }
-
- public void renderFurtherResults(final SearchInstance si,
- final int startIndex, final int count,
- final boolean disableListDataListeners) {
- logger.debug("Started rendering further search results for "
- + si.getResourceTypeToSearchFor().getCollectionName());
-
- // NB! very important to remove all listeners here, so that the JList
- // won't "freeze"
- // on updating the components
- ListDataListener[] listeners = null;
- if (disableListDataListeners) {
- listeners = resultsListingModel.getListDataListeners();
- for (ListDataListener listener : listeners) {
- resultsListingModel.removeListDataListener(listener);
- }
- }
-
- for (int i = startIndex; i < startIndex + count
- && i < resultsListingModel.getSize(); i++) {
- resultsListingModel.set(i, searchInstance.getSearchResults()
- .getFoundItems().get(i));
- }
-
- // reset all listeners in case they were removed
- if (disableListDataListeners) {
- for (ListDataListener listener : listeners) {
- resultsListingModel.addListDataListener(listener);
- }
- }
-
- // NB! critical to have UI update done within the invokeLater()
- // method - this is to prevent UI from 'flashing' and to
- // avoid some weird errors
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- jlResultsListing.validate();
- jlResultsListing.repaint();
-
- logger.debug("Finished rendering further search results for "
- + si.getResourceTypeToSearchFor().getCollectionName());
- }
- });
- }
-
- private void switchToDesignPerspective() {
- if (designPerspective == null) {
- for (PerspectiveSPI perspective : Workbench.getInstance()
- .getPerspectives().getPerspectives()) {
- if (perspective.getText().equalsIgnoreCase("design")) {
- designPerspective = perspective;
- break;
- }
- }
- }
-
- if (designPerspective != null) {
- ModelMap.getInstance().setModel(
- ModelMapConstants.CURRENT_PERSPECTIVE, designPerspective);
- }
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SearchResultsMainPanel.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SearchResultsMainPanel.java
deleted file mode 100644
index 03455f2..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SearchResultsMainPanel.java
+++ /dev/null
@@ -1,514 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.search_results;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JSplitPane;
-import javax.swing.JTabbedPane;
-import javax.swing.JToggleButton;
-
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.model.search.SearchInstance;
-import org.apache.taverna.biocatalogue.model.search.SearchInstanceTracker;
-import org.apache.taverna.biocatalogue.model.search.SearchOptions;
-import org.apache.taverna.biocatalogue.model.search.ServiceFilteringSettings;
-import org.apache.taverna.biocatalogue.ui.filtertree.FilterTreePane;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-
-import org.apache.log4j.Logger;
-
-/**
- * This class represents the main panel that deals with the status
- * and results of the current search.
- *
- * It has a status label, spinner to depict search in progress,
- * actual search results split into tabs by their type, a toolbar
- * with search history, favourite searches settings, favourite filters,
- * ability to restart last search, etc.
- *
- * @author Sergejs Aleksejevs
- */
-public class SearchResultsMainPanel extends JPanel implements ActionListener, SearchInstanceTracker
-{
- private final SearchResultsMainPanel instanceOfSelf;
- private Logger logger;
-
- private LinkedHashMap<TYPE, JComponent> searchResultTabs;
- private Map<TYPE, SearchResultsListingPanel> searchResultListings;
-
- // holds a reference to the instance of the search instances in the current context
- // that should be active at the moment (will aid early termination of older searches
- // when new ones are started)
- private Map<TYPE, SearchInstance> currentSearchInstances;
-
- // holds a map of references to the current instances of filter trees per resource type
- private Map<TYPE, FilterTreePane> currentFilterPanes;
-
-
- // COMPONENTS
- private JTabbedPane tabbedSearchResultPanel;
-
- protected JToggleButton bToggleSearchHistory;
- protected JButton bRefreshLastSearch;
- protected JButton bClearSearchResults;
-
-
- public SearchResultsMainPanel()
- {
- this.instanceOfSelf = this;
- MainComponentFactory.getSharedInstance();
- this.logger = Logger.getLogger(SearchResultsMainPanel.class);
-
- this.currentSearchInstances = new HashMap<TYPE,SearchInstance>();
-
- this.searchResultListings = new HashMap<TYPE, SearchResultsListingPanel>();
- this.currentFilterPanes = new HashMap<TYPE,FilterTreePane>();
- this.searchResultTabs = new LinkedHashMap<TYPE, JComponent>(); // crucial to preserve the order -- so that these tabs always appear in the UI in the same order!
- initialiseResultTabsMap();
-
- initialiseUI();
- }
-
-
- private void initialiseUI()
- {
- // create a panel for tabbed listings of search results
- this.tabbedSearchResultPanel = new JTabbedPane();
- reloadResultTabsFromMap();
-
- // pack all main components together
- JPanel jpMainResultsPanel = new JPanel(new BorderLayout());
- jpMainResultsPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 3));
-
- jpMainResultsPanel.add(tabbedSearchResultPanel, BorderLayout.CENTER);
-
-
- // --- Put together all parts ---
- // main components in the middle, toolbar on the right
- this.setMinimumSize(new Dimension(450, 50));
- this.setLayout(new BorderLayout());
- this.add(jpMainResultsPanel, BorderLayout.CENTER);
-
- // FIXME - add toolbar to the main window!
-// this.add(tbSearchActions, BorderLayout.EAST);
- }
-
-
-
- // ----- Hiding / Showing tabs for various search result types -----
-
- /**
- * Dynamically populates the map of resource types and components that represent these types
- * in the tabbed pane -- this is only to be done once during the initialisation.
- */
- private void initialiseResultTabsMap()
- {
- for (TYPE t : TYPE.values()) {
- toggleResultTabsInMap(t, t.isDefaultSearchType());
- }
- }
-
-
- /**
- * Adds or removes a tab for a specified type of resource.
- *
- * @param type Resource type for which the tab is to be added / removed.
- * @param doShowTab Defines whether to add or remove tab for this resource type.
- */
- public void toggleResultTabsInMap(TYPE type, boolean doShowTab)
- {
- JPanel jpResultTabContent = null;
-
- if (doShowTab)
- {
- jpResultTabContent = new JPanel(new GridLayout());
-
- // decide if this resource type supports filtering
- if (type.isSuitableForFiltering()) {
- FilterTreePane filterTreePane = new FilterTreePane(type);
- this.currentFilterPanes.put(type, filterTreePane);
- }
- else {
- // not suitable for filtering - record this in a map
- this.currentFilterPanes.put(type, null);
- }
-
-
- SearchResultsListingPanel resultsListingPanel = new SearchResultsListingPanel(type, this);
- this.searchResultListings.put(type, resultsListingPanel);
-
- if (this.currentFilterPanes.get(type) == null) {
- jpResultTabContent.add(resultsListingPanel);
- }
- else {
- JSplitPane spFiltersAndResultListing = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
- spFiltersAndResultListing.setLeftComponent(this.currentFilterPanes.get(type));
- spFiltersAndResultListing.setRightComponent(resultsListingPanel);
- jpResultTabContent.add(spFiltersAndResultListing);
- }
- }
- else {
- // tab for this type is being hidden - just remove the references
- // to the search result listing and to filter pane
- this.searchResultListings.put(type, null);
- this.currentFilterPanes.put(type, null);
- }
-
- this.searchResultTabs.put(type, jpResultTabContent);
- }
-
-
- /**
- * (Re-)loads the user interface from the internal map.
- */
- public void reloadResultTabsFromMap()
- {
- Component selectedTabsComponent = tabbedSearchResultPanel.getSelectedComponent();
- tabbedSearchResultPanel.removeAll();
- for (TYPE type : this.searchResultTabs.keySet()) {
- JComponent c = this.searchResultTabs.get(type);
- if (c != null) {
- tabbedSearchResultPanel.addTab(type.getCollectionName(), type.getIcon(), c, type.getCollectionTabTooltip());
- }
- }
-
- // attempt to re-select the same tab that was open before reloading
- try {
- tabbedSearchResultPanel.setSelectedComponent(selectedTabsComponent);
- }
- catch (IllegalArgumentException e) {
- // failed - probably previously selected tab got removed - select the first one
- tabbedSearchResultPanel.setSelectedIndex(0);
- }
- }
-
-
- /**
- * @param resourceType Resource type to look for.
- * @return Current index of the tab in the results tabbed pane view
- * that holds a component showing search results for this type.
- * Returns <code>-1</code> if requested type is not currently displayed.
- */
- protected int getTabIndexForResourceType(TYPE resourceType) {
- return (tabbedSearchResultPanel.indexOfComponent(searchResultTabs.get(resourceType)));
- }
-
-
- // ----- ------
-
-
- /**
- * This method is intended to be called when filter options in one of the tabs change.
- * It starts the new filtering operation.
- *
- * Effectively it sets the filtering parameters for the SearchInstance
- * and then starts a new search with that {@link SearchInstance} wrapped into {@link SearchOptions}.
- *
- * @param resourceType Resource type for which the new filtering operation is started
- * @param filteringSettings Filtering settings for the current filtering operation
- * obtained from the filter tree (or favourite filters).
- */
- public void startNewFiltering(TYPE resourceType, ServiceFilteringSettings filteringSettings)
- {
- SearchInstance siPreviousSearchForThisType = getCurrentSearchInstance(resourceType);
-
- // pass on the filtering parameters to the relevant search instance (this will overwrite the old ones if any were present!)
- if (siPreviousSearchForThisType == null) {
- // no filterings have been done earlier for this resource type;
- // we'll need a new (blank) query search SearchInstance and
- // wrap it into a service filtering SearchInstance
- siPreviousSearchForThisType = new SearchInstance(new SearchInstance("", resourceType), filteringSettings);
- }
- else {
- if (!siPreviousSearchForThisType.isServiceFilteringSearch()) {
- // just wrap existing search instance that was (probably) transferred from the Search tab
- // into another SearchInstance that explicitly deals with service filtering
- siPreviousSearchForThisType = new SearchInstance(siPreviousSearchForThisType, filteringSettings);
- }
- else {
- // previous search instance dealt with filtering -
- // simply update the filtering settings (but before that
- // run a 'deep copy' of the original search instance, so
- // that the new one gets a new reference; this will aid
- // in early termination of older filterings)
- siPreviousSearchForThisType = siPreviousSearchForThisType.deepCopy();
- siPreviousSearchForThisType.setFilteringSettings(filteringSettings);
- }
- }
-
- // proceed with "search" as usual - it will treat this search instance differently
- // from "ordinary" search
- startNewSearch(new SearchOptions(siPreviousSearchForThisType));
- }
-
-
- /**
- * Worker method responsible for starting a new search via the API.
- *
- * This method is to be used when a *new* search is started. It will
- * mainly make updates to the UI and store the new search in the history.
- */
- public void startNewSearch(final SearchOptions searchOptions)
- {
- try
- {
- for (final TYPE resourceType : searchOptions.getResourceTypesToSearchFor())
- {
- SearchInstance si = null;
- switch (searchOptions.getSearchType()) {
- case QuerySearch: si = new SearchInstance(searchOptions.getSearchString(), resourceType);
- resetAllFilterPanes(searchOptions.getSearchString());
- break;
-
- case TagSearch: if (resourceType.isSuitableForTagSearch()) {
- si = new SearchInstance(searchOptions.getSearchTags(), resourceType);
- resetAllFilterPanes(searchOptions.getSearchString());
- }
- else {
- // FIXME implement this... - show "no results" in the appropriate tab
- JOptionPane.showMessageDialog(null, "'" + resourceType.getTypeName() + "' resource type is not suitable for tag search");
- }
- break;
-
- case Filtering: if (resourceType.isSuitableForFiltering()) {
- si = searchOptions.getPreconfiguredSearchInstance();
- }
- else {
- // FIXME implement this... - show "no results" in the appropriate tab
- JOptionPane.showMessageDialog(null, "'" + resourceType.getTypeName() + "' resource type is not suitable for filtering");
- }
- break;
- }
-
- if (si.isEmptySearch()) {
- clearListingPanels();
- return;
- }
-
- // Record 'this' search instance and set it as the new "primary" one for
- // this resource type;
- // (this way it if a new search thread starts afterwards, it is possible to
- // detect this and stop the 'older' search, because it is no longer relevant)
- registerSearchInstance(resourceType, si);
-
- // start spinner icon for this tab to indicate search in progress - also show status message
- setSpinnerIconForTab(resourceType);
- setDefaultTitleForTab(resourceType);
- searchResultListings.get(resourceType).setSearchStatusText("Searching for " + si.getDescriptionStringForSearchStatus() + "...", true);
-
-
- // start the actual search
- final SearchInstance siToStart = si;
- new Thread(searchOptions.getSearchType() + " of " + resourceType.getCollectionName() + " via the API") {
- public void run() {
- siToStart.startNewSearch(instanceOfSelf, new CountDownLatch(1), searchResultListings.get(resourceType)); // FIXME - the new countdown latch is never used...
- }
- }.start();
- }
- }
- catch (Exception e) {
- logger.error("Error while searching via the Service Catalogue API. Error details attached.", e);
- }
-
-}
-
-
-
- /**
- * Clears selection of filtering criteria and collapses any expanded nodes
- * in all filter tree panes.<br/><br/>
- *
- * To be used for resetting all filter panes when the new query / tag
- * search starts.
- * @param queryString
- */
- private void resetAllFilterPanes(String queryString) {
- for (FilterTreePane filterTreePane : this.currentFilterPanes.values()) {
- if (filterTreePane != null) {
- filterTreePane.clearSelection();
- filterTreePane.collapseAll();
- if ((queryString != null) && !queryString.isEmpty()) {
- filterTreePane.applyQueryString(queryString);
- }
- }
- }
- }
-
-
- protected void setSpinnerIconForTab(TYPE resourceType) {
- tabbedSearchResultPanel.setIconAt(getTabIndexForResourceType(resourceType), ResourceManager.getImageIcon(ResourceManager.SPINNER));
- }
-
- protected void setDefaultIconForTab(TYPE resourceType) {
- this.tabbedSearchResultPanel.setIconAt(getTabIndexForResourceType(resourceType), resourceType.getIcon());
- }
-
-
- /**
- * Same as {@link SearchResultsMainPanel#setDefaultTitleForTab(TYPE)},
- * but allows to append a specified string at the end of the default title.
- *
- * @param resourceType
- * @param suffix
- */
- protected void setDefaultTitleForTabWithSuffix(TYPE resourceType, String suffix) {
- tabbedSearchResultPanel.setTitleAt(getTabIndexForResourceType(resourceType),
- resourceType.getCollectionName() + (suffix == null ? "" : suffix) );
- }
-
-
- /**
- * Sets default title for a tab that contains panel representing
- * search results of the specified resource type. Default title
- * is just a name of the collections of resources in that tab.
- *
- * @param resourceType
- */
- protected void setDefaultTitleForTab(TYPE resourceType) {
- setDefaultTitleForTabWithSuffix(resourceType, null);
- }
-
-
- /**
- * @param resourceType Resource type for which the search result listing panel is requested.
- * @return Reference to the requested panel or <code>null</code> if a tab for the specified
- * <code>resourceType</code> does not exist.
- */
- protected SearchResultsListingPanel getResultsListingFor(TYPE resourceType) {
- return (this.searchResultListings.get(resourceType));
- }
-
-
- /**
- * @param resourceType Resource type for which filter tree pane is to be returned.
- * @return Reference to the requested filter tree pane or <code>null</code> if
- * there is no search result tab for the specified <code>resourceType</code>
- * (or if that <code>resourceType</code> does not support filtering).
- */
- protected FilterTreePane getFilterTreePaneFor(TYPE resourceType) {
- return (this.currentFilterPanes.get(resourceType));
- }
-
-
- // *** Callback for ActionListener interface ***
-
- public void actionPerformed(ActionEvent e)
- {
- // FIXME -- remove this...
-// if (e.getSource().equals(bRefreshLastSearch))
-// {
-// // restore state of the search options panel
-// pluginPerspectiveMainComponent.getSearchTab().restoreSearchOptions(siPreviousSearch);
-//
-// // completely re-run the previous search
-// startNewSearch(siPreviousSearch);
-// }
-// else if (e.getSource().equals(bClearSearchResults))
-// {
-// // manual request to clear results of previous search
-//
-// // if any search thread was running, deactivate it as well
-// if (isSearchThreadRunning()) {
-// vCurrentSearchThreadID.set(0, null);
-// }
-//
-// // changing both - spinner image and the status text simultaneously
-// setSearchStatusText("No searches were made yet", false);
-//
-// // removed the previous search, hence makes no sense to allow to clear "previous" results again
-// bClearSearchResults.setEnabled(false);
-//
-// // only remove data about previous search and disable refresh button
-// // if no search thread is currently running - otherwise keep the button
-// // enabled in case there is a need to re-start the search if it's frozen
-// if (!isSearchThreadRunning()) {
-// siPreviousSearch = null;
-// bRefreshLastSearch.setEnabled(false);
-// }
-//
-// // also notify tabbed results panel, so that it removes the actual search results
-// searchResultsPanel.clearPreviousSearchResults();
-// }
-// else if (e.getSource().equals(this.jclPreviewCurrentFilteringCriteria))
-// {
-// // open a preview window showing current filtering settings
-// SwingUtilities.invokeLater(new Runnable()
-// {
-// public void run() {
-// ServiceFilteringSettingsPreview p = new ServiceFilteringSettingsPreview(siPreviousSearch.getFilteringSettings());
-// p.setVisible(true);
-// }
-// });
-//
-// }
- }
-
-
- // *** Callbacks for SearchInstanceTracker interface ***
-
- public synchronized void clearPreviousSearchInstances() {
- this.currentSearchInstances.clear();
- }
-
- public synchronized boolean isCurrentSearchInstance(TYPE searchType, SearchInstance searchInstance) {
- // NB! it is crucial to perform test by reference here (hence the use of "==", not equals()!)
- return (this.currentSearchInstances.get(searchType) == searchInstance);
- }
-
- public synchronized void registerSearchInstance(TYPE searchType, SearchInstance searchInstance) {
- this.currentSearchInstances.put(searchType, searchInstance);
- }
-
- public synchronized SearchInstance getCurrentSearchInstance(TYPE searchType) {
- return this.currentSearchInstances.get(searchType);
- }
-
-public void clearListingPanels() {
- for (SearchResultsListingPanel listingPanel : searchResultListings.values()) {
- listingPanel.resetSearchResultsListing(true);
- }
- for (TYPE t : searchResultListings.keySet()) {
- setDefaultTitleForTab(t);
- }
-
-}
-
-public void clearSearch() {
- clearPreviousSearchInstances();
- clearListingPanels();
- for (FilterTreePane treePanel : currentFilterPanes.values()) {
- treePanel.reset();
- }
-}
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SearchResultsRenderer.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SearchResultsRenderer.java
deleted file mode 100644
index 7c39fc9..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/SearchResultsRenderer.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.search_results;
-/*
- * 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.
- */
-
-import org.apache.taverna.biocatalogue.model.search.SearchInstance;
-
-/**
- * This interfaces avoids coupling of search engine classes
- * directly with the UI classes.
- *
- * Search engines would send new chunks of search results
- * to the <code>SearchResultsRenderer</code> as soon as
- * they become available.
- *
- * @author Sergejs Aleksejevs
- */
-public interface SearchResultsRenderer
-{
- /**
- * Render initial fragment of search results. This includes
- * creating a new <code>ListModel</code> in the results listing
- * and populating it with the first chunk of results and placeholders
- * for those results that haven't been fetched yet.
- *
-// * @param searchThreadID This is the ID of the thread that initiated search // FIXME
-// * from within the UI component, rather than the ID of
-// * the real worker search engine's search thread.
-// * It is used to test whether that thread is still active -
-// * to determine whether the partial results need to be rendered.
- * @param si The search instance containing partial search results to be rendered.
- */
- void renderInitialResults(SearchInstance si);
-
-
- /**
- * Update the results listing with a specific fragment of the collection
- * of search results.
- *
- * @param si The search instance containing partial search results to be rendered.
- * @param startIndex First index in the result collection to update.
- * @param count Number of result listing entries to update.
- * <br/>
- * At most <code>count</code> results will be rendered - less can be rendered
- * if end of result list is reached earlier. <code>count</code> is normally
- * just a page size for a specific resource type.
- */
- void renderFurtherResults(SearchInstance si, int startIndex, int count);
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/ServiceListCellRenderer.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/ServiceListCellRenderer.java
deleted file mode 100644
index c7cf5ba..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/search_results/ServiceListCellRenderer.java
+++ /dev/null
@@ -1,307 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.search_results;
-/*
- * 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.
- */
-
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.biocatalogue.x2009.xml.rest.Location;
-import org.biocatalogue.x2009.xml.rest.ResourceLinkWithString;
-import org.biocatalogue.x2009.xml.rest.Service;
-import org.biocatalogue.x2009.xml.rest.ServiceSummary.Provider;
-
-import org.apache.taverna.biocatalogue.model.LoadingExpandedResource;
-import org.apache.taverna.biocatalogue.model.LoadingResource;
-import org.apache.taverna.biocatalogue.model.Resource;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.ServiceMonitoringStatusInterpreter;
-
-
-/**
- * This list cell renderer is will display (web) Service items in the search results
- * list box.
- *
- * In the collapsed state, four data items will be shown per service: status (as per monitoring data),
- * service type (SOAP / REST), the name of the service and its description.
- *
- * In the expanded state, other details are added to the ones above: service categories, locations,
- * endpoints and providers.
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class ServiceListCellRenderer extends ExpandableOnDemandLoadedListCellRenderer
-{
- private JLabel jlTypeIcon;
- private JLabel jlItemStatus;
- private JLabel jlItemTitle;
- private JLabel jlDescription;
-
- private GridBagConstraints c;
-
-
- public ServiceListCellRenderer() {
- /* do nothing */
- }
-
-
- /**
- * This entry can be in one of two states:
- * -- containing only the name of the resource and NOT loading further details;
- * -- containing only the name of the resource and LOADING further details.
- *
- * @param itemToRender
- * @return
- */
- protected GridBagConstraints prepareInitiallyLoadingEntry(Object itemToRender)
- {
- TYPE resourceType = determineResourceType(itemToRender);
- LoadingResource resource = (LoadingResource)itemToRender;
-
- jlTypeIcon = new JLabel(resourceType.getIcon());
- jlItemStatus = new JLabel(ResourceManager.getImageIcon(ResourceManager.SERVICE_STATUS_UNKNOWN_ICON));
-
- jlItemTitle = new JLabel(Resource.getDisplayNameForResource(resource), JLabel.LEFT);
- jlItemTitle.setForeground(Color.decode("#AD0000")); // very dark red
- jlItemTitle.setFont(jlItemTitle.getFont().deriveFont(Font.PLAIN, jlItemTitle.getFont().getSize() + 2));
-
- jlDescription = resource.isLoading() ? loaderBarAnimationGrey : loaderBarAnimationGreyStill;
-
- return (arrangeLayout(false));
- }
-
-
- /**
- *
- * @param itemToRender
- * @param expandedView <code>true</code> to indicate that this method generates the top
- * fragment of the expanded list entry for this SOAP operation / REST method.
- * @return
- */
- protected GridBagConstraints prepareLoadedEntry(Object itemToRender, boolean selected)
- {
- TYPE resourceType = determineResourceType(itemToRender);
- Service service = (Service)itemToRender;;
-
- // service type
- if (service.getServiceTechnologyTypes() != null && service.getServiceTechnologyTypes().getTypeList().size() > 0)
- {
- if (service.getServiceTechnologyTypes().getTypeList().size() > 1 &&
- !(service.getServiceTechnologyTypes().getTypeList().get(0).toString().equalsIgnoreCase("SOAP")) &&
- service.getServiceTechnologyTypes().getTypeList().get(1).toString().equalsIgnoreCase("SOAPLAB")
- )
- {
- jlTypeIcon = new JLabel(ResourceManager.getImageIcon(ResourceManager.SERVICE_TYPE_MULTITYPE_ICON));
- }
- else if (service.getServiceTechnologyTypes().getTypeArray(0).toString().equalsIgnoreCase("SOAP")) {
- jlTypeIcon = new JLabel(ResourceManager.getImageIcon(ResourceManager.SERVICE_TYPE_SOAP_ICON));
- }
- else if (service.getServiceTechnologyTypes().getTypeArray(0).toString().equalsIgnoreCase("REST")) {
- jlTypeIcon = new JLabel(ResourceManager.getImageIcon(ResourceManager.SERVICE_TYPE_REST_ICON));
- }
- }
- else {
- // can't tell the type - just show as a service of no particular type
- jlTypeIcon = new JLabel(resourceType.getIcon());
- }
-
-
- // service status
- jlItemStatus = new JLabel(ServiceMonitoringStatusInterpreter.getStatusIcon(service, true));
-
- jlItemTitle = new JLabel(Resource.getDisplayNameForResource(service), JLabel.LEFT);
- jlItemTitle.setForeground(Color.decode("#AD0000")); // very dark red
- jlItemTitle.setFont(jlItemTitle.getFont().deriveFont(Font.PLAIN, jlItemTitle.getFont().getSize() + 2));
-
- int descriptionMaxLength = DESCRIPTION_MAX_LENGTH_EXPANDED;
- String strDescription = Util.stripAllHTML(service.getDescription());
- strDescription = (strDescription == null || strDescription.length() == 0 ?
- "<font color=\"gray\">no description</font>" :
- StringEscapeUtils.escapeHtml(Util.ensureLineLengthWithinString(strDescription, LINE_LENGTH, false)));
-
- if (strDescription.length() > descriptionMaxLength) {
- strDescription = strDescription.substring(0, descriptionMaxLength) + "<font color=\"gray\">(...)</font>";
- }
- strDescription = "<html><b>Description: </b>" + strDescription + "</html>";
- jlDescription = new JLabel(strDescription);
-
- return (arrangeLayout(true));
- }
-
-
- /**
- * @return Final state of the {@link GridBagConstraints} instance
- * that was used to lay out components in the panel.
- */
- private GridBagConstraints arrangeLayout(boolean showActionButtons)
- {
- // POPULATE PANEL WITH PREPARED COMPONENTS
- this.setLayout(new GridBagLayout());
- c = new GridBagConstraints();
- c.anchor = GridBagConstraints.NORTHWEST;
- c.fill = GridBagConstraints.HORIZONTAL;
-
- c.gridx = 0;
- c.gridy = 0;
- c.weightx = 0;
- c.insets = new Insets(10, 6, 6, 3);
- this.add(jlTypeIcon, c);
-
- c.gridx++;
- c.insets = new Insets(10, 3, 6, 3);
- this.add(jlItemStatus, c);
-
- c.gridx++;
- c.weightx = 1.0;
- c.insets = new Insets(10, 3, 6, 3);
- this.add(jlItemTitle, c);
-
- if (showActionButtons) {
- c.gridx++;
- c.gridheight = 3;
- c.weightx = 0;
- c.weighty = 1.0;
- jlExpand = new JLabel(ResourceManager.getImageIcon(ResourceManager.FOLD_ICON));
- this.add(jlExpand, c);
- }
-
- c.gridx = 2;
- c.gridy++;
- c.gridheight = 1;
- c.weightx = 1.0;
- c.weighty = 0;
- c.insets = new Insets(3, 3, 3, 3);
- this.add(jlDescription, c);
-
- return (c);
- }
-
-
-
- protected void prepareLoadingExpandedEntry(Object itemToRender)
- {
- LoadingExpandedResource expandedResource = (LoadingExpandedResource) itemToRender;
- GridBagConstraints c = prepareLoadedEntry(expandedResource.getAssociatedObj(), false);
-
- if (expandedResource.isLoading())
- {
- c.gridx = 0;
- c.gridy++;
- c.gridwidth = 3;
- c.anchor = GridBagConstraints.CENTER;
- c.fill = GridBagConstraints.HORIZONTAL;
- c.weightx = 1.0;
- this.add(loaderBarAnimationOrange, c);
- }
- else
- {
- // *** additional data for this Web Service operations ***
- Service service = (Service) expandedResource.getAssociatedObj();
-
-
- // -- categories --
- int categoryCount = service.getSummary().getCategoryList().size();
- String categoryString = "";
- if (categoryCount > 0) {
- List<String> categoryNames = new ArrayList<String>();
- for (ResourceLinkWithString category : service.getSummary().getCategoryList()) {
- categoryNames.add(category.getStringValue());
- }
- categoryString = "<html><b>" + Util.pluraliseNoun("Category", categoryCount) + ": </b>" + StringEscapeUtils.escapeHtml(Util.join(categoryNames, ", ")) + "</html>";
- }
- else {
- categoryString = "<html><b>Category: </b><font color=\"gray\">unknown</font></html>";
- }
-
- c.gridy++;
- this.add(new JLabel(categoryString),c);
-
-
- // -- endpoints --
- int endpointCount = service.getSummary().getEndpointList().size();
- String endpointString = "";
- if (endpointCount > 0) {
- endpointString = "<html><b>" + Util.pluraliseNoun("Endpoint", endpointCount) + ": </b>" +
- StringEscapeUtils.escapeHtml(Util.join(service.getSummary().getEndpointList(), ", ")) + "</html>";
- }
- else {
- endpointString = "<html><b>Endpoint: </b><font color=\"gray\">unknown</font></html>";
- }
-
- c.gridy++;
- this.add(new JLabel(endpointString), c);
-
-
- // -- providers --
- int providerCount = service.getSummary().getProviderList().size();
- String providerString = "";
- if (providerCount > 0) {
- List<String> providerNames = new ArrayList<String>();
- for (Provider serviceProvider : service.getSummary().getProviderList()) {
- providerNames.add(serviceProvider.getName());
- }
- providerString = "<html><b>" + Util.pluraliseNoun("Provider", providerCount) + ": </b>" + StringEscapeUtils.escapeHtml(Util.join(providerNames, ", ")) + "</html>";
- }
- else {
- providerString = "<html><b>Provider: </b><font color=\"gray\">unknown</font></html>";
- }
-
- c.gridy++;
- this.add(new JLabel(providerString),c);
-
-
- // -- locations --
- int locationCount = service.getSummary().getLocationList().size();
- String locationString = "";
- List<String> locations = new ArrayList<String>();
- if (locationCount > 0) {
- for (Location location : service.getSummary().getLocationList()) {
- List<String> locationNameFragments = new ArrayList<String>();
- locationNameFragments.add(location.getCity());
- locationNameFragments.add(location.getCountry());
- locations.add(Util.join(locationNameFragments, ", "));
- }
- }
- locationString = "<html><b>" + Util.pluraliseNoun("Location", locations.size()) + ": </b>" +
- (locations.size() > 0 ? StringEscapeUtils.escapeHtml(Util.join(locations, "; ")) : "<font color=\"gray\">unknown</font>") +
- "</html>";
-
- c.gridy++;
- c.insets = new Insets(3, 3, 12, 3);
- this.add(new JLabel(locationString),c);
- }
- }
-
-
-@Override
-boolean shouldBeHidden(Object itemToRender) {
- return false;
-}
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/JTriStateTree.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/JTriStateTree.java
deleted file mode 100644
index 548a904..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/JTriStateTree.java
+++ /dev/null
@@ -1,647 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.tristatetree;
-/*
- * 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.
- */
-
-import java.awt.Component;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JPopupMenu;
-import javax.swing.JTree;
-import javax.swing.SwingUtilities;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.MutableTreeNode;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.workbench.icons.WorkbenchIcons;
-
-
-/**
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class JTriStateTree extends JTree
-{
- // This is used to manage location and padding of tooltips on long items
- // that don't fit into the visible part of this tree.
- private static final int JCHECKBOX_WIDTH = 16;
-
- private JTriStateTree instanceOfSelf;
- private JPopupMenu contextualMenu;
-
- private TriStateTreeNode root;
-
- // will enable/disable checkboxes - when disabled the selection
- // will remain, but will appear as read-only
- private boolean bCheckingEnabled;
-
- private List<Action> contextualMenuActions;
- private Action expandAllAction;
- private Action collapseAllAction;
- private Action selectAllAction;
- private Action deselectAllAction;
-
- private Set<TriStateTreeCheckingListener> checkingListeners;
-
-
- @SuppressWarnings("serial")
-public JTriStateTree(TriStateTreeNode root)
- {
- super(root);
- this.root = root;
- this.instanceOfSelf = this;
-
- // by default checking is allowed
- this.bCheckingEnabled = true;
-
- // initially, no checking listeners
- checkingListeners = new HashSet<TriStateTreeCheckingListener>();
-
- // initially set to show the [+]/[-] icons for expanding collapsing top-level nodes
- this.setShowsRootHandles(true);
-
- // use the cell rendered which understands the three states of the
- // nodes of this tree
- this.setCellRenderer(new TriStateCheckBoxTreeCellRenderer());
-
-
- // create all necessary actions for the popup menu: selecting/deselecting and expanding/collapsing all nodes
- this.selectAllAction = new AbstractAction("Select all", ResourceManager.getImageIcon(ResourceManager.SELECT_ALL_ICON))
- {
- // Tooltip
- { this.putValue(SHORT_DESCRIPTION, "Select all nodes in the tree"); }
-
- public void actionPerformed(ActionEvent e) {
- selectAllNodes(true);
- }
- };
-
- // Use the Taverna untick icon
- this.deselectAllAction = new AbstractAction("Deselect all", ResourceManager.getImageIcon(ResourceManager.UNCHECKED_ICON))
- {
- // Tooltip
- { this.putValue(SHORT_DESCRIPTION, "Deselect all nodes in the tree"); }
-
- public void actionPerformed(ActionEvent e) {
- selectAllNodes(false);
- }
- };
-
-
-// this.expandAllAction = new AbstractAction("Expand all", ResourceManager.getImageIcon(ResourceManager.EXPAND_ALL_ICON))
- // Use the standard Taverna plus icon
- this.expandAllAction = new AbstractAction("Expand all", WorkbenchIcons.plusIcon)
- {
- // Tooltip
- { this.putValue(SHORT_DESCRIPTION, "Expand all nodes in the tree"); }
-
- public void actionPerformed(ActionEvent e) {
- expandAll();
- }
- };
-
-// this.collapseAllAction = new AbstractAction("Collapse all", ResourceManager.getImageIcon(ResourceManager.COLLAPSE_ALL_ICON))
- // Use the standard Taverna minus icon
- this.collapseAllAction = new AbstractAction("Collapse all", WorkbenchIcons.minusIcon)
- {
- // Tooltip
- { this.putValue(SHORT_DESCRIPTION, "Collapse all expanded nodes in the tree"); }
-
- public void actionPerformed(ActionEvent e) {
- collapseAll();
- }
- };
-
-
- // populate the popup menu with created menu items
- contextualMenuActions = Arrays.asList(new Action[] {expandAllAction, collapseAllAction, deselectAllAction});
-
- contextualMenu = new JPopupMenu();
- contextualMenu.add(expandAllAction);
- contextualMenu.add(collapseAllAction);
- contextualMenu.add(new JPopupMenu.Separator());
- //contextualMenu.add(selectAllAction);
- contextualMenu.add(deselectAllAction);
-
-
- this.addMouseListener(new MouseAdapter() {
- // use mousePressed, not mouseClicked to make sure that
- // quick successive clicks get processed correctly, otherwise
- // some clicks are disregarded
- public void mousePressed(MouseEvent e)
- {
- // only listen to checkbox checking requests if this is
- // a correct type of mouse event for this
- if (!e.isPopupTrigger() && e.getButton() == MouseEvent.BUTTON1)
- {
- int clickedRow = instanceOfSelf.getRowForLocation(e.getX(), e.getY());
-
- // only make changes to node selections if checking is enabled in the tree and
- // it was a node which was clicked, not [+]/[-] or blank space
- if (bCheckingEnabled && clickedRow != -1)
- {
- Object clickedObject = instanceOfSelf.getPathForRow(clickedRow).getLastPathComponent();
- if (clickedObject instanceof TriStateTreeNode) {
- TriStateTreeNode node = ((TriStateTreeNode)clickedObject);
-
- // toggle state of the clicked node + propagate the changes to
- // the checking state of all nodes
- node.toggleState(true);
-
- // repaint the whole tree
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- instanceOfSelf.repaint();
- }
- });
-
- // notify all listeners
- notifyCheckingListeners();
- }
- }
- }
- else {
- // not a checking action - instead, bring up a popup menu
- contextualMenu.show(instanceOfSelf, e.getX(), e.getY());
- }
- }
-
- public void mouseReleased(MouseEvent e)
- {
- if (e.isPopupTrigger()) {
- // another way a popup menu may be called on different systems
- contextualMenu.show(instanceOfSelf, e.getX(), e.getY());
- }
- }
-
-
- /**
- * This method enables tooltips on this instance of JTriStateTree
- * when mouse enters its bounds. Custom tooltips will be used, but
- * this notifies ToolTipManager that tooltips must be shown on this
- * tree.
- */
- public void mouseEntered(MouseEvent e) {
- instanceOfSelf.setToolTipText("Filter tree");
- }
-
- /**
- * Removes tooltips from this JTriStateTree when mouse leaves its bounds.
- */
- public void mouseExited(MouseEvent e) {
- instanceOfSelf.setToolTipText(null);
- }
-
- });
-
- }
-
-
- /**
- * This method is used to determine tooltip location.
- *
- * Helps to ensure that the tooltip appears directly over the
- * text in the row over which the mouse currently hovers.
- */
- public Point getToolTipLocation(MouseEvent e)
- {
- int iRowIndex = this.getRowForLocation(e.getX(), e.getY());
- if (iRowIndex != -1) {
- // mouse hovers over one of the rows - make top-left corner of
- // the tooltip to appear over the top-left corner of that row
- Rectangle bounds = this.getRowBounds(iRowIndex);
- return (new Point(bounds.x + JCHECKBOX_WIDTH, bounds.y));
- }
- else {
- // let ToolTipManager determine where to show the tooltip (if it will be shown)
- return null;
- }
- }
-
-
- /**
- * Supports dynamic tooltips for the contents of this JTriStateTree -
- * the tooltips will only be shown for those tree nodes that don't
- * fully fit within the visible bounds of the tree.
- *
- * For other nodes no tooltip will be shown.
- */
- public String getToolTipText(MouseEvent e)
- {
- String strTooltip = null;
-
- Object correspondingObject = getTreeNodeObject(e);
- if (correspondingObject != null) {
- // mouse is hovering over some row in the tree, not a blank space --
- // obtain a component that is identical to the one which is currently displayed at the identified row in the tree
- Component rendering = this.getCellRenderer().getTreeCellRendererComponent(this, correspondingObject, false, false,
- true, this.getRowForLocation(e.getX(), e.getY()), false);
-
- if (rendering.getPreferredSize().width + getToolTipLocation(e).x - JCHECKBOX_WIDTH > this.getVisibleRect().width) {
- // if the component is not fully visible, the tooltip will be displayed -
- // tooltip text matches the one for this row in the tree, will just be shown in full
- strTooltip = correspondingObject.toString();
- }
- }
-
- // return either tooltip text or 'null' if no tooltip is currently required
- return (strTooltip);
- }
-
-
- /**
- * Check whether a {@link MouseEvent} happened in such a location
- * in the {@link JTriStateTree} that corresponds to some node or a
- * blank space.
- *
- * @param e
- * @return Object contained in the tree node that corresponds to the
- * location of specified {@link MouseEvent} <code>e</code>;
- * or <code>null</code> if the event happened over a blank space.
- */
- public Object getTreeNodeObject(MouseEvent e)
- {
- int iRowIndex = this.getRowForLocation(e.getX(), e.getY());
- if (iRowIndex != -1) {
- // mouse is hovering over some row in the tree, not a blank space
- return (this.getPathForRow(iRowIndex).getLastPathComponent());
- }
-
- return (null);
- }
-
-
- /**
- * @return List of the highest-level nodes of the tree that have full (not partial) selection and,
- * therefore, act as roots of checked paths.
- */
- public List<TreePath> getRootsOfCheckedPaths()
- {
- return getRootsOfCheckedPaths(this.root);
- }
-
- /**
- * A recursive version of the getCheckedRootsOfCheckedPaths().
- * Performs all the work for a given node and returns result to
- * the caller.
- *
- * @param startNode Node to start with.
- * @return
- */
- private List<TreePath> getRootsOfCheckedPaths(TriStateTreeNode startNode)
- {
- ArrayList<TreePath> pathsToRootsOfCheckings = new ArrayList<TreePath>();
-
- Object currentNode = null;
- for (Enumeration e = startNode.children(); e.hasMoreElements(); )
- {
- currentNode = e.nextElement();
- if (currentNode instanceof TriStateTreeNode) {
- TriStateTreeNode curTriStateNode = (TriStateTreeNode)currentNode;
-
- if (curTriStateNode.getState().equals(TriStateCheckBox.State.CHECKED)) {
- pathsToRootsOfCheckings.add(new TreePath(curTriStateNode.getPath()));
- }
- else if (curTriStateNode.getState().equals(TriStateCheckBox.State.PARTIAL)) {
- pathsToRootsOfCheckings.addAll(getRootsOfCheckedPaths(curTriStateNode));
- }
- }
- }
-
- return (pathsToRootsOfCheckings);
- }
-
-
- /**
- * @return List of TreePath objects, where the last component in each
- * path is the root of an unchecked path in this tree. In other
- * words each of those last components is either an unchecked
- * leaf node or a node, none of whose children (and itself as
- * well) are checked.
- */
- public List<TreePath> getRootsOfUncheckedPaths()
- {
- return (getRootsOfUncheckedPaths(this.root));
- }
-
-
- /**
- * Recursive worker method for <code>getRootsOfUncheckedPaths()</code>.
- */
- private List<TreePath> getRootsOfUncheckedPaths(TreeNode startNode)
- {
- List<TreePath> rootNodesOfUncheckedPaths = new ArrayList<TreePath>();
-
- Object currentNode = null;
- for (Enumeration e = startNode.children(); e.hasMoreElements(); )
- {
- currentNode = e.nextElement();
- if (!(currentNode instanceof TriStateTreeNode) ||
- ((TriStateTreeNode)currentNode).getState().equals(TriStateCheckBox.State.UNCHECKED))
- {
- rootNodesOfUncheckedPaths.add(new TreePath(((DefaultMutableTreeNode)currentNode).getPath()));
- }
- else {
- rootNodesOfUncheckedPaths.addAll(getRootsOfUncheckedPaths((TreeNode)currentNode));
- }
- }
-
- return (rootNodesOfUncheckedPaths);
- }
-
-
- /**
- * @return List of TreePath objects, that point to all "leaf"
- * nodes in the tree that are checked - in other words
- * this method returns a collection of paths to all "deepest"
- * nodes in this tree that are checked and do not have any
- * (checked) children.
- */
- public List<TreePath> getLeavesOfCheckedPaths() {
- return (getLeavesOfCheckedPaths(this.root));
- }
-
-
- /**
- * Recursive worker method for {@link JTriStateTree#getLeavesOfCheckedPaths()}
- */
- private List<TreePath> getLeavesOfCheckedPaths(TriStateTreeNode startNode)
- {
- List<TreePath> leavesOfCheckedPaths = new ArrayList<TreePath>();
-
- // this node is only relevant if it is checked itself - if not,
- // it must be the first-level child of another node that is checked
- // and is only considered here on the recursive pass (but will be discarded)
- if (startNode.getState().equals(TriStateCheckBox.State.CHECKED) ||
- startNode.getState().equals(TriStateCheckBox.State.PARTIAL))
- {
- // "ask" all children to do the same...
- Object currentNode = null;
- for (Enumeration e = startNode.children(); e.hasMoreElements(); ) {
- currentNode = e.nextElement();
- if (currentNode instanceof TriStateTreeNode) {
- leavesOfCheckedPaths.addAll(getLeavesOfCheckedPaths((TriStateTreeNode)currentNode));
- }
- }
-
- // ...if we have a list of leaf nodes, then this node can't be a leaf;
- // -> but alternatively, if the list is empty, it means that this node is
- // itself a leaf node and must be added to the result
- if (leavesOfCheckedPaths.isEmpty()) {
- leavesOfCheckedPaths.add(new TreePath(startNode.getPath()));
- }
- }
-
- return (leavesOfCheckedPaths);
- }
-
-
- /**
- * @return List of all contextual menu actions that are available for this tree.
- */
- public List<Action> getContextualMenuActions() {
- return this.contextualMenuActions;
- }
-
-
- /**
- * Enables or disables all actions in the contextual menu
- * @param actionsAreEnabled
- */
- public void enableAllContextualMenuAction(boolean actionsAreEnabled) {
- for (Action a : getContextualMenuActions()) {
- a.setEnabled(actionsAreEnabled);
- }
- }
-
-
- /**
- * Selects or deselects all nodes.
- * @param selectAll True - to select all; false - to reset all selections.
- */
- public void selectAllNodes(boolean selectAll) {
- root.setState(selectAll ? TriStateCheckBox.State.CHECKED : TriStateCheckBox.State.UNCHECKED);
- root.updateStateOfRelatedNodes();
- this.repaint();
-
- // even though this isn't a click in the tree, the selection has changed -
- // notify all listeners
- notifyCheckingListeners();
- }
-
-
- /**
- * TODO - this method doesn't take into account a possibility that the
- * filter tree might have changed
- *
- * @param rootsOfCheckedPaths A list of TreePath objects which represent a checking state of
- * the nodes in this tree (as returned by <code>getRootsOfCheckedPaths()</code>).
- *
- * The last node of each path is the one that should have <code>TriStateCheckBox.State.CHECKED</code>
- * state (so that last node is a root of checked path that start at that node). Related partial
- * checkings for the UI can be computed from that by the tree checking model.
- *
- * Therefore, a single "real" checking per provided TreePath from <code>rootsOfCheckedPaths</code> is
- * made.
- */
- public void restoreFilterCheckingSettings(List<TreePath> rootsOfCheckedPaths)
- {
- // start with removing all selections
- this.selectAllNodes(false);
-
- for (TreePath p : rootsOfCheckedPaths) {
- restoreTreePathCheckingSettings(this.root, p);
- }
- }
-
- /**
- * A worker method for <code>restoreFilterCheckingSettings(List<TreePath> rootsOfCheckedPaths)</code>.
- * See that method for further details.
- *
- * @param startNode A node of this tree.
- * @param pathFromStartNode A TreePath object from the stored filter, where the first node must be
- * equals to <code>startNode</code> (based on the <code>userObject</code>,
- * but not the checking state), should the traversal of the tree result in
- * checking the last node of this TreePath eventually - which is the goal
- * of this method.
- * @return True if traversal of <code>pathFromStartNode</code> succeeded and a node in this tree was checked;
- * false if traversal couldn't find a matching node in this tree, and so no checking was made.
- */
- private boolean restoreTreePathCheckingSettings(TriStateTreeNode startNode, TreePath pathFromStartNode)
- {
- if (startNode == null || pathFromStartNode == null || pathFromStartNode.getPathCount() == 0) {
- // no match - no data to work with
- return (false);
- }
-
- // compare the "roots" - provided start node and the root of the provided path
- // (based on the 'user object', but not the selection state)
- if (startNode.equals(pathFromStartNode.getPathComponent(0)))
- {
- if (pathFromStartNode.getPathCount() == 1) {
- // provided startNode is equals to the only node in the provided tree path -
- // so it is the node to mark as checked; also - make sure that this selection
- // propagates through tree
- startNode.setState(TriStateCheckBox.State.CHECKED, true);
-
- // we've found the required node in this path - no further search needed,
- // so terminate this method
- return (true);
- }
- else {
- // provided startNode is equals to the first node of the provided tree path -
- // meaning that at this stage we need to traverse all children of the startNode
- // and look for the child that would match the next element in the provided tree path
- //
- // to do this, produce a new tree path from the provided one that doesn't contain
- // the first node - then proceed recursively
- Object[] currentPathComponents = pathFromStartNode.getPath();
- Object[] reducedPathComponents = new Object[currentPathComponents.length - 1];
- System.arraycopy(currentPathComponents, 1, reducedPathComponents, 0, currentPathComponents.length - 1);
-
- Enumeration children = startNode.children();
- while (children.hasMoreElements()) {
- TriStateTreeNode currentChild = (TriStateTreeNode)children.nextElement();
-
- // if recursive call succeeds, no need to iterate any further
- if (restoreTreePathCheckingSettings(currentChild, new TreePath(reducedPathComponents))) return (true);
- }
- }
- }
-
- // the startNode doesn't match the the first element in the provided tree path
- // or no match could be found during recursive search for the node to "check"
- return (false);
- }
-
-
- /**
- * Expands all paths in this tree.
- */
- public void expandAll()
- {
- // this simply expands all tree nodes
- // TODO - this actually "freezes" the UI if there are many nodes in the tree
- // some better solution to be found (e.g. expand the nodes in the model, then update UI, or similar)
- for (int i = 0; i < getRowCount(); i++) {
- instanceOfSelf.expandRow(i);
- }
- }
-
-
- /**
- * Collapses all paths in this tree.
- */
- public void collapseAll()
- {
- // this simply collapses all expanded nodes - this is very quick, execute just as it is
- for (int i = getRowCount() - 1; i >= 0; i--) {
- instanceOfSelf.collapseRow(i);
- }
- }
-
-
- /**
- * Removes all nodes in this tree that are unchecked.
- *
- * It doesn't iterate through *all* nodes - if some node is
- * indeed unchecked, it removes that node and any children that
- * it has (because unchecked node is the root of an unchecked path).
- */
- public void removeAllUncheckedNodes()
- {
- // get the tree model first - will be used to remove the nodes
- DefaultTreeModel theTreeModel = (DefaultTreeModel)this.treeModel;
-
- // remove unchecked nodes
- List<TreePath> allNodesToRemove = this.getRootsOfUncheckedPaths();
- for (TreePath p : allNodesToRemove) {
- theTreeModel.removeNodeFromParent((MutableTreeNode)p.getLastPathComponent());
- }
- }
-
-
- /**
- * Provides access to the contextual menu of this JTriStateTree.
- *
- * @return Reference to the contextual menu.
- */
- public JPopupMenu getContextualMenu() {
- return contextualMenu;
- }
-
-
- public void setCheckingEnabled(boolean bCheckingEnabled) {
- this.bCheckingEnabled = bCheckingEnabled;
- }
-
- /**
- * @return True if the current state of this JTriStateTree
- * allows making changes to checking of checkboxes
- * in its nodes.
- */
- public boolean isCheckingEnabled() {
- return bCheckingEnabled;
- }
-
-
- /**
- * @param listener New tree checking listener to register for updates
- * to tree node selections.
- */
- public void addCheckingListener(TriStateTreeCheckingListener listener) {
- if (listener != null) {
- this.checkingListeners.add(listener);
- }
- }
-
-
- /**
- * @param listener Tree checking listener to remove.
- */
- public void removeCheckingListener(TriStateTreeCheckingListener listener) {
- if (listener != null) {
- this.checkingListeners.remove(listener);
- }
- }
-
-
- /**
- * Sends a signal to all listeners to check the state of the tree,
- * as it has changed.
- */
- private void notifyCheckingListeners() {
- for (TriStateTreeCheckingListener listener : this.checkingListeners) {
- listener.triStateTreeCheckingChanged(instanceOfSelf);
- }
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/Swing - Tristate CheckBox.7z b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/Swing - Tristate CheckBox.7z
deleted file mode 100644
index 8c60d87..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/Swing - Tristate CheckBox.7z
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/Test.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/Test.java
deleted file mode 100644
index 0cd3592..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/Test.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.tristatetree;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-
-import javax.swing.JFrame;
-import javax.swing.JScrollPane;
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class Test extends JFrame
-{
- public Test() {
- this.setLayout(new BorderLayout());
-
- this.add(new TriStateCheckBox("LOL", TriStateCheckBox.State.PARTIAL), BorderLayout.NORTH);
-
- TriStateTreeNode root = new TriStateTreeNode("root");
- TriStateTreeNode c1 = new TriStateTreeNode("child 1");
- TriStateTreeNode c2 = new TriStateTreeNode("child 2");
- TriStateTreeNode c3 = new TriStateTreeNode("child 3");
-
- TriStateTreeNode c1_1 = new TriStateTreeNode("child 1_1");
- TriStateTreeNode c1_2 = new TriStateTreeNode("child 1_2");
- TriStateTreeNode c1_3 = new TriStateTreeNode("child 1_3");
-
- TriStateTreeNode c2_1 = new TriStateTreeNode("child 2_1");
- TriStateTreeNode c2_2 = new TriStateTreeNode("child 2_2");
- TriStateTreeNode c2_3 = new TriStateTreeNode("child 2_3");
-
- TriStateTreeNode c3_1 = new TriStateTreeNode("child 3_1");
- TriStateTreeNode c3_2 = new TriStateTreeNode("child 3_2");
- TriStateTreeNode c3_3 = new TriStateTreeNode("child 3_3");
-
- TriStateTreeNode c1_1_1 = new TriStateTreeNode("child 1_1_1");
- TriStateTreeNode c1_1_2 = new TriStateTreeNode("child 1_1_2");
- TriStateTreeNode c1_1_3 = new TriStateTreeNode("child 1_1_3");
-
- // adding second level children
- root.add(c1); root.add(c2); root.add(c3);
-
- // adding third-level children
- c1.add(c1_1); c1.add(c1_2); c1.add(c1_3);
- c2.add(c2_1); c2.add(c2_2); c2.add(c2_3);
- c3.add(c3_1); c3.add(c3_2); c3.add(c3_3);
-
- // adding fourth-level children
- c1_1.add(c1_1_1); c1_1.add(c1_1_2); c1_1.add(c1_1_3);
-
-
- // NB! important to create the tree when 'root' is already populated with children
- JTriStateTree tree = new JTriStateTree(root);
- tree.setRootVisible(false);
- tree.setShowsRootHandles(true);
- this.add(new JScrollPane(tree), BorderLayout.CENTER);
-
- this.setDefaultCloseOperation(EXIT_ON_CLOSE);
- this.pack();
- }
-
-
- public static void main(String[] args) {
- JFrame a = new Test();
- a.setVisible(true);
- }
-
-}
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateCheckBox.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateCheckBox.java
deleted file mode 100644
index 82d19ec..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateCheckBox.java
+++ /dev/null
@@ -1,188 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.tristatetree;
-/*
- * 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.
- */
-
-/*
- * Taken from: http://72.5.124.102/thread.jspa?threadID=721308&messageID=9955637
- * Data webpage accessed: 07/February/2010
- *
- * Modified by Sergejs Aleksejevs
- */
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.GradientPaint;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-
-import javax.swing.Icon;
-import javax.swing.JCheckBox;
-import javax.swing.JToggleButton;
-import javax.swing.UIManager;
-
-public class TriStateCheckBox extends JCheckBox
-{
- private static final long serialVersionUID = 1L;
-
- public static enum State {
- CHECKED, UNCHECKED, PARTIAL
- };
-
-
- // these colors will be used for painting the 'partial' state of the checkbox -
- // a gradient painting will be made from top-left to bottom-right
- private Color partialStateTopLeftColor = Color.GREEN.darker().darker().darker();
- private Color partialStateBottomRightColor = Color.GREEN.brighter().brighter().brighter();
-
-
- /**
- * Creates an initially unselected check box button with no text, no icon.
- */
- public TriStateCheckBox() {
- this(null, State.UNCHECKED);
- }
-
- /**
- * Creates a check box with text and icon, and specifies whether or not it is initially
- * selected.
- *
- * @param text
- * The text of the check box.
- * @param initial
- * The initial state
- */
- public TriStateCheckBox(String text, State initial) {
- super.setText(text);
- setModel(new TriStateModel(initial));
- setIcon(new TriStateIcon(this));
- // some UI settings
- setRolloverEnabled(true);
- }
-
- /**
- * Set the new state to either CHECKED, PARTIAL or UNCHECKED.
- */
- public void setState(State state) {
- ((TriStateModel) model).setState(state);
- }
-
- /**
- * Return the current state, which is determined by the selection status of the model.
- */
- public State getState() {
- return ((TriStateModel) model).getState();
- }
-
- public void setSelected(boolean selected) {
- ((TriStateModel) model).setSelected(selected);
- }
-
- /** The model for the button */
- private static class TriStateModel extends JToggleButton.ToggleButtonModel {
-
- private static final long serialVersionUID = 1L;
- protected State state;
-
- public TriStateModel(State state) {
- this.state = state;
- }
-
- public boolean isSelected() {
- return state == State.CHECKED;
- }
-
- public State getState() {
- return state;
- }
-
- public void setState(State state) {
- this.state = state;
- fireStateChanged();
- }
-
- public void setPressed(boolean pressed) {
- if (pressed) {
- switch (state) {
- case UNCHECKED:
- state = State.CHECKED;
- break;
- case PARTIAL:
- state = State.UNCHECKED;
- break;
- case CHECKED:
- state = State.PARTIAL;
- break;
- }
- }
-
- }
-
- public void setSelected(boolean selected) {
- if (selected) {
- this.state = State.CHECKED;
- } else {
- this.state = State.UNCHECKED;
- }
- }
- }
-
- private class TriStateIcon implements Icon
- {
- private Icon checkBoxIcon;
- private TriStateCheckBox triStateCheckBox;
- public TriStateIcon(TriStateCheckBox triStateCheckBox) {
- this.triStateCheckBox = triStateCheckBox;
- this.checkBoxIcon = UIManager.getIcon("CheckBox.icon");
-
- return;
- }
-
- public final int getIconHeight() {
- return this.checkBoxIcon.getIconHeight();
-
- }
-
- public final int getIconWidth() {
- return this.checkBoxIcon.getIconWidth();
-
- }
-
-
- public void paintIcon(Component c, Graphics g, int x, int y)
- {
- checkBoxIcon.paintIcon(triStateCheckBox, g, x, y);
- if (triStateCheckBox.getState().equals(TriStateCheckBox.State.PARTIAL))
- {
- // this is changed to create the gradient paint dynamically every time;
- // this makes sure that the gradient is relative to the actual position of the checkbox,
- // rather than in the absolute coordinates of the parent component
- GradientPaint gradient = new GradientPaint(x, y, partialStateTopLeftColor, x + 8, y + 8, partialStateBottomRightColor, false);
-
- Graphics2D g2d = (Graphics2D) g;
- g2d.setPaint(gradient);
- final int deltaX = 2;
- final int deltaY = 2;
- final int xNew = x + deltaX;
- final int yNew = y + deltaY;
- final int width = getIconWidth() - 2*deltaX;
- final int height = getIconHeight() - 2*deltaY;
- g2d.fillRect(xNew, yNew, width, height);
- }
- }
-
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateCheckBoxTreeCellRenderer.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateCheckBoxTreeCellRenderer.java
deleted file mode 100644
index 5743250..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateCheckBoxTreeCellRenderer.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.tristatetree;
-/*
- * 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.
- */
-
-import java.awt.Color;
-import java.awt.Component;
-
-import javax.swing.JLabel;
-import javax.swing.JTree;
-import javax.swing.border.Border;
-import javax.swing.tree.DefaultTreeCellRenderer;
-
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-
-
-/**
- * Provides a mechanism for rendering tri-state tree nodes.
- *
- * @author Sergejs Aleksejevs
- */
-public class TriStateCheckBoxTreeCellRenderer extends DefaultTreeCellRenderer
-{
- public Component getTreeCellRendererComponent(JTree tree, Object value,
- boolean selected, boolean expanded, boolean leaf, int row,
- boolean hasFocus)
- {
- Border treeNodePanelBorder = null; // will be obtained from default rendering and applied to the new one
- Color backgroundColor = null; // likewise: will be applied to all constituents of the new rendering
-
- // obtain the default rendering, we'll then customize it
- Component defaultRendering = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
-
- // it is most likely that the default rendering will be a JLabel, check just to be safe
- if (defaultRendering instanceof JLabel)
- {
- JLabel defaultRenderedLabel = ((JLabel)defaultRendering);
-
- // if this is not the case, it kind of undermines the whole purpose
- // of using this tree cell renderer, but check just to be sure
- if (value instanceof TriStateTreeNode) {
- // a state value from within the TriStateTreeNode will be used to
- // set the correct state in its rendering
- switch (((TriStateTreeNode)value).getState()) {
- case CHECKED:
- if (((TriStateTreeNode)value).getPath().length > 2) {
- // only allow CHECKED state icon for nodes that are deeper than second
- // level in the tree - that is for any nodes that do not represent categories
- // in the tree (root is not shown, so nodes that represent categories are
- // effectively multiple category "roots" that have actual contents inside them)
- defaultRenderedLabel.setIcon(ResourceManager.getImageIcon(ResourceManager.TRISTATE_CHECKBOX_CHECKED_ICON));
- break;
- }
- // else -- 'fall through' to PARTIAL icon: this was a CHECKED state for the category node
- case PARTIAL: defaultRenderedLabel.setIcon(ResourceManager.getImageIcon(ResourceManager.TRISTATE_CHECKBOX_PARTIAL_ICON)); break;
- case UNCHECKED: defaultRenderedLabel.setIcon(ResourceManager.getImageIcon(ResourceManager.TRISTATE_CHECKBOX_UNCHECKED_ICON)); break;
- default: defaultRenderedLabel.setIcon(null); break;
- }
- }
- }
-
- return (defaultRendering);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateTreeCheckingListener.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateTreeCheckingListener.java
deleted file mode 100644
index efb4b76..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateTreeCheckingListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.tristatetree;
-/*
- * 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.
- */
-
-/**
- * A simple interface to enable tracking tree checking
- * changes.
- *
- * @author Sergejs Aleksejevs
- */
-public interface TriStateTreeCheckingListener
-{
- public void triStateTreeCheckingChanged(JTriStateTree source);
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateTreeNode.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateTreeNode.java
deleted file mode 100644
index 499eb7d..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/ui/tristatetree/TriStateTreeNode.java
+++ /dev/null
@@ -1,262 +0,0 @@
-package org.apache.taverna.biocatalogue.ui.tristatetree;
-/*
- * 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.
- */
-
-import java.util.Enumeration;
-
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeNode;
-
-/**
- * This class models tri-state nodes in the tree. Effectively
- * it associates a tri-state checkbox with each tree node.
- *
- * Useful for partial selections of hierarchical data -
- * partial selection of a node indicates that some of the
- * children of that node are selected.
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class TriStateTreeNode extends DefaultMutableTreeNode
-{
- private TriStateCheckBox.State state;
-
- /**
- * Creates a regular tree node; associated tri-state checkbox state is set to UNCHECKED.
- *
- * @param userObject The object this tree node will represent.
- */
- public TriStateTreeNode(Object userObject) {
- this(userObject, TriStateCheckBox.State.UNCHECKED);
- }
-
- /**
- * Creates a regular tree node; associated tri-state checkbox state is set to the provided <code>initialState</code> value.
- *
- * @param userObject The object this tree node will represent.
- * @param initialState One of the enum values of <code>TriStateCheckBox.State</code>.
- */
- public TriStateTreeNode(Object userObject, TriStateCheckBox.State initialState) {
- super(userObject);
- this.state = initialState;
- }
-
-
- /**
- * Compares based on the user object, not the state of this node.
- */
- public boolean equals(Object other) {
- if (other instanceof TriStateTreeNode) {
- return (this.userObject.equals(((TriStateTreeNode)other).userObject));
- }
- else {
- return (false);
- }
- }
-
-
- /**
- * Sets the state of the current node and (optionally) propagates
- * those changes through the tree.
- *
- * @param state The new state to set - value from <code>TriStateCheckBox.State</code> enum.
- * @param propagateChangesToRelatedNodes True - to use the tree checking model to
- * propagate changes of the state of the current tree node to the
- * other related tree nodes (e.g. all descendants and ancestors) -
- * up and down the tree hierarchy. False - to only update the current
- * node and make no changes to the rest of the tree.
- */
- public void setState(TriStateCheckBox.State state, boolean propagateChangesToRelatedNodes)
- {
- this.state = state;
-
- // check if the tree checking model should be activated
- if (propagateChangesToRelatedNodes) {
- updateStateOfRelatedNodes();
- }
- }
-
-
- /**
- * Sets the state of the current node.
- *
- * @param state The new state to set - value from <code>TriStateCheckBox.State</code> enum.
- */
- public void setState(TriStateCheckBox.State state) {
- setState(state, false);
- }
-
-
- public TriStateCheckBox.State getState() {
- return state;
- }
-
-
- /**
- * Toggles the state of the associated tri-state checkbox.
- * State transitions are as follows:</br>
- * <code>
- * TriStateCheckBox.State.CHECKED -> TriStateCheckBox.State.UNCHECKED
- * TriStateCheckBox.State.PARTIAL -> TriStateCheckBox.State.UNCHECKED
- * TriStateCheckBox.State.UNCHECKED -> TriStateCheckBox.State.CHECKED
- * </code>
- *
- * @param propagateChangesToRelatedNodes True - to use the tree checking model to
- * propagate changes of the state of the current tree node to the
- * other related tree nodes (e.g. all descendants and ancestors) -
- * up and down the tree hierarchy. False - to only update the current
- * node and make no changes to the rest of the tree.
- * @return The value of the new state.
- */
- public TriStateCheckBox.State toggleState(boolean propagateChangesToRelatedNodes)
- {
- if (state.equals(TriStateCheckBox.State.CHECKED) || state.equals(TriStateCheckBox.State.PARTIAL)) {
- state = TriStateCheckBox.State.UNCHECKED;
- }
- else if (state.equals(TriStateCheckBox.State.UNCHECKED)) {
- state = TriStateCheckBox.State.CHECKED;
- }
-
- // check if the tree checking model should be activated
- if (propagateChangesToRelatedNodes) {
- updateStateOfRelatedNodes();
- }
-
- return (state);
- }
-
-
- /*
- * === The tree CHECKING MODEL ===
- *
- * Effectively, this defines the way the tree reacts to it's nodes
- * being checked / unchecked. Only one model is implemented at the
- * moment, therefore it's not extracted into a separate class, but
- * remains to be a part of the TriStateTreeNode.
- *
- * Could possibly be better placed within the JTriStateTree, rather
- * than TriStateTreeNode.
- */
-
- /**
- * The entry point - must be invoked to traverse the tree and make
- * changes to checking states of related tree nodes.
- */
- public void updateStateOfRelatedNodes()
- {
- updateStateOfAncestors(this.getParent());
- updateStateOfDescendants(this);
- }
-
-
- /**
- * Recursively visits all ancestors of the <code>parentNode</code>
- * and decides on their checking states based on the states of their
- * children nodes.
- *
- * @param parentNode Initially - parent node of the current node (i.e. the one,
- * for which a state update has been made); then updated for
- * recursive calls.
- */
- private void updateStateOfAncestors(TreeNode parentNode)
- {
- // reached root of the tree, do nothing - return
- if (parentNode == null) {
- return;
- }
-
- if (parentNode instanceof TriStateTreeNode) {
- TriStateTreeNode parentTriStateNode = (TriStateTreeNode)parentNode;
-
- // explicitly fetch children into a new enumeration - this is
- // to make sure that we work with the same enumeration, rather
- // than obtaining a fresh one with every reference to 'parentTriStateNode.children()'
- Enumeration childNodes = parentTriStateNode.children();
-
- // go through all the children and count the number of selected ones
- int iChildrenCount = 0;
- int iPartiallySelectedChildren = 0;
- int iSelectedChildren = 0;
-
- while(childNodes.hasMoreElements()) {
- Object node = childNodes.nextElement();
- if (node instanceof TriStateTreeNode) {
- TriStateTreeNode currentNode = (TriStateTreeNode)node;
- iChildrenCount++;
- if (currentNode.getState().equals(TriStateCheckBox.State.CHECKED)) {
- iSelectedChildren++;
- }
- else if (currentNode.getState().equals(TriStateCheckBox.State.PARTIAL)) {
- iPartiallySelectedChildren++;
- }
- }
- }
-
-
- // decide on the state of the 'parentNode' based on the checking state of its children
- if (iSelectedChildren == 0 && iPartiallySelectedChildren == 0) {
- // no children are selected
- parentTriStateNode.setState(TriStateCheckBox.State.UNCHECKED);
- }
- else if ((iSelectedChildren + iPartiallySelectedChildren) > 0 && iSelectedChildren < iChildrenCount) {
- // some children are selected (either partially or fully)
- parentTriStateNode.setState(TriStateCheckBox.State.PARTIAL);
- }
- else if (iSelectedChildren > 0 && iSelectedChildren == iChildrenCount) {
- // all children are selected
- parentTriStateNode.setState(TriStateCheckBox.State.CHECKED);
- }
-
-
- // repeat the same recursively up the hierarchy
- updateStateOfAncestors(parentTriStateNode.getParent());
- }
- }
-
- /**
- * Recursively traverses all descendants of the <code>parentNode</code>
- * to set their checking state to the value of the state of the <code>parentNode</code>.
- *
- * @param parentNode Initially - the tree node for which the state
- * change was made; then updated for recursive calls.
- */
- private void updateStateOfDescendants(TriStateTreeNode parentNode)
- {
- // explicitly fetch children into a new enumeration - this is
- // to make sure that we work with the same enumeration, rather
- // than obtaining a fresh one with every reference to 'parentNode.children()'
- Enumeration childNodes = parentNode.children();
-
- // for all child nodes do 2 things:
- // - set their state as that of the parent;
- // - repeat the same recursively with their children
- while(childNodes.hasMoreElements()) {
- Object node = childNodes.nextElement();
- if (node instanceof TriStateTreeNode) {
- TriStateTreeNode currentNode = (TriStateTreeNode) node;
- currentNode.setState(parentNode.getState());
- currentNode.updateStateOfDescendants(currentNode);
- }
- }
- }
-
- /*
- * === End of CHECKING MODEL implementation.
- */
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/BioCataloguePerspective.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/BioCataloguePerspective.java
deleted file mode 100644
index 722954a..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/BioCataloguePerspective.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue;
-/*
- * 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.
- */
-
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.swing.ImageIcon;
-
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.workbench.ui.zaria.PerspectiveSPI;
-
-import org.jdom.Element;
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class BioCataloguePerspective implements PerspectiveSPI
-{
- private MainComponent perspectiveMainComponent;
- private boolean visible = true;
-
- public ImageIcon getButtonIcon()
- {
- return ResourceManager.getImageIcon(ResourceManager.FAVICON);
- }
-
- public InputStream getLayoutInputStream() {
- return getClass().getResourceAsStream("biocatalogue-perspective.xml");
- }
-
- public String getText() {
- return "Service Catalogue";
- }
-
- public boolean isVisible() {
- return visible;
- }
-
- public int positionHint()
- {
- // this determines position of perspective in the
- // bar with perspective buttons (currently makes it the last in
- // the list)
- return 40;
- }
-
- public void setVisible(boolean visible) {
- this.visible = visible;
-
- }
-
- public void update(Element layoutElement) {
- // TODO Auto-generated method stub
-
- // Not sure what to do here
- }
-
- public void setMainComponent(MainComponent component)
- {
- this.perspectiveMainComponent = component;
- }
-
- /**
- * Returns the instance of the main component of this perspective.
- */
- public MainComponent getMainComponent()
- {
- return this.perspectiveMainComponent;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/MainComponent.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/MainComponent.java
deleted file mode 100644
index 03a083b..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/MainComponent.java
+++ /dev/null
@@ -1,301 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.GridLayout;
-
-import javax.swing.ImageIcon;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-import javax.swing.ToolTipManager;
-import javax.swing.border.LineBorder;
-
-import org.apache.taverna.biocatalogue.model.BioCataloguePluginConstants;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.biocatalogue.ui.BioCatalogueExplorationTab;
-import org.apache.taverna.workbench.icons.WorkbenchIcons;
-import org.apache.taverna.workbench.ui.zaria.UIComponentSPI;
-
-import org.apache.log4j.Logger;
-
-/*
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public final class MainComponent extends JPanel implements UIComponentSPI //, ChangeListener
-{
-// private static final String windowBaseTitle = "BioCatalogue API Demo";
-// private HashMap<String, String> windowTitleMap;
-
- private MainComponent pluginPerspectiveMainComponent;
- private final Logger logger = Logger.getLogger(MainComponent.class);
-
- //private JTabbedPane tpMainTabs;
- private BioCatalogueExplorationTab jpBioCatalogueExplorationTab;
-// private BioCataloguePluginAbout jpAboutTab;
-
- public static JFrame dummyOwnerJFrame;
- static {
- // this is only to have a nice icon on all Dialog boxes - can be removed at any time
- dummyOwnerJFrame = new JFrame();
- dummyOwnerJFrame.setIconImage(ResourceManager.getImageIcon(ResourceManager.FAVICON).getImage());
- }
-
-
- /**
- * This constructor is protected, and so is only available to the classes in its package -
- * i.e. Taverna integration classes. Other parts of the plugin must use <code>MainComponentFactory.getSharedInstance()</code>
- * to get the shared instance of this class.
- */
- protected MainComponent()
- {
- super();
- initialiseEnvironment();
- initialisePerspectiveUI();
- }
-
-
- // *** Methods implementing UIComponentSPI interface ***
-
- public ImageIcon getIcon() {
- return WorkbenchIcons.databaseIcon;
- }
-
- @Override
- public String getName() {
- return "Service Catalogue Perspective Main Component";
- }
-
- public void onDisplay() {
- // TODO Auto-generated method stub
- }
-
- public void onDispose() {
- // TODO Auto-generated method stub
- }
-
- // *** End of methods implementing UIComponentSPI interface ***
-
-
- private void initialiseEnvironment()
- {
- // before anything else - store a reference to self for use during
- // initialisation of other components
- pluginPerspectiveMainComponent = this;
-
-
- // pre-load classes for FlyingSaucer XHTML renderer - this will make sure
- // that the first time it is used, there will be no delay while classes
- // are loaded by Java
- new Thread("class pre-loading") {
- public void run() {
- try {
- Class.forName("org.xhtmlrenderer.simple.FSScrollPane");
- Class.forName("org.xhtmlrenderer.simple.XHTMLPanel");
- }
- catch (ClassNotFoundException e) {
- logger.error("Problem while pre-loading classes for FlyingSaucer XHTML renderer", e);
- }
- }
- }.start();
-
-
- // determine what folder is to be used for config files
- if (!Util.isRunningInTaverna()) {
- // running outside Taverna, place config file and log into the user's home directory
- BioCataloguePluginConstants.CONFIG_FILE_FOLDER =
- new java.io.File(System.getProperty("user.home"), BioCataloguePluginConstants.CONFIG_FILE_FOLDER_WHEN_RUNNING_STANDALONE);
- BioCataloguePluginConstants.LOG_FILE_FOLDER =
- new java.io.File(System.getProperty("user.home"), BioCataloguePluginConstants.CONFIG_FILE_FOLDER_WHEN_RUNNING_STANDALONE);
- }
-
-
- // this makes sure that tooltips will stay displayed for longer than default
- ToolTipManager.sharedInstance().setDismissDelay(BioCataloguePluginConstants.DEFAULT_TOOLTIP_DURATION);
-
- // these components must be accessed by all other components, hence need
- // to be initialised before any other initialisation is done
-
-// windowTitleMap = new HashMap<String,String>();
- }
-
- private void initialisePerspectiveUI()
- {
- // set the loader icon to show that the perspective is loading
- this.setLayout(new GridLayout(1,1));
- this.add(new JLabel(ResourceManager.getImageIcon(ResourceManager.BAR_LOADER_ORANGE)));
-
- new Thread("Initialise Service Catalogue Perspective UI")
- {
- public void run() {
- // create all tabs prior to putting them inside the tabbed pane
- jpBioCatalogueExplorationTab = new BioCatalogueExplorationTab();
-// jpServiceFilteringTab = new ServiceFilteringTab(pluginPerspectiveMainComponent, client, logger);
-// jpSearchTab = new SearchTab(pluginPerspectiveMainComponent, client, logger);
-// jpAboutTab = new BioCataloguePluginAbout(pluginPerspectiveMainComponent, client, logger);
-
- // create main tabs
-// tpMainTabs = new JTabbedPane();
-// tpMainTabs.add("Explore BioCatalogue", jpBioCatalogueExplorationTab);
-// tpMainTabs.add("Search", jpSearchTab);
-// tpMainTabs.add("Filter Services", jpServiceFilteringTab);
-// tpMainTabs.add("About", jpAboutTab);
-
- SwingUtilities.invokeLater(new Runnable() {
- public void run()
- {
- // add main tabs and the status bar into the perspective
- pluginPerspectiveMainComponent.removeAll();
- pluginPerspectiveMainComponent.setLayout(new BorderLayout());
- pluginPerspectiveMainComponent.setBorder(new LineBorder(Color.BLACK));
- pluginPerspectiveMainComponent.add(jpBioCatalogueExplorationTab, BorderLayout.CENTER);
-
- // everything is prepared -- need to focus default component on the first tab
- // (artificially generate change event on the tabbed pane to perform focus request)
-// tpMainTabs.setSelectedIndex(1);
-// tpMainTabs.addChangeListener(pluginPerspectiveMainComponent);
-// tpMainTabs.setSelectedIndex(0);
- }
- });
- }
- }.start();
- }
-
- /**
- * Determines whether the specified tab is currently active in the main tabbed pane.
- * @param strTabClassName Class name of the tab which is tested for being active.
- * @return True if specified tab is currently active.
- */
-/*
- private boolean isTabActive(String strTabClassName)
- {
- if (tpMainTabs == null) return (false);
-
- // if an anonymous thread within the main tab component class will call
- // this method, we want to store the main tab's class, rather than
- // the full class name of the anonymous worker thread
- String strCurSelectedTabClassName = tpMainTabs.getSelectedComponent().getClass().getName();
-
- // get the real class name to match
- String strBaseClassName = Util.getBaseClassName(strTabClassName);
-
- // compare the two class names
- return (strBaseClassName.equals(strCurSelectedTabClassName));
- }
- */
-
-
- /**
- * This method "selects" the tab represented by the component provided as a parameter.
- *
- * @param c Component that represents one of the tabs in the main tabbed pane.
- * If <code>c</code> is not found within the components of the tabbed pane, nothing will happen.
- */
-/*
- public void setTabActive(Component c)
- {
- try {
- tpMainTabs.setSelectedComponent(c);
- }
- catch (IllegalArgumentException e) {
- // do nothing, can't activate component which is not in the tabbed pane
- }
- }
- */
-
-
- /**
- * Sets title of the main perspective window for a specified tab,
- * thus supporting different window titles for different tabs;
- * new title will only be displayed immediately if the specified tab.
- *
- * @param strTabClassName Class name of the tab, for which window title should be updated.
- * @param strTitle New title to set.
- */
-/*
- public void setWindowTitle(String strTabClassName, String strTitle)
- {
- // if an anonymous thread within the main tab component class will call
- // this method, we want to store the main tab's class, rather than
- // the full class name of the anonymous worker thread
- String strBaseClassName = Util.getBaseClassName(strTabClassName);
-
- // store the new title for for the specified tab
- windowTitleMap.put(strBaseClassName, strTitle);
-
- // if the specified tab is active, update window title immediately
- if (isTabActive(strBaseClassName)) displayWindowTitle(strBaseClassName);
- }
- */
-
-
- /**
- * Displays window title that corresponds to specified tab.
- *
- * @param strTabClassName Class name of the tab for which the window title is to be set.
- */
-/*
- public void displayWindowTitle(String strTabClassName)
- {
- // if an anonymous thread within the main tab component class will call
- // this method, we want to store the main tab's class, rather than
- // the full class name of the anonymous worker thread
- String strBaseClassName = Util.getBaseClassName(strTabClassName);
-
- if (windowTitleMap.containsKey(strBaseClassName)) {
- // title for specified tab found - show it
- // TODO - disabled until this info will be shown in the status bar
- //this.setTitle(windowBaseTitle + " :: " + windowTitleMap.get(strBaseClassName));
- }
- else {
- // tab not found - display standard title
- // TODO - disabled until this info will be shown in the status bar
- //this.setTitle(windowBaseTitle);
- }
- }
- */
-
- // *** Getters for various components ***
-
- /**
- * @return Reference to the component that represents the BioCatalogue Exploration
- * tab in the BioCatalogue Perspective.
- */
- public BioCatalogueExplorationTab getBioCatalogueExplorationTab() {
- return (this.jpBioCatalogueExplorationTab);
- }
-
- // *** Callbacks for ChangeListener interface ***
-
-/* public void stateChanged(ChangeEvent e)
- {
- if (e.getSource().equals(tpMainTabs)) {
- // will get called when selected tab changes - need to focus default component in the active tab
- // and also set a correct window title
- if (tpMainTabs.getSelectedComponent() instanceof HasDefaultFocusCapability) {
- ((HasDefaultFocusCapability)tpMainTabs.getSelectedComponent()).focusDefaultComponent();
- this.displayWindowTitle(tpMainTabs.getSelectedComponent().getClass().getName());
- }
- }
- }*/
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/MainComponentFactory.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/MainComponentFactory.java
deleted file mode 100644
index a07fdb2..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/MainComponentFactory.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue;
-/*
- * 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.
- */
-
-import javax.swing.ImageIcon;
-
-import org.apache.taverna.workbench.icons.WorkbenchIcons;
-import org.apache.taverna.workbench.ui.zaria.UIComponentFactorySPI;
-import org.apache.taverna.workbench.ui.zaria.UIComponentSPI;
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class MainComponentFactory implements UIComponentFactorySPI
-{
- // this is to ensure that the whole perspective is not re-created
- // each time it is being activated in Taverna, rather it will only
- // happen once during the execution
- private static MainComponent mainPerspectiveComponent = null;
-
- public static MainComponent getSharedInstance()
- {
- // double-check on existence of the 'mainPerspectiveComponent' ensures
- // that it is really created only once
- if (mainPerspectiveComponent == null) {
- synchronized(MainComponentFactory.class) {
- if (mainPerspectiveComponent == null) {
- mainPerspectiveComponent = new MainComponent();
- }
- }
- }
- return (mainPerspectiveComponent);
- }
-
- public UIComponentSPI getComponent() {
- return (getSharedInstance());
- }
-
-
- public ImageIcon getIcon() {
- return WorkbenchIcons.databaseIcon;
- }
-
- public String getName() {
- return "Service Catalogue Main Component Factory";
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/MainComponentShutdownHook.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/MainComponentShutdownHook.java
deleted file mode 100644
index dc7664b..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/MainComponentShutdownHook.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue;
-/*
- * 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.
- */
-
-import com.thoughtworks.xstream.XStream;
-
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.config.BioCataloguePluginConfiguration;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel.BioCatalogueServiceProvider;
-import org.apache.taverna.workbench.ShutdownSPI;
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class MainComponentShutdownHook implements ShutdownSPI
-{
- public int positionHint()
- {
- // all custom plugins are suggested to return a value of > 100;
- // this affects when in the termination process will this plugin
- // be shutdown;
- return 100;
- }
-
- public boolean shutdown()
- {
- // Do not save service providers in BioCatalogue's conf file - they should be saved by Taverna together with
- // other service providers
-
-// // store services that were added to the Service Panel - both REST and SOAP
-// XStream xstream = new XStream();
-//
-// BioCataloguePluginConfiguration configuration = BioCataloguePluginConfiguration.getInstance();
-//
-// configuration.setProperty(
-// BioCataloguePluginConfiguration.SOAP_OPERATIONS_IN_SERVICE_PANEL,
-// xstream.toXML(BioCatalogueServiceProvider.getRegisteredSOAPOperations()));
-// configuration.setProperty(
-// BioCataloguePluginConfiguration.REST_METHODS_IN_SERVICE_PANEL,
-// xstream.toXML(BioCatalogueServiceProvider.getRegisteredRESTMethods()));
-//
-// // save all the plugin's configuration
-// configuration.store();
-//
-//
-// // close API operation log
-// MainComponentFactory.getSharedInstance().getBioCatalogueClient().getAPILogWriter().close();
-//
- return true;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/TestJFrameForLocalLaunch.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/TestJFrameForLocalLaunch.java
deleted file mode 100644
index 12f90f5..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/TestJFrameForLocalLaunch.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-
-import javax.swing.JFrame;
-
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class TestJFrameForLocalLaunch extends JFrame implements ComponentListener
-{
- private static final int DEFAULT_POSITION_X = 225;
- private static final int DEFAULT_POSITION_Y = 150;
-
- private static final int DEFAULT_WIDTH = 800;
- private static final int DEFAULT_HEIGHT = 500;
-
-
- private TestJFrameForLocalLaunch()
- {
- // set window title and icon
- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.setTitle("Service Catalogue API Demo"/* TODO - windowBaseTitle */);
- this.setIconImage(ResourceManager.getImageIcon(ResourceManager.FAVICON).getImage());
- this.addComponentListener(this);
-
- // get content pane
- Container contentPane = this.getContentPane();
- contentPane.setLayout(new BorderLayout());
-
- // put main tabs into the content pane
- contentPane.add(MainComponentFactory.getSharedInstance(), BorderLayout.CENTER);
-
- this.pack();
- }
-
-
- // *** Callbacks for ComponentListener interface ***
-
- public void componentResized(ComponentEvent e) { /* do nothing */ }
- public void componentMoved(ComponentEvent e) { /* do nothing */ }
- public void componentHidden(ComponentEvent e) { /* do nothing */ }
- public void componentShown(ComponentEvent e) {
- this.setLocation(DEFAULT_POSITION_X, DEFAULT_POSITION_Y);
- }
-
-
- /**
- * This is a simple test class for launching BioCatalogue perspective
- * from outside Taverna. At some point it will be not usable anymore,
- * when proper integration of BioCatalogue plugin is made.
- *
- * @author Sergejs Aleksejevs
- */
- public static void main(String[] args)
- {
- TestJFrameForLocalLaunch standaloneFrame = new TestJFrameForLocalLaunch();
- standaloneFrame.setMinimumSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT));
- standaloneFrame.setVisible(true);
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/Integration.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/Integration.java
deleted file mode 100644
index efa1efa..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/Integration.java
+++ /dev/null
@@ -1,534 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration;
-/*
- * 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.
- */
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.log4j.Logger;
-import org.biocatalogue.x2009.xml.rest.ResourceLink;
-import org.biocatalogue.x2009.xml.rest.RestMethod;
-import org.biocatalogue.x2009.xml.rest.RestService;
-import org.biocatalogue.x2009.xml.rest.Service;
-import org.biocatalogue.x2009.xml.rest.ServiceTechnologyType;
-import org.biocatalogue.x2009.xml.rest.SoapOperation;
-import org.biocatalogue.x2009.xml.rest.SoapService;
-import org.biocatalogue.x2009.xml.rest.Service.Variants;
-
-import org.apache.taverna.biocatalogue.model.HTTPMethodInterpreter;
-import org.apache.taverna.biocatalogue.model.HTTPMethodInterpreter.UnsupportedHTTPMethodException;
-import org.apache.taverna.biocatalogue.model.Resource;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.biocatalogue.model.SoapOperationPortIdentity;
-import org.apache.taverna.biocatalogue.model.SoapProcessorIdentity;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.activities.rest.RESTActivity;
-import org.apache.taverna.activities.rest.RESTActivity.HTTP_METHOD;
-import org.apache.taverna.activities.wsdl.WSDLActivity;
-import org.apache.taverna.activities.wsdl.servicedescriptions.WSDLServiceDescription;
-import org.apache.taverna.ui.menu.ContextualSelection;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel.BioCatalogueRESTServiceProvider;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel.BioCatalogueWSDLOperationServiceProvider;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel.RESTFromBioCatalogueServiceDescription;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel.WSDLOperationFromBioCatalogueServiceDescription;
-import org.apache.taverna.workbench.file.FileManager;
-import org.apache.taverna.workbench.ui.workflowview.WorkflowView;
-import org.apache.taverna.workflowmodel.Dataflow;
-import org.apache.taverna.workflowmodel.Port;
-import org.apache.taverna.workflowmodel.Processor;
-import org.apache.taverna.workflowmodel.processor.activity.Activity;
-import org.apache.taverna.workflowmodel.processor.activity.ActivityInputPort;
-import org.apache.taverna.workflowmodel.processor.activity.ActivityOutputPort;
-import org.apache.taverna.workflowmodel.utils.Tools;
-
-/**
- * This class contains helpers for deeper integration with Taverna UI.
- *
- * @author Sergejs Aleksejevs
- */
-public class Integration
-{
- private static final Logger logger = Logger.getLogger(Integration.class);
-
-
- // deny instantiation of this class
- private Integration() { }
-
-
- /**
- * Adds a processor to the current workflow.
- * The processor is specified by WSDL location and the operation name.
- *
- * @param processorResource Resource to add to the current workflow.
- * @return Outcome of inserting the processor into the current workflow as a
- * HTML-formatted string (with no opening and closing HTML tags).
- */
- public static JComponent insertProcessorIntoCurrentWorkflow(ResourceLink processorResource)
- {
- // check if this type of resource can be added to workflow diagram
- TYPE resourceType = Resource.getResourceTypeFromResourceURL(processorResource.getHref());
- if (resourceType.isSuitableForAddingToWorkflowDiagram()) {
- switch (resourceType) {
- case SOAPOperation:
- SoapOperation soapOp = (SoapOperation) processorResource;
- try {
- SoapService soapService = BioCatalogueClient.getInstance().
- getBioCatalogueSoapService(soapOp.getAncestors().getSoapService().getHref());
-
- try {
- WSDLServiceDescription myServiceDescription = new WSDLServiceDescription();
- myServiceDescription.setOperation(soapOp.getName());
- myServiceDescription.setUse("literal"); // or "encoded"
- myServiceDescription.setStyle("document"); // or "rpc"
- myServiceDescription.setURI(new URI(soapService.getWsdlLocation()));
- myServiceDescription.setDescription(StringEscapeUtils.escapeHtml(soapService.getDescription())); // TODO - not sure where this is used
-
- if (WorkflowView.importServiceDescription(myServiceDescription, false) != null) {
- return (new JLabel("Selected " + TYPE.SOAPOperation.getTypeName() + " was successfully added to the current workflow",
- ResourceManager.getImageIcon(ResourceManager.TICK_ICON), JLabel.CENTER));
- }
- else {
- return (new JLabel("<html><center>Taverna was unable to add selected " + TYPE.SOAPOperation.getTypeName() +
- " as a service to the current workflow.<br>This could be because the service is currently not accessible.</center></html>",
- ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
- }
- catch (URISyntaxException e)
- {
- logger.error("Couldn't add " + TYPE.SOAPOperation + " to the current workflow", e);
- return (new JLabel("<html>Could not add the selected " + TYPE.SOAPOperation.getTypeName() + " to the current workflow.<br>" +
- "Log file will containt additional details about this error.</html>",
- ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
-
- }
- catch (Exception e) {
- logger.error("Failed to fetch required details to add this " + TYPE.SOAPOperation + " into the current workflow.", e);
- return (new JLabel("<html>Failed to fetch required details to add this<br>" +
- TYPE.SOAPOperation.getTypeName() + " into the current workflow.</html>",
- ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
-
- case RESTMethod:
- // received object may only contain limited data, therefore need to fetch full details first
- try {
- RestMethod restMethod = BioCatalogueClient.getInstance().
- getBioCatalogueRestMethod(processorResource.getHref());
-
- // actual import of the service into the workflow
- RESTFromBioCatalogueServiceDescription restServiceDescription = createRESTServiceDescriptionFromRESTMethod(restMethod);
- WorkflowView.importServiceDescription(restServiceDescription, false);
-
- // prepare result of the operation to be shown in the the waiting dialog window
- String warnings = extractWarningsFromRESTServiceDescription(restServiceDescription, false);
- JLabel outcomes = new JLabel("<html>Selected " + TYPE.RESTMethod.getTypeName() + " was successfully added to the current workflow" + warnings + "</html>",
- ResourceManager.getImageIcon(warnings.length() > 0 ? ResourceManager.WARNING_ICON : ResourceManager.TICK_ICON),
- JLabel.CENTER);
- outcomes.setIconTextGap(20);
- return (outcomes);
- }
- catch (UnsupportedHTTPMethodException e) {
- logger.error(e);
- return (new JLabel(e.getMessage(), ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
- catch (Exception e) {
- logger.error("Failed to fetch required details to add this " + TYPE.RESTMethod + " as a service to the current workflow.", e);
- return (new JLabel("<html>Failed to fetch required details to add this " + TYPE.RESTMethod.getTypeName() + "<br>" +
- "as a service to the current workflow.</html>",
- ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
-
- // type not currently supported, but maybe in the future?
- default: return (new JLabel("Adding " + resourceType.getCollectionName() + " to the current workflow is not yet possible",
- ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
- }
-
- // definitely not supported type
- return (new JLabel("<html>It is not possible to add resources of the provided type<br>" +
- "into the current workflow.</html>",
- ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
-
-
- /**
- *
- * @param processorResource
- * @return Outcome of inserting the processor into the current workflow as a
- * HTML-formatted string (with no opening and closing HTML tags).
- */
- public static JComponent insertProcesorIntoServicePanel(ResourceLink processorResource)
- {
- // check if this type of resource can be added to Service Panel
- TYPE resourceType = Resource.getResourceTypeFromResourceURL(processorResource.getHref());
- if (resourceType.isSuitableForAddingToServicePanel()) {
- switch (resourceType) {
- case SOAPOperation:
- SoapOperation soapOp = (SoapOperation) processorResource;
- try {
- SoapService soapService = BioCatalogueClient.getInstance().
- getBioCatalogueSoapService(soapOp.getAncestors().getSoapService().getHref());
- SoapOperationIdentity soapOpId = new SoapOperationIdentity(soapService.getWsdlLocation(), soapOp.getName(), StringEscapeUtils.escapeHtml(soapOp.getDescription()));
- WSDLOperationFromBioCatalogueServiceDescription wsdlOperationDescription = new WSDLOperationFromBioCatalogueServiceDescription(soapOpId);
- BioCatalogueWSDLOperationServiceProvider.registerWSDLOperation(wsdlOperationDescription, null);
-
- return (new JLabel("Selected SOAP operation has been successfully added to the Service Panel.",
- ResourceManager.getImageIcon(ResourceManager.TICK_ICON), JLabel.CENTER));
- }
- catch (Exception e) {
- logger.error("Failed to fetch required details to add this SOAP service into the Service Panel.", e);
- return (new JLabel("Failed to fetch required details to add this " +
- "SOAP service into the Service Panel.", ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
-
- case RESTMethod:
- try {
- // received object may only contain limited data, therefore need to fetch full details first
- RestMethod restMethod = BioCatalogueClient.getInstance().
- getBioCatalogueRestMethod(processorResource.getHref());
- RESTFromBioCatalogueServiceDescription restServiceDescription = createRESTServiceDescriptionFromRESTMethod(restMethod);
-
- // actual insertion of the REST method into Service Panel
- BioCatalogueRESTServiceProvider.registerNewRESTMethod(restServiceDescription, null);
-
- // prepare result of the operation to be shown in the the waiting dialog window
- String warnings = extractWarningsFromRESTServiceDescription(restServiceDescription, true);
- JLabel outcomes = new JLabel("<html>Selected REST method has been successfully added to the Service Panel" + warnings + "</html>",
- ResourceManager.getImageIcon(warnings.length() > 0 ? ResourceManager.WARNING_ICON : ResourceManager.TICK_ICON),
- JLabel.CENTER);
- outcomes.setIconTextGap(20);
- return (outcomes);
- }
- catch (UnsupportedHTTPMethodException e) {
- logger.error(e);
- return (new JLabel(e.getMessage(), ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
- catch (Exception e) {
- logger.error("Failed to fetch required details to add this REST service into the Service Panel.", e);
- return (new JLabel("Failed to fetch required details to add this " +
- "REST service into the Service Panel.", ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
-
- // type not currently supported, but maybe in the future?
- default: return (new JLabel("Adding " + resourceType.getCollectionName() + " to the Service Panel is not yet possible",
- ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
- }
-
- // definitely not supported type
- return (new JLabel("<html>It is not possible to add resources of the provided type<br>" +
- "into the Service Panel.</html>",
- ResourceManager.getImageIcon(ResourceManager.ERROR_ICON), JLabel.CENTER));
- }
-
- /**
- * Inserts all operations of the given parent SOAP or REST Web service resource link
- * into Service Panel. Works for SOAP operations only at the moment.
- *
- * @return Outcome of inserting operations into Service Panel as a
- * HTML-formatted string (with no opening and closing HTML tags).
- */
- public static JComponent insertAllOperationsIntoServicePanel(ResourceLink serviceResource)
- {
- // Check if this type of resource is a parent SOAP Web service
- // whose operations can be added to the Service Panel
- TYPE resourceType = Resource
- .getResourceTypeFromResourceURL(serviceResource.getHref());
-
- Service service = null;
- if (resourceType == TYPE.SOAPOperation) {
- SoapService soapService = ((SoapOperation) serviceResource)
- .getAncestors().getSoapService();
-
- // Get the WSDL URL of the SOAP service
- String wsdlURL = soapService.getWsdlLocation();
-
- // Import this WSDL into Service panel - it will add all
- // of
- // its operations
- if (BioCatalogueWSDLOperationServiceProvider.registerWSDLService(
- wsdlURL, null)) {
- return (new JLabel(
- "Operation(s) of the SOAP service have been successfully added to the Service Panel.",
- ResourceManager.getImageIcon(ResourceManager.TICK_ICON),
- JLabel.CENTER));
- } else {
- return (new JLabel(
- "Failed to insert the operations of the SOAP service "
- + " to the Service Panel.", ResourceManager
- .getImageIcon(ResourceManager.ERROR_ICON),
- JLabel.CENTER));
- }
- } else if (resourceType == TYPE.RESTMethod) {
- RestService restService = ((RestMethod) serviceResource)
- .getAncestors().getRestService();
- for (RestMethod method : restService.getMethods().getRestMethodList()) {
-
- }
- }
-
- return (new JLabel(
- "<html>It is not possible to add resources of the provided type<br>"
- + "into the Service Panel.</html>", ResourceManager
- .getImageIcon(ResourceManager.ERROR_ICON),
- JLabel.CENTER));
- }
-
- /**
- * Instantiates a {@link RESTFromBioCatalogueServiceDescription} object from the {@link RestMethod}
- * XML data obtained from BioCatalogue API.
- *
- * @param restMethod
- * @return
- */
- public static RESTFromBioCatalogueServiceDescription createRESTServiceDescriptionFromRESTMethod(RestMethod restMethod) throws UnsupportedHTTPMethodException
- {
- // if the type of the HTTP method is not supported, an exception will be throws
- HTTP_METHOD httpMethod = HTTPMethodInterpreter.getHTTPMethodForRESTActivity(restMethod.getHttpMethodType());
-
- RESTFromBioCatalogueServiceDescription restServiceDescription = new RESTFromBioCatalogueServiceDescription();
- restServiceDescription.setServiceName(Resource.getDisplayNameForResource(restMethod));
- restServiceDescription.setDescription(StringEscapeUtils.escapeHtml(restMethod.getDescription()));
- restServiceDescription.setHttpMethod(httpMethod);
- restServiceDescription.setURLSignature(restMethod.getUrlTemplate());
-
- int outputRepresentationCount = restMethod.getOutputs().getRepresentations().getRestRepresentationList().size();
- if (outputRepresentationCount > 0) {
- if (outputRepresentationCount > 1) {
- restServiceDescription.getDataWarnings().add(RESTFromBioCatalogueServiceDescription.AMBIGUOUS_ACCEPT_HEADER_VALUE);
- }
- restServiceDescription.setAcceptHeaderValue(restMethod.getOutputs().getRepresentations().getRestRepresentationList().get(0).getContentType());
- }
- else {
- restServiceDescription.getDataWarnings().add(RESTFromBioCatalogueServiceDescription.DEFAULT_ACCEPT_HEADER_VALUE);
- }
-
- int inputRepresentationCount = restMethod.getInputs().getRepresentations().getRestRepresentationList().size();
- if (inputRepresentationCount > 0) {
- if (inputRepresentationCount > 1) {
- restServiceDescription.getDataWarnings().add(RESTFromBioCatalogueServiceDescription.AMBIGUOUS_CONTENT_TYPE_HEADER_VALUE);
- }
- restServiceDescription.setOutgoingContentType(restMethod.getInputs().getRepresentations().getRestRepresentationList().get(0).getContentType());
- }
- else if (RESTActivity.hasMessageBodyInputPort(httpMethod)) {
- restServiceDescription.getDataWarnings().add(RESTFromBioCatalogueServiceDescription.DEFAULT_CONTENT_TYPE_HEADER_VALUE);
- }
-
- return (restServiceDescription);
- }
-
-
- /**
- * @param restServiceDescription {@link RESTFromBioCatalogueServiceDescription} to process.
- * @param addingToServicePanel <code>true</code> indicates that the warning messages
- * will assume that the processor is added to the service panel;
- * <code>false</code> would mean that the processor is added to
- * the current workflow.
- * @return An HTML-formatted string (with no opening-closing HTML tags) that lists
- * any warnings that have been recorded during the {@link RESTFromBioCatalogueServiceDescription}
- * object creation. Empty string will be returned if there are no warnings.
- */
- public static String extractWarningsFromRESTServiceDescription(RESTFromBioCatalogueServiceDescription restServiceDescription,
- boolean addingToServicePanel)
- {
- String messageSuffix = addingToServicePanel ?
- " once you add it into the workflow" :
- "";
-
- String warnings = "";
- if (restServiceDescription.getDataWarnings().contains(RESTFromBioCatalogueServiceDescription.AMBIGUOUS_ACCEPT_HEADER_VALUE)) {
- warnings += "<br><br>Service Catalogue description of this REST method contains more than one<br>" +
- "representation of the method's outputs - the first one was used.<br>" +
- "Please check value of the 'Accept' header in the configuration<br>" +
- "of the imported service" + messageSuffix + ".";
- }
- else if (restServiceDescription.getDataWarnings().contains(RESTFromBioCatalogueServiceDescription.DEFAULT_ACCEPT_HEADER_VALUE)) {
- warnings += "<br><br>Service Catalogue description of this REST method does not contain any<br>" +
- "representations of the method's outputs - default value was used.<br>" +
- "Please check value of the 'Accept' header in the configuration<br>" +
- "of the imported service" + messageSuffix + ".";
- }
-
- if (restServiceDescription.getDataWarnings().contains(RESTFromBioCatalogueServiceDescription.AMBIGUOUS_CONTENT_TYPE_HEADER_VALUE)) {
- warnings += "<br><br>Service Catalogue description of this REST method contains more than one<br>" +
- "representation of the method's input data - the first one was used.<br>" +
- "Please check value of the 'Content-Type' header in the configuration<br>" +
- "of the imported service" + messageSuffix + ".";
- }
- else if (restServiceDescription.getDataWarnings().contains(RESTFromBioCatalogueServiceDescription.DEFAULT_CONTENT_TYPE_HEADER_VALUE)) {
- warnings += "<br><br>Service Catalogue description of this REST method does not contain any<br>" +
- "representations of the method's input data - default value was used.<br>" +
- "Please check value of the 'Content-Type' header in the configuration<br>" +
- "of the imported service" + messageSuffix + ".";
- }
-
- if (warnings.length() > 0) {
- warnings = "<br><br>WARNINGS:" + warnings;
- }
-
- return (warnings);
- }
-
-
-
- /**
- * @param activityPort Probably comes from contextual selection - must be either
- * ActivityInputPort or ActivityOutputPort.
- * @return SOAP input / output port details (WSDL location, operation name, port name) from
- * ActivityInputPort/ActivityOutputPort which is obtained from contextual selection in the Dataflow.
- */
- public static <T extends Port> SoapOperationPortIdentity extractSoapOperationPortDetailsFromActivityInputOutputPort(T activityPort)
- {
- // check that we have the correct instance of Port here - either ActivityInputPort or ActivityOutputPort
- boolean hasInputPort;
- if (activityPort instanceof ActivityInputPort) {
- hasInputPort = true;
- }
- else if (activityPort instanceof ActivityOutputPort) {
- hasInputPort = false;
- }
- else {
- // ERROR - wrong type supplied
- return new SoapOperationPortIdentity("Activity port from the contextual selection was not of correct type. Impossible to create preview.");
- }
-
- // get parent processor details
- Dataflow currentDataflow = FileManager.getInstance().getCurrentDataflow();
- Collection<Processor> processors = null;
- if (hasInputPort) {
- processors = Tools.getProcessorsWithActivityInputPort(currentDataflow, (ActivityInputPort)activityPort);
- }
- else {
- processors = Tools.getProcessorsWithActivityOutputPort(currentDataflow, (ActivityOutputPort)activityPort);
- }
-
- // TODO - doesn't take into account that it's possible to have several
- SoapOperationIdentity soapOperationDetails = extractSoapOperationDetailsFromProcessor(processors.toArray(new Processor[]{})[0]);
-
- // if no error happened, add port details and return
- if (!soapOperationDetails.hasError()) {
- return (new SoapOperationPortIdentity(soapOperationDetails.getWsdlLocation(),
- soapOperationDetails.getOperationName(),
- activityPort.getName(), hasInputPort));
- }
- else {
- // error...
- return (new SoapOperationPortIdentity(soapOperationDetails.getErrorDetails()));
- }
- }
-
-
- /**
- * Uses contextual selection to extract WSDL location and operation name of the
- * currently selected processor within the Design view of current workflow.
- *
- * @param contextualSelection Selection that was made in the Design view.
- * @return Details of the SOAP operation that acts as a processor wrapped into
- * this single instance. If any problems occurred while performing
- * contextual selection analysis, these are also recorded into the same
- * instance - before using the returned value the caller must check
- * <code>SoapOperationIdentity.hasError()</code> value.
- */
- public static SoapOperationIdentity extractSoapOperationDetailsFromProcessorContextualSelection(ContextualSelection contextualSelection)
- {
- if (!(contextualSelection.getSelection() instanceof Processor)) {
- return (new SoapOperationIdentity("ERROR: It is only possible to extract " +
- "SOAP operation details from the service."));
- }
-
- // now we know it's a Processor
- Processor processor = (Processor)contextualSelection.getSelection();
- return (extractSoapOperationDetailsFromProcessor(processor));
- }
-
-
- /**
- * Worker method for <code>extractSoapOperationDetailsFromProcessorContextualSelection()</code>.
- *
- * @param processor
- * @return
- */
- public static SoapOperationIdentity extractSoapOperationDetailsFromProcessor(Processor processor)
- {
- List<? extends Activity> activityList = (List<? extends Activity>) processor.getActivityList();
-
- if (activityList == null || activityList.size() == 0) {
- return (new SoapOperationIdentity("ERROR: Selected processor doesn't have any activities - " +
- "impossible to extract SOAP operation details."));
- }
- else {
- // take only the first activity - TODO: figure out what should be done here...
- Activity activity = activityList.get(0);
- if (activity instanceof WSDLActivity) {
- WSDLActivity a = (WSDLActivity)activity;
- return (new SoapOperationIdentity(a.getConfiguration().getWsdl(), a.getConfiguration().getOperation(), null));
- }
- else {
- return (new SoapOperationIdentity("Service Catalogue integration only works with WSDL Activities at the moment"));
- }
- }
- }
-
-
- /**
- * @param contextualSelection
- * @return A list of all WSDL activities (the only supported processors by BioCatalogue plugin for now).
- */
- public static List<SoapProcessorIdentity> extractSupportedProcessorsFromDataflow(ContextualSelection contextualSelection)
- {
- // check that there was a correct contextual selection
- if (!(contextualSelection.getSelection() instanceof Dataflow)) {
- logger.error("It is only possible to extract supported services from the workflow.");
- return (new ArrayList<SoapProcessorIdentity>());
- }
-
- // first extract all processors
- Dataflow dataflow = (Dataflow)contextualSelection.getSelection();
- List<? extends Processor> allProcessors = dataflow.getEntities(Processor.class);
-
- // now filter out any processors that are not WSDL activities
- List<SoapProcessorIdentity> supportedProcessors = new ArrayList<SoapProcessorIdentity>();
- for (Processor proc : allProcessors) {
- List<? extends Activity> activityList = (List<? extends Activity>) proc.getActivityList();
- if (activityList != null && activityList.size() > 0) {
- // take only the first activity - TODO: figure out what should be done here...
- Activity activity = activityList.get(0);
- if (activity instanceof WSDLActivity) {
- WSDLActivity a = (WSDLActivity)activity;
- supportedProcessors.add(new SoapProcessorIdentity(a.getConfiguration().getWsdl(),
- a.getConfiguration().getOperation(),
- proc.getLocalName()));
- }
- }
- }
-
- // return all found processors
- return (supportedProcessors);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/config/BioCataloguePluginConfiguration.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/config/BioCataloguePluginConfiguration.java
deleted file mode 100644
index a301c6a..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/config/BioCataloguePluginConfiguration.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.config;
-/*
- * 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.
- */
-
-import java.util.HashMap;
-import java.util.Map;
-
-import uk.org.taverna.configuration.AbstractConfigurable;
-
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import uk.org.taverna.configuration.ConfigurationManager;
-
-/**
- *
- *
- * @author Sergejs Aleksejevs
- */
-public class BioCataloguePluginConfiguration extends AbstractConfigurable
-{
- public static final String SERVICE_CATALOGUE_BASE_URL = "ServiceCatalogue_Base_URL";
- public static final String SOAP_OPERATIONS_IN_SERVICE_PANEL = "SOAP_Operations_in_Service_Panel";
- public static final String REST_METHODS_IN_SERVICE_PANEL = "REST_Methods_in_Service_Panel";
-
- private static class Singleton {
- private static BioCataloguePluginConfiguration instance = new BioCataloguePluginConfiguration();
- }
-
- // private static Logger logger = Logger.getLogger(MyExperimentConfiguration.class);
-
- private Map<String, String> defaultPropertyMap;
-
-
- public static BioCataloguePluginConfiguration getInstance() {
- return Singleton.instance;
- }
-
- public String getCategory() {
- return "general";
- }
-
- public Map<String,String> getDefaultPropertyMap() {
- if (defaultPropertyMap == null) {
- defaultPropertyMap = new HashMap<String,String>();
- defaultPropertyMap.put(SERVICE_CATALOGUE_BASE_URL, BioCatalogueClient.DEFAULT_API_LIVE_SERVER_BASE_URL);
- }
- return defaultPropertyMap;
- }
-
- public String getDisplayName() {
- return "Service catalogue";
- }
-
- public String getFilePrefix() {
- return "ServiceCatalogue";
- }
-
- public String getUUID() {
- return "4daac25c-bd56-4f90-b909-1e49babe5197";
- }
-
-
- /**
- * Just a "proxy" method - {@link AbstractConfigurable#store()}
- * is not visible to the users of instances of this class otherwise.
- */
- public void store() {
- super.store();
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/config/BioCataloguePluginConfigurationPanel.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/config/BioCataloguePluginConfigurationPanel.java
deleted file mode 100644
index 42120bc..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/config/BioCataloguePluginConfigurationPanel.java
+++ /dev/null
@@ -1,464 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.config;
-/*
- * 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.
- */
-
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.ProxySelector;
-import java.net.URL;
-
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.UsernamePasswordCredentials;
-//import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.impl.conn.ProxySelectorRoutePlanner;
-import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.HttpContext;
-import org.apache.log4j.Logger;
-import org.jdom.Attribute;
-import org.jdom.Document;
-import org.jdom.input.SAXBuilder;
-
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-
-
-/**
- *
- * @author Sergejs Aleksejevs
- */
-@SuppressWarnings("serial")
-public class BioCataloguePluginConfigurationPanel extends JPanel
-{
- public static final String APPLICATION_XML_MIME_TYPE = "application/xml";
-
- public static String PROXY_HOST = "http.proxyHost";
- public static String PROXY_PORT = "http.proxyPort";
- public static String PROXY_USERNAME = "http.proxyUser";
- public static String PROXY_PASSWORD = "http.proxyPassword";
-
- // 1.0.0b and higher until the first digit changes, as according to "Semantic Versioning"
- // from http://www.biocatalogue.org/wiki/doku.php?id=public:api:changelog
- // "Major version X (X.y.z | X > 0) MUST be incremented if any backwards
- // incompatible changes are introduced to the public API. It MAY include minor and patch level changes."
- public static String[] MIN_SUPPORTED_BIOCATALOGUE_API_VERSION = {"1", "1", "0"}; // major, minor and patch versions
- public static String API_VERSION = "apiVersion";
-
- private BioCataloguePluginConfiguration configuration =
- BioCataloguePluginConfiguration.getInstance();
-
-
- // UI elements
- JTextField tfBioCatalogueAPIBaseURL;
-
- private Logger logger = Logger.getLogger(BioCataloguePluginConfigurationPanel.class);
-
- public BioCataloguePluginConfigurationPanel() {
- initialiseUI();
- resetFields();
- }
-
- private void initialiseUI()
- {
- this.setLayout(new GridBagLayout());
- GridBagConstraints c = new GridBagConstraints();
- c.fill = GridBagConstraints.HORIZONTAL;
- c.anchor = GridBagConstraints.NORTHWEST;
- c.weightx = 1.0;
-
- c.gridx = 0;
- c.gridy = 0;
- JTextArea taDescription = new JTextArea("Configure the Service Catalogue integration functionality");
- taDescription.setFont(taDescription.getFont().deriveFont(Font.PLAIN, 11));
- taDescription.setLineWrap(true);
- taDescription.setWrapStyleWord(true);
- taDescription.setEditable(false);
- taDescription.setFocusable(false);
- taDescription.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
- this.add(taDescription, c);
-
-
- c.gridy++;
- c.insets = new Insets(20, 0, 0, 0);
- JLabel jlBioCatalogueAPIBaseURL = new JLabel("Base URL of the Service Catalogue instance to connect to:");
- this.add(jlBioCatalogueAPIBaseURL, c);
-
- c.gridy++;
- c.insets = new Insets(0, 0, 0, 0);
- tfBioCatalogueAPIBaseURL = new JTextField();
- this.add(tfBioCatalogueAPIBaseURL, c);
-
-
- c.gridy++;
- c.insets = new Insets(30, 0, 0, 0);
- // We are not removing BioCatalogue services from its config panel any more -
- // they are being handled by the Taverna's Service Registry
-// JButton bForgetStoredServices = new JButton("Forget services added to Service Panel by BioCatalogue Plugin");
-// bForgetStoredServices.addActionListener(new ActionListener() {
-// public void actionPerformed(ActionEvent e)
-// {
-// int response = JOptionPane.showConfirmDialog(null, // no way T2ConfigurationFrame instance can be obtained to be used as a parent...
-// "Are you sure you want to clear all SOAP operations and REST methods\n" +
-// "that were added to the Service Panel by the BioCatalogue Plugin?\n\n" +
-// "This action is permanent is cannot be undone.\n\n" +
-// "Do you want to proceed?", "BioCatalogue Plugin", JOptionPane.YES_NO_OPTION);
-//
-// if (response == JOptionPane.YES_OPTION)
-// {
-// BioCatalogueServiceProvider.clearRegisteredServices();
-// JOptionPane.showMessageDialog(null, // no way T2ConfigurationFrame instance can be obtained to be used as a parent...
-// "Stored services have been successfully cleared, but will remain\n" +
-// "being shown in Service Panel during this session.\n\n" +
-// "They will not appear in the Service Panel after you restart Taverna.",
-// "BioCatalogue Plugin", JOptionPane.INFORMATION_MESSAGE);
-// }
-// }
-// });
-// this.add(bForgetStoredServices, c);
-
-
- JButton bLoadDefaults = new JButton("Load Defaults");
- bLoadDefaults.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- loadDefaults();
- }
- });
-
- JButton bReset = new JButton("Reset");
- bReset.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- resetFields();
- }
- });
-
- JButton bApply = new JButton("Apply");
- bApply.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- applyChanges();
- }
- });
-
- JPanel jpActionButtons = new JPanel();
- jpActionButtons.add(bLoadDefaults);
- jpActionButtons.add(bReset);
- jpActionButtons.add(bApply);
- c.insets = new Insets(30, 0, 0, 0);
- c.gridy++;
- c.weighty = 1.0;
- this.add(jpActionButtons, c);
- }
-
-
- /**
- * Resets all fields to the last saved configuration.
- */
- private void resetFields() {
- tfBioCatalogueAPIBaseURL.setText(configuration.getProperty(BioCataloguePluginConfiguration.SERVICE_CATALOGUE_BASE_URL));
- }
-
- /**
- * Resets all fields to the default values.
- */
- private void loadDefaults() {
- tfBioCatalogueAPIBaseURL.setText(configuration.getDefaultProperty(BioCataloguePluginConfiguration.SERVICE_CATALOGUE_BASE_URL));
- }
-
- /**
- * Saves recent changes to the configuration parameter map.
- * Some input validation is performed as well.
- */
- private void applyChanges() {
- // --- BioCatalogue BASE URL ---
-
- String candidateBaseURL = tfBioCatalogueAPIBaseURL.getText();
- if (candidateBaseURL.length() == 0) {
- JOptionPane.showMessageDialog(this,
- "Service Catalogue base URL must not be blank",
- "Service Catalogue Configuration", JOptionPane.WARNING_MESSAGE);
- tfBioCatalogueAPIBaseURL.requestFocusInWindow();
- return;
- } else {
- try {
- new URL(candidateBaseURL);
- } catch (MalformedURLException e) {
- JOptionPane
- .showMessageDialog(
- this,
- "Currently set Service Catalogue instance URL is not valid\n." +
- "Please check the URL and try again.",
- "Service Catalogue Configuration",
- JOptionPane.WARNING_MESSAGE);
- tfBioCatalogueAPIBaseURL.selectAll();
- tfBioCatalogueAPIBaseURL.requestFocusInWindow();
- return;
- }
-
- // check if the base URL has changed from the last saved state
- if (!candidateBaseURL
- .equals(configuration
- .getProperty(BioCataloguePluginConfiguration.SERVICE_CATALOGUE_BASE_URL))) {
- // Perform various checks on the new URL
-
- // Do a GET with "Accept" header set to "application/xml"
- // We are expecting a 200 OK and an XML doc in return that
- // contains the BioCataogue version number element.
- DefaultHttpClient httpClient = new DefaultHttpClient();
-
- // Set the proxy settings, if any
- if (System.getProperty(PROXY_HOST) != null
- && !System.getProperty(PROXY_HOST).equals("")) {
- // Instruct HttpClient to use the standard
- // JRE proxy selector to obtain proxy information
- ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
- httpClient.getConnectionManager().getSchemeRegistry(), ProxySelector
- .getDefault());
- httpClient.setRoutePlanner(routePlanner);
- // Do we need to authenticate the user to the proxy?
- if (System.getProperty(PROXY_USERNAME) != null
- && !System.getProperty(PROXY_USERNAME).equals("")) {
- // Add the proxy username and password to the list of credentials
- httpClient.getCredentialsProvider().setCredentials(
- new AuthScope(System.getProperty(PROXY_HOST),Integer.parseInt(System.getProperty(PROXY_PORT))),
- new UsernamePasswordCredentials(System.getProperty(PROXY_USERNAME), System.getProperty(PROXY_PASSWORD)));
- }
- }
-
- HttpGet httpGet = new HttpGet(candidateBaseURL);
- httpGet.setHeader("Accept", APPLICATION_XML_MIME_TYPE);
-
- // Execute the request
- HttpContext localContext = new BasicHttpContext();
- HttpResponse httpResponse;
- try {
- httpResponse = httpClient.execute(httpGet, localContext);
- } catch (Exception ex1) {
- logger.error("Service Catalogue preferences configuration: Failed to do "
- + httpGet.getRequestLine(), ex1);
- // Warn the user
- JOptionPane.showMessageDialog(this,
- "Failed to connect to the URL of the Service Catalogue instance.\n"
- + "Please check the URL and try again.",
- "Service Catalogue Configuration",
- JOptionPane.INFORMATION_MESSAGE);
-
- // Release resource
- httpClient.getConnectionManager().shutdown();
-
- tfBioCatalogueAPIBaseURL.requestFocusInWindow();
- return;
- }
-
- if (httpResponse.getStatusLine().getStatusCode() == HttpURLConnection.HTTP_OK) { // HTTP/1.1 200 OK
- HttpEntity httpEntity = httpResponse.getEntity();
- String contentType = httpEntity.getContentType().getValue()
- .toLowerCase().trim();
- logger
- .info("Service Catalogue preferences configuration: Got 200 OK when testing the Service Catalogue instance by doing "
- + httpResponse.getStatusLine()
- + ". Content type of response "
- + contentType);
- if (contentType.startsWith(APPLICATION_XML_MIME_TYPE)) {
- String value = null;
- Document doc = null;
- try {
- value = readResponseBodyAsString(httpEntity)
- .trim();
- // Try to read this string into an XML document
- SAXBuilder builder = new SAXBuilder();
- byte[] bytes = value.getBytes("UTF-8");
- doc = builder.build(new ByteArrayInputStream(bytes));
- } catch (Exception ex2) {
- logger.error("Service Catalogue preferences configuration: Failed to build an XML document from the response.", ex2);
- // Warn the user
- JOptionPane.showMessageDialog(this,
- "Failed to get the expected response body when testing the Service Catalogue instance.\n"
- + "The URL is probably wrong. Please check it and try again.",
- "Service Catalogue Configuration",
- JOptionPane.INFORMATION_MESSAGE);
- tfBioCatalogueAPIBaseURL.requestFocusInWindow();
- return;
- }
- finally{
- // Release resource
- httpClient.getConnectionManager().shutdown();
- }
- // Get the version element from the XML document
- Attribute apiVersionAttribute = doc.getRootElement().getAttribute(API_VERSION);
- if (apiVersionAttribute != null){
- String apiVersion = apiVersionAttribute.getValue();
- String versions[] = apiVersion.split("[.]");
- String majorVersion = versions[0];
- String minorVersion = versions[1];
- try {
- //String patchVersion = versions[2]; // we are not comparing the patch versions
- String supportedMajorVersion = MIN_SUPPORTED_BIOCATALOGUE_API_VERSION[0];
- String supportedMinorVersion = MIN_SUPPORTED_BIOCATALOGUE_API_VERSION[1];
- Integer iSupportedMajorVersion = Integer.parseInt(supportedMajorVersion);
- Integer iMajorVersion = Integer.parseInt(majorVersion);
- Integer iSupportedMinorVersion = Integer.parseInt(supportedMinorVersion);
- Integer iMinorVersion = Integer.parseInt(minorVersion);
- if (!(iSupportedMajorVersion == iMajorVersion &&
- iSupportedMinorVersion <= iMinorVersion)){
- // Warn the user
- JOptionPane
- .showMessageDialog(
- this,
- "The version of the Service Catalogue instance you are trying to connect to is not supported.\n"
- + "Please change the URL and try again.",
- "Service Catalogue Configuration",
- JOptionPane.INFORMATION_MESSAGE);
- tfBioCatalogueAPIBaseURL.requestFocusInWindow();
- return;
- }
- } catch (Exception e) {
- logger.error(e);
- }
- } // if null - we'll try to do our best to connect to BioCatalogue anyway
- } else {
- logger
- .error("Service Catalogue preferences configuration: Failed to get the expected response content type when testing the Service Catalogue instance. "
- + httpGet.getRequestLine()
- + " returned content type '"
- + contentType
- + "'; expected response content type is 'application/xml'.");
- // Warn the user
- JOptionPane
- .showMessageDialog(
- this,
- "Failed to get the expected response content type when testing the Service Catalogue instance.\n"
- + "The URL is probably wrong. Please check it and try again.",
- "Service Catalogue Plugin",
- JOptionPane.INFORMATION_MESSAGE);
- tfBioCatalogueAPIBaseURL.requestFocusInWindow();
- return;
- }
- }
- else{
- logger
- .error("Service Catalogue preferences configuration: Failed to get the expected response status code when testing the Service Catalogue instance. "
- + httpGet.getRequestLine()
- + " returned the status code "
- + httpResponse.getStatusLine()
- .getStatusCode() + "; expected status code is 200 OK.");
- // Warn the user
- JOptionPane
- .showMessageDialog(
- this,
- "Failed to get the expected response status code when testing the Service Catalogue instance.\n"
- + "The URL is probably wrong. Please check it and try again.",
- "Service Catalogue Configuration",
- JOptionPane.INFORMATION_MESSAGE);
- tfBioCatalogueAPIBaseURL.requestFocusInWindow();
- return;
- }
-
- // Warn the user of the changes in the BioCatalogue base URL
- JOptionPane
- .showMessageDialog(
- this,
- "You have updated the Service Catalogue base URL.\n"
- + "This does not take effect until you restart Taverna.",
- "Service catalogue Configuration",
- JOptionPane.INFORMATION_MESSAGE);
-
- }
-
- // the new base URL seems to be valid - can save it into config
- // settings
- configuration.setProperty(
- BioCataloguePluginConfiguration.SERVICE_CATALOGUE_BASE_URL,
- candidateBaseURL);
-
-/* // also update the base URL in the BioCatalogueClient
- BioCatalogueClient.getInstance()
- .setBaseURL(candidateBaseURL);*/
- }
-
- }
-
-
- /**
- * For testing only.
- */
- public static void main(String[] args) {
- JFrame theFrame = new JFrame();
- theFrame.add(new BioCataloguePluginConfigurationPanel());
- theFrame.pack();
- theFrame.setLocationRelativeTo(null);
- theFrame.setVisible(true);
- }
-
- /**
- * Worker method that extracts the content of the received HTTP message as a
- * string. It also makes use of the charset that is specified in the
- * Content-Type header of the received data to read it appropriately.
- *
- * @param entity
- * @return
- * @throws IOException
- */
- // Taken from HTTPRequestHandler in rest-activity by Sergejs Aleksejevs
- private static String readResponseBodyAsString(HttpEntity entity)
- throws IOException {
- // get charset name
- String charset = null;
- String contentType = entity.getContentType().getValue().toLowerCase();
-
- String[] contentTypeParts = contentType.split(";");
- for (String contentTypePart : contentTypeParts) {
- contentTypePart = contentTypePart.trim();
- if (contentTypePart.startsWith("charset=")) {
- charset = contentTypePart.substring("charset=".length());
- }
- }
-
- // read the data line by line
- StringBuilder responseBodyString = new StringBuilder();
- BufferedReader reader = new BufferedReader(new InputStreamReader(entity
- .getContent(), charset));
-
- String str;
- while ((str = reader.readLine()) != null) {
- responseBodyString.append(str + "\n");
- }
-
- return (responseBodyString.toString());
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/config/BioCataloguePluginConfigurationUIFactory.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/config/BioCataloguePluginConfigurationUIFactory.java
deleted file mode 100644
index c038c57..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/config/BioCataloguePluginConfigurationUIFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.config;
-/*
- * 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.
- */
-
-import javax.swing.JPanel;
-
-import uk.org.taverna.configuration.Configurable;
-import uk.org.taverna.configuration.ConfigurationUIFactory;
-
-/**
- *
- * @author Sergejs Aleksejevs
- */
-public class BioCataloguePluginConfigurationUIFactory implements ConfigurationUIFactory
-{
-
- public boolean canHandle(String uuid) {
- return uuid.equals(getConfigurable().getUUID());
- }
-
- public Configurable getConfigurable() {
- return BioCataloguePluginConfiguration.getInstance();
- }
-
- public JPanel getConfigurationPanel() {
- return new BioCataloguePluginConfigurationPanel();
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/BioCataloguePluginInputPortContextViewFactory.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/BioCataloguePluginInputPortContextViewFactory.java
deleted file mode 100644
index 8c04a76..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/BioCataloguePluginInputPortContextViewFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.contextual_views;
-/*
- * 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.
- */
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationPortIdentity;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.Integration;
-import org.apache.taverna.workbench.ui.views.contextualviews.ContextualView;
-import org.apache.taverna.workbench.ui.views.contextualviews.activity.ContextualViewFactory;
-import org.apache.taverna.workflowmodel.processor.activity.ActivityInputPort;
-
-
-public class BioCataloguePluginInputPortContextViewFactory implements
- ContextualViewFactory<ActivityInputPort> {
-
- public boolean canHandle(Object selection)
- {
- // TODO - HACK: this would stop showing the contextual view in case of any error,
- // not just in case of unsupported contextual selection; this needs to be
- // changed, so that useful error messages are still displayed in the
- // contextual view
- if (selection instanceof ActivityInputPort)
- {
- SoapOperationPortIdentity portDetails = Integration.
- extractSoapOperationPortDetailsFromActivityInputOutputPort((ActivityInputPort)selection);
- boolean canHandleSelection = !portDetails.hasError();
- if (!canHandleSelection) {
- Logger.getLogger(BioCataloguePluginProcessorContextViewFactory.class).debug(
- "Input port contextual view not shown due to some condition: " + portDetails.getErrorDetails());
- }
-
- return (canHandleSelection);
- }
- else {
- return (false);
- }
- }
-
- public List<ContextualView> getViews(ActivityInputPort selection) {
- return Arrays.<ContextualView>asList(new ProcessorInputPortView(selection));
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/BioCataloguePluginOutputPortContextViewFactory.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/BioCataloguePluginOutputPortContextViewFactory.java
deleted file mode 100644
index c6a3250..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/BioCataloguePluginOutputPortContextViewFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.contextual_views;
-/*
- * 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.
- */
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationPortIdentity;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.Integration;
-import org.apache.taverna.workbench.ui.views.contextualviews.ContextualView;
-import org.apache.taverna.workbench.ui.views.contextualviews.activity.ContextualViewFactory;
-import org.apache.taverna.workflowmodel.processor.activity.ActivityOutputPort;
-
-
-public class BioCataloguePluginOutputPortContextViewFactory implements
- ContextualViewFactory<ActivityOutputPort> {
-
- public boolean canHandle(Object selection)
- {
- // TODO - HACK: this would stop showing the contextual view in case of any error,
- // not just in case of unsupported contextual selection; this needs to be
- // changed, so that useful error messages are still displayed in the
- // contextual view
- if (selection instanceof ActivityOutputPort)
- {
- SoapOperationPortIdentity portDetails = Integration.
- extractSoapOperationPortDetailsFromActivityInputOutputPort((ActivityOutputPort)selection);
- boolean canHandleSelection = !portDetails.hasError();
- if (!canHandleSelection) {
- Logger.getLogger(BioCataloguePluginProcessorContextViewFactory.class).debug(
- "Output port contextual view not shown due to some condition: " + portDetails.getErrorDetails());
- }
-
- return (canHandleSelection);
- }
- else {
- return (false);
- }
- }
-
- public List<ContextualView> getViews(ActivityOutputPort selection) {
- return Arrays.<ContextualView>asList(new ProcessorOutputPortView(selection));
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/BioCataloguePluginProcessorContextViewFactory.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/BioCataloguePluginProcessorContextViewFactory.java
deleted file mode 100644
index 60ce129..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/BioCataloguePluginProcessorContextViewFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.contextual_views;
-/*
- * 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.
- */
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.Integration;
-import org.apache.taverna.workbench.ui.views.contextualviews.ContextualView;
-import org.apache.taverna.workbench.ui.views.contextualviews.activity.ContextualViewFactory;
-import org.apache.taverna.workflowmodel.Processor;
-
-public class BioCataloguePluginProcessorContextViewFactory implements
- ContextualViewFactory<Processor> {
-
- public boolean canHandle(Object selection)
- {
- // TODO - HACK: this would stop showing the contextual view in case of any error,
- // not just in case of unsupported contextual selection; this needs to be
- // changed, so that useful error messages are still displayed in the
- // contextual view
- if (selection instanceof Processor)
- {
- SoapOperationIdentity opId = Integration.extractSoapOperationDetailsFromProcessor((Processor) selection);
- boolean canHandleSelection = !opId.hasError();
- if (!canHandleSelection) {
- Logger.getLogger(BioCataloguePluginProcessorContextViewFactory.class).debug(
- "Service's contextual view not shown due to some condition: " + opId.getErrorDetails());
- }
-
- return (canHandleSelection);
- }
- else {
- return (false);
- }
- }
-
- public List<ContextualView> getViews(Processor selection) {
- return Arrays.<ContextualView>asList(new ProcessorView(selection));
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/ProcessorInputPortView.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/ProcessorInputPortView.java
deleted file mode 100644
index aa960a2..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/ProcessorInputPortView.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.contextual_views;
-/*
- * 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.
- */
-
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-
-import org.apache.taverna.biocatalogue.model.BioCataloguePluginConstants;
-import org.apache.taverna.workbench.ui.views.contextualviews.ContextualView;
-import org.apache.taverna.workflowmodel.processor.activity.ActivityInputPort;
-
-
-public class ProcessorInputPortView extends ContextualView
-{
- private final ActivityInputPort inputPort;
- private JPanel jPanel;
-
- public ProcessorInputPortView(ActivityInputPort inputPort) {
- this.inputPort = inputPort;
-
- jPanel = new JPanel();
-
- // NB! This is required to have the body of this contextual
- // view added to the main view; otherwise, body will be
- // blank
- initView();
- }
-
- @Override
- public JComponent getMainFrame()
- {
- return jPanel;
- }
-
- @Override
- public String getViewTitle() {
- return "Service Catalogue Information";
- }
-
- @Override
- public void refreshView()
- {
- // this actually causes the parent container to validate itself,
- // which is what is needed here
- this.revalidate();
- this.repaint();
- }
-
- @Override
- public int getPreferredPosition() {
- return BioCataloguePluginConstants.CONTEXTUAL_VIEW_PREFERRED_POSITION;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/ProcessorOutputPortView.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/ProcessorOutputPortView.java
deleted file mode 100644
index 93fd37c..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/ProcessorOutputPortView.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.contextual_views;
-/*
- * 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.
- */
-
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-
-import org.apache.taverna.biocatalogue.model.BioCataloguePluginConstants;
-import org.apache.taverna.workbench.ui.views.contextualviews.ContextualView;
-import org.apache.taverna.workflowmodel.processor.activity.ActivityOutputPort;
-
-
-public class ProcessorOutputPortView extends ContextualView
-{
- private final ActivityOutputPort outputPort;
- private JPanel jPanel;
-
- public ProcessorOutputPortView(ActivityOutputPort outputPort) {
- this.outputPort = outputPort;
-
- jPanel = new JPanel();
-
- // NB! This is required to have the body of this contextual
- // view added to the main view; otherwise, body will be
- // blank
- initView();
- }
-
- @Override
- public JComponent getMainFrame()
- {
- return jPanel;
- }
-
- @Override
- public String getViewTitle() {
- return "Service Catalogue Information";
- }
-
- @Override
- public void refreshView()
- {
- // this actually causes the parent container to validate itself,
- // which is what is needed here
- this.revalidate();
- this.repaint();
- }
-
- @Override
- public int getPreferredPosition() {
- return BioCataloguePluginConstants.CONTEXTUAL_VIEW_PREFERRED_POSITION;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/ProcessorView.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/ProcessorView.java
deleted file mode 100644
index 34779e7..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/contextual_views/ProcessorView.java
+++ /dev/null
@@ -1,245 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.contextual_views;
-/*
- * 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.
- */
-
-import java.awt.Component;
-import java.awt.Desktop;
-import java.awt.Dimension;
-import java.awt.FlowLayout;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.GridLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.net.URI;
-import java.rmi.activation.UnknownObjectException;
-
-import javax.swing.AbstractAction;
-import javax.swing.BorderFactory;
-import javax.swing.Box;
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-
-import org.apache.taverna.biocatalogue.model.BioCataloguePluginConstants;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.lang.ui.DeselectingButton;
-import org.apache.taverna.lang.ui.ReadOnlyTextArea;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.Integration;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.ServiceHealthChecker;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.ServiceMonitoringStatusInterpreter;
-import org.apache.taverna.workbench.ui.views.contextualviews.ContextualView;
-import org.apache.taverna.workflowmodel.Processor;
-
-import org.apache.log4j.Logger;
-import org.biocatalogue.x2009.xml.rest.Service;
-import org.biocatalogue.x2009.xml.rest.SoapOperation;
-
-
-public class ProcessorView extends ContextualView {
- private final Processor processor;
- private JPanel jPanel;
-
- private static Logger logger = Logger.getLogger(ProcessorView.class);
-
-
-
- public ProcessorView(Processor processor) {
- this.processor = processor;
-
- jPanel = new JPanel();
-
- // this is required to have the body of this contextual
- // view added to the main view; otherwise, body will be
- // blank
- initView();
- }
-
-
-
- @Override
- public JComponent getMainFrame()
- {
- Thread t = new Thread("loading processor data") {
- public void run() {
- final SoapOperationIdentity operationDetails = Integration.extractSoapOperationDetailsFromProcessor(processor);
-
- if (operationDetails.hasError()) {
- SwingUtilities.invokeLater(new RefreshThread(new JLabel(operationDetails.getErrorDetails().toString(),
- UIManager.getIcon("OptionPane.warningIcon"), JLabel.CENTER)));
- return;
- }
- else {
- BioCatalogueClient client = BioCatalogueClient.getInstance();
-
- if (client != null) {
- try {
- final SoapOperation soapOperation = client.lookupSoapOperation(operationDetails);
- if (soapOperation == null) {
- SwingUtilities.invokeLater(new RefreshThread(new JLabel("This service is not registered in the Service Catalogue",
- UIManager.getIcon("OptionPane.warningIcon"), JLabel.CENTER)));
- return;
- }
-
- Service parentService = client.getBioCatalogueService(soapOperation.getAncestors().getService().getHref());
- if (parentService == null) {
- SwingUtilities.invokeLater(new RefreshThread(new JLabel("Problem while fetching monitoring data from the Service Catalogue",
- UIManager.getIcon("OptionPane.warningIcon"), JLabel.CENTER)));
- return;
- }
-
-
- // *** managed to get all necessary data successfully - present it ***
-
- // create status update panel
- JButton jclServiceStatus = new DeselectingButton(
- new AbstractAction("Check monitoring status") {
- public void actionPerformed(ActionEvent e) {
- ServiceHealthChecker.checkWSDLProcessor(operationDetails);
- }
- });
- jclServiceStatus.setAlignmentX(Component.LEFT_ALIGNMENT);
- JLabel jlStatusMessage = new JLabel(parentService.getLatestMonitoringStatus().getMessage());
- jlStatusMessage.setAlignmentX(Component.LEFT_ALIGNMENT);
-
- // operation description
- String operationDescription = (soapOperation.getDescription().length() > 0 ?
- soapOperation.getDescription() :
- "No description is available for this service");
-
- ReadOnlyTextArea jlOperationDescription = new ReadOnlyTextArea(operationDescription);
-
- jlOperationDescription.setAlignmentX(Component.LEFT_ALIGNMENT);
-
- // a button to open preview of the service
- JButton jbLaunchProcessorPreview = new DeselectingButton("Show on the Service Catalogue",
- new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (!operationDetails.hasError()) {
- String hrefString = soapOperation.getHref();
- try {
- Desktop.getDesktop().browse(new URI(hrefString));
- }
- catch (Exception ex) {
- logger.error("Failed while trying to open the URL in a standard browser; URL was: " +
- hrefString, ex);
- };
- }
- else {
- // this error message comes from Integration class extracting SOAP operation details from the contextual selection
- JOptionPane.showMessageDialog(null, operationDetails.getErrorDetails(), "Service Catalogue Error", JOptionPane.WARNING_MESSAGE);
- }
- }
- },
- "View this service on the Service Catalogue");
-
- JPanel jpPreviewButtonPanel = new JPanel();
- jpPreviewButtonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
- jbLaunchProcessorPreview.setAlignmentX(Component.LEFT_ALIGNMENT);
- // jpPreviewButtonPanel.add(jbLaunchProcessorPreview);
- // put everything together
- JPanel jpInnerPane = new JPanel();
- jpInnerPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
- jpInnerPane.setLayout(new BoxLayout(jpInnerPane, BoxLayout.Y_AXIS));
- jpInnerPane.add(jlOperationDescription);
- jpInnerPane.add(Box.createVerticalStrut(10));
- jpInnerPane.add(jlStatusMessage);
- jpInnerPane.add(Box.createVerticalStrut(10));
- jpInnerPane.add(jclServiceStatus);
- jpInnerPane.add(Box.createVerticalStrut(10));
- jpInnerPane.add(jbLaunchProcessorPreview);
-
- JScrollPane spInnerPane = new JScrollPane(jpInnerPane);
-
- SwingUtilities.invokeLater(new RefreshThread(spInnerPane));
- return;
- }
- catch (UnknownObjectException e) {
- SwingUtilities.invokeLater(new RefreshThread(new JLabel(e.getMessage(),
- UIManager.getIcon("OptionPane.informationIcon"), JLabel.CENTER)));
- return;
- }
- catch (Exception e) {
- // a real error occurred while fetching data about selected processor
- logger.error("ERROR: unexpected problem while trying to ", e);
- SwingUtilities.invokeLater(new RefreshThread(new JLabel("An unknown problem has prevented Taverna from loading this preview",
- UIManager.getIcon("OptionPane.errorIcon"), JLabel.CENTER)));
- return;
- }
- }
- else {
- SwingUtilities.invokeLater(new RefreshThread(new JLabel("Service Catalogue integration has not initialised yet. Please wait and try again.",
- UIManager.getIcon("OptionPane.warningIcon"), JLabel.CENTER)));
- return;
- }
- }
- }
- };
-
- jPanel.removeAll();
- jPanel.setPreferredSize(new Dimension(200,200));
- jPanel.setLayout(new GridLayout());
- jPanel.add(new JLabel(ResourceManager.getImageIcon(ResourceManager.BAR_LOADER_ORANGE), JLabel.CENTER));
- t.start();
- return jPanel;
- }
-
- @Override
- public String getViewTitle() {
- return "Service Catalogue Information";
- }
-
- @Override
- public void refreshView()
- {
- // this actually causes the parent container to validate itself,
- // which is what is needed here
- this.revalidate();
- this.repaint();
- }
-
- @Override
- public int getPreferredPosition() {
- return BioCataloguePluginConstants.CONTEXTUAL_VIEW_PREFERRED_POSITION;
- }
-
- class RefreshThread extends Thread {
- private final Component component;
-
- public RefreshThread (Component component) {
- this.component = component;
- }
-
- public void run() {
- jPanel.removeAll();
- if (component != null) {
- jPanel.add(component);
- }
- refreshView();
- }
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/BioCatalogueWSDLActivityHealthCheck.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/BioCatalogueWSDLActivityHealthCheck.java
deleted file mode 100644
index 9760460..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/BioCatalogueWSDLActivityHealthCheck.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check;
-/*
- * 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.
- */
-
-import org.apache.taverna.visit.VisitKind;
-import org.apache.taverna.visit.Visitor;
-
-/**
- * A {@link BioCatalogueWSDLActivityHealthCheck} is a kind of visit that determines
- * if the corresponding WSDL activity in a workflow will work during a workflow run -
- * checks will be made based on the monitoring status held about that service in BioCatalogue.
- *
- * @author Sergejs Aleksejevs
- */
-public class BioCatalogueWSDLActivityHealthCheck extends VisitKind
-{
- // The following values indicate the type of results that can be associated
- // with a VisitReport generated by a health-checking visitor.
- public static final int MESSAGE_IN_VISIT_REPORT = 0;
-
-
- // property names to be placed into VisitReport generated by BioCatalogueWSDLActivityHealthChecker
- public static final String WSDL_LOCATION_PROPERTY = "wsdlLocation";
- public static final String OPERATION_NAME_PROPERTY = "soapOperationName";
- public static final String EXPLANATION_MSG_PROPERTY = "fullExplanationMessage";
-
-
-
-
- @Override
- public Class<? extends Visitor> getVisitorClass() {
- return BioCatalogueWSDLActivityHealthChecker.class;
- }
-
- private static class Singleton {
- private static BioCatalogueWSDLActivityHealthCheck instance = new BioCatalogueWSDLActivityHealthCheck();
- }
-
- public static BioCatalogueWSDLActivityHealthCheck getInstance() {
- return Singleton.instance;
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/BioCatalogueWSDLActivityHealthCheckVisitExplainer.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/BioCatalogueWSDLActivityHealthCheckVisitExplainer.java
deleted file mode 100644
index ed6afe6..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/BioCatalogueWSDLActivityHealthCheckVisitExplainer.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.lang.ui.ReadOnlyTextArea;
-import org.apache.taverna.visit.VisitKind;
-import org.apache.taverna.visit.VisitReport;
-import org.apache.taverna.workbench.report.explainer.VisitExplainer;
-
-// import status constants
-import static org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.BioCatalogueWSDLActivityHealthCheck.*;
-
-/**
- *
- * @author Sergejs Aleksejevs
- */
-public class BioCatalogueWSDLActivityHealthCheckVisitExplainer implements VisitExplainer
-{
-
- public boolean canExplain(VisitKind vk, int resultId) {
- return (vk instanceof BioCatalogueWSDLActivityHealthCheck);
- }
-
-
- /**
- * This class only handles {@link VisitReport} instances that are of
- * {@link BioCatalogueWSDLActivityHealthCheck} kind. Therefore, decisions on
- * the explanations / solutions are made solely by visit result IDs.
- */
- public JComponent getExplanation(final VisitReport vr)
- {
- int resultId = vr.getResultId();
- String explanation = null;
-
- switch (resultId) {
- case MESSAGE_IN_VISIT_REPORT:
- explanation = (String) vr.getProperty(EXPLANATION_MSG_PROPERTY); break;
-
- default:
- explanation = "Unknown issue - no expalanation available"; break;
- }
-
-
- JButton bRunBioCatalogueHealthCheck = new JButton("View monitoring status details");
- bRunBioCatalogueHealthCheck.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- SoapOperationIdentity soapOpIdentity =
- new SoapOperationIdentity((String)vr.getProperty(BioCatalogueWSDLActivityHealthCheck.WSDL_LOCATION_PROPERTY),
- (String)vr.getProperty(BioCatalogueWSDLActivityHealthCheck.OPERATION_NAME_PROPERTY), null);
-
- ServiceHealthChecker.checkWSDLProcessor(soapOpIdentity);
- }
- });
- JPanel jpButton = new JPanel();
- jpButton.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
- jpButton.add(bRunBioCatalogueHealthCheck);
- jpButton.setOpaque(false);
-
- JPanel jpExplanation = new JPanel(new BorderLayout());
- jpExplanation.add(new ReadOnlyTextArea(explanation), BorderLayout.CENTER);
- jpExplanation.add(jpButton, BorderLayout.SOUTH);
-
- return (jpExplanation);
- }
-
-
-
- /**
- * This class only handles {@link VisitReport} instances that are of
- * {@link BioCatalogueWSDLActivityHealthCheck} kind. Therefore, decisions on
- * the explanations / solutions are made solely by visit result IDs.
- */
- public JComponent getSolution(VisitReport vr)
- {
- String explanation = null;
-
- // instead of switching between possible health check resultIDs,
- // simply choose from possible statuses: for all failures there's
- // nothing specific that can be done, so no need to differentiate
- // displayed messages
- switch (vr.getStatus()) {
- case OK:
- explanation = "This WSDL service works fine - no change necessary"; break;
-
- case WARNING:
- case SEVERE:
- explanation = "This remote WSDL service appears to have an internal problem. There is nothing " +
- "specific that can be done to fix it locally.\n\n" +
- "It is possible that the current state of the service will still allow to execute " +
- "the workflow successfully. Also, the service may have already recovered since the " +
- "last time it's monitoring status has been checked.\n\n" +
- "If this problem does affect the current workflow, it may be resolved by the " +
- "service provider. It may be worth contacting them to report the issue.";
- break;
-
- default:
- explanation = "Unknown issue - no solution available"; break;
- }
-
- return (new ReadOnlyTextArea(explanation));
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/BioCatalogueWSDLActivityHealthChecker.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/BioCatalogueWSDLActivityHealthChecker.java
deleted file mode 100644
index df00c27..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/BioCatalogueWSDLActivityHealthChecker.java
+++ /dev/null
@@ -1,215 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check;
-/*
- * 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.
- */
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.apache.log4j.Logger;
-import org.biocatalogue.x2009.xml.rest.MonitoringStatusLabel;
-import org.biocatalogue.x2009.xml.rest.Service;
-import org.biocatalogue.x2009.xml.rest.ServiceTest;
-import org.biocatalogue.x2009.xml.rest.TestScript;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.activities.wsdl.WSDLActivity;
-import org.apache.taverna.activities.wsdl.WSDLActivityConfigurationBean;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-import org.apache.taverna.visit.VisitReport;
-import org.apache.taverna.visit.VisitReport.Status;
-import org.apache.taverna.workflowmodel.health.HealthChecker;
-
-
-/**
- * A {@link HealthChecker} for a {@link WSDLActivity}.
- *
- * @author Sergejs Aleksejevs
- */
-public class BioCatalogueWSDLActivityHealthChecker implements HealthChecker<WSDLActivity>
-{
- private static final int MILLIS_IN_THE_PAST_FOR_OLDEST_MONITORING_DATA = 48 * 60 * 60 * 1000; // 48hrs
-
-
- private Logger logger;
-
- public BioCatalogueWSDLActivityHealthChecker() {
- logger = Logger.getLogger(BioCatalogueWSDLActivityHealthChecker.class);
- }
-
-
- public boolean canVisit(Object subject) {
- return (subject instanceof WSDLActivity);
- }
-
-
- public VisitReport visit(WSDLActivity activity, List<Object> ancestors)
- {
- WSDLActivityConfigurationBean configBean = activity.getConfiguration();
- SoapOperationIdentity soapOpIdentity = new SoapOperationIdentity(configBean.getWsdl(), configBean.getOperation(), null);
-
- try {
- // make BioCatalogue API request to fetch the data
- Service serviceWithMonitoringData = BioCatalogueClient.getInstance().lookupParentServiceMonitoringData(soapOpIdentity);
- MonitoringStatusLabel.Enum serviceStatusLabel = null;
-
-
- VisitReport.Status status = null;
- String visitReportLabel = null;
- String visitReportExplanation = null;
- List<VisitReport> subReports = new ArrayList<VisitReport>();
-
-
- if (serviceWithMonitoringData == null) {
- // BioCatalogue doesn't "know" about this service - it appears not to be registered;
- // --> nothing to report to Taverna
- return (null);
- }
- else if (serviceWithMonitoringData.getLatestMonitoringStatus() == null) {
- // BioCatalogue "knows" this service, but for some reason there was no monitoring data available;
- // possibly an API change? either way --> nothing to report to Taverna
- return (null);
- }
- else
- {
- Calendar lastCheckedAt = serviceWithMonitoringData.getLatestMonitoringStatus().getLastChecked();
- String agoString = Util.getAgoString(lastCheckedAt, Calendar.getInstance(), MILLIS_IN_THE_PAST_FOR_OLDEST_MONITORING_DATA);
- if (agoString == null) {
- return (null);
- }
-
- serviceStatusLabel = serviceWithMonitoringData.getLatestMonitoringStatus().getLabel();
- switch (serviceStatusLabel.intValue()) {
- case MonitoringStatusLabel.INT_PASSED:
- visitReportLabel = "Service Catalogue: all tests passed " + agoString;
- visitReportExplanation = "The Service Catalogue reports that all available tests for this WSDL service have " +
- "been successful. They have been last executed " + agoString;
- status = Status.OK;
- break;
-
- case MonitoringStatusLabel.INT_WARNING:
- case MonitoringStatusLabel.INT_FAILED:
- visitReportLabel = "Service Catalogue: some tests failed " + agoString;
- visitReportExplanation = "Some test scripts for this WSDL service have failed";
-
- // only extract data about failing test scripts
- subReports = createTestScriptSubReportsForFailingService(activity, serviceWithMonitoringData);
- if (subReports.size() == 0) {
- // failing tests must have been for endpoint / WSDL location - but not for scripts;
- // Taverna doesn't need to know about the former, as it replicates internal checks
- return (null);
- }
- else {
- // determine the worst status and report as the one of the collection of subreports
- status = VisitReport.getWorstStatus(subReports);
- }
- break;
-
- case MonitoringStatusLabel.INT_UNCHECKED:
- // monitoring record states that the status of this service was not (yet) checked;
- // possibly monitoring on BioCatalogue was switched off before this service was registered;
- // --> nothing to report to Taverna
- return (null);
-
- default:
- visitReportLabel = "Service Catalogue: unknown monitoring status received - \"" + serviceStatusLabel.toString() + "\"";
- visitReportExplanation = "The Service Catalogue has returned a new monitoring status for this service: \"" +
- serviceStatusLabel.toString() + "\"\n\n" +
- "It has never been used before and probably indicates a change in the Service Catalogue API. " +
- "Please report this issue to the Service Catalogue developers.";
- status = Status.WARNING;
- break;
- }
- }
-
- // wrap determined values into a single VisitReport object; then attach data to identify
- // this service in associated VisitExplainer
- VisitReport report = new VisitReport(BioCatalogueWSDLActivityHealthCheck.getInstance(), activity,
- visitReportLabel, BioCatalogueWSDLActivityHealthCheck.MESSAGE_IN_VISIT_REPORT, status, subReports);
- report.setProperty(BioCatalogueWSDLActivityHealthCheck.WSDL_LOCATION_PROPERTY, soapOpIdentity.getWsdlLocation());
- report.setProperty(BioCatalogueWSDLActivityHealthCheck.OPERATION_NAME_PROPERTY, soapOpIdentity.getOperationName());
- report.setProperty(BioCatalogueWSDLActivityHealthCheck.EXPLANATION_MSG_PROPERTY, visitReportExplanation);
-
- return (report);
- }
- catch (Exception e) {
- // not sure what could have happened - it will be visible in the logs
- logger.error("Unexpected error while performing health check for " +
- soapOpIdentity.getWsdlLocation() + " service.", e);
- return (null);
- }
- }
-
-
- private List<VisitReport> createTestScriptSubReportsForFailingService(WSDLActivity activity, Service serviceWithMonitoringData)
- {
- List<VisitReport> subReports = new ArrayList<VisitReport>();
-
- try {
- List<ServiceTest> serviceTests = serviceWithMonitoringData.getMonitoring().getTests().getServiceTestList();
- for (ServiceTest test : serviceTests)
- {
- if (test.getTestType().getTestScript() != null &&
- test.getTestType().getTestScript()instanceof TestScript)
- {
- TestScript testScript = test.getTestType().getTestScript();
-
- String agoString = Util.getAgoString(test.getLatestStatus().getLastChecked(), Calendar.getInstance(),
- MILLIS_IN_THE_PAST_FOR_OLDEST_MONITORING_DATA);
-
- // only proceed if this test wasn't run too long ago
- if (agoString != null) {
- String label = "Service Catalogue: \"" + testScript.getName() + "\" test script " + test.getLatestStatus().getLabel();
- VisitReport report = new VisitReport(BioCatalogueWSDLActivityHealthCheck.getInstance(), activity,
- label, BioCatalogueWSDLActivityHealthCheck.MESSAGE_IN_VISIT_REPORT,
- ServiceMonitoringStatusInterpreter.translateBioCatalogueStatusForTaverna(test.getLatestStatus().getLabel()));
- report.setProperty(BioCatalogueWSDLActivityHealthCheck.WSDL_LOCATION_PROPERTY, activity.getConfiguration().getWsdl());
- report.setProperty(BioCatalogueWSDLActivityHealthCheck.OPERATION_NAME_PROPERTY, activity.getConfiguration().getOperation());
- report.setProperty(BioCatalogueWSDLActivityHealthCheck.EXPLANATION_MSG_PROPERTY,
- "This test was last executed " + agoString + "." +
- "\n\n" + StringEscapeUtils.escapeHtml(test.getLatestStatus().getMessage()) +
- "\n\n---- Test script description ----\n" + StringEscapeUtils.escapeHtml(testScript.getDescription()));
-
- subReports.add(report);
- }
- }
- }
- }
- catch (Exception e) {
- // log the error, but do not terminate the method - maybe some sub reports were successfully
- // generated, in which case at least partial result can be returned
- logger.error("Encountered unexpected problem while trying to generate a collection of sub-reports " +
- "for a failing service: " + activity.getConfiguration().getWsdl(), e);
- }
-
- return (subReports);
- }
-
-
- /**
- * Health check for the WSDL activities involves fetching
- * the monitoring status of each activity from BioCatalogue -
- * this *may* be time consuming.
- */
- public boolean isTimeConsuming() {
- return true;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/ServiceHealthChecker.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/ServiceHealthChecker.java
deleted file mode 100644
index 32a6670..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/ServiceHealthChecker.java
+++ /dev/null
@@ -1,296 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check;
-/*
- * 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.
- */
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import javax.swing.BorderFactory;
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.border.EmptyBorder;
-
-import org.apache.log4j.Logger;
-import org.biocatalogue.x2009.xml.rest.ResourceLink;
-import org.biocatalogue.x2009.xml.rest.RestMethod;
-import org.biocatalogue.x2009.xml.rest.Service;
-import org.biocatalogue.x2009.xml.rest.ServiceTest;
-import org.biocatalogue.x2009.xml.rest.SoapOperation;
-
-import org.apache.taverna.biocatalogue.model.BioCataloguePluginConstants;
-import org.apache.taverna.biocatalogue.model.Resource;
-import org.apache.taverna.biocatalogue.model.Resource.TYPE;
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.biocatalogue.model.SoapProcessorIdentity;
-import org.apache.taverna.biocatalogue.model.connectivity.BioCatalogueClient;
-import org.apache.taverna.biocatalogue.ui.JClickableLabel;
-import org.apache.taverna.biocatalogue.ui.JWaitDialog;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponent;
-import org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory;
-
-
-/**
- * This class helps with "health checks" of individual Taverna processors
- * (i.e. SOAP operations) and the workflows in general (by iterating through
- * the processors).
- *
- * @author Sergejs Aleksejevs
- */
-public class ServiceHealthChecker
-{
- private static Logger logger = Logger.getLogger(ServiceHealthChecker.class);
-
- // deny creation of instances of this class
- private ServiceHealthChecker() { };
-
-
- // =====================================================================================================
- // *** Health Check of Individual Service / Processor ***
- // =====================================================================================================
-
- /**
- * @param serviceURL URL of SOAP service or REST service on BioCatalogue;
- * URL should be of the
- */
- public static void checkServiceByURL(String serviceURL)
- {
- if (serviceURL != null) {
- checkMonitoringStatusRoutine(serviceURL);
- }
- else {
- // for some reason the URL of the service wasn't provided...
- JOptionPane.showMessageDialog(null, "Cannot provide monitoring status for this service - " +
- "unknown service URL", "Service Catalogue Error", JOptionPane.ERROR_MESSAGE);
- }
- }
-
-
- /**
- * @param
- */
- public static void checkResource(ResourceLink serviceOrOperationOrMethod)
- {
- if (serviceOrOperationOrMethod != null) {
- checkMonitoringStatusRoutine(serviceOrOperationOrMethod);
- }
- else {
- // for some reason resource object wasn't provided...
- JOptionPane.showMessageDialog(null, "Cannot provide monitoring status - " +
- "null reference received", "Service Catalogue Error", JOptionPane.ERROR_MESSAGE);
- }
- }
-
-
- /**
- * Used when invoked from the workflow diagram - e.g. when a URL of the specific
- * resource on BioCatalogue is not known, but have enough of identifying data
- * to proceed with health check.
- *
- * @param soapOperationDetails
- */
- public static void checkWSDLProcessor(SoapOperationIdentity soapOperationDetails)
- {
- if (!soapOperationDetails.hasError()) {
- checkMonitoringStatusRoutine(soapOperationDetails);
- }
- else {
- // this error message comes from Integration class extracting SOAP operation details from the contextual selection
- JOptionPane.showMessageDialog(null, soapOperationDetails.getErrorDetails(), "Service Catalogue Error", JOptionPane.WARNING_MESSAGE);
- }
- }
-
-
- /**
- * @param serviceOrSoapOperationToCheck Instance of SoapOperationIdentity representing Taverna processor
- * or String representing a URL of the service to check health for.
- */
- private static void checkMonitoringStatusRoutine(final Object serviceOrSoapOperationToCheck)
- {
- // helper variable to determine the kind of check to perform - the difference is minimal:
- // wording in the status messages ("Web Service" | "processor" | "REST Service") and which method to call on
- // the BioCatalogue client to fetch monitoring data
- final boolean bCheckingService = (serviceOrSoapOperationToCheck instanceof String);
- final boolean bCheckingWSDLProcessor = (serviceOrSoapOperationToCheck instanceof SoapOperationIdentity);
- final boolean bCheckingResource = (serviceOrSoapOperationToCheck instanceof ResourceLink);
-
- final StringBuilder itemToCheck = new StringBuilder();
- if (bCheckingService) {
- itemToCheck.append("service");
- }
- else if (bCheckingWSDLProcessor) {
- itemToCheck.append("WSDL service");
- }
- else if (bCheckingResource) {
- TYPE resourceType = Resource.getResourceTypeFromResourceURL(((ResourceLink)serviceOrSoapOperationToCheck).getHref());
- itemToCheck.append(resourceType.getTypeName());
- }
-
- // create the wait dialog, but don't make it visible - first need to start the background processing thread
- final JWaitDialog jwd = new JWaitDialog(MainComponent.dummyOwnerJFrame, "Checking "+itemToCheck+" status",
- "Please wait while status of selected "+itemToCheck+" is being checked...");
-
- new Thread(itemToCheck + " lookup and health check operation") {
- public void run() {
- try
- {
- BioCatalogueClient client = BioCatalogueClient.getInstance();
- Service serviceMonitoringData = null;
-
- // attempt to get monitoring data from BioCatalogue - for this need to identify what type of
- // item was provided as a parameter
- if (bCheckingService) {
- serviceMonitoringData = client.getBioCatalogueServiceMonitoringData((String)serviceOrSoapOperationToCheck);
- }
- else if (bCheckingWSDLProcessor) {
- serviceMonitoringData = client.lookupParentServiceMonitoringData((SoapOperationIdentity)serviceOrSoapOperationToCheck);
- }
- else if (bCheckingResource) {
- String resourceURL = ((ResourceLink)serviceOrSoapOperationToCheck).getHref();
- TYPE resourceType = Resource.getResourceTypeFromResourceURL(resourceURL);
-
-// if (resourceType == TYPE.Service) {
-// serviceMonitoringData = client.getBioCatalogueServiceMonitoringData(resourceURL);
-// }
-// else
- if (resourceType == TYPE.SOAPOperation) {
- String parentServiceURL = ((SoapOperation)serviceOrSoapOperationToCheck).getAncestors().getService().getHref();
- serviceMonitoringData = client.getBioCatalogueServiceMonitoringData(parentServiceURL);
- }
- else if (resourceType == TYPE.RESTMethod) {
- String parentServiceURL = ((RestMethod)serviceOrSoapOperationToCheck).getAncestors().getService().getHref();
- serviceMonitoringData = client.getBioCatalogueServiceMonitoringData(parentServiceURL);
- }
- else {
- JOptionPane.showMessageDialog(jwd, "Unexpected resource type - can't execute health check for this",
- "Service Catalogue Error", JOptionPane.ERROR_MESSAGE);
- logger.error("Service Catalogue: Could not perform health check for" + resourceType);
- }
- }
-
-
- // need to make this assignment to make the variable final - otherwise unavailable inside the new thread...
- final Service serviceWithMonitoringData = serviceMonitoringData;
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- if (serviceWithMonitoringData == null) {
- jwd.setTitle("Service Catalogue - Information");
- jwd.waitFinished(new JLabel("There is no information about this "+itemToCheck+" in the Service Catalogue",
- UIManager.getIcon("OptionPane.informationIcon"), JLabel.CENTER));
- }
- else if (serviceWithMonitoringData.getLatestMonitoringStatus() == null) {
- jwd.setTitle("Service Catalogue Warning");
- jwd.waitFinished(new JLabel("This "+itemToCheck+" is known to the Service Catalogue, but no monitoring data was available.",
- UIManager.getIcon("OptionPane.warningIcon"), JLabel.CENTER));
- }
- else
- {
- // set the overall status message
- String overallStatusLabel = "<html><b>Overall status:</b><br>" +
- serviceWithMonitoringData.getLatestMonitoringStatus().getMessage() + "<br>" +
- "(last checked";
- if (serviceWithMonitoringData.getLatestMonitoringStatus().getLastChecked() == null) {
- overallStatusLabel += ": never";
- }
- else {
- overallStatusLabel += " at " + BioCatalogueClient.getShortDateFormatter().format(
- serviceWithMonitoringData.getLatestMonitoringStatus().getLastChecked().getTime());
- }
- overallStatusLabel += ")</html>";
- JLabel jlOverallStatus = new JLabel(overallStatusLabel);
-
- // create panel for additional status messages (e.g. endpoint, wsdl location, etc)
- JPanel jpStatusMessages = new JPanel();
- jpStatusMessages.setLayout(new BoxLayout(jpStatusMessages, BoxLayout.Y_AXIS));
-
- for (ServiceTest test : serviceWithMonitoringData.getMonitoring().getTests().getServiceTestList())
- {
- // First get the service type
- String testLabel = "<html><br><b>";
- if (test.getTestType().getUrlMonitor() != null)
- {
- if (test.getTestType().getUrlMonitor().getUrl().endsWith("wsdl")) {
- // WSDL location test
- testLabel += "WSDL Location Availability:</b><br>" +
- "URL: " + test.getTestType().getUrlMonitor().getUrl();
- }
- else {
- // Endpoint availability test
- testLabel += "Endpoint Availability:</b><br>" +
- "URL: " + test.getTestType().getUrlMonitor().getUrl();
- }
- }
- else if (test.getTestType().getTestScript() != null) {
- // test script
- testLabel += "Test Script: " + test.getTestType().getTestScript().getName() + "</b>";
- }
- else {
- testLabel += "Unknown test type</b>";
- }
- testLabel += "<br>";
-
- // Add service results
- testLabel += test.getLatestStatus().getMessage() + "</html>";
-
- // Add the current test into the test messages panel
- jpStatusMessages.add(new JLabel(testLabel));
- }
-
- // either way add the overall status on top of everything
- jpStatusMessages.add(jlOverallStatus, 0);
- jpStatusMessages.setBorder(new EmptyBorder(10,10,10,10));
- JScrollPane jspStatusMessages = new JScrollPane(jpStatusMessages);
- jspStatusMessages.setBorder(BorderFactory.createEmptyBorder());
-
- // *** Put everything together ***
- JPanel jpHealthCheckStatus = new JPanel(new BorderLayout(15, 10));
- jpHealthCheckStatus.add(new JLabel(ServiceMonitoringStatusInterpreter.getStatusIcon(serviceWithMonitoringData, false)),
- BorderLayout.WEST);
- jpHealthCheckStatus.add(jspStatusMessages, BorderLayout.CENTER);
-
- jwd.setTitle("Service Catalogue - Monitoring Status");
- jwd.waitFinished(jpHealthCheckStatus);
- }
- }
- });
- }
- catch (Exception e) {
- logger.error("Service Catalogue: Error occurred while checking status of selected", e);
- jwd.setTitle("Service Catalogue - Error");
- jwd.waitFinished(new JLabel("<html>An unexpected error occurred while checking status of selected " +
- itemToCheck + "<br>Please see error log for details...",
- UIManager.getIcon("OptionPane.errorIcon"), JLabel.CENTER));
- }
- }
- }.start();
-
- jwd.setVisible(true);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/ServiceMonitoringStatusInterpreter.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/ServiceMonitoringStatusInterpreter.java
deleted file mode 100644
index 880327d..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/health_check/ServiceMonitoringStatusInterpreter.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check;
-/*
- * 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.
- */
-
-import java.net.URL;
-
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.visit.VisitReport;
-import org.apache.taverna.visit.VisitReport.Status;
-
-import org.biocatalogue.x2009.xml.rest.MonitoringStatus;
-import org.biocatalogue.x2009.xml.rest.MonitoringStatusLabel;
-import org.biocatalogue.x2009.xml.rest.Service;
-
-/**
- * @author Sergejs Aleksejevs
- */
-public class ServiceMonitoringStatusInterpreter
-{
- // prevent instantiation of this class
- private ServiceMonitoringStatusInterpreter() { /* do nothing */ }
-
-
- /**
- * @param serviceWithMonitoringData
- * @param listingIconRequired True to get a small icon suitable for a JList entry;
- * false to get a larger icon.
- * @return
- */
- public static ImageIcon getStatusIcon(Service serviceWithMonitoringData, boolean listingIconRequired)
- {
- MonitoringStatus latestMonitoringStatus = serviceWithMonitoringData.getLatestMonitoringStatus();
- if (latestMonitoringStatus == null) {
- return ResourceManager.getImageIcon((listingIconRequired ?
- ResourceManager.SERVICE_STATUS_UNCHECKED_ICON :
- ResourceManager.SERVICE_STATUS_UNCHECKED_ICON_LARGE));
- }
- MonitoringStatusLabel.Enum serviceStatusLabel = latestMonitoringStatus.getLabel();
-
- switch (serviceStatusLabel.intValue()) {
- case MonitoringStatusLabel.INT_PASSED:
- return ResourceManager.getImageIcon((listingIconRequired ?
- ResourceManager.SERVICE_STATUS_PASSED_ICON :
- ResourceManager.SERVICE_STATUS_PASSED_ICON_LARGE));
- case MonitoringStatusLabel.INT_WARNING:
- return ResourceManager.getImageIcon((listingIconRequired ?
- ResourceManager.SERVICE_STATUS_WARNING_ICON :
- ResourceManager.SERVICE_STATUS_WARNING_ICON_LARGE));
- case MonitoringStatusLabel.INT_FAILED:
- return ResourceManager.getImageIcon((listingIconRequired ?
- ResourceManager.SERVICE_STATUS_FAILED_ICON :
- ResourceManager.SERVICE_STATUS_FAILED_ICON_LARGE));
- case MonitoringStatusLabel.INT_UNCHECKED:
- return ResourceManager.getImageIcon((listingIconRequired ?
- ResourceManager.SERVICE_STATUS_UNCHECKED_ICON :
- ResourceManager.SERVICE_STATUS_UNCHECKED_ICON_LARGE));
- default:
- return (ResourceManager.getImageIcon(ResourceManager.SERVICE_STATUS_UNKNOWN_ICON));
- }
-
- }
-
-
- public static VisitReport.Status translateBioCatalogueStatusForTaverna(MonitoringStatusLabel.Enum monitoringStatusLabelEnum)
- {
- switch (monitoringStatusLabelEnum.intValue()) {
- case MonitoringStatusLabel.INT_PASSED: return Status.OK;
- case MonitoringStatusLabel.INT_WARNING: return Status.WARNING;
- case MonitoringStatusLabel.INT_FAILED: return Status.SEVERE;
- case MonitoringStatusLabel.INT_UNCHECKED: return Status.OK; // not really OK, but Taverna isn't interested in missing data anyway
- default: return Status.WARNING; // could be worth to pop up a warning in this case, as it may mean something has changed
- }
- }
-
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/menus/BioCatalogueContextualMenuSection.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/menus/BioCatalogueContextualMenuSection.java
deleted file mode 100644
index 5518c77..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/menus/BioCatalogueContextualMenuSection.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.menus;
-/*
- * 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.
- */
-
-import java.awt.event.ActionEvent;
-import java.net.URI;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-
-import org.apache.taverna.biocatalogue.model.ResourceManager;
-import org.apache.taverna.lang.ui.ShadedLabel;
-import org.apache.taverna.ui.menu.AbstractMenuSection;
-import org.apache.taverna.ui.menu.ContextualMenuComponent;
-import org.apache.taverna.ui.menu.ContextualSelection;
-import org.apache.taverna.ui.menu.DefaultContextualMenu;
-import org.apache.taverna.workflowmodel.Dataflow;
-import org.apache.taverna.workflowmodel.InputPort;
-import org.apache.taverna.workflowmodel.Processor;
-
-
-public class BioCatalogueContextualMenuSection extends AbstractMenuSection implements ContextualMenuComponent
-{
- // TODO - this shouldn't be here, must reference this field in AbstractMenuSection!!
- public static final String SECTION_COLOR = "sectionColor";
-
-
- public static final URI BIOCATALOGUE_MENU_SECTION_ID = URI.create("http://biocatalogue.org/2010/contextMenu/biocatalogue_section");
- private static final String SECTION_TITLE = "Service Catalogue";
-
- private ContextualSelection contextualSelection;
-
-
- public BioCatalogueContextualMenuSection() {
- super(DefaultContextualMenu.DEFAULT_CONTEXT_MENU, 100000, BIOCATALOGUE_MENU_SECTION_ID);
- }
-
- public ContextualSelection getContextualSelection() {
- return contextualSelection;
- }
-
- public void setContextualSelection(ContextualSelection contextualSelection) {
- this.contextualSelection = contextualSelection;
- }
-
- @Override
- public boolean isEnabled() {
- return super.isEnabled()
- && (getContextualSelection().getSelection() instanceof Dataflow ||
- getContextualSelection().getSelection() instanceof Processor ||
- getContextualSelection().getSelection() instanceof InputPort);
- }
-
- @SuppressWarnings("serial")
- protected Action createAction()
- {
- Action action = new AbstractAction(SECTION_TITLE, ResourceManager.getImageIcon(ResourceManager.FAVICON)) {
- public void actionPerformed(ActionEvent e) {
- }
- };
- action.putValue(SECTION_COLOR, ShadedLabel.GREEN);
- return (action);
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/menus/MenuActionInputPort.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/menus/MenuActionInputPort.java
deleted file mode 100644
index 31efc59..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/menus/MenuActionInputPort.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.menus;
-/*
- * 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.
- */
-
-import java.awt.event.ActionEvent;
-import java.net.URISyntaxException;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.JOptionPane;
-
-import org.apache.taverna.ui.menu.AbstractContextualMenuAction;
-
-import org.apache.taverna.workflowmodel.InputPort;
-
-
-/**
- * This class currently won't be used, as an entry for it was removed from
- * META-INF/services/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent
- *
- * This is because no useful action is yet available for input/output ports.
- *
- * @author Sergejs Aleksejevs
- */
-public class MenuActionInputPort extends AbstractContextualMenuAction {
-
- public MenuActionInputPort() throws URISyntaxException {
- super(BioCatalogueContextualMenuSection.BIOCATALOGUE_MENU_SECTION_ID, 15);
- }
-
- @Override
- protected Action createAction() {
- return new AbstractAction("InputPort") {
- public void actionPerformed(ActionEvent e) {
- JOptionPane.showMessageDialog(getContextualSelection().getRelativeToComponent(), "Hoho!");
- }
- };
- }
-
- @Override
- public boolean isEnabled() {
- return (super.isEnabled() && getContextualSelection().getSelection() instanceof InputPort);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/menus/MenuActionProcessorHealthCheck.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/menus/MenuActionProcessorHealthCheck.java
deleted file mode 100644
index 60ec793..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/menus/MenuActionProcessorHealthCheck.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.menus;
-/*
- * 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.
- */
-
-import java.awt.event.ActionEvent;
-import java.net.URISyntaxException;
-
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.ui.menu.AbstractContextualMenuAction;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.Integration;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.ServiceHealthChecker;
-import org.apache.taverna.workflowmodel.Processor;
-
-
-public class MenuActionProcessorHealthCheck extends AbstractContextualMenuAction {
-
- public MenuActionProcessorHealthCheck() throws URISyntaxException {
- super(BioCatalogueContextualMenuSection.BIOCATALOGUE_MENU_SECTION_ID, 20);
- }
-
- @SuppressWarnings("serial")
-@Override
- protected Action createAction()
- {
- Action action = new AbstractAction("Service Health Check") {
- public void actionPerformed(ActionEvent e) {
- SoapOperationIdentity soapOperationDetails = Integration.extractSoapOperationDetailsFromProcessorContextualSelection(getContextualSelection());
- ServiceHealthChecker.checkWSDLProcessor(soapOperationDetails);
- }
- };
- action.putValue(Action.SHORT_DESCRIPTION, "Check monitoring status of this service");
- return (action);
- }
-
- @Override
- public boolean isEnabled()
- {
- // FIXME - this will only work for SOAP processors for now..
- boolean isEnabled = super.isEnabled() && getContextualSelection().getSelection() instanceof Processor;
-
- if (isEnabled) {
- SoapOperationIdentity soapOperationDetails = Integration.extractSoapOperationDetailsFromProcessorContextualSelection(getContextualSelection());
- isEnabled = !soapOperationDetails.hasError();
- }
-
- return isEnabled;
- }
-
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/BioCatalogueRESTServiceProvider.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/BioCatalogueRESTServiceProvider.java
deleted file mode 100644
index 62800ed..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/BioCatalogueRESTServiceProvider.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel;
-/*
- * 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.
- */
-
-import java.net.URI;
-import java.util.Collections;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import org.apache.log4j.Logger;
-
-//import net.sf.taverna.t2.activities.rest.ui.servicedescription.RESTActivityIcon;
-import org.apache.taverna.servicedescriptions.AbstractConfigurableServiceProvider;
-import org.apache.taverna.servicedescriptions.impl.ServiceDescriptionRegistryImpl;
-
-/**
- * Service provider for REST service added to the Service Panel through the
- * BioCatalogue perspective.
- *
- * @author Alex Nenadic
- */
-public class BioCatalogueRESTServiceProvider extends
- AbstractConfigurableServiceProvider<RESTFromBioCatalogueServiceDescription> {
-
- public static final String PROVIDER_NAME = "Service Catalogue - selected services";
-
- private static final URI providerId = URI
- .create("http://taverna.sf.net/2010/service-provider/servicecatalogue/rest");
-
- private static Logger logger = Logger.getLogger(BioCatalogueRESTServiceProvider.class);
-
- public BioCatalogueRESTServiceProvider(
- RESTFromBioCatalogueServiceDescription restServiceDescription) {
- super(restServiceDescription);
- }
-
- public BioCatalogueRESTServiceProvider() {
- super(new RESTFromBioCatalogueServiceDescription());
- }
-
- @Override
- protected List<? extends Object> getIdentifyingData() {
- return getConfiguration().getIdentifyingData();
- }
-
- @Override
- public void findServiceDescriptionsAsync(
- FindServiceDescriptionsCallBack callBack) {
- callBack.status("Starting Service Catalogue REST Service Provider");
- registerNewRESTMethod(getConfiguration(), callBack);
- }
-
- @Override
- public Icon getIcon() {
-// return RESTActivityIcon.getRESTActivityIcon();
- return getConfiguration().getIcon();
- }
-
- @Override
- public String getId() {
- return providerId.toString();
- }
-
- @Override
- public String getName() {
- return "Service Catalogue REST";
- }
-
- @Override
- public String toString() {
- return "Service Catalogue REST service " + getConfiguration().getName();
- }
-
- public static boolean registerNewRESTMethod(
- RESTFromBioCatalogueServiceDescription restServiceDescription,
- FindServiceDescriptionsCallBack callBack) {
- if (callBack == null) {
- // We are not adding service through a callback and
- // findServiceDescriptionsAsync() -
- // we are adding directly from the BioCatalogue perspective.
- ServiceDescriptionRegistryImpl serviceDescriptionRegistry = ServiceDescriptionRegistryImpl
- .getInstance();
- serviceDescriptionRegistry
- .addServiceDescriptionProvider(new BioCatalogueRESTServiceProvider(
- restServiceDescription));
- return true;
- } else {
- {
- // Add the REST method to the Service Panel through the callback
- callBack.partialResults(Collections
- .singletonList(restServiceDescription));
- callBack.finished();
- return (true);
- }
- }
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/BioCatalogueServiceProvider.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/BioCatalogueServiceProvider.java
deleted file mode 100644
index d57f978..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/BioCatalogueServiceProvider.java
+++ /dev/null
@@ -1,290 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel;
-/*
- * 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.
- */
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.wsdl.Operation;
-import javax.wsdl.WSDLException;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.SAXException;
-
-import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.io.xml.DomDriver;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.biocatalogue.model.Util;
-import org.apache.taverna.activities.wsdl.WSDLActivityHealthChecker;
-import org.apache.taverna.servicedescriptions.ServiceDescription;
-import org.apache.taverna.servicedescriptions.ServiceDescriptionProvider;
-import org.apache.taverna.ui.perspectives.biocatalogue.BioCataloguePerspective;
-import org.apache.taverna.ui.perspectives.biocatalogue.integration.config.BioCataloguePluginConfiguration;
-import org.apache.taverna.wsdl.parser.UnknownOperationException;
-import org.apache.taverna.wsdl.parser.WSDLParser;
-
-public class BioCatalogueServiceProvider implements ServiceDescriptionProvider
-{
- public static final String PROVIDER_NAME = "Service Catalogue - selected services";
-
- private static BioCatalogueServiceProvider instanceOfSelf = null;
- private static FindServiceDescriptionsCallBack callBack;
-
- private static List<SoapOperationIdentity> registeredSOAPOperations;
- private static List<RESTFromBioCatalogueServiceDescription> registeredRESTMethods;
-
- private static Logger logger = Logger.getLogger(BioCatalogueServiceProvider.class);
-
-
- public BioCatalogueServiceProvider() {
- BioCatalogueServiceProvider.instanceOfSelf = this;
- }
-
- @SuppressWarnings("unchecked")
- public void findServiceDescriptionsAsync(FindServiceDescriptionsCallBack callBack)
- {
- BioCatalogueServiceProvider.callBack = callBack;
- callBack.status("Starting Service Catalogue Service Provider");
-
- // --- Initilise the service provider with stored services ---
-
- // read stored settings
- // NB! it's crucial to set the custom classloader, otherwise XStream would fail,
- // as it would attempt to use the default one, which wouldn't know about the
- // plugin's classes
- logger.info("Starting to deserialise the list of services stored in the configuration file");
- XStream xstream = new XStream(new DomDriver());
- xstream.setClassLoader(BioCataloguePerspective.class.getClassLoader());
-
- BioCataloguePluginConfiguration configuration = BioCataloguePluginConfiguration.getInstance();
-
- // *** load stored SOAP operations ***
- String loadedSOAPServicesXMLString = configuration.getProperty(BioCataloguePluginConfiguration.SOAP_OPERATIONS_IN_SERVICE_PANEL);
-
- Object loadedSOAPServices = (loadedSOAPServicesXMLString == null ?
- null :
- xstream.fromXML(loadedSOAPServicesXMLString));
-
- registeredSOAPOperations = (loadedSOAPServices == null || !(loadedSOAPServices instanceof List<?>) ?
- new ArrayList<SoapOperationIdentity>() :
- (List<SoapOperationIdentity>)loadedSOAPServices
- );
- logger.info("Deserialised " + registeredSOAPOperations.size() + Util.pluraliseNoun("SOAP operation", registeredSOAPOperations.size()));
-
- // prepare the correct format of data for initialisation
- List<ServiceDescription> results = new ArrayList<ServiceDescription>();
- for (SoapOperationIdentity opId : registeredSOAPOperations) {
- results.add(new WSDLOperationFromBioCatalogueServiceDescription(opId));
- }
-
-
- // *** load stored REST methods ***
- String loadedRESTMethodsXMLString = configuration.getProperty(BioCataloguePluginConfiguration.REST_METHODS_IN_SERVICE_PANEL);
-
- Object loadedRESTMethods = (loadedRESTMethodsXMLString == null ?
- null :
- xstream.fromXML(loadedRESTMethodsXMLString));
-
- registeredRESTMethods = (loadedRESTMethods == null || !(loadedRESTMethods instanceof List<?>) ?
- new ArrayList<RESTFromBioCatalogueServiceDescription>() :
- (List<RESTFromBioCatalogueServiceDescription>)loadedRESTMethods);
- logger.info("Deserialised " + registeredRESTMethods.size() + Util.pluraliseNoun("REST method", registeredRESTMethods.size()));
-
- results.addAll(registeredRESTMethods);
-
-
- // *** send the services to the Service Panel ***
- callBack.partialResults(results);
-
-
- // NB! This is to be called when it is known that no more items will be added -
- // it's never true for this provider, as items may be added on user request
- // at any time!
- //
- // callBack.finished();
- }
-
- public Icon getIcon() {
- return null;
- }
-
- public String getName(){
- // TODO - not sure where this is used
- return "My dummy service";
- }
-
- public String getId() {
- return "http://www.taverna.org.uk/2010/services/servicecatalogue";
- }
-
-
- /**
- * Adds a new "processor" - i.e. a WSDL operation into the main Service Panel.
- *
- * @param wsdlLocation URL of the WSDL location of the operation to add.
- * @param operationName Name of the operation within specified WSDL document.
- * @return True if the operation was added;
- * false if the service provided was not yet initiliased (unlikely) or
- * when supplied strings were empty/null.
- */
- public static boolean registerNewWSDLOperation(SoapOperationIdentity soapOperationDetails)
- {
- if (BioCatalogueServiceProvider.instanceOfSelf == null || soapOperationDetails == null ||
- soapOperationDetails.getWsdlLocation() == null || soapOperationDetails.getWsdlLocation().length() == 0 ||
- soapOperationDetails.getOperationName() == null || soapOperationDetails.getOperationName().length() == 0)
- {
- // the service provider hasn't been initialised yet
- // OR not all details available
- return (false);
- }
- else
- {
- // record the newly added operation in the internal list
- registeredSOAPOperations.add(soapOperationDetails);
-
- // add the provided operation to the Service Panel
- ServiceDescription service = new WSDLOperationFromBioCatalogueServiceDescription(soapOperationDetails);
- BioCatalogueServiceProvider.callBack.partialResults(Collections.singletonList(service));
- return (true);
- }
-
- }
-
- /**
- * Adds a SOAP/WSDL service and all of its operations into the Taverna's Service Panel.
- */
- public static boolean registerNewWSDLService(String wsdlURL)
- {
- if (BioCatalogueServiceProvider.instanceOfSelf == null || wsdlURL == null)
- {
- // the service provider hasn't been initialised yet
- // OR not all details available
- return (false);
- }
- else
- {
- // Do the same thing as in the WSDL service provider
- callBack.status("Service Catalogue service provider: Parsing wsdl: " + wsdlURL);
- WSDLParser parser = null;
- try {
- parser = new WSDLParser(wsdlURL);
- List<Operation> operations = parser.getOperations();
- callBack.status("Found " + operations.size() + " WSDL operations of service "
- + wsdlURL);
- List<WSDLOperationFromBioCatalogueServiceDescription> items = new ArrayList<WSDLOperationFromBioCatalogueServiceDescription>();
- for (Operation operation : operations) {
- WSDLOperationFromBioCatalogueServiceDescription item;
- try {
- String operationName = operation.getName();
- String operationDesc = parser.getOperationDocumentation(operationName);
- String use = parser.getUse(operationName);
- String style = parser.getStyle();
- if (!WSDLActivityHealthChecker.checkStyleAndUse(style, use)) {
- logger.warn("Unsupported style and use combination " + style + "/" + use + " for operation " + operationName + " from " + wsdlURL);
- continue;
- }
- item = new WSDLOperationFromBioCatalogueServiceDescription(wsdlURL, operationName, operationDesc);
- items.add(item);
-
- // Record the newly added operation in the internal list
- SoapOperationIdentity soapOperationDetails = new SoapOperationIdentity(wsdlURL, operationName, operationDesc);
- registeredSOAPOperations.add(soapOperationDetails);
- } catch (UnknownOperationException e) {
- String message = "Encountered an unexpected operation name:"
- + operation.getName();
- callBack.fail(message, e);
- return false;
- }
- }
- callBack.partialResults(items);
- callBack.finished();
- return true;
- } catch (ParserConfigurationException e) {
- String message = "Error configuring the WSDL parser";
- callBack.fail(message, e);
- return false;
- } catch (WSDLException e) {
- String message = "There was an error with the wsdl: " + wsdlURL;
- callBack.fail(message, e);
- return false;
- } catch (IOException e) {
- String message = "There was an IO error parsing the wsdl: " + wsdlURL
- + " Possible reason: the wsdl location was incorrect.";
- callBack.fail(message, e);
- return false;
- } catch (SAXException e) {
- String message = "There was an error with the XML in the wsdl: "
- + wsdlURL;
- callBack.fail(message, e);
- return false;
- } catch (IllegalArgumentException e) { // a problem with the wsdl url
- String message = "There was an error with the wsdl: " + wsdlURL + " "
- + "Possible reason: the wsdl location was incorrect.";
- callBack.fail(message, e);
- return false;
- } catch (Exception e) { // anything else we did not expect
- String message = "There was an error with the wsdl: " + wsdlURL;
- callBack.fail(message, e);
- return false;
- }
- }
-
- }
-
-
- public static boolean registerNewRESTMethod(RESTFromBioCatalogueServiceDescription restServiceDescription)
- {
- if (restServiceDescription == null) {
- return (false);
- }
- else
- {
- // record the newly added method in the internal list
- registeredRESTMethods.add(restServiceDescription);
-
- // add the provided method to the Service Panel
- BioCatalogueServiceProvider.callBack.partialResults(Collections.singletonList(restServiceDescription));
- return (true);
- }
- }
-
-
- public static List<SoapOperationIdentity> getRegisteredSOAPOperations() {
- return (registeredSOAPOperations);
- }
-
- public static List<RESTFromBioCatalogueServiceDescription> getRegisteredRESTMethods() {
- return (registeredRESTMethods);
- }
-
-
- /**
- * Clears internal lists of stored SOAP operations / REST methods.
- * Therefore, once Taverna is restarted, the stored services will
- * be effectively "forgotten".
- */
- public static void clearRegisteredServices() {
- registeredRESTMethods.clear();
- registeredSOAPOperations.clear();
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/BioCatalogueWSDLOperationServiceProvider.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/BioCatalogueWSDLOperationServiceProvider.java
deleted file mode 100644
index fed906c..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/BioCatalogueWSDLOperationServiceProvider.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel;
-/*
- * 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.
- */
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.wsdl.Operation;
-import javax.wsdl.WSDLException;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.log4j.Logger;
-import org.xml.sax.SAXException;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.activities.wsdl.WSDLActivityHealthChecker;
-import org.apache.taverna.servicedescriptions.AbstractConfigurableServiceProvider;
-import org.apache.taverna.servicedescriptions.impl.ServiceDescriptionRegistryImpl;
-import org.apache.taverna.wsdl.parser.UnknownOperationException;
-import org.apache.taverna.wsdl.parser.WSDLParser;
-
-/**
- * Service provider for WSDL operations added to the Service Panel through the
- * BioCatalogue perspective.
- *
- * @author Alex Nenadic
- */
-public class BioCatalogueWSDLOperationServiceProvider extends
- AbstractConfigurableServiceProvider<WSDLOperationFromBioCatalogueServiceDescription> {
-
- public BioCatalogueWSDLOperationServiceProvider(
- WSDLOperationFromBioCatalogueServiceDescription wsdlOperationDescription) {
- super(wsdlOperationDescription);
- }
-
- public BioCatalogueWSDLOperationServiceProvider() {
- super(new WSDLOperationFromBioCatalogueServiceDescription(new SoapOperationIdentity("", "", "")));
- }
-
- public static final String PROVIDER_NAME = "Service Catalogue - selected services";
-
- private static final URI providerId = URI
- .create("http://taverna.sf.net/2010/service-provider/servicecatalogue/wsdl");
-
- private static Logger logger = Logger.getLogger(BioCatalogueWSDLOperationServiceProvider.class);
-
- @Override
- protected List<? extends Object> getIdentifyingData() {
- return getConfiguration().getIdentifyingData();
- }
-
- @Override
- public void findServiceDescriptionsAsync(
- FindServiceDescriptionsCallBack callBack) {
- callBack.status("Starting Service Catalogue WSDL Service Provider");
- registerWSDLOperation(getConfiguration(), callBack);
- }
-
- @Override
- public Icon getIcon() {
- return getConfiguration().getIcon();
- }
-
- @Override
- public String getId() {
- return providerId.toString();
- }
-
- @Override
- public String getName() {
- return "Service Catalogue WSDL";
- }
-
- @Override
- public String toString() {
- return "Service Catalogue WSDL service " + getConfiguration().getName();
- }
-
- public static boolean registerWSDLOperation(
- WSDLOperationFromBioCatalogueServiceDescription wsdlOperationDescription,
- FindServiceDescriptionsCallBack callBack) {
-
- if (callBack == null) {
- // We are not adding service through Taverna service registry's callback and
- // findServiceDescriptionsAsync() -
- // we are adding directly from the BioCatalogue perspective.
- ServiceDescriptionRegistryImpl serviceDescriptionRegistry = ServiceDescriptionRegistryImpl
- .getInstance();
- serviceDescriptionRegistry
- .addServiceDescriptionProvider(new BioCatalogueWSDLOperationServiceProvider(
- wsdlOperationDescription));
- return true;
- } else {
- // Add the WSDL operation to the Service Panel through the callback
- callBack.partialResults(Collections
- .singletonList(wsdlOperationDescription));
- callBack.finished();
- return (true);
- }
- }
-
- /**
- * Adds a SOAP/WSDL service and all of its operations into the Taverna's Service Panel.
- */
- public static boolean registerWSDLService(String wsdlURL, FindServiceDescriptionsCallBack callBack)
- {
- String errorMessage = null;
- Exception ex = null;
-
- List<Operation> operations = null;
- List<WSDLOperationFromBioCatalogueServiceDescription> items = null;
-
- // Do the same thing as in the WSDL service provider
- WSDLParser parser = null;
- try {
- parser = new WSDLParser(wsdlURL);
- operations = parser.getOperations();
- items = new ArrayList<WSDLOperationFromBioCatalogueServiceDescription>();
- for (Operation operation : operations) {
- WSDLOperationFromBioCatalogueServiceDescription item;
- try {
- String operationName = operation.getName();
- String operationDesc = parser.getOperationDocumentation(operationName);
- String use = parser.getUse(operationName);
- String style = parser.getStyle();
- if (!WSDLActivityHealthChecker.checkStyleAndUse(style, use)) {
- logger.warn("Unsupported style and use combination " + style + "/" + use + " for operation " + operationName + " from " + wsdlURL);
- continue;
- }
- item = new WSDLOperationFromBioCatalogueServiceDescription(wsdlURL, operationName, operationDesc);
- items.add(item);
- } catch (UnknownOperationException e) {
- errorMessage = "Encountered an unexpected operation name:"
- + operation.getName();
- ex = e;
- }
- }
- } catch (ParserConfigurationException e) {
- errorMessage = "Error configuring the WSDL parser";
- ex = e;
- } catch (WSDLException e) {
- errorMessage = "There was an error with the wsdl: " + wsdlURL;
- ex = e;
- } catch (IOException e) {
- errorMessage = "There was an IO error parsing the wsdl: " + wsdlURL
- + " Possible reason: the wsdl location was incorrect.";
- ex = e;
- } catch (SAXException e) {
- errorMessage = "There was an error with the XML in the wsdl: "
- + wsdlURL;
- ex = e;
- } catch (IllegalArgumentException e) { // a problem with the wsdl url
- errorMessage = "There was an error with the wsdl: " + wsdlURL + " "
- + "Possible reason: the wsdl location was incorrect.";
- ex = e;
- } catch (Exception e) { // anything else we did not expect
- errorMessage = "There was an error with the wsdl: " + wsdlURL;
- ex = e;
- }
-
- if (callBack == null) {
- if (errorMessage != null){
- logger.error(errorMessage, ex);
- return false;
- }
- else{
- // We are not adding service through Taverna service registry's callback and
- // findServiceDescriptionsAsync() -
- // we are adding directly from the BioCatalogue perspective.
- ServiceDescriptionRegistryImpl serviceDescriptionRegistry = ServiceDescriptionRegistryImpl
- .getInstance();
- for (WSDLOperationFromBioCatalogueServiceDescription item : items) {
- serviceDescriptionRegistry
- .addServiceDescriptionProvider(new BioCatalogueWSDLOperationServiceProvider(
- item));
- }
- return true;
- }
- } else {
- if (errorMessage != null){
- callBack.fail(errorMessage, ex);
- return false;
- }
- else{
- callBack.status("Found " + operations.size() + " WSDL operations of service "
- + wsdlURL);
- callBack.partialResults(items);
- callBack.finished();
- return true;
- }
- }
- }
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/RESTFromBioCatalogueServiceDescription.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/RESTFromBioCatalogueServiceDescription.java
deleted file mode 100644
index bed6d02..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/RESTFromBioCatalogueServiceDescription.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel;
-/*
- * 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.
- */
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import org.apache.taverna.lang.beans.PropertyAnnotation;
-import org.apache.taverna.servicedescriptions.ServiceDescription;
-import org.apache.taverna.workflowmodel.processor.activity.Activity;
-
-import org.apache.taverna.activities.rest.RESTActivity;
-import org.apache.taverna.activities.rest.RESTActivity.DATA_FORMAT;
-import org.apache.taverna.activities.rest.RESTActivity.HTTP_METHOD;
-import org.apache.taverna.activities.rest.RESTActivityConfigurationBean;
-import org.apache.taverna.activities.rest.ui.servicedescription.RESTActivityIcon;
-
-/**
- * This class is solely intended to support import of REST services from BioCatalogue.
- *
- * @author Sergejs Aleksejevs
- */
-public class RESTFromBioCatalogueServiceDescription extends ServiceDescription<RESTActivityConfigurationBean>
-{
- private static final int SHORT_DESCRIPTION_MAX_LENGTH = 200;
-
- private static final String FULL_DESCRIPTION = "Full description";
-
- public static final int AMBIGUOUS_ACCEPT_HEADER_VALUE = 100;
- public static final int DEFAULT_ACCEPT_HEADER_VALUE = 110;
- public static final int AMBIGUOUS_CONTENT_TYPE_HEADER_VALUE = 200;
- public static final int DEFAULT_CONTENT_TYPE_HEADER_VALUE = 210;
-
-
- private RESTActivityConfigurationBean serviceConfigBean;
- private String serviceName;
- private String description;
-
- private List<Integer> dataWarnings;
-
-
- /**
- * Constructor instantiates config bean and pre-populates
- * it with default values.
- */
- public RESTFromBioCatalogueServiceDescription()
- {
- // apply default name in case it won't be set manually later
- this.serviceName = "REST Service";
- this.serviceConfigBean = RESTActivityConfigurationBean.getDefaultInstance();
- this.dataWarnings = new ArrayList<Integer>();
- }
-
- /**
- * The subclass of Activity which should be instantiated when adding a service
- * for this description.
- */
- @Override
- public Class<? extends Activity<RESTActivityConfigurationBean>> getActivityClass() {
- return RESTActivity.class;
- }
-
- /**
- * The configuration bean which is to be used for configuring the instantiated activity.
- *
- * Values are to be set through individual setters provided in this class.
- */
- @Override
- public RESTActivityConfigurationBean getActivityConfiguration() {
- return serviceConfigBean;
- }
-
- /**
- * An icon to represent this service type in the service palette.
- */
- @Override
- public Icon getIcon() {
- return RESTActivityIcon.getRESTActivityIcon();
- }
-
- /**
- * The display name that will be shown in service palette and will
- * be used as a template for processor name when added to workflow.
- */
- @Override
- public String getName() {
- return serviceName;
- }
-
-
- /**
- * Truncates the description if necessary to {@link WSDLOperationFromBioCatalogueServiceDescription#SHORT_DESCRIPTION_MAX_LENGTH} --
- * to get full description, use {@link WSDLOperationFromBioCatalogueServiceDescription#getFullDescription()}
- */
- public String getDescription() {
- if (this.description != null && this.description.length() > SHORT_DESCRIPTION_MAX_LENGTH) {
- return (this.description.substring(0, SHORT_DESCRIPTION_MAX_LENGTH) + "(...)");
- }
- else {
- return this.description;
- }
- }
-
- @PropertyAnnotation(displayName = FULL_DESCRIPTION)
- public String getFullDescription() {
- return this.description;
- }
-
-
- /**
- * The path to this service description in the service palette. Folders
- * will be created for each element of the returned path.
- *
- * (Shouldn't really be ever used, as instances of different type are
- * added into the Service Panel).
- */
- @Override
- public List<String> getPath() {
- // For deeper paths you may return several strings
- return Arrays.asList(BioCatalogueRESTServiceProvider.PROVIDER_NAME, "REST @ " + serviceConfigBean.getUrlSignature());
- }
-
- /**
- * Return a list of data values uniquely identifying this service
- * description (to avoid duplicates). Include only primary key like fields,
- * ie. ignore descriptions, icons, etc.
- */
- @Override
- protected List<? extends Object> getIdentifyingData() {
- return Arrays.<Object>asList(serviceConfigBean.getUrlSignature(), serviceConfigBean.getHttpMethod());
- }
-
-
- public List<Integer> getDataWarnings() {
- return dataWarnings;
- }
-
-
- public void setURLSignature(String urlSignature) {
- this.serviceConfigBean.setUrlSignature(urlSignature);
- }
-
-
- public void setHttpMethod(HTTP_METHOD httpMethod) {
- this.serviceConfigBean.setHttpMethod(httpMethod);
- }
-
-
- public void setAcceptHeaderValue(String acceptHeaderValue) {
- this.serviceConfigBean.setAcceptsHeaderValue(acceptHeaderValue);
- }
-
-
- public void setOutgoingContentType(String outgoingContentType)
- {
- this.serviceConfigBean.setUrlSignature(outgoingContentType);
-
- // automatically infer data format - string/binary from the content type
- if (outgoingContentType.startsWith("text")) { this.serviceConfigBean.setOutgoingDataFormat(DATA_FORMAT.String); }
- else { this.serviceConfigBean.setOutgoingDataFormat(DATA_FORMAT.Binary); }
- }
-
-
- public void setServiceName(String name) {
- this.serviceName = name;
- }
-
-
- public void setDescription(String description) {
- this.description = description;
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/WSDLOperationFromBioCatalogueServiceDescription.java b/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/WSDLOperationFromBioCatalogueServiceDescription.java
deleted file mode 100644
index f070145..0000000
--- a/taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/ui/perspectives/biocatalogue/integration/service_panel/WSDLOperationFromBioCatalogueServiceDescription.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel;
-/*
- * 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.
- */
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import org.apache.taverna.biocatalogue.model.SoapOperationIdentity;
-import org.apache.taverna.activities.wsdl.WSDLActivity;
-import org.apache.taverna.activities.wsdl.WSDLActivityConfigurationBean;
-import org.apache.taverna.activities.wsdl.servicedescriptions.WSDLActivityIcon;
-import org.apache.taverna.lang.beans.PropertyAnnotation;
-import org.apache.taverna.servicedescriptions.ServiceDescription;
-
-public class WSDLOperationFromBioCatalogueServiceDescription extends ServiceDescription<WSDLActivityConfigurationBean>
-{
- private static final int SHORT_DESCRIPTION_MAX_LENGTH = 200;
-
- private static final String FULL_DESCRIPTION = "Full description";
-
-
- private final String wsdlLocation;
- private final String operationName;
- private final String description;
-
-
- public WSDLOperationFromBioCatalogueServiceDescription(String wsdlLocation, String operationName, String description)
- {
- this.wsdlLocation = wsdlLocation;
- this.operationName = operationName;
- this.description = description;
- }
-
- public WSDLOperationFromBioCatalogueServiceDescription(SoapOperationIdentity soapOpearationIdentity)
- {
- this.wsdlLocation = soapOpearationIdentity.getWsdlLocation();
- this.operationName = soapOpearationIdentity.getOperationName();
- this.description = soapOpearationIdentity.getDescription();
- }
-
-
- @Override
- public Class getActivityClass() {
- return WSDLActivity.class;
- }
-
- @Override
- public WSDLActivityConfigurationBean getActivityConfiguration() {
- WSDLActivityConfigurationBean bean = new WSDLActivityConfigurationBean();
- bean.setOperation(operationName);
- bean.setWsdl(wsdlLocation);
- return bean;
- }
-
- @Override
- public Icon getIcon() {
- return WSDLActivityIcon.getWSDLIcon();
- }
-
- @Override
- public String getName() {
- return (this.operationName);
- }
-
- /**
- * Truncates the description if necessary to {@link WSDLOperationFromBioCatalogueServiceDescription#SHORT_DESCRIPTION_MAX_LENGTH} --
- * to get full description, use {@link WSDLOperationFromBioCatalogueServiceDescription#getFullDescription()}
- */
- public String getDescription() {
- if (this.description != null && this.description.length() > SHORT_DESCRIPTION_MAX_LENGTH) {
- return (this.description.substring(0, SHORT_DESCRIPTION_MAX_LENGTH) + "(...)");
- }
- else {
- return this.description;
- }
- }
-
- @PropertyAnnotation(displayName = FULL_DESCRIPTION)
- public String getFullDescription() {
- return this.description;
- }
-
- @Override
- public List<String> getPath() {
- return Arrays.asList(BioCatalogueWSDLOperationServiceProvider.PROVIDER_NAME, "WSDL @ " + this.wsdlLocation);
- }
-
- @Override
- protected List<? extends Object> getIdentifyingData()
- {
- // This is important - Taverna won't add identical operations
- // into the Service Panel. These tokens distinguish added items.
- return Arrays.asList(wsdlLocation, operationName);
- }
-
-}
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider
deleted file mode 100644
index 0124d85..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider
+++ /dev/null
@@ -1,2 +0,0 @@
-org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel.BioCatalogueWSDLOperationServiceProvider
-org.apache.taverna.ui.perspectives.biocatalogue.integration.service_panel.BioCatalogueRESTServiceProvider
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent
deleted file mode 100644
index 0fb60ee..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent
+++ /dev/null
@@ -1,2 +0,0 @@
-org.apache.taverna.ui.perspectives.biocatalogue.integration.menus.BioCatalogueContextualMenuSection
-org.apache.taverna.ui.perspectives.biocatalogue.integration.menus.MenuActionProcessorHealthCheck
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ShutdownSPI b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ShutdownSPI
deleted file mode 100644
index 186ece0..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ShutdownSPI
+++ /dev/null
@@ -1 +0,0 @@
-#org.apache.taverna.ui.perspectives.biocatalogue.MainComponentShutdownHook
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.configuration.ConfigurationUIFactory b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.configuration.ConfigurationUIFactory
deleted file mode 100644
index 88115ce..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.configuration.ConfigurationUIFactory
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.taverna.ui.perspectives.biocatalogue.integration.config.BioCataloguePluginConfigurationUIFactory
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.report.explainer.VisitExplainer b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.report.explainer.VisitExplainer
deleted file mode 100644
index ad7eccb..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.report.explainer.VisitExplainer
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.BioCatalogueWSDLActivityHealthCheckVisitExplainer
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory
deleted file mode 100644
index 78481bf..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory
+++ /dev/null
@@ -1,3 +0,0 @@
-org.apache.taverna.ui.perspectives.biocatalogue.integration.contextual_views.BioCataloguePluginProcessorContextViewFactory
-#org.apache.taverna.ui.perspectives.biocatalogue.integration.contextual_views.BioCataloguePluginInputPortContextViewFactory
-#org.apache.taverna.ui.perspectives.biocatalogue.integration.contextual_views.BioCataloguePluginOutputPortContextViewFactory
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.zaria.PerspectiveSPI b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.zaria.PerspectiveSPI
deleted file mode 100644
index be4d2b7..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.zaria.PerspectiveSPI
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.taverna.ui.perspectives.biocatalogue.BioCataloguePerspective
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.zaria.UIComponentFactorySPI b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.zaria.UIComponentFactorySPI
deleted file mode 100644
index fe3b8b6..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.zaria.UIComponentFactorySPI
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.taverna.ui.perspectives.biocatalogue.MainComponentFactory
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.zaria.UIComponentSPI b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.zaria.UIComponentSPI
deleted file mode 100644
index 471d95d..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workbench.ui.zaria.UIComponentSPI
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.taverna.ui.perspectives.biocatalogue.MainComponent
diff --git a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker b/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
deleted file mode 100644
index 0fa1923..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/META-INF/services/net.sf.taverna.t2.workflowmodel.health.HealthChecker
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.taverna.ui.perspectives.biocatalogue.integration.health_check.BioCatalogueWSDLActivityHealthChecker
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-grey-bert2-still.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-grey-bert2-still.png
deleted file mode 100644
index 12abdf6..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-grey-bert2-still.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-grey-bert2.gif b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-grey-bert2.gif
deleted file mode 100644
index c4793ec..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-grey-bert2.gif
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-orange-bert2-still.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-orange-bert2-still.png
deleted file mode 100644
index 9b6784e..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-orange-bert2-still.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-orange-bert2.gif b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-orange-bert2.gif
deleted file mode 100644
index c6745b9..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-orange-bert2.gif
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-still.gif b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-still.gif
deleted file mode 100644
index b100470..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader-still.gif
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader.gif b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader.gif
deleted file mode 100644
index 078b55f..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/ajax-loader.gif
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/biocatalogue-perspective.xml b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/biocatalogue-perspective.xml
deleted file mode 100644
index 1aeb7c7..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/biocatalogue-perspective.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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.
-
--->
-<basepane>
- <child>
- <znode classname="net.sf.taverna.zaria.ZRavenComponent">
- <component scroll="false">
- <raven>
- <group>net.sf.taverna.t2.ui-exts</group>
- <artifact>perspective-biocatalogue</artifact>
- </raven>
- <classname>
- net.sf.taverna.t2.ui.perspectives.biocatalogue.MainComponentFactory
- </classname>
- <interface>
- net.sf.taverna.t2.workbench.ui.zaria.UIComponentFactorySPI
- </interface>
- </component>
- </znode>
- </child>
- <namedcomponents />
-</basepane>
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/biocatalogue_styles.css b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/biocatalogue_styles.css
deleted file mode 100644
index 3f7246a..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/biocatalogue_styles.css
+++ /dev/null
@@ -1,2673 +0,0 @@
-@charset "utf-8";
-/**
- * BioCatalogue: app/public/stylesheets/styles.css
- *
- * Copyright (c) 2009, University of Manchester, The European Bioinformatics
- * Institute (EMBL-EBI) and the University of Southampton.
- * See license.txt for details
- */
-
-/* CSS Document */
-
-/**
- * NOTE: this relies on the Yahoo IU reset-fonts CSS to normalise styles for HTML elements and fonts
- * ALl font sizes MUST be specified in %ages as per the table here: http://developer.yahoo.com/yui/fonts/
- */
-
-/*
-** Markup free clearing
-** Details: http://www.positioniseverything.net/easyclearing.html
-*/
-.clear-block:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
-}
-
-.clear-block {
- display: inline-block;
-}
-
-/* Hides from IE-mac \*/
-* html .clear-block {
- height: 1%;
-}
-.clear-block {
- display: block;
-}
-/* End hide from IE-mac */
-
-
-
-/**
- *
- * This css is a variation of the Garland theme, for Drupal 5.0
- *
- * Credits to:
- * Stefan Nagtegaal, iStyledThis [dot] nl
- * Steven Wittens, acko [dot] net`
- *
- */
-
-/**
- * Generic elements
- */
-
-html {
- background-color: #e9f7cc;
-}
-
-body {
- margin: 0;
- padding: 0;
- background-color: #e9f7cc;
- font-family: arial;
- color: #333333;
- min-width: 950px;
-}
-
-p {
- font-family: arial;
- margin: 1em 0;
- padding: 0;
- line-height: 1.5;
-}
-
-input {
- color: #333333;
- vertical-align: middle;
-}
-
-textarea, select {
- color: #333333;
-}
-
-h1, h2, h3, h4, h5, h6 {
- margin: 0;
- padding: 0;
- font-weight: bold;
- font-family: arial;
- line-height: 1.5;
- color: #333333;
-}
-
-h1 {
- font-size: 153.9%;
- color: #000033;
- margin: 0.5em 0;
-}
-
-h2 {
- font-size: 138.5%;
-}
-
-h3 {
- font-size: 123.1%;
-}
-
-h4 {
- margin: 0.5em 0;
-}
-
-h5 {
- margin: 0.8em 0 0.5em 0;
- padding-bottom: 0.3em;
- border-bottom: 1px solid #CCC;
-}
-
-h6 {
-}
-
-table {
- margin: 0;
- border-collapse: separate;
-}
-
-th,td {
- text-align: left;
- border: none;
- vertical-align: top;
-}
-
-ul, quote, code, fieldset {
- margin: 0.5em 0;
-}
-
-pre {
- background-color: #EEEEEE;
- padding: 1em;
- font-size: 85%;
-}
-
-small {
- line-height: 1.3;
- color: #555555;
-}
-
-fieldset {
- border: 1px solid #cdeb8b;
- padding: 0.3em 1.3em 0.8em 1.3em;
-}
-
-legend {
- padding: 0.3em 0.6em;
- text-align: left;
- font-weight: bold;
- margin: 0;
- margin-bottom: 0.2em;
-}
-
-strong {
- font-weight: bold;
-}
-
-em {
- font-style: italic;
-}
-
-a:link, a:visited {
- color: #333333;
- text-decoration: underline;
-}
-
-a:hover {
- color: #ff7400;
- text-decoration: underline;
-}
-
-a:active, a.active {
- color: #ff7400;
- text-decoration: underline;
-}
-
-a img {
- text-decoration: none;
-}
-
-hr {
- margin: 0.5em 0;
- *margin: 0;
- padding: 0;
- border: none;
- height: 1px;
- background: #5294c1;
-}
-
-ul {
- margin: 0;
- padding: 0;
-}
-
-ul li {
- margin: 0;
- padding: 0;
- line-height: 1.4;
-}
-
-img, a img {
- border: none;
-}
-
-.center {
- text-align: center;
-}
-
-.nomargin {
- margin: 0;
-}
-
-.medium_linespaced {
- line-height: 1.5;
-}
-
-.high_linespaced {
- line-height: 2.0;
-}
-
-.inline-block {
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
-}
-
-.faded {
- color: #999;
-}
-
-.faded_plus {
- color: #AAA;
-}
-
-.faded_plus_plus {
- color: #BBB;
-}
-
-.green_box {
- border: 1px dotted #999999;
- background-color: #e9f7cc;
- padding: 2px;
-}
-
-.green_highlight {
- background-color: #e9f7cc;
- padding: 3px 5px 3px 5px;
-}
-
-.orange_highlight {
- background-color: #ffbb7f;
- padding: 4px 6px 4px 6px;
-}
-
-.yellow_highlight {
- background-color: #FFC;
- padding: 3px 5px 3px 5px;
-}
-
-.standout_link {
- color: #333333;
- border: 1px solid #EED799;
- background: #FFC;
- padding: 0.3em 0.5em;
- line-height: 1.3;
-}
-
-.ago {
- margin-left: 0.2em;
- color: #666;
-}
-
-.container_middled * {
- vertical-align: middle;
-}
-
-a:link.login, a:visited.login {
- padding-left: 2px;
- padding-right: 20px;
- background: url(../images/login.gif) right no-repeat;
- white-space: nowrap;
-}
-
-a:link.signup, a:visited.signup {
- padding-left: 2px;
- padding-right: 20px;
- background: url(../images/pencil.gif) right no-repeat;
- white-space: nowrap;
-}
-
-a:link.green_arrow, a:visited.green_arrow {
- padding-left: 2px;
- padding-right: 18px;
- background: url(../images/green_arrow.gif) right no-repeat;
- white-space: nowrap;
-}
-
-a:link.red_arrow, a:visited.red_arrow {
- padding-left: 2px;
- padding-right: 18px;
- background: url(../images/red_arrow.gif) right no-repeat;
- white-space: nowrap;
-}
-
-a:link.red_arrow_left, a:visited.red_arrow_left {
- padding-right: 2px;
- padding-left: 18px;
- background: url(../images/red_arrow_left.gif) left no-repeat;
- white-space: nowrap;
-}
-
-a:link.write_email, a:visited.write_email {
- padding-left: 2px;
- padding-right: 22px;
- background: url(../images/write_email.gif) right no-repeat;
- white-space: nowrap;
-}
-
-a:link.edit_profile, a:visited.edit_profile {
- padding-right: 2px;
- padding-left: 22px;
- background: url(../images/user_edit.gif) left no-repeat;
- white-space: nowrap;
-}
-
-a:link.change_pwd, a:visited.change_pwd {
- padding-right: 2px;
- padding-left: 22px;
- background: url(../images/key.gif) left no-repeat;
- white-space: nowrap;
-}
-
-a:hover.login {
- background: url(../images/login_hover.gif) right no-repeat;
- text-decoration: underline;
-}
-
-a:hover.signup {
- background: url(../images/pencil_hover.gif) right no-repeat;
- text-decoration: underline;
-}
-
-a:hover.green_arrow {
- background: url(../images/green_arrow_hover.gif) right no-repeat;
- text-decoration: underline;
-}
-
-a:hover.red_arrow {
- background: url(../images/red_arrow_hover.gif) right no-repeat;
- text-decoration: underline;
-}
-
-a:hover.red_arrow_left {
- background: url(../images/red_arrow_left_hover.gif) left no-repeat;
- text-decoration: underline;
-}
-
-a:hover.write_email {
- background: url(../images/write_email_hover.gif) right no-repeat;
- text-decoration: underline;
-}
-
-a:hover.edit_profile {
- background: url(../images/user_edit_hover.gif) left no-repeat;
- text-decoration: underline;
-}
-
-a:hover.change_pwd {
- background: url(../images/key_hover.gif) left no-repeat;
- text-decoration: underline;
-}
-
-#error_flash .rcontainer,
-#notice_flash .rcontainer {
- padding: 0;
- margin: auto;
- margin-top: 0;
- margin-bottom: 1em;
- text-align: center;
- max-width: 800px;
- line-height: 1.3;
-}
-
-#error_flash .rcontain,
-#notice_flash .rcontain {
- padding: 0.1em 0.5em;
-}
-
-#last_search_notice {
- text-align: right;
- line-height: 1.0;
- padding: 0;
- margin: 0 1em;
-}
-
-#last_search_notice * {
- vertical-align: middle;
-}
-
-#last_search_notice_text {
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
- color: #333333;
- border: 1px solid #99CCFF;
- background-color: #EEF6FF;
- padding: 0.2em 0.4em;
-}
-
-.flash_header {
- font-weight: bold;
- font-size: 108%;
- margin-top: 5px;
- margin-bottom: 10px;
-}
-
-.flash_body {
- margin-top: 5px;
- margin-bottom: 10px;
-}
-
-/**
- * Layout
- */
-#header-region {
- height: 0.75em;
-}
-
-#wrapper {
- background: #e9f7cc url(../images/central_part_small.gif) repeat-x top center;
-}
-
-#wrapper #container {
- margin: 0 auto;
- padding: 0 20px;
- max-width: 1270px;
-}
-
-#wrapper #container #header {
- padding-top: 1.1em;
- height: 5em;
-}
-
-#wrapper #container #header #logo-floater {
- position: absolute;
- /*padding-top: 8px;*/
-}
-
-/* With 2 columns, require a minimum width of 800px. */
-body.sidebar-right {
- min-width: 850px;
-}
-
-/* We must define 100% width to avoid the body being too narrow for near-empty pages */
-#wrapper #container #center {
- float: left;
- width: 100%;
-}
-
-/* So we move the #center container over the sidebars to compensate */
-body.sidebar-right #center {
- margin-right: -210px;
-}
-
-/* And add blanks right for the sidebars to fill */
-body.sidebar-right #squeeze {
- margin-right: 210px;
-}
-
-/* We ensure the sidebars are still clickable using z-index */
-#wrapper #container .sidebar {
- margin: 60px 0 5em;
- width: 210px;
- float: left;
- z-index: 2;
- position: relative;
-}
-
-/* Now we add the backgrounds for the main content shading */
-#wrapper #container #center #squeeze {
- background: #fff url(../images/central_bar_big.png) repeat-x 50% 0;
- position: relative;
- /*min-width: 600px;*/
- min-width: 900px;
-}
-
-#wrapper #container #center .right-corner {
- background: transparent url(../images/right_corner.gif) no-repeat 100% 0;
- position: relative;
- /*left: 10px;*/
- left: 5px;
- /*border: 1px #ff0000 solid;*/
- /*min-width: 600px;*/
- min-width: 900px;
-}
-
-#wrapper #container #center .right-corner .left-corner {
- padding: 50px 25px 3em 25px;
- background: transparent url(../images/left_corner.gif) no-repeat 0 0;
- margin-left: -10px;
- position: relative;
- /*left: 1px;*/
- min-height: 400px;
-}
-
-#footer {
- float: none;
- clear: both;
- text-align: center;
- padding-top: 1em;
- padding-bottom: 1em;
- /*margin: 4em 0 -3em;*/
- /*color: #898989;*/
-}
-
-body.sidebar-right #footer {
- width: 75%;
-}
-
-#footer_links {
- float:left;
- position:relative;
- left:50%;
- text-align:left;
-}
-
-#footer_links ul {
- list-style:none;
- position:relative;
- left:-50%;
-}
-
-#footer_links ul li {
- list-style-type: none;
- list-style-image: none;
- margin: 0;
- padding: 0;
- float: left;
- position:relative;
-}
-
-#footer_links ul li.separator {
- border-left: 1px solid #333333;
-}
-
-#footer_links ul li a, #footer_links ul li a:link, #footer_links ul li a:visited {
- display: block;
- margin: 0 1em;
- color: #333333;
-}
-
-#footer_links ul li a:hover, #footer_links ul li a.active {
- color: #ff7400;
-}
-
-#footer .logos {
- margin: 1.5em 0;
- -moz-border-radius: 15px;
- -webkit-border-radius: 15px;
- border: 1px solid #DDD;
- width: 950px;
- color: #333;
- background-color: #FFF;
-}
-
-#footer .logos * {
- vertical-align: middle;
-}
-
-#footer .logos p {
- text-align: center;
-}
-
-#footer .logos a {
- margin: 0 0.8em;
-}
-
-#footer .copyright {
- text-align: center;
- font-weight: bold;
- font-size: 93%;
- margin-top: 1.5em;
-}
-
-#wrapper #container #content {
- margin-top: 2em;
-}
-
-#wrapper #container #action_bar {
- position: absolute;
- top: 10px;
- left: 30px;
- z-index: 3;
- font-size: 123.1%;
- font-weight: bolder;
- vertical-align: middle;
-}
-
-#wrapper #container #action_bar #action_links {
- padding-left: 15px;
-}
-
-#wrapper #container #action_bar #action_links * {
- vertical-align: middle;
-}
-
-#wrapper #container #action_bar #action_links a {
- padding-left: 15px;
- padding-right: 14px;
- background: transparent url(../images/green_separator.gif) no-repeat left;
- vertical-align: middle;
- text-align: center;
-}
-
-#wrapper #container #action_icons {
- position: absolute;
- top: 14px;
- right: 10px;
- z-index: 3;
- vertical-align: middle;
-}
-
-#wrapper #container #action_icons * {
- vertical-align: middle;
-}
-
-#wrapper #container #action_icons a {
- padding: 0 5px 0 10px;
- background: transparent url(../images/green_separator.gif) no-repeat left;
- vertical-align: middle;
-}
-
-#wrapper #container #action_bar img {
- vertical-align: middle;
-}
-
-body.sidebar-right #footer {
- margin-right: -210px;
-}
-
-/* BEGIN breadcrumbs */
-
-#breadcrumbs_bar {
- z-index: 3;
- font-size: 85%;
- color: #666666;
- margin: 3px -10px 0 -5px;
-}
-
-#breadcrumbs_bar table {
- width: 100%;
- padding: 0;
- margin: 0;
-}
-
-#breadcrumbs_bar td {
- text-align: left;
- margin: 0;
- padding: 0;
- vertical-align: top;
-}
-
-#breadcrumbs_bar td * {
- vertical-align: middle;
-}
-
-ul.breadcrumb_list {
- list-style: none;
- margin: 0;
- padding: 0;
- border: none;
- vertical-align: middle;
-}
-
-ul.breadcrumb_list li {
- display: inline;
-}
-
-/* END breadcrumbs */
-
-/**
- * Primary navigation
- */
-ul.primary-links {
- margin: 0;
- padding: 0;
- float: right;
- position: relative;
- z-index: 4;
- font-size: 108%;
- font-weight: bold;
-}
-
-ul.primary-links li {
- margin: 0;
- padding: 0;
- float: left;
- list-style-type: none;
- list-style-image: none;
-}
-
-ul.primary-links li.separator {
- /*background: transparent url(../images/green_separator.gif) no-repeat bottom left;*/
- border-left: 1px solid #999;
-}
-
-ul.primary-links li a, ul.primary-links li a:link, ul.primary-links li a:visited {
- display: block;
- margin: 0 1em;
- /*padding: .75em 0 0;*/
- color: #333333;
- /*background: transparent url(images/bg-navigation-item.png) no-repeat 50% 0;*/
-}
-
-ul.primary-links li a:hover, ul.primary-links li a.active {
- color: #ff7400;
- /*background: transparent url(images/bg-navigation-item-hover.png) no-repeat 50% 0;*/
-}
-
-/**
- * Secondary navigation
- */
-ul.secondary-links {
- margin: 0;
- padding: 18px 0 0;
- float: right;
- clear: right;
- position: relative;
- z-index: 4;
-}
-
-ul.secondary-links li {
- margin: 0;
- padding: 0;
- float: left;
- background-image: none;
-}
-
-ul.secondary-links li a, ul.secondary-links li a:link, ul.secondary-links li a:visited {
- display: block;
- margin: 0 1em;
- padding: .75em 0 0;
- color: #cde3f1;
- background: transparent;
-}
-
-ul.secondary-links li a:hover, ul.secondary-links li a.active {
- color: #cde3f1;
- background: transparent;
-}
-
-/**
- * Local tasks
- */
-ul.primary, ul.primary li, ul.secondary, ul.secondary li {
- border: 0;
- background: none;
- margin: 0;
- padding: 0;
-}
-
-#tabs-wrapper {
- margin: 0 -26px 1em;
- padding: 0 26px;
- border-bottom: 1px solid #e9eff3;
- position: relative;
-}
-ul.primary {
- padding: 0.5em 0 10px;
- float: left;
-}
-ul.secondary {
- clear: both;
- text-align: left;
- border-bottom: 1px solid #e9eff3;
- margin: -0.2em -26px 1em;
- padding: 0 26px 0.6em;
-}
-h2.with-tabs {
- float: left;
- margin: 0 2em 0 0;
- padding: 0;
-}
-
-ul.primary li a, ul.primary li.active a, ul.primary li a:hover, ul.primary li a:visited,
-ul.secondary li a, ul.secondary li.active a, ul.secondary li a:hover, ul.secondary li a:visited {
- border: 0;
- background: transparent;
- padding: 4px 1em;
- margin: 0 0 0 1px;
- height: auto;
- text-decoration: none;
- position: relative;
- top: -1px;
-}
-ul.primary li.active a, ul.primary li.active a:link, ul.primary li.active a:visited, ul.primary li a:hover,
-ul.secondary li.active a, ul.secondary li.active a:link, ul.secondary li.active a:visited, ul.secondary li a:hover {
- background: url(images/bg-tab.png) repeat-x 0 50%;
- color: #fff;
-}
-ul.primary li.active a,
-ul.secondary li.active a {
- font-weight: bold;
-}
-
-/**
- * CSS support
- */
-span.clear {
- display: block;
- clear: both;
- height: 1px;
- line-height: 0px;
- font-size: 0px;
- margin-bottom: -1px;
-}
-
-/* BEGIN Login box styles */
-#wrapper #container #header #login_links {
- clear: both;
- float: right;
- padding: 2.1em 0 0 0;
- margin-bottom: 0;
- position: relative;
- z-index: 4;
- color: #333;
- font-size: 93%;
-}
-
-#wrapper #container #header #login_links .sep {
- color: #999;
- margin: 0 0.4em;
-}
-
-body.sidebar-right #wrapper #container #header #login_links {
- margin-right: 210px;
-}
-
-#login_box {
- position: absolute;
- top: 3px;
- right: 3px;
- background-color: #e9f7cc;
- border: 2px solid #CCC;
- width: 320px;
- height: auto;
- margin: 0 0 auto auto;
- z-index: 4;
- padding: 7px;
-}
-
-body.sidebar-right #login_box {
- margin-right: 210px;
- top: 3px;
- right: -15.6em;
-}
-
-#login_box form {
- margin: 10px 0 1.5em 0;
-}
-
-#login_box span label {
- float: left;
- font-weight: bold;
- padding-top: 0.2em;
-}
-
-#login_box span input.small_login {
- clear: both;
- float: right;
- height: 1.4em;
- line-height: 1.4;
- width: 200px;
- /*background-color: #feffcf;*/
- margin-bottom: 5px;
-}
-
-#login_box input.small_submit_button {
- clear: both;
- float: right;
- position: relative;
- top: 5px;
- width: 80px;
-}
-
-#login_box .rpx {
- margin: 0;
- padding: 0.8em 0;
- border-top: 1px dotted #CCC;
- text-align: center;
- line-height: 1.8;
-}
-
-#login_box_other_links {
- clear: both;
- font-size: 93%;
- width: 100%;
- padding-top: 1.2em;
- border-top: 1px dotted #CCC;
- text-align: right;
-}
-
-#login_box_other_links li {
- margin-bottom: 0.7em;
-}
-
-/* END Login box styles */
-
-/* BEGIN sidebar box styles */
-.sidebar_box {
- border: solid 1px #cccccc;
- width: 200px;
- height: 270px;
- margin-left: 1em;
-}
-
-.sidebar_box .box_title {
- text-align: center;
- font-weight: bold;
- font-size: 123.1%;
- height: 30px;
- line-height: 28px;
- background: url(../images/box_title_bkgd_green_14.gif) repeat-x;
- /*color: #ff7400;*/
- /*color: #ffffff;*/
-}
-
-.sidebar_box .box_body {
- background-color: #fdfdfd;
- height: 240px;
- /*background: url(../images/green_body_bkgd2.gif) repeat-x;*/
-}
-
-.sidebar_box .box_body .box_text {
- padding: 1em 1em 1em 1em;
-}
-
-.sidebar_box .box_body .separator {
- border-bottom: 1px solid #cccccc;
- height: 1px;
- margin: 0 1em 0 1em;
-}
-
-.sidebar_box .box_body .box_subtitle {
- text-align: center;
- font-weight: bold;
- font-size: 108%;
- position: relative;
-}
-
-/* END sidebar box styles */
-
-/* BEGIN css tooltips/boxovers */
-
-.boxoverTooltipHeader {
- z-index: 100000;
- display: none;
- border: 0;
- height: 0;
-}
-
-.boxoverTooltipBody {
- z-index: 100000;
- border: solid 1px Gray;
- color: #000000;
- background-color: #FFFF66;
- font-size: 93%;
- font-weight: normal;
- padding: 0.3em 0.6em;
- max-width: 500px;
- text-align: left;
- line-height: 1.4;
-}
-
-.boxoverInfoHeader {
- z-index: 100000;
- display: none;
- border: 0;
- height: 0;
-}
-
-.boxoverInfoBody {
- z-index: 100000;
- border: solid 1px Gray;
- color: #333333;
- padding: 0.3em 0.6em;
- background-color: #ebf3ff;
- font-size: 93%;
- text-align: left;
- max-width: 500px;
- line-height: 1.4;
-}
-
-/* END css tooltips/boxovers */
-
-/* BEGIN liquid round corners box styles */
-.liquid-round {
- /*width: 70%;*/
- margin: 25px auto;
- background: url(../images/round_box_2_left.gif) repeat-y left top;
-}
-
-.liquid-round .top {
- width: 100%;
- height: 12px;
- background: url(../images/round_box_2_top.gif) no-repeat left top;
-}
-
-.liquid-round .top span {
- display: block;
- position: relative;
- height: 12px;
- background: url(../images/round_box_2_top_right.gif) no-repeat right top;
-}
-
-.liquid-round .center-content {
- position: relative;
- background: #f8f8f8 url(../images/round_box_2_right.gif) repeat-y right top;
- padding: 1px 15px 1px 15px;
- margin-left: 3px;
-}
-
-.liquid-round .center-content img.round_box_title {
- margin-top: -38px;
-}
-
-.liquid-round .center-content p {
- margin-top: 0px;
- text-align: justify;
- *line-height: 1.5;
-}
-
-.liquid-round .bottom {
- width: 100%;
- height: 13px;
- background: url(../images/round_box_2_bottom.gif) no-repeat left bottom;
-}
-
-.liquid-round .bottom span {
- display: block;
- position: relative;
- height: 13px;
- background: url(../images/round_box_2_bottom_right.gif) no-repeat right bottom;
-}
-/* END liquid round corners box styles */
-
-.step_text {
- font-weight: bold;
- margin-top: 2em;
- color: #660000;
- /* border-top: 1px dotted #CCC;
- padding-top: 0.5em; */
-}
-
-.none_text {
- font-style: italic;
- color: #666;
-}
-
-.error_text {
- color: red;
- font-weight: bold;
-}
-
-.additional_info_text {
- font-size: 93%;
- color: #666666;
- font-weight: normal;
-}
-
-.required {
- color: red;
- font-weight: bold;
-}
-
-.framed {
- vertical-align: middle;
- padding: 3px;
- background-color: #FFF;
- border: 1px solid #DDD;
-}
-
-.field {
- border: 1px solid #EEE;
- background-color: #FFF;
- padding: 0.2em 0.5em;
-}
-
-.flag {
- vertical-align: middle;
-}
-
-/* BEGIN pagination styles */
-
-.pagination {
- background: white;
- /* self-clearing method: */
- }
-
-.pagination a,
-.pagination span {
- padding: .2em .5em;
- display: block;
- float: left;
- margin-right: 1px;
-}
-
-.pagination span.disabled {
- color: #999;
- border: 1px solid #DDD;
-}
-
-.pagination span.current {
- font-weight: bold;
- background: #E9F7CC;
- color: #333333;
- border: 1px solid #CDEB8B;
-}
-
-.pagination a {
- text-decoration: none;
- color: #333333;
- border: 1px solid #CDEB8B;
-}
-
-.pagination a:hover,
-.pagination a:focus {
- background: #E9F7CC;
-}
-
-.pagination .page_info {
- background: #E9F7CC;
- color: #333333;
- padding: .4em .6em;
- width: 25em;
- margin-bottom: 0.5em;
- text-align: center;
-}
-
-.pagination .page_info b {
- color: #003;
- padding: .1em .25em;
-}
-
-.pagination:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
-}
-
-* html .pagination {
- height: 1%;
-}
-
-*:first-child+html .pagination {
- overflow: hidden;
-}
-
-/* END pagination styles
-
-/* BEGIN listing styles */
-
-.listings {
- padding: 0;
- margin: 0;
-}
-
-.listing_item {
- margin-bottom: 1.5em;
- padding: 0.6em 1em;
- border-left: 1px solid #CCC;
- border-top: 1px solid #CCC;
- border-right: 2px solid #BBB;
- border-bottom: 2px solid #BBB;
- background-color: #F5F5F5;
-}
-
-.listing_item p {
- margin: 0;
-}
-
-.listing_item p * {
- vertical-align: middle;
-}
-
-.listing_item .name_section td {
- vertical-align: middle;
-}
-
-.listing_item .name {
- font-size: 138.5%;
- font-weight: bold;
- line-height: 1.8;
-}
-
-.listing_item .simple_listing .name {
- font-size: 123.1%;
- font-weight: bold;
- line-height: 1.6;
-}
-
-.listing_item .desc {
- color: #333333;
- padding: 0.6em 1em;
- margin: 1em 0;
- background-color: #F3F3F3;
- border: 1px dotted #DDD;
-}
-
-.listing_item .detail {
- color: #333333;
- font-size: 85%;
- margin-top: 0.6em;
-}
-
-.listing_item .detail_simple {
- color: #333333;
- font-size: 93%;
- margin-top: 0.6em;
-}
-
-.listing_item .detail_simple * {
- vertical-align: baseline;
-}
-
-.listing_item .extra_detail_box {
- color: #333333;
- font-size: 85%;
- margin-top: 1.2em;
- padding-top: 0.8em;
- border-top: 1px solid #DDD;
-}
-
-/* END listing styles */
-
-.submitter_info {
- color: #666;
- vertical-align: baseline;
-}
-
-.submitter_info * {
- vertical-align: baseline;
-}
-
-a.service_type_badge {
- font-size: 85%;
- font-weight: bold;
- background-color: #FFF;
- border: 1px solid #DDD;
- padding: 2px 3px;
- text-decoration: none;
- line-height: 1.0;
-}
-
-a.service_type_badge:hover {
- color: #FFF;
- background-color: #999;
-}
-
-.service_type_badge_special {
- font-size: 85%;
- font-weight: bold;
- background-color: #FFEFEF;
- border: 1px solid #DDD;
- padding: 2px 3px;
- text-decoration: none;
- line-height: 1.0;
-}
-
-a.service_location_flag {
- margin-left: 1em;
- line-height: 1.0;
- vertical-align: middle;
- padding: 0px;
- line-height: 1.0;
-}
-
-.operation_box {
- margin: 2em 0;
- line-height: 1.5;
- padding-bottom: 1em;
- border: 0px solid #DDD;
- border-width: 2px 0 2px 0;
-}
-
-.operation_heading {
- margin: 0;
- padding: 1em 0;
- font-size: 116%;
-}
-
-.operation_name {
- background-color: #FFBB7F;
- font-weight: bold;
- padding: 0.3em 0.5em;
-}
-
-.port {
- margin-bottom: 1.5em;
- padding: 0.7em 0.7em 0.3em 0.7em;
- border: 1px solid #DDE;
- background-color: #F7F7F7;
-}
-
-.monitoring_section {
- margin-bottom: 1em;
- padding: 0.7em 1em;
- border: 1px solid #DDE;
- background-color: #F7F7F7;
-}
-
-ul.simple_list {
- padding: 0;
- margin: 0;
-}
-
-ul.simple_list li {
- padding: 0;
- margin: 0 0 0.5em 2em;
- list-style: disc;
-}
-
-.home_heading {
- font-weight: bold;
- font-size: 153.9%;
- line-height: 1.5;
- text-align: center;
- padding: 0;
- margin: 0;
- margin-top: 1em;
-}
-
-#home_content {
- width: 950px;
- /*padding-top: 1em;*/
- margin: 1em auto auto auto;
-}
-
-#home_content em {
- color: #ff7400;
- font-weight: bold;
-}
-
-#key_points {
- clear:both;
- margin: 0 0 1em 0;
-}
-
-#key_points li {
- margin-top: 5px;
- padding-left: 20px;
- background: url(../images/bullet_green2.gif) left top no-repeat;
- /*list-style-type: circle;
- list-style-image: url("../images/bullet_green2.gif");*/
- font-size: 108%;
- line-height: 1.5;
-}
-
-#key_points em {
- color: #ff7400;
- font-weight: bold;
-}
-
-div.search_widget {
- text-align: center;
-}
-
-div.search_widget * {
- vertical-align: middle;
-}
-
-/* BEGIN Tabber tab styles */
-
-/*--------------------------------------------------
- REQUIRED to hide the non-active tab content.
- But do not hide them in the print stylesheet!
- --------------------------------------------------*/
-.tabberlive .tabbertabhide {
- display: none;
-}
-
-/*--------------------------------------------------
- .tabber = before the tabber interface is set up
- .tabberlive = after the tabber interface is set up
- --------------------------------------------------*/
-.tabber {
-}
-
-.tabberlive {
- margin-top: 1em;
-}
-
-/*--------------------------------------------------
- ul.tabbernav = the tab navigation list
- li.tabberactive = the active tab
- --------------------------------------------------*/
-ul.tabbernav
-{
- margin: 0;
- border-bottom: 1px solid #CCC;
- font-weight: bold;
- font-size: 123.1%;
- line-height: 24px;
- padding-bottom: 1px;
-}
-
-ul.tabbernav li
-{
- list-style: none;
- margin: 0;
- display: inline;
-}
-
-ul.tabbernav li a
-{
- padding: 3px 0.5em;
- margin-right: 4px;
- border: 1px solid #CCC;
- border-bottom: none;
- background: #E9F7CC;
- text-decoration: none;
-}
-
-ul.tabbernav li a:link { color: #333; }
-
-ul.tabbernav li a:hover
-{
- color: #000;
- background: #BFE76F;
- border-color: #CCC;
-}
-
-ul.tabbernav li.tabberactive a
-{
- background-color: #fff;
- border-bottom: 1px solid #fff;
-}
-
-ul.tabbernav li.tabberactive a:hover
-{
- color: #000;
- background: white;
- border-bottom: 1px solid white;
-}
-
-/*--------------------------------------------------
- .tabbertab = the tab content
- Add style only after the tabber interface is set up (.tabberlive)
- --------------------------------------------------*/
-.tabberlive .tabbertab {
- padding: 1em;
- border: 1px solid #CCC;
- border-top: 0;
-
- /* If you don't want the tab size changing whenever a tab is changed
- you can set a fixed height */
-
- /* height:200px; */
-
- /* If you set a fix height set overflow to auto and you will get a
- scrollbar when necessary */
-
- /* overflow:auto; */
-}
-
-/* If desired, hide the heading since a heading is provided by the tab */
-.tabberlive .tabbertab h3 {
- display: none;
-}
-.tabberlive .tabbertab h3 {
- display:none;
-}
-
-/* Example of using an ID to set different styles for the tabs on the page */
-.tabberlive#tab1 {
-}
-.tabberlive#tab2 {
-}
-.tabberlive#tab2 .tabbertab {
- height:200px;
- overflow:auto;
-}
-
-/* END Tabber tab styles */
-
-.search_button {
- border: none;
- height: 31px;
- width: 38px;
- background: url('/images/go_button.png') 0 0 no-repeat;
- cursor: pointer;
-}
-
-.search_button:hover { }
-
-/* BEGIN tables styles */
-.biocat_table {
- border: 1px solid #cccccc;
-}
-
-.biocat_table th {
- font-weight: bold;
- white-space: nowrap;
- vertical-align: middle;
- color: #333333;
- height: 1.8em;
- background: url(../images/box_title_bkgd_green_14.gif) repeat-x;
- background-position: bottom;
- padding-left: 6px;
- padding-right: 6px;
- border-right: 1px solid #cccccc;
-}
-
-.biocat_table th.center {
- text-align: center;
-}
-
-.biocat_table .small_center {
- text-align: center;
- width: 40px;
-}
-
-.biocat_table tr.odd {
- background-color: #f2fbe1;
-}
-
-.biocat_table td {
- white-space: nowrap;
- padding: 3px 6px 3px 6px;
- border-left: 1px solid #cccccc;
- border-right: 1px solid #cccccc;
-}
-
-.biocat_table td.center {
- text-align: center;
-}
-
-.biocat_table td.action_links a:link, .biocat_table td.action_links a:visited {
- text-align: center;
- text-decoration: underline;
- font-size: 93%;
-}
-
-.biocat_table td.action_links a:hover {
- background-color: #feffcf;
-}
-/* END tables styles */
-
-/* BEGIN ActiveRecord errors box */
-
-/*.fieldWithErrors {
- padding: 2px;
- background-color: #ffaaaa;
- display: table;
-}*/
-
-.fieldWithErrors label {
- padding: 2px;
- background-color: #ffaaaa;
-}
-
-.fieldWithErrors input, .fieldWithErrors select {
- padding: 2px;
- background-color: #ffaaaa;
-}
-
-#errorExplanation {
- width: 400px;
- border: 2px solid #ffaaaa;
- margin: 1.5em 0;
- background-color: #f5f5f5;
- padding-bottom: 1em;
-}
-
-#errorExplanation h2 {
- text-align: center;
- font-weight: bold;
- padding: 0.5em;
- font-size: 93%;
- margin: 0;
- background-image: none;
- background-color: #ffaaaa;
- border: none;
-}
-
-#errorExplanation p {
- font-size: 93%;
- margin-bottom: 0;
- margin-top: 0.5em;
- padding: 0.5em;
-}
-
-#errorExplanation ul {
- padding-left: 2em;
-}
-
-#errorExplanation ul li {
- font-size: 93%;
- list-style: square;
-}
-
-/* END ActiveRecord errors box */
-
-.box_description {
- padding: 0.9em 1.3em;
- background-color: #F7F7F7;
- border: 1px solid #DDD;
- line-height: 1.4;
-}
-
-.box_info {
- background: #E9F7CC;
- color: #333333;
- padding: 0.6em 1em;
- margin: 0;
- margin-bottom: 1em;
- text-align: center;
-}
-
-.box_info_standout {
- color: #333333;
- border: 1px solid #DDD;
- background: #FFFFCC;
- padding: 0.3em 0.6em;
- margin-bottom: 1em;
- line-height: 1.5;
-}
-
-.box_indented_with_bar {
- border: 0;
- border-left: 4px solid #DDD;
- padding: 1em 0 1em 1em;
- margin-left: 1em;
-}
-
-.box_currentuser_specific {
- padding: 1em 1.5em;
- border: 1px solid #99CCFF;
- background-color: #EEF6FF;
-}
-
-.box_currentuser_specific * {
- vertical-align: middle;
-}
-
-.box_form {
- margin: 1em 0;
- border: 1px solid #CCC;
- padding: 0.7em 1.2em;
- background-color: #EEE;
-}
-
-.box_form fieldset {
- border: 1px solid #cccccc;
-}
-
-.box_form fieldset legend {
- font-size: 108%;
- color: #660000;
-}
-
-.box_form hr {
- background: #CCC;
-}
-
-/* BEGIN annotations styles */
-
-.annotations_container { }
-
-.annotations_container .inactive {
- color: #BBB;
- line-height: 1.0;
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
-}
-
-.annotations_container .active {
- line-height: 1.0;
- text-decoration: none;
- color: #333;
- display: none;
-}
-
-.annotations_container:hover .inactive {
- display: none;
-}
-
-.annotations_container:hover .active {
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
-}
-
-.box_annotations {
- padding: 0;
- line-height: 1.4;
-}
-
-.box_annotations .rcontain {
- padding: 2px;
-}
-
-.box_annotations div.text {
- padding: 0.1em 0.5em 0.2em 0.5em;
- overflow-x: auto;
-}
-
-.box_annotations div.text p {
- margin: 0.5em 0;
- line-height: 1.4;
-}
-
-.box_annotations div.other {
- padding: 0.1em 0.5em 0.2em 0.5em;
-}
-
-.box_annotations .actions {
- margin: 0.5em 0 0 0;
- font-size: 85%;
- color: #666;
- text-align: right;
-}
-
-.annotations_container .add_box {
- margin-top: 0.5em;
- text-align: center;
-}
-
-.annotations_container .add_box form {
- text-align: center;
-}
-
-.annotations_container .add_box form div {
- width: 100%;
- text-align: center;
-}
-.annotations_container .add_box form textarea {
- width: 99%;
-}
-
-.annotations_container .add_box .submit_button_div {
- margin-top: 0.4em;
- text-align: right;
-}
-
-.annotations_container .add_box .submit_button_div input {
- width: 80px;
-}
-
-.annotations_container .login_link_box {
- text-align: right;
- margin-top: 0.7em;
-}
-
-.annotation_source_text {
- float: right;
- color: #666;
- background-color: #FFC;
- font-size: 85%;
- padding: 0.1em 0.5em;
- line-height: 1.3;
-}
-
-.annotation_source_text * {
- vertical-align: middle;
-}
-
-.annotation_source_text a {
- font-weight: bold;
-}
-
-.annotation_source_provider {
- background-color: #FFDFDF;
-}
-
-.annotation_source_member {
- background-color: #FFEFBF;
-}
-
-.annotation_source_registry {
- background-color: #DDFFDD;
-}
-
-.aliases {
- font-size: 100%;
- margin: 0.3em 0 0.2em 0;
- margin-left: 1em;
- line-height: 1.6;
-}
-
-.annotations_counts_outer_box {
- display: -moz-inline-block;
- display: -moz-inline-box;
- display: -moz-inline-stack;
- display: inline-block;
- *display: inline;
- vertical-align: top;
- white-space: nowrap;
- line-height: 1.0;
- zoom: 1;
-}
-
-.annotations_counts_outer_box .rtop,
-.annotations_counts_outer_box .rbottom {
- *display: none;
-}
-
-.annotations_counts_outer_box .rcontain {
- padding: 0px 3px;
- *padding: 6px 3px 4px 3px;
-}
-
-.annotations_counts_box {
- font-weight: bold;
- font-size: 93%;
- color: #333333;
- vertical-align: middle;
- line-height: 22px;
-}
-
-.annotations_counts_box span {
- padding: 4px 3px 4px 5px;
- vertical-align: middle;
-}
-
-.annotations_counts_box img {
- vertical-align: middle;
- margin-left: 2px;
- *margin-left: 0;
-}
-
-.annotations_counts_box span.total {
- background-color: #DDD;
-}
-
-.annotations_counts_box img {
- vertical-align: middle;
-}
-
-.annotations_counts_box span.end {
-}
-
-/* END annotations styles */
-
-/* BEGIN terms of use page styles */
-#terms_of_use ul, #terms_of_use ol {
- padding-left: 3em;
-}
-
-#terms_of_use ul li {
- padding-top: 1em;
- list-style: square;
-}
-
-#terms_of_use ol li {
- padding-top: 1em;
- list-style: decimal;
-}
-/* END terms of use page styles */
-
-/* BEGIN generic horizontal buttons classes */
-/* Should be used with <ul> elements */
-
-.buttons {
- margin: 2em 0;
- font-weight: bold;
- text-align: center;
-}
-
-.buttons li {
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
- margin: 0;
- margin-left: 8px;
- line-height: 2.0;
-}
-
-.buttons li.first {
- margin-left: 0;
-}
-
-.buttons li:hover {
-}
-
-.buttons li * {
- vertical-align: middle;
-}
-
-.buttons li a {
- width: 100%;
- padding: 6px 0.5em;
- line-height: 2.0;
- font-weight: bold;
- text-decoration: none;
- border: 1px solid #BBBBBB;
- background-image: url('/images/button_slim_bg.png');
- background-position: top;
- background-repeat: repeat-x;
- background-color: #EEF6FF;
-}
-
-.buttons li a:hover {
- background-image: none;
- background-color: #0099FF;
- color: #F5F5F5;
-}
-
-.buttons li a * {
- vertical-align: middle;
-}
-
-a.button_slim {
- font-weight: bold;
- line-height: 1.6;
- text-decoration: none;
- border: 1px solid #BBBBBB;
- background-image: url('/images/button_slim_bg.png');
- background-position: top;
- background-repeat: repeat-x;
- background-color: #EEF6FF;
- vertical-align: middle;
- padding: 0.1em 0.5em;
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
-}
-
-a.button_slim:hover {
- background-image: none;
- background-color: #0099FF;
- color: #F5F5F5;
-}
-
-a.button_slim * {
- vertical-align: middle;
-}
-
-/* END generic horizontal buttons classes */
-
-/* BEGIN tag cloud styles */
-
-.tag_cloud {
- text-align: center;
- line-height: 1.7;
-}
-
-.tag_cloud ul {
- margin: 0;
- padding: 0;
-}
-
-.tag_cloud ul li {
- display: inline;
- text-decoration: none;
- margin: 0 0.25em;
-}
-
-.tag_cloud li a {
- color: #000099;
- padding: 0.1em 0;
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
-}
-
-span.namespace,
-.tag_cloud li a.namespace {
- color: #999;
- font-size: 10px;
-}
-
-span.ontology_term,
-.tag_cloud li a.ontology_term {
- color: #6600CC;
-}
-
-/* END tag cloud styles */
-
-/* BEGIN Section Boxes (usually for inner sidebars) */
-
-.box_section {
- margin: 0;
- text-align: center;
- margin-bottom: 1em;
-}
-
-.box_section .content {
- padding: 0.5em 0.8em;
- border-top: none;
- border-right: 1px solid #DDD;
- border-bottom: none;
- border-left: 1px solid #DDD;
- background-image: url('/images/box-bg1.png');
- background-position: top;
- background-repeat: repeat-x;
- background-color: #FFC;
- overflow: hidden;
- line-height: 1.5;
-}
-
-.box_section .xtop,
-.box_section .xbottom {
- display: block;
- background: transparent;
- font-size: 1px;
-}
-
-.box_section .xb1,
-.box_section .xb2,
-.box_section .xb3,
-.box_section .xb4,
-.box_section .xb5,
-.box_section .xb6,
-.box_section .xb7 {
- display: block;
- overflow: hidden;
-}
-
-.box_section .xb1,
-.box_section .xb2,
-.box_section .xb3,
-.box_section .xb6,
-.box_section .xb7 {
- height: 1px;
-}
-
-.box_section .xb2,
-.box_section .xb3,
-.box_section .xb4 {
- background: #f4f0b0;
- border-left: 1px solid #DDD;
- border-right: 1px solid #DDD;
-}
-
-.box_section .xb5,
-.box_section .xb6,
-.box_section .xb7 {
- background: #ffffcb;
- border-left: 1px solid #DDD;
- border-right: 1px solid #DDD;
-}
-
-.box_section .xb1 {
- margin: 0 5px;
- background: #DDD;
-}
-
-.box_section .xb2,
-.box_section .xb7 {
- margin: 0 3px;
- border-width: 0 2px;
-}
-
-.box_section .xb3,
-.box_section .xb6 {
- margin: 0 2px;
-}
-
-.box_section .xb4,
-.box_section .xb5 {
- height: 2px;
- margin: 0 1px;
-}
-
-.box_section .heading {
- font-size: 108%;
- font-weight: bold;
- line-height: 1.0;
- margin-top: 0.2em;
-}
-
-.box_section .footer {
- text-align: center;
- margin-top: 1em;
- border-top: 1px solid #DDD;
- padding-top: 0.7em;
-}
-
-.box_section ul.items {
- margin: 0 0 0.8em 1em;
- text-align: left;
-}
-
-.box_section ul.items li {
- list-style-type: none;
- margin: 0.6em 0;
- padding-left: 0.8em;
- line-height: 1.1;
- /*border-left: 3px solid #DDDDBB;*/
- text-align: center;
-}
-
-.box_section ul.items li * {
- vertical-align: middle;
-}
-
-/* END Section Boxes (usually for inner sidebars) */
-
-
-/* BEGIN ratings table styles */
-
-.ratings_table {
- border: 1px solid #cccccc;
- margin-bottom: 0.5em;
- background-color: #FFC;
- border-collapse: collapse;
- font-size: 93%;
-}
-
-.ratings_table th {
- font-weight: bold;
- white-space: nowrap;
- vertical-align: middle;
- color: #333333;
- height: 2em;
- background: url(../images/box_title_bkgd_green_14.gif) repeat-x;
- background-position: bottom;
- padding-left: 6px;
- padding-right: 6px;
- border-right: 1px solid #cccccc;
- text-align: center;
-}
-
-.ratings_table td {
- white-space: nowrap;
- padding: 4px 6px 4px 6px;
- border-left: 1px solid #cccccc;
- border-right: 1px solid #cccccc;
- vertical-align: middle;
- text-align: center;
-}
-
-.ratings_table tr:hover {
- background-color: #F7F7F7;
-}
-
-.ratings_table .your_rating .delete_rating_faded {
- width: 10px;
- height: 10px;
- margin-left: 0.5em;
- vertical-align: middle;
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
- background: url('/images/delete_faded.png') no-repeat center;
-}
-
-.ratings_table .your_rating .delete_rating a {
- text-decoration: none;
-}
-
-.ratings_table .your_rating:hover .delete_rating {
- background: url('/images/delete.png') no-repeat center;
-}
-
-/* END ratings table styles */
-
-/* BEGIN filtering styles */
-
-#filters_header {
- width: auto;
- color: #000;
- line-height: 1.2;
- padding: 0.5em 0;
- text-align: center;
- margin-bottom: 0.5em;
-}
-
-#filters_header .text {
- font-size: 108%;
- font-weight: bold;
- vertical-align: middle;
-}
-
-div.filters {
- padding: 0 0.3em;
- line-height: 1.5;
-}
-
-div.filters p.type {
- font-weight: bold;
- text-align: center;
- line-height: 1.2;
- padding: 0;
- margin: 0;
- margin-bottom: 0.8em;
- color: #555;
-}
-
-div.filters p.subtype {
- font-size: 93%;
- font-weight: bold;
- text-align: center;
- line-height: 1.2;
- padding: 0;
- margin: 0;
- margin-top: 0.7em;
- margin-bottom: 0.6em;
- color: #666;
- border-bottom: 1px dotted #DDD;
- padding-bottom: 0.3em;
-}
-
-div.filters p.type_small {
- font-size: 85%;
- line-height: 1.2;
- font-weight: bold;
- margin: 0;
- margin-bottom: 0.7em;
- text-align: center;
- color: #555;
-}
-
-div.filters div.filter_type_box {
- margin-bottom: 1em;
- padding: 0;
-}
-
-div.filters div.current_filters_box {
- margin-bottom: 1em;
- padding: 0;
-}
-
-div.filters div.current_filters_box .rcontain {
- padding: 2px 3px;
-}
-
-div.filters div.current_filters_box .and {
- font-weight: bold;
- font-size: 100%;
- text-align: center;
- margin: 0;
- padding-right: 12px;
-}
-
-div.filters div.selected_filters_type_box {
- margin: 0 0.1em;
- padding: 0;
-}
-
-div.filters div.selected_filters_type_box .or {
- font-weight: bold;
- font-size: 77%;
- text-align: center;
- margin: 2px 0;
- padding-right: 12px;
-}
-
-div.filters ul.top_level {
- font-size: 85%;
-}
-
-div.filters li {
- list-style: none;
- margin: 0;
- padding: 0;
-}
-
-div.filters li .container {
-
-}
-
-div.filters li .container a {
- display: block;
- vertical-align: top;
- margin-bottom: 0.3em;
- padding: 1px 3px;
- text-decoration: none;
- border: 1px dotted transparent;
- vertical-align: baseline;
-}
-
-div.filters li .container a * {
- vertical-align: baseline;
-}
-
-div.filters li .container a:hover {
- border: 1px dotted #CCC;
- background-color: #DDE;
-}
-
-div.filters li .container a.selected {
- border: 1px dotted #CCC;
- background-color: #DDE;
-}
-
-div.filters li .container a:hover.selected { }
-
-div.filters li .container a span.text {
- text-decoration: underline;
-}
-
-div.filters li .container a span.count {
- margin-left: 0.2em;
-}
-
-div.filters li .container a span.deselect {
- float: right;
- width: 12px;
- background: url('/images/delete_faded_darker.png') no-repeat left center;
-}
-
-div.filters li .container a:hover span.deselect {
- background: url('/images/delete.png') no-repeat left center;
-}
-
-div.filters li.category_root .container a {
- margin-bottom: 0.5em;
-}
-
-div.filters li.sub_category .container a {
- /*border-left: 1px dotted #CCC;*/
- margin-left: 0.2em;
-}
-
-/* END filtering styles */
-
-/* BEGIN autocomplete styles */
-
-
-div.auto_complete {
- position: absolute;
- background-color: white;
- border: 1px solid #999;
- margin-top: -2px;
- padding: 0px;
- z-index: 10000;
- font-size: 85%;
- font-weight: normal;
-}
-
-div.auto_complete * {
- vertical-align: baseline;
-}
-
-div.auto_complete ul {
- list-style-type: none;
- margin: 0px;
- padding: 0px;
-}
-
-div.auto_complete ul li.selected {
- background-color: #ffb;
-}
-
-div.auto_complete ul li {
- text-align: left;
- list-style-type: none;
- display: block;
- margin: 0;
- padding: 3px;
- border-bottom: 1px solid #DDD;
- cursor: pointer;
- overflow: hidden;
-}
-
-div.auto_complete ul li.selected {
- background-color: #ffb;
-}
-
-div.auto_complete ul strong.highlight {
- color: #800;
- margin: 0px;
- padding: 0px;
- font-weight: normal;
-}
-
-/* END autocomplete styles */
-
-/* BEGIN stats page styles */
-
-#stats_page {
- margin: 0 2em;
-}
-
-#stats_page p {
- margin: 0.6em 0;
-}
-
-#stats_page h4 {
- padding: 0.2em 0.6em;
- background-color: #EEE;
- margin-top: 1.5em;
-}
-
-#stats_page .left_column {
- float: left;
- width: 80%;
-}
-
-#stats_page .right_column {
- float: right;
- width: 18%;
-}
-
-#stats_page .box_indented_with_bar {
- padding: 0.5em 1.5em;
-}
-
-#stats_page .box_info_standout {
- width: 550px;
- font-size: 85%;
-}
-
-#stats_page .services {
- margin: 0.5em 0 0.5em 1.5em;
- line-height: 1.5;
- font-size: 85%;
-}
-
-#stats_page ul.contents {
- text-align: left;
-}
-
-#stats_page ul.contents li {
- padding: 0.2em 0;
-}
-
-#stats_page ul.contents li ul {
- margin-left: 1em;
-}
-
-/* END stats page styles */
-
-/* BEGIN styles for rounded corner boxes */
-
-.rcontain {
- padding: 0 0.3em;
-}
-
-/* END styles for rounded corner boxes */
-
-p.more_less_links {
- font-weight: bold;
- text-align: right;
- font-size: 85%;
- margin: 0;
-}
-
-p.more_less_links a {
- text-decoration: none;
-}
-
-.search_box .rcontain {
- padding: 0.4em 1em;
-}
-
-.form_field_section {
- margin-top: 1.5em;
-}
-
-.form_selected_values {
- padding: 0.3em 0.5em;
- border: 1px solid #DDD;
- background-color: #FFF;
- color: #333;
-}
-
-/* BEGIN categories styles */
-
-.categories_box {
- font-size: 85%;
- line-height: 16px;
-}
-
-ul.categories {
- float: left;
- overflow: hidden;
- margin: 0;
- padding: 0;
- list-style-type: none;
-}
-
-ul.categories li {
- display: inline;
-}
-
-ul.categories li span.main {
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
- background-color: #FFC;
- margin-bottom: 0.4em;
- margin-right: 0.5em;
- padding: 0 3px;
- border-top: 1px solid #DEDEDE;
- border-left: 1px solid #DEDEDE;
- border-right: 1px solid #999;
- border-bottom: 1px solid #999;
-}
-
-ul.categories li span.main a.category {
- line-height: 1.6;
- text-decoration: none;
- vertical-align: middle;
-}
-
-ul.categories li span.main a.category:hover {
- color: #000;
-}
-
-ul.categories li span.main:hover {
- background-color: #F0E68C;
-}
-
-/* END categories styles */
-
-/* BEGIN stats bar styles */
-
-.stats_bar {
- color: #555;
- font-weight: bold;
-}
-
-.stats_bar * {
- vertical-align: middle;
-}
-
-.stats_bar img {
- margin-right: 0.3em;
-}
-
-.stats_bar .each {
- margin-left: 1em;
-}
-
-/* END stats bar styles */
-
-#feedback_help {
- margin: 1.5em;
- font-size: 93%;
- text-align: left;
-}
-
-#feedback_help ul {
- margin-left: 1.5em;
- margin-bottom: 1em;
-}
-
-#search_within {
- margin-bottom: 1em;
-}
-
-#search_within .rcontain {
- padding: 0 1.5em;
- text-align: right;
-}
-
-.service_properties p,
-.service_properties .property {
- margin: 0;
- margin-top: 1.5em;
-}
-
-#filter_message {
- text-align: left;
- font-size: 93%;
- margin-bottom: 0.8em;
- color: #333333;
- /**border: 1px solid #DDD;
- background: #FFFFCC;
- padding: 0.4em 0.6em; */
- line-height: 1.5;
-}
-
-#filter_message .rcontain {
- padding: 1px 0.8em;
-}
-
-#filter_message .rtop,
-#filter_message .contain,
-#filter_message .rbottom {
- margin: 0;
-}
-
-#filter_message .rtop,
-#filter_message .rbottom {
- height: 4px;
- line-height: 1.0;
-}
-
-#filter_message * {
- vertical-align: middle;
-}
-
-#subscribe_results_link {
- float: right;
- text-decoration: none;
- vertical-align: middle;
- font-weight: bold;
- margin-left: 2em;
-}
-
-#subscribe_results_link img {
- margin-right: 0.4em;
-}
-
-/* Style for default texts in inputs */
-.ex {
- color: #999;
-}
-
-/* BEGIN login page styles */
-
-.login_form {
- padding: 1.2em 0.8em;
-}
-
-.login_form label {
- float: left;
- font-weight: bold;
- margin-bottom: 1em;
-}
-
-.login_form input.login_field {
- clear: both;
- float: right;
- height: 1.4em;
- line-height: 1.4;
- width: 220px;
- margin-bottom: 1em;
-}
-
-.login_form input.sign_in_button {
- clear: both;
- float: right;
- width: 80px;
-}
-
-.login_form .other_links {
- clear: both;
- width: 100%;
- padding-top: 1.2em;
- border-top: 1px dotted #CCC;
- text-align: right;
-}
-
-.login_form .other_links li {
- margin-bottom: 0.7em;
-}
-
-/* END login page styles */
-
-img.account_provider_logo {
- margin: 0 2px;
-}
-
-.side_link {
- color: #999;
- margin-left: 3em;
- font-size: 85%;
-}
-
-.side_link a {
- color: #999;
-}
-
-.toolbar {
- float: right;
-}
-
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/blue-sphere-50.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/blue-sphere-50.png
deleted file mode 100644
index 0b3626d..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/blue-sphere-50.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/cross-sphere-35.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/cross-sphere-35.png
deleted file mode 100644
index 2553bd9..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/cross-sphere-35.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/cross-sphere-50.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/cross-sphere-50.png
deleted file mode 100644
index 2bcba73..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/cross-sphere-50.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/accept.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/accept.png
deleted file mode 100644
index 89c8129..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/accept.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/add - tick.pdn b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/add - tick.pdn
deleted file mode 100644
index 04ee9be..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/add - tick.pdn
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/add - tick.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/add - tick.png
deleted file mode 100644
index 5d2d4af..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/add - tick.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/add.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/add.png
deleted file mode 100644
index 6332fef..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/add.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/application_form_add.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/application_form_add.png
deleted file mode 100644
index 28c2175..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/application_form_add.png
+++ /dev/null
Binary files differ
diff --git "a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_join \050flipped vertically\051.png" "b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_join \050flipped vertically\051.png"
deleted file mode 100644
index 7858d14..0000000
--- "a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_join \050flipped vertically\051.png"
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_left.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_left.png
deleted file mode 100644
index 2bed329..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_left.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_refresh.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_refresh.png
deleted file mode 100644
index 0de2656..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_refresh.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_right.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_right.png
deleted file mode 100644
index 2cf15f1..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/arrow_right.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/chart_organisation.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/chart_organisation.png
deleted file mode 100644
index c32d25c..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/chart_organisation.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/cross.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/cross.png
deleted file mode 100644
index 1514d51..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/cross.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/disk.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/disk.png
deleted file mode 100644
index 99d532e..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/disk.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/error.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/error.png
deleted file mode 100644
index 628cf2d..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/error.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/exclamation.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/exclamation.png
deleted file mode 100644
index c37bd06..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/exclamation.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/external_link_listing_small.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/external_link_listing_small.png
deleted file mode 100644
index a22b1f7..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/external_link_listing_small.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/folder_explore.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/folder_explore.png
deleted file mode 100644
index 0ba9391..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/folder_explore.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/grey_circle.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/grey_circle.png
deleted file mode 100644
index 69ede6c..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/grey_circle.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/help.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/help.png
deleted file mode 100644
index 5c87017..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/help.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/information.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/information.png
deleted file mode 100644
index 12cd1ae..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/information.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/lightbulb.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/lightbulb.png
deleted file mode 100644
index d22fde8..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/lightbulb.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/lock.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/lock.png
deleted file mode 100644
index 2ebc4f6..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/lock.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/lock_open.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/lock_open.png
deleted file mode 100644
index a471765..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/lock_open.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/magnifier.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/magnifier.png
deleted file mode 100644
index cf3d97f..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/magnifier.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/multiple_star.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/multiple_star.png
deleted file mode 100644
index c663d73..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/multiple_star.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/page_white_code.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/page_white_code.png
deleted file mode 100644
index 0c76bd1..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/page_white_code.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/plugin.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/plugin.png
deleted file mode 100644
index 6187b15..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/plugin.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/remote_resource.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/remote_resource.png
deleted file mode 100644
index b8edc12..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/remote_resource.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/server.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/server.png
deleted file mode 100644
index 720a237..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/server.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/star.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/star.png
deleted file mode 100644
index b88c857..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/star.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/style.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/style.png
deleted file mode 100644
index 81e41de..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/style.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/sum.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/sum.png
deleted file mode 100644
index fd7b32e..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/sum.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/tag_blue.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/tag_blue.png
deleted file mode 100644
index 9757fc6..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/tag_blue.png
+++ /dev/null
Binary files differ
diff --git "a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/text_linespacing \050collapse\051.png" "b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/text_linespacing \050collapse\051.png"
deleted file mode 100644
index ff09e31..0000000
--- "a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/text_linespacing \050collapse\051.png"
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/text_linespacing.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/text_linespacing.png
deleted file mode 100644
index 1a91cbd..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/text_linespacing.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/text_list_numbers.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/text_list_numbers.png
deleted file mode 100644
index 33b0b8d..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/text_list_numbers.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/tick.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/tick.png
deleted file mode 100644
index a9925a0..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/tick.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/user.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/user.png
deleted file mode 100644
index 79f35cc..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/famfamfam_silk/user.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/favicon.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/favicon.png
deleted file mode 100644
index 1ac1bde..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/favicon.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/fold.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/fold.png
deleted file mode 100644
index a13d280..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/fold.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/fold_16x16.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/fold_16x16.png
deleted file mode 100644
index 5a37b67..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/fold_16x16.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/unfold.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/unfold.png
deleted file mode 100644
index 589e2c9..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/unfold.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/unfold_16x16.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/unfold_16x16.png
deleted file mode 100644
index dd2396c..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/folds/unfold_16x16.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/info-sphere-35.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/info-sphere-35.png
deleted file mode 100644
index cdbacd3..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/info-sphere-35.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/info-sphere-50.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/info-sphere-50.png
deleted file mode 100644
index 8e8ac21..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/info-sphere-50.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/open_in_BioCatalogue.pdn b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/open_in_BioCatalogue.pdn
deleted file mode 100644
index 3357714..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/open_in_BioCatalogue.pdn
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/open_in_BioCatalogue.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/open_in_BioCatalogue.png
deleted file mode 100644
index 897b2c1..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/open_in_BioCatalogue.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/pling-sphere-35.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/pling-sphere-35.png
deleted file mode 100644
index 3326aad..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/pling-sphere-35.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/pling-sphere-50.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/pling-sphere-50.png
deleted file mode 100644
index 1f47035..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/pling-sphere-50.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/query-sphere-35.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/query-sphere-35.png
deleted file mode 100644
index 8091ff3..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/query-sphere-35.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/query-sphere-50.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/query-sphere-50.png
deleted file mode 100644
index 443a868..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/query-sphere-50.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_multitype.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_multitype.png
deleted file mode 100644
index 1a8e9cf..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_multitype.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_rest.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_rest.png
deleted file mode 100644
index a4276c2..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_rest.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_soap.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_soap.png
deleted file mode 100644
index aa80209..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_soap.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_unknown.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_unknown.png
deleted file mode 100644
index 92638f1..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/service_type_unknown.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/soap_rest_multitype_unknown.pdn b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/soap_rest_multitype_unknown.pdn
deleted file mode 100644
index cc7fcb9..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/service_icons/soap_rest_multitype_unknown.pdn
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/styles.css b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/styles.css
deleted file mode 100644
index 48bbdff..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/styles.css
+++ /dev/null
@@ -1,290 +0,0 @@
-/* BEGIN service preview header styles */
-
-p.service_aka_names {
- margin-top: 5px;
- margin-bottom: 0;
-}
-
-span.service_aka_name {
- font-weight: bold;
- margin-right: 0.5em;
-}
-
-a.service_status_details {
- text-decoration: none;
-}
-
-a.service_status_details:hover {
- color: #ff7400;
- text-decoration: underline;
-}
-
-h1.service_title {
- border: 1px solid #D7EFA4;
- background-color: #E9F7CC;
- color: #000033;
- text-align: center;
- font-size: 180%;
- margin: 0.2em 0 0 0;
- padding: 0;
-}
-
-
-h2.soap_operation_name {
- border: 1px solid #D7EFA4;
- background-color: #E9F7CC;
- color: #000033;
- text-align: center;
- font-size: 120%;
- margin: 0.2em 0 0 0;
- padding: 0;
-}
-
-h3.soap_operation_inputs_or_outputs_section {
- background-color: #EEEEEE;
- border: 1px solid #CCCCCC;
- padding: 0.1em 0.6em;
- font-size: 110%;
- margin-top: 2em;
-}
-
-div.soap_input_or_output {
- border: 1px solid #C6961D;
- margin: 0.5em 1em;
-}
-
-div.soap_input_or_output p.name {
- background-color: #FFC526;
- border: 1px solid #C6961D;
- padding: 0.2em 1em;
- margin: 0;
-}
-
-div.soap_input_or_output p.body {
- border: 1px solid #C6961D;
- padding: 0.5em 1em;
- margin: 0;
-}
-
-
-.orange_highlight {
- background-color: #ffbb7f;
- padding: 1px 5px 1px 5px;
- margin: 0 2px;
-}
-
-.none_text {
- font-weight: normal;
- font-style: italic;
- color: #777777;
-}
-
-.left_indented {
- margin-left: 2em;
-}
-
-/* END service preview header styles */
-
-
-/* BEGIN service preview annotation styles */
-
-div.annotation {
- margin: 1em;
- font-size: 100%;
-}
-
-div.annotation p.key {
- margin: 0;
- padding: 0;
- font-weight: bold;
-}
-
-div.annotation p.value {
- margin: 0;
- padding: 0 0.7em;
-}
-
-div.annotation p.value_with_submitter {
- margin: 0.4em 0;
- padding: 0.3em 0.7em;
- background-color: #AAFFC1;
- border: 1px solid #91D8A4;
-}
-
-div.annotation p.value_with_submitter span.submitter{
- float: right;
- font-size: 80%;
- margin: 0 0.2em 0 1em;
- padding: 2px 5px 1px 5px;
- background-color: #D8FFE2;
-}
-
-div.annotation img.link_icon {
- padding: 0 3px;
- vertical-align: middle;
-}
-
-div.annotation a {
- vertical-align: middle;
- color: #000000;
-}
-
-div.annotation a:link, a:visited {
- /*color: #333333;*/
- text-decoration: underline;
-}
-
-div.annotation a:hover {
- color: #ff7400;
- text-decoration: underline;
-}
-
-div.annotation a:active {
- color: #ff7400;
- text-decoration: underline;
-}
-
-/* END service preview annotation styles */
-
-
-
-/* BEGIN service type styles */
-
-p.service_types {
- margin-top: 0.5em;
- margin-bottom: 0px;
-}
-
-a.service_type_badge {
- font-size: 85%;
- font-weight: bold;
- background-color: #FFF;
- border: 1px solid #DDD;
- padding: 2px 3px;
- text-decoration: none;
- line-height: 1.0;
-}
-
-a.service_type_badge:hover {
- color: #FFF;
- background-color: #999;
-}
-
-/* END service type styles */
-
-
-/* BEGIN categories styles */
-
-.categories_box {
- font-size: 90%;
-}
-
-ul.categories {
- float: left;
- overflow: hidden;
- margin: 0;
- padding: 0;
- list-style-type: none;
-}
-
-ul.categories li {
- display: inline;
-}
-
-ul.categories li span.title {
- line-height: 1.6;
- font-weight: bold;
- margin-right: 0.7em;
- vertical-align: middle;
-}
-
-ul.categories li span.main {
- display:-moz-inline-block;
- display:-moz-inline-box;
- display: inline-block;
- background-color: #FFC;
- margin-bottom: 0.4em;
- margin-right: 0.5em;
- padding: 0;
- border-top: 1px solid #DEDEDE;
- border-left: 1px solid #DEDEDE;
- border-right: 1px solid #999;
- border-bottom: 1px solid #999;
-}
-
-ul.categories li span.main a.category {
- line-height: 1.6;
- text-decoration: none;
- vertical-align: middle;
- padding: 3px 5px 2px 5px;
-}
-
-ul.categories li span.main a.category:hover {
- color: #000;
- background-color: #F0E68C;
-}
-
-ul.categories li span.main:hover {
- background-color: #F0E68C;
-}
-
-/* END categories styles */
-
-
-
-/* BEGIN tag cloud styles */
-
-div.tag_cloud a {
- font-family:Arial,Helvetica,sans-serif;
- color: #000099; /* font color as on BioCatalogue */
- margin: 0 10px; /* vertical margin doesn't seem to work, so adding line-height to make sure that selection borders on different lines do not overlap */
- line-height: 1.9em;
- padding: 0 4px 2px 4px;
- text-decoration: none;
-
- vertical-align: middle;
-}
-
-div.tag_cloud a:hover {
- color: orange;
-}
-
-div.tag_cloud a.unselected {
- /*
- * this style is used to make sure that equal space
- * around anchor tags is taken by the transparent border
- * even when the tag is not "selected"
- */
- border-style: solid;
- border-width: 2px;
- border-color: transparent;
-}
-
-div.tag_cloud a.unselected_ontological_term {
- /*
- * this style is used to make sure that equal space
- * around anchor tags is taken by the transparent border
- * even when the tag is not "selected"
- */
- border-style: solid solid double solid;
- border-width: 2px 2px 3px 2px;
- border-color: transparent transparent #000099 transparent;
-}
-
-#ontological_term{
- color:#3090C7 ; /*Deep Sky Blue3*/
-}
-
-div.tag_cloud a.selected {
- border-style: solid;
- border-width: 2px;
- background: #D6E9FF;
-}
-
-div.tag_cloud a.selected_ontological_term {
- border-style: double double double double;
- border-width: 3px 3px 3px 3px;
- background: #D6E9FF;
-}
-
-/* END tag cloud styles */
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/test.html b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/test.html
deleted file mode 100644
index e23f24c..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/test.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<html>
- <head>
- <link href="styles.css" media="screen" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <h1 class="service_title">
- Service:
- <span class="orange_highlight">Blast</span>
- <a class="service_type_badge" style="margin-left: 1.5em" href="">SOAP</a>
- </h1>
- <p class="left_indented service_aka_names"><span class="none_text">aka</span><span class="service_aka_name"> BLAST(DDBJ)</span></p>
-
- <div class="categories_box">
- <ul class="categories">
- <li>
- <span class="title">
- Categories:
- </span>
- </li>
- <li>
- <span class="main">
- <a href="/services?cat=%5B18%5D" class="category">Nucleotide Sequence Similarity</a>
- </span>
- </li>
- <li>
- <span class="main">
- <a href="/services?cat=%5B6%5D" class="category">Protein Sequence Similarity</a>
- </span>
- </li>
- </ul>
- </div>
-
- <p style="border-top: 1px solid #000000; margin-top: 3em;"></p>
-
- <div class="annotation">
- <p class="key">Provider</p>
- <p class="value"><a href="">xml.nig.ac.jp</a></p>
- </div>
-
- <div class="annotation">
- <p class="key">Location</p>
- <p class="value">Japan</p>
- </div>
-
- <div class="annotation">
- <p class="key">Submitter / Source</p>
- <p class="value">
- <img src="famfamfam_silk/user.png" class="link_icon"/>
- <a href="">Franck</a>
- <span class="none_text" style="margin-left: 0.7em; vertical-align: middle;">(2009-01-01)</span>
- </p>
- </div>
-
- <div class="annotation">
- <p class="key">Endpoint</p>
- <p class="value"><a href="">http://xml.nig.ac.jp/xddbj/Blast</a></p>
- </div>
-
- <div class="annotation">
- <p class="key">WSDL Location</p>
- <p class="value"><a href="">http://xml.nig.ac.jp/xddbj/Blast.wsdl</a></p>
- </div>
-
- <div class="annotation">
- <p class="key">Documentation URL(s)</p>
- <p class="value_with_submitter">
- <span class="submitter">
- <span style="vertical-align: middle;">by</span>
- <img src="famfamfam_silk/remote_resource.png" class="link_icon"/>
- <a href="">The EMBRACE Registry</a>
- <span class="none_text" style="margin-left: 0.3em;">(2009-02-03)</span>
- </span>
- <a href="">http://xml.nig.ac.jp/index.html</a>
- </p>
- </div>
-
- </body>
-</html>
\ No newline at end of file
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tick-sphere-35.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tick-sphere-35.png
deleted file mode 100644
index 3593666..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tick-sphere-35.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tick-sphere-50.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tick-sphere-50.png
deleted file mode 100644
index f93f269..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tick-sphere-50.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/trash.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/trash.png
deleted file mode 100644
index 80f5624..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/trash.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_checked.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_checked.png
deleted file mode 100644
index af679a2..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_checked.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_partial.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_partial.png
deleted file mode 100644
index 9a61aa4..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_partial.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_partial_green.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_partial_green.png
deleted file mode 100644
index 9d1eeea..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_partial_green.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_unchecked.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_unchecked.png
deleted file mode 100644
index d9b5c92..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/tristate_checkbox/tristate_checkbox_unchecked.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/unchecked.png b/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/unchecked.png
deleted file mode 100644
index c131d07..0000000
--- a/taverna-perspective-biocatalogue/src/main/resources/net/sf/taverna/t2/ui/perspectives/biocatalogue/unchecked.png
+++ /dev/null
Binary files differ
diff --git a/taverna-perspective-biocatalogue/src/main/xsd/dc.xsd b/taverna-perspective-biocatalogue/src/main/xsd/dc.xsd
deleted file mode 100644
index 815d1a2..0000000
--- a/taverna-perspective-biocatalogue/src/main/xsd/dc.xsd
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns="http://purl.org/dc/elements/1.1/"
- targetNamespace="http://purl.org/dc/elements/1.1/"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified">
-
- <xs:annotation>
- <xs:documentation xml:lang="en">
- Simplified XML Schema for http://purl.org/dc/elements/1.1/
-
- Created 2007-06-28
-
- Created by
-
- Stian Soiland (ssoiland@cs.man.ac.uk)
-
- This simplification removes SimpleLiteral and specifies dc:any as
- an xs:string, except for dc:date which is specified as an
- xs:dateTime. This makes the schema more usable for tools like
- XMLBeans.
-
-
-
- Based on
- http://dublincore.org/schemas/xmls/qdc/2006/01/06/dc.xsd :
-
-
- DCMES 1.1 XML Schema
- XML Schema for http://purl.org/dc/elements/1.1/ namespace
-
- Created 2003-04-02
-
- Created by
-
- Tim Cole (t-cole3@uiuc.edu)
- Tom Habing (thabing@uiuc.edu)
- Jane Hunter (jane@dstc.edu.au)
- Pete Johnston (p.johnston@ukoln.ac.uk),
- Carl Lagoze (lagoze@cs.cornell.edu)
-
- This schema declares XML elements for the 15 DC elements from the
- http://purl.org/dc/elements/1.1/ namespace.
-
- It defines a complexType SimpleLiteral which permits mixed content
- and makes the xml:lang attribute available. It disallows child elements by
- use of minOcccurs/maxOccurs.
-
- However, this complexType does permit the derivation of other complexTypes
- which would permit child elements.
-
- All elements are declared as substitutable for the abstract element any,
- which means that the default type for all elements is dc:SimpleLiteral.
-
- </xs:documentation>
-
- </xs:annotation>
-
-
- <xs:import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/xml.xsd">
-
- </xs:import>
-
-
- <xs:element name="any" type="xs:string" abstract="true"/>
-
- <xs:element name="title" substitutionGroup="any"/>
- <xs:element name="creator" substitutionGroup="any"/>
- <xs:element name="subject" substitutionGroup="any"/>
- <xs:element name="description" substitutionGroup="any"/>
- <xs:element name="publisher" substitutionGroup="any"/>
-
- <xs:element name="contributor" substitutionGroup="any"/>
- <xs:element name="date" type="xs:dateTime" />
- <xs:element name="type" substitutionGroup="any"/>
- <xs:element name="format" substitutionGroup="any"/>
- <xs:element name="identifier" substitutionGroup="any"/>
- <xs:element name="source" substitutionGroup="any"/>
- <xs:element name="language" substitutionGroup="any"/>
- <xs:element name="relation" substitutionGroup="any"/>
- <xs:element name="coverage" substitutionGroup="any"/>
-
- <xs:element name="rights" substitutionGroup="any"/>
-
- <xs:group name="elementsGroup">
- <xs:annotation>
- <xs:documentation xml:lang="en">
- This group is included as a convenience for schema authors
- who need to refer to all the elements in the
- http://purl.org/dc/elements/1.1/ namespace.
- </xs:documentation>
- </xs:annotation>
-
- <xs:sequence>
-
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="any"/>
- </xs:choice>
- </xs:sequence>
- </xs:group>
-
- <xs:complexType name="elementContainer">
- <xs:annotation>
- <xs:documentation xml:lang="en">
-
- This complexType is included as a convenience for schema authors who need to define a root
- or container element for all of the DC elements.
- </xs:documentation>
- </xs:annotation>
-
- <xs:choice>
- <xs:group ref="elementsGroup"/>
- </xs:choice>
- </xs:complexType>
-
-
-</xs:schema>
-
diff --git a/taverna-perspective-biocatalogue/src/main/xsd/dcterms.xsd b/taverna-perspective-biocatalogue/src/main/xsd/dcterms.xsd
deleted file mode 100644
index 205bf48..0000000
--- a/taverna-perspective-biocatalogue/src/main/xsd/dcterms.xsd
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- targetNamespace="http://purl.org/dc/terms/"
- xmlns="http://purl.org/dc/terms/"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified">
-
- <xs:annotation>
- <xs:documentation xml:lang="en">
- Simplified XML Schema for http://purl.org/dc/terms/
-
- Created 2007-06-28
-
- Created by
-
- Stian Soiland (ssoiland@cs.man.ac.uk)
-
- This simplification removes SimpleLiteral references
- so that it can be used with the simplified dc.xsd.
- This makes the schema more usable for tools like
- XMLBeans.
-
-
- Based on
- http://dublincore.org/schemas/xmls/qdc/2006/01/06/dcterms.xsd :
-
-
- DCterms XML Schema
- XML Schema for http://purl.org/dc/terms/ namespace
-
- Created 2006-01-06
-
- Created by
-
- Tim Cole (t-cole3@uiuc.edu)
- Tom Habing (thabing@uiuc.edu)
- Jane Hunter (jane@dstc.edu.au)
- Pete Johnston (p.johnston@ukoln.ac.uk),
- Carl Lagoze (lagoze@cs.cornell.edu)
-
- This schema declares XML elements for the DC elements and
- DC element refinements from the http://purl.org/dc/terms/ namespace.
-
- It reuses the complexType dc:SimpleLiteral, imported from the dc.xsd
- schema, which permits simple element content, and makes the xml:lang
- attribute available.
-
- This complexType permits the derivation of other complexTypes
- which would permit child elements.
-
- DC elements are declared as substitutable for the abstract element dc:any, and
- DC element refinements are defined as substitutable for the base elements
- which they refine.
-
- This means that the default type for all XML elements (i.e. all DC elements and
- element refinements) is dc:SimpleLiteral.
-
- Encoding schemes are defined as complexTypes which are restrictions
- of the dc:SimpleLiteral complexType. These complexTypes restrict
- values to an appropriates syntax or format using data typing,
- regular expressions, or enumerated lists.
-
- In order to specify one of these encodings an xsi:type attribute must
- be used in the instance document.
-
- Also, note that one shortcoming of this approach is that any type can be
- applied to any of the elements or refinements. There is no convenient way
- to restrict types to specific elements using this approach.
-
- </xs:documentation>
-
- </xs:annotation>
-
-
- <xs:import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/xml.xsd">
-
- </xs:import>
-
- <xs:import namespace="http://purl.org/dc/elements/1.1/"
- schemaLocation="dc.xsd"/>
-
- <xs:element name="alternative" substitutionGroup="dc:title"/>
-
- <xs:element name="tableOfContents" substitutionGroup="dc:description"/>
- <xs:element name="abstract" substitutionGroup="dc:description"/>
-
- <xs:element name="created" substitutionGroup="dc:date"/>
- <xs:element name="valid" substitutionGroup="dc:date"/>
-
- <xs:element name="available" substitutionGroup="dc:date"/>
- <xs:element name="issued" substitutionGroup="dc:date"/>
- <xs:element name="modified" substitutionGroup="dc:date"/>
- <xs:element name="dateAccepted" substitutionGroup="dc:date"/>
- <xs:element name="dateCopyrighted" substitutionGroup="dc:date"/>
- <xs:element name="dateSubmitted" substitutionGroup="dc:date"/>
-
- <xs:element name="extent" substitutionGroup="dc:format"/>
- <xs:element name="medium" substitutionGroup="dc:format"/>
-
- <xs:element name="isVersionOf" substitutionGroup="dc:relation"/>
- <xs:element name="hasVersion" substitutionGroup="dc:relation"/>
- <xs:element name="isReplacedBy" substitutionGroup="dc:relation"/>
- <xs:element name="replaces" substitutionGroup="dc:relation"/>
- <xs:element name="isRequiredBy" substitutionGroup="dc:relation"/>
- <xs:element name="requires" substitutionGroup="dc:relation"/>
- <xs:element name="isPartOf" substitutionGroup="dc:relation"/>
- <xs:element name="hasPart" substitutionGroup="dc:relation"/>
-
- <xs:element name="isReferencedBy" substitutionGroup="dc:relation"/>
- <xs:element name="references" substitutionGroup="dc:relation"/>
- <xs:element name="isFormatOf" substitutionGroup="dc:relation"/>
- <xs:element name="hasFormat" substitutionGroup="dc:relation"/>
- <xs:element name="conformsTo" substitutionGroup="dc:relation"/>
-
- <xs:element name="spatial" substitutionGroup="dc:coverage"/>
- <xs:element name="temporal" substitutionGroup="dc:coverage"/>
-
- <xs:element name="audience" substitutionGroup="dc:any"/>
-
- <xs:element name="accrualMethod" substitutionGroup="dc:any"/>
- <xs:element name="accrualPeriodicity" substitutionGroup="dc:any"/>
- <xs:element name="accrualPolicy" substitutionGroup="dc:any"/>
- <xs:element name="instructionalMethod" substitutionGroup="dc:any"/>
- <xs:element name="provenance" substitutionGroup="dc:any"/>
- <xs:element name="rightsHolder" substitutionGroup="dc:any"/>
-
- <xs:element name="mediator" substitutionGroup="audience"/>
- <xs:element name="educationLevel" substitutionGroup="audience"/>
-
- <xs:element name="accessRights" substitutionGroup="dc:rights"/>
- <xs:element name="license" substitutionGroup="dc:rights"/>
-
- <xs:element name="bibliographicCitation" substitutionGroup="dc:identifier"/>
-
-</xs:schema>
diff --git a/taverna-perspective-biocatalogue/src/main/xsd/schema-v1.xsd b/taverna-perspective-biocatalogue/src/main/xsd/schema-v1.xsd
deleted file mode 100644
index fc37641..0000000
--- a/taverna-perspective-biocatalogue/src/main/xsd/schema-v1.xsd
+++ /dev/null
@@ -1,3572 +0,0 @@
-<?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.
--->
-<xsd:schema targetNamespace="http://www.biocatalogue.org/2009/xml/rest"
- xml:lang="en" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.biocatalogue.org/2009/xml/rest"
- elementFormDefault="qualified" xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/">
-
- <xsd:import namespace="http://purl.org/dc/elements/1.1/"
- schemaLocation="dc.xsd" />
- <xsd:import namespace="http://purl.org/dc/terms/"
- schemaLocation="dcterms.xsd" />
- <xsd:import namespace="http://www.w3.org/1999/xlink"
- schemaLocation="xlink.xsd" />
-
- <xsd:simpleType name="SearchScopeUrlValue">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="all"></xsd:enumeration>
- <xsd:enumeration value="service_providers"></xsd:enumeration>
-
- <xsd:enumeration value="services"></xsd:enumeration>
- <xsd:enumeration value="users"></xsd:enumeration>
- <xsd:enumeration value="registries"></xsd:enumeration>
- <xsd:enumeration value="soap_operations"></xsd:enumeration>
- <xsd:enumeration value="rest_methods"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:element name="search" type="Search"></xsd:element>
-
- <xsd:complexType name="Search">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="SearchParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="SearchStatistics"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="results" type="SearchResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="SearchRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="SearchParameters">
- <xsd:sequence>
-
- <xsd:element name="query" type="SearchQueryParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="scope" type="SearchScopeParameter"
- maxOccurs="unbounded" minOccurs="1">
- </xsd:element>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="SearchStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics">
- <xsd:sequence>
- <xsd:element name="scopedResults" minOccurs="0"
- maxOccurs="unbounded">
- <xsd:complexType>
-
- <xsd:simpleContent>
- <xsd:extension base="xsd:nonNegativeInteger">
- <xsd:attribute name="scope" type="SearchScopeName">
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
-
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="biocatalogue" type="BioCatalogue" />
-
- <xsd:complexType name="BioCatalogue">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
-
- <xsd:element name="documentation" maxOccurs="1"
- minOccurs="1" type="ResourceLink">
- </xsd:element>
- <xsd:element name="collections" maxOccurs="1"
- minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="agents"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="annotationAttributes"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="annotations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="categories"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="registries"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="restMethods"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="restResources"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="restServices"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="search"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="serviceProviders"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="services"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="soapOperations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="soapServices"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="tags"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="testResults"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="users"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="filters"
- maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="annotations" type="ResourceLink" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element
- name="restMethods" type="ResourceLink" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="services"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element
- name="soapOperations" type="ResourceLink" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="version" type="xsd:string"
- use="required">
- </xsd:attribute>
- <xsd:attribute name="apiVersion" type="xsd:string" use="required"></xsd:attribute>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="SearchRelatedLinks">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks">
- <xsd:sequence>
- <xsd:element name="searches" minOccurs="1" maxOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="scoped" type="ScopedSearch"
- minOccurs="0" maxOccurs="unbounded">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="CollectionCoreRelatedLinks">
-
- <xsd:sequence>
- <xsd:element name="previous" type="ResourceLink"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="next" type="ResourceLink" maxOccurs="1"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="ResourceLink">
-
- <xsd:attribute ref="xlink:href" use="required"></xsd:attribute>
- <xsd:attribute ref="xlink:title" use="optional"></xsd:attribute>
- <xsd:attribute name="resourceType" type="ResourceType"
- use="optional"></xsd:attribute>
- <xsd:attribute name="resourceName" type="xsd:string"
- use="optional">
- </xsd:attribute>
- </xsd:complexType>
-
-
- <xsd:complexType name="ScopedSearch">
- <xsd:complexContent>
-
- <xsd:extension base="ResourceLink">
- <xsd:attribute name="scope" type="SearchScopeName"></xsd:attribute>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:simpleType name="SearchScopeName">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="All"></xsd:enumeration>
-
- <xsd:enumeration value="Services"></xsd:enumeration>
- <xsd:enumeration value="Service Providers"></xsd:enumeration>
- <xsd:enumeration value="Users"></xsd:enumeration>
- <xsd:enumeration value="Registries"></xsd:enumeration>
- <xsd:enumeration value="SOAP Operations"></xsd:enumeration>
- <xsd:enumeration value="REST Endpoints"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="SearchScopeParameter">
- <xsd:simpleContent>
- <xsd:extension base="SearchScopeName">
- <xsd:attribute name="urlKey" type="xsd:string"></xsd:attribute>
- <xsd:attribute name="urlValue" type="SearchScopeUrlValue"
- use="required">
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="SearchResults">
- <xsd:sequence>
- <xsd:choice maxOccurs="unbounded" minOccurs="0">
- <xsd:element name="service" type="Service"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- <xsd:element name="soapOperation" type="SoapOperation"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- <xsd:element name="serviceProvider"
- type="ServiceProvider" maxOccurs="unbounded" minOccurs="0">
-
- </xsd:element>
- <xsd:element name="user" type="User"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- <xsd:element name="registry" type="Registry"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- <xsd:element name="restMethod" type="RestMethod"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:choice>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="service" type="Service"></xsd:element>
-
- <xsd:complexType name="Service">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="name" type="xsd:string"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="originalSubmitter"
- type="ResourceLink" minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="serviceTechnologyTypes"
- maxOccurs="1" minOccurs="1">
- <xsd:complexType>
-
- <xsd:sequence>
- <xsd:element name="type"
- type="ServiceTechnologyType" maxOccurs="unbounded"
- minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="latestMonitoringStatus"
- type="MonitoringStatus" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" minOccurs="1"
- maxOccurs="1">
-
- </xsd:element>
- <xsd:element name="archived" type="xsd:dateTime"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="summary" minOccurs="0"
- maxOccurs="1" type="ServiceSummary">
- </xsd:element>
- <xsd:element name="deployments" minOccurs="0"
- maxOccurs="1">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
-
- <xsd:sequence>
- <xsd:element
- name="serviceDeployment" type="ServiceDeployment"
- minOccurs="1" maxOccurs="unbounded">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="variants" minOccurs="0"
- maxOccurs="1">
-
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:choice
- maxOccurs="unbounded" minOccurs="1">
- <xsd:element
- name="soapService" type="SoapService" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
- <xsd:element
- name="restService" type="RestService" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
-
- </xsd:choice>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="monitoring" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:complexContent>
-
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="tests"
- maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="serviceTest" type="ServiceTest"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related"
- type="ServiceRelatedLinks" minOccurs="0" maxOccurs="1">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ServiceSummary">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="counts" minOccurs="1" maxOccurs="1">
-
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="deployments" type="xsd:positiveInteger"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="variants" type="xsd:positiveInteger"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="metadata" type="MetadataCount"
- minOccurs="0" maxOccurs="unbounded">
- </xsd:element>
- <xsd:element name="favourites" type="xsd:nonNegativeInteger"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="views" type="xsd:nonNegativeInteger"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="alternativeName" minOccurs="0"
- maxOccurs="unbounded" type="xsd:string">
- </xsd:element>
- <xsd:element name="category" minOccurs="0" maxOccurs="unbounded"
- type="ResourceLinkWithString">
-
- </xsd:element>
- <xsd:element name="provider" minOccurs="1" maxOccurs="unbounded">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="endpoint" minOccurs="1" maxOccurs="unbounded"
- type="xsd:anyURI">
- </xsd:element>
- <xsd:element name="wsdl" minOccurs="0" maxOccurs="unbounded"
- type="xsd:anyURI">
- </xsd:element>
- <xsd:element name="location" minOccurs="0" maxOccurs="unbounded"
- type="Location">
-
- </xsd:element>
- <xsd:element name="documentationUrl" maxOccurs="unbounded"
- minOccurs="0" type="xsd:string">
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="tag" minOccurs="0" maxOccurs="unbounded"
- type="ResourceLinkWithString">
- </xsd:element>
- <xsd:element name="cost" maxOccurs="unbounded"
- minOccurs="0" type="xsd:string">
- </xsd:element>
-
- <xsd:element name="license" type="xsd:string"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- <xsd:element name="usageCondition" maxOccurs="unbounded"
- minOccurs="0" type="xsd:string">
- </xsd:element>
- <xsd:element name="contact" maxOccurs="unbounded"
- minOccurs="0" type="xsd:string">
- </xsd:element>
- <xsd:element name="publication" maxOccurs="unbounded"
- minOccurs="0" type="xsd:string">
- </xsd:element>
- <xsd:element name="citation" maxOccurs="unbounded"
- minOccurs="0" type="xsd:string">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="serviceProvider" type="ServiceProvider"></xsd:element>
-
- <xsd:complexType name="ServiceProvider">
- <xsd:complexContent>
-
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string" minOccurs="1"
- maxOccurs="1">
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="hostnames" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="hostname" type="xsd:string"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="related" type="ServiceProviderRelatedLinks"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="user" type="User"></xsd:element>
-
- <xsd:complexType name="User">
-
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="affiliation" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="location" type="Location"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="publicEmail" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="joined" type="xsd:dateTime"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="savedSearches" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:complexContent>
-
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="savedSearch"
- type="SavedSearch" maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="related" type="UserRelatedLinks"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="registry" type="Registry"></xsd:element>
-
- <xsd:complexType name="Registry">
-
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string" minOccurs="1"
- maxOccurs="1">
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
-
- <xsd:element name="homepage" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="RegistryRelatedLinks"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:element name="services" type="Services"></xsd:element>
-
- <xsd:complexType name="Services">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="ServicesParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="statistics" type="ServicesStatistics"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="results" type="ServicesResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="ServicesRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:complexType name="ServicesParameters">
- <xsd:sequence>
- <xsd:element name="filters" maxOccurs="1" minOccurs="1"
- type="FiltersParameters">
-
- </xsd:element>
- <xsd:element name="query" maxOccurs="1" minOccurs="1"
- type="SearchQueryParameter">
- </xsd:element>
- <xsd:element ref="sortBy" maxOccurs="1" minOccurs="1"></xsd:element>
-
- <xsd:element ref="sortOrder" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="FiltersParameters">
- <xsd:sequence>
- <xsd:element name="group" type="FilterGroupParameter"
- minOccurs="0" maxOccurs="unbounded">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="ServicesStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:complexType name="ServicesResults">
- <xsd:sequence>
- <xsd:element name="service" type="Service" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="ServicesRelatedLinks">
-
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks">
- <xsd:sequence>
- <xsd:element name="filters" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="filtersOnCurrentResults" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="withSummaries" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="withDeployments" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="withVariants" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="withMonitoring" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="withAllSections" type="ResourceLink"
- maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="Filters">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="group" type="FilterGroup" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="for" type="ResourceType" use="required"></xsd:attribute>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="filters" type="Filters"></xsd:element>
-
- <xsd:complexType name="FilterType">
- <xsd:sequence>
-
- <xsd:element name="filter" type="Filter" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="FilterTypeName" use="required">
- </xsd:attribute>
- <xsd:attribute name="urlKey" type="FilterTypeUrlKey"
- use="required">
- </xsd:attribute>
- <xsd:attribute name="description" type="xsd:string" use="required"></xsd:attribute>
- </xsd:complexType>
-
- <xsd:simpleType name="FilterTypeName">
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="FilterTypeUrlKey">
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="Filter">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="filter" type="Filter" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="urlValue" type="xsd:string" use="required">
-
- </xsd:attribute>
- <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
- <xsd:attribute name="count" type="xsd:nonNegativeInteger"
- use="required">
- </xsd:attribute>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="CollectionCoreStatistics">
-
- <xsd:sequence>
- <xsd:element name="pages" type="xsd:nonNegativeInteger"
- maxOccurs="1" minOccurs="1">
- <xsd:annotation>
- <xsd:documentation>The total number of pages available for this
- result set</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="results" type="xsd:nonNegativeInteger"
- maxOccurs="1" minOccurs="1">
- <xsd:annotation>
-
- <xsd:documentation>The total number of results available for this
- result set</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="total" type="xsd:nonNegativeInteger"
- maxOccurs="1" minOccurs="0">
- <xsd:annotation>
- <xsd:documentation>When present, this gives the total number of
- resources of the particular resource type that the result set is
- referring to. Eg: for /services, this would be the total number of
- services available regardless of how many are in the result set
- (which may have been filtered down).</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
-
-
-
- <xsd:simpleType name="SortBy">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="created"></xsd:enumeration>
- <xsd:enumeration value="activated"></xsd:enumeration>
- <xsd:enumeration value="name"></xsd:enumeration>
-
- <xsd:enumeration value="modified"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="SortOrder">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="asc"></xsd:enumeration>
- <xsd:enumeration value="desc"></xsd:enumeration>
- </xsd:restriction>
-
- </xsd:simpleType>
-
- <xsd:element name="tags" type="Tags"></xsd:element>
-
- <xsd:complexType name="Tags">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="TagsParameters"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
-
- <xsd:element name="statistics" type="TagsStatistics"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="results" type="TagsResults"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="TagsRelated"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:complexType name="TagsParameters">
- <xsd:sequence>
- <xsd:element name="sort" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="urlKey" use="required">
-
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="sort">
- </xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="urlValue">
- <xsd:simpleType>
-
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="counts">
- </xsd:enumeration>
- <xsd:enumeration value="name">
- </xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:extension>
-
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element name="limit" type="xsd:nonNegativeInteger"
- maxOccurs="1" minOccurs="1" nillable="true"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="TagsStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="TagsResults">
- <xsd:sequence>
-
- <xsd:element name="tag" type="Tag" minOccurs="0"
- maxOccurs="unbounded">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="TagsRelated">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks">
- </xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="Tag">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="name" type="xsd:string" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="displayName" type="xsd:string"
- maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element name="totalItemsCount" type="xsd:nonNegativeInteger"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="TagRelatedLinks"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:simpleType name="SubmitterType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="User"></xsd:enumeration>
- <xsd:enumeration value="Registry"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:simpleType name="AnnotationSourceType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="User"></xsd:enumeration>
- <xsd:enumeration value="ServiceProvider"></xsd:enumeration>
- <xsd:enumeration value="Registry"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
-
-
- <xsd:complexType name="ServiceDeployment">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="endpoint" type="xsd:anyURI"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="serviceProvider" type="ServiceProvider"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="location" minOccurs="1" maxOccurs="1"
- type="Location">
-
- </xsd:element>
- <xsd:element name="submitter" type="ResourceLink"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="providedVariant" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:choice>
- <xsd:element name="soapService" type="SoapService"
- maxOccurs="1" minOccurs="0">
-
- </xsd:element>
- <xsd:element name="restService" type="RestService"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
-
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="annotations" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
- <xsd:simpleType name="ServiceTechnologyType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="SOAP"></xsd:enumeration>
- <xsd:enumeration value="REST"></xsd:enumeration>
- <xsd:enumeration value="Soaplab"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="Annotation">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="annotatable" type="ResourceLink"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="source" type="ResourceLink"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="version" type="xsd:positiveInteger"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="annotationAttribute" type="AnnotationAttribute"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="value" minOccurs="1" maxOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="resource" type="ResourceLink"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="type" type="xsd:string"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="content" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element ref="dcterms:created" minOccurs="1"
- maxOccurs="1">
- </xsd:element>
-
- <xsd:element ref="dcterms:modified" minOccurs="0"
- maxOccurs="1">
- </xsd:element>
- <xsd:element name="related" maxOccurs="1" minOccurs="0">
- <xsd:complexType></xsd:complexType>
- </xsd:element>
- </xsd:sequence>
-
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:complexType name="AnnotationAttribute">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element ref="dc:identifier" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="related" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="annotations" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
-
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
-
-
- <xsd:complexType name="ServiceRelatedLinks">
- <xsd:sequence>
- <xsd:element name="withSummary" type="ResourceLink"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="withMonitoring" type="ResourceLink"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- <xsd:element name="withAllSections" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="summary" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="deployments" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="variants" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="monitoring" type="ResourceLink"
- maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element name="annotations" type="ResourceLink"
- minOccurs="1" maxOccurs="1">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
-
- <xsd:simpleType name="MetadataBy">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="all"></xsd:enumeration>
- <xsd:enumeration value="users"></xsd:enumeration>
- <xsd:enumeration value="providers"></xsd:enumeration>
- <xsd:enumeration value="registries"></xsd:enumeration>
- </xsd:restriction>
-
- </xsd:simpleType>
-
- <xsd:complexType name="MetadataCount">
- <xsd:simpleContent>
- <xsd:extension base="xsd:nonNegativeInteger">
- <xsd:attribute name="by" type="MetadataBy"></xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="SearchQueryParameter">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="urlKey" type="xsd:string" use="required">
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="PageParameter">
- <xsd:simpleContent>
- <xsd:extension base="xsd:nonNegativeInteger">
- <xsd:attribute name="urlKey" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="page"></xsd:enumeration>
- </xsd:restriction>
-
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
-
-
- <xsd:complexType name="SortByParameter">
- <xsd:simpleContent>
-
- <xsd:extension base="xsd:string">
- <xsd:attribute name="urlKey" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="sort_by"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="urlValue" type="SortBy" use="required">
-
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="SortOrderParameter">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="urlKey" use="required">
-
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="sort_order"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="urlValue" type="SortOrder" use="required"></xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
-
- </xsd:complexType>
-
- <xsd:element name="categories" type="Categories"></xsd:element>
-
- <xsd:element name="category" type="Category"></xsd:element>
-
- <xsd:complexType name="Category">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
-
- <xsd:element ref="dc:title" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element name="name" type="xsd:string" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="totalItemsCount" type="xsd:nonNegativeInteger"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="broader" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="category" type="Category"
- maxOccurs="unbounded" minOccurs="0">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="narrower" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="category" type="Category"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="services" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="Categories">
- <xsd:complexContent>
-
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="CategoriesParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="CategoriesStatistics"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="results" type="CategoriesResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="CategoriesRelatedLinks"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="CategoriesParameters">
- <xsd:sequence>
- <xsd:element name="rootsOnly" maxOccurs="1" minOccurs="1">
-
- <xsd:complexType>
- <xsd:simpleContent>
- <xsd:extension base="xsd:boolean">
- <xsd:attribute name="urlKey" type="xsd:string" use="required">
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="CategoriesStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="CategoriesResults">
- <xsd:sequence>
- <xsd:element name="category" type="Category" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="CategoriesRelatedLinks">
- <xsd:sequence>
-
- <xsd:element name="serviceFilters" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="ResourceLinkWithString">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute ref="xlink:href" use="required"></xsd:attribute>
-
- <xsd:attribute ref="xlink:title" use="optional"></xsd:attribute>
- <xsd:attribute name="resourceType" type="ResourceType"
- use="optional"></xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
-
- <xsd:complexType name="MonitoringStatus">
- <xsd:sequence>
- <xsd:element name="label" maxOccurs="1" minOccurs="1"
- type="MonitoringStatusLabel">
-
- </xsd:element>
- <xsd:element name="message" type="xsd:string" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="symbol" type="ResourceLink" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="smallSymbol" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="lastChecked" type="xsd:dateTime"
- maxOccurs="1" minOccurs="1" nillable="true"></xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
-
- <xsd:complexType name="TagRelatedLinks">
- <xsd:sequence>
- <xsd:element name="services" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="soapOperations" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="restMethods" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="tag" type="Tag"></xsd:element>
-
- <xsd:complexType name="PageSizeParameter">
- <xsd:simpleContent>
- <xsd:extension base="xsd:nonNegativeInteger">
- <xsd:attribute name="urlKey" use="required">
-
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="per_page"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:element name="serviceProviders" type="ServiceProviders"></xsd:element>
-
- <xsd:complexType name="ServiceProviders">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="ServiceProvidersParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="ServiceProvidersStatistics"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="results" type="ServiceProvidersResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="ServiceProvidersRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ServiceProviderRelatedLinks">
- <xsd:sequence>
- <xsd:element name="annotations" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="annotationsBy" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="services" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="ServiceProvidersParameters">
- <xsd:sequence>
- <xsd:element name="filters" type="FiltersParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="query" type="SearchQueryParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element ref="sortBy" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="sortOrder" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="ServiceProvidersStatistics">
- <xsd:complexContent>
-
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="ServiceProvidersResults">
- <xsd:sequence>
- <xsd:element name="serviceProvider" type="ServiceProvider"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="ServiceProvidersRelatedLinks">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks">
- <xsd:sequence>
- <xsd:element name="filters" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="filtersOnCurrentResults"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="sortBy" type="SortByParameter"></xsd:element>
-
- <xsd:element name="sortOrder" type="SortOrderParameter"></xsd:element>
-
- <xsd:element name="page" type="PageParameter"></xsd:element>
-
- <xsd:element name="pageSize" type="PageSizeParameter"></xsd:element>
-
- <xsd:element name="soapService" type="SoapService"></xsd:element>
-
- <xsd:complexType name="SoapService">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
-
- <xsd:element ref="dc:title" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="wsdlLocation" type="xsd:anyURI"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="submitter" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="documentationUrl" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="deployments" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
-
- <xsd:sequence>
- <xsd:element name="serviceDeployment" type="ServiceDeployment"
- maxOccurs="unbounded" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="operations" maxOccurs="1" minOccurs="0">
-
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="soapOperation" type="SoapOperation"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:element>
- <xsd:element name="related" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="deployments" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="operations" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="annotations" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
- <xsd:element name="restService" type="RestService"></xsd:element>
-
- <xsd:complexType name="RestService">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
-
- <xsd:element name="name" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="submitter" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="documentationUrl"
- type="xsd:string" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="deployments" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element
- name="serviceDeployment" type="ServiceDeployment"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resources" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
-
- <xsd:element name="restResource"
- type="RestResource" maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="methods" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
-
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="restMethod"
- type="RestMethod" maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="related" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="deployments"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="resources"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="methods"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="annotations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
-
- <xsd:element name="serviceDeployment" type="ServiceDeployment"></xsd:element>
-
-
- <xsd:complexType name="FilterTypeParameter">
- <xsd:sequence>
- <xsd:element name="filter" type="FilterParameter"
- maxOccurs="unbounded" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
-
- <xsd:attribute name="name" type="FilterTypeName" use="required">
- </xsd:attribute>
- <xsd:attribute name="urlKey" type="FilterTypeUrlKey"
- use="required">
- </xsd:attribute>
- <xsd:attribute name="description" type="xsd:string" use="required"></xsd:attribute>
- </xsd:complexType>
-
- <xsd:complexType name="FilterParameter">
- <xsd:simpleContent>
-
- <xsd:extension base="xsd:string">
- <xsd:attribute name="urlValue" type="xsd:string" use="required">
- </xsd:attribute>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:complexType name="Location">
- <xsd:sequence>
-
- <xsd:element name="city" type="xsd:string" maxOccurs="1"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="country" type="xsd:string" maxOccurs="1"
- minOccurs="0">
- </xsd:element>
- <xsd:element name="iso3166CountryCode" type="xsd:string"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="flag" type="ResourceLink" maxOccurs="1"
- minOccurs="0"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="users" type="Users"></xsd:element>
-
- <xsd:complexType name="Users">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="UsersParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="UsersStatistics"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="results" type="UsersResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="UsersRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="UsersParameters">
- <xsd:sequence>
- <xsd:element name="filters" type="FiltersParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="query" type="SearchQueryParameter" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="sortBy" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="sortOrder" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
-
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="UsersStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:complexType name="UsersResults">
- <xsd:sequence>
- <xsd:element name="user" type="User" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="UsersRelatedLinks">
-
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks">
- <xsd:sequence>
- <xsd:element name="filters" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="filtersOnCurrentResults"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="UserRelatedLinks">
- <xsd:sequence>
- <xsd:element name="annotationsBy" type="ResourceLink"
- maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element name="services" type="ResourceLink"
- maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="registries" type="Registries"></xsd:element>
-
- <xsd:complexType name="Registries">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="RegistriesParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="RegistriesStatistics"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="results" type="RegistriesResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="RegistriesRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="RegistriesParameters">
- <xsd:sequence>
- <xsd:element ref="sortBy" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="sortOrder" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="RegistriesStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="RegistriesResults">
- <xsd:sequence>
-
- <xsd:element name="registry" type="Registry" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="RegistriesRelatedLinks">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks"></xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:complexType name="RegistryRelatedLinks">
- <xsd:sequence>
- <xsd:element name="annotationsBy" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="services" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
-
- <xsd:simpleType name="MonitoringStatusLabel">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="PASSED"></xsd:enumeration>
- <xsd:enumeration value="WARNING"></xsd:enumeration>
- <xsd:enumeration value="FAILED"></xsd:enumeration>
- <xsd:enumeration value="UNCHECKED"></xsd:enumeration>
- </xsd:restriction>
-
- </xsd:simpleType>
-
-
- <xsd:complexType name="SoapOperation">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="parameterOrder" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="archived" type="xsd:dateTime"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
-
- <xsd:element name="inputs" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="soapInput"
- type="SoapInput" maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="outputs" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="soapOutput"
- type="SoapOutput" maxOccurs="unbounded" minOccurs="0">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
-
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="soapService"
- type="SoapService" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
-
- <xsd:sequence>
- <xsd:element name="inputs"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="outputs"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="annotations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="annotationsOnAll"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="soapOperation" type="SoapOperation"></xsd:element>
-
- <xsd:element name="soapInput" type="SoapInput"></xsd:element>
-
- <xsd:complexType name="SoapInput">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="computationalType"
- type="xsd:string" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="computationalTypeDetails"
- type="xsd:string" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
-
- <xsd:element name="archived" type="xsd:dateTime"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="soapService"
- type="SoapService" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="soapOperation"
- type="SoapOperation" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="annotations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="soapOutput" type="SoapOutput"></xsd:element>
-
- <xsd:complexType name="SoapOutput">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="computationalType"
- type="xsd:string" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="computationalTypeDetails"
- type="xsd:string" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
-
- <xsd:element name="archived" type="xsd:dateTime"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="soapService"
- type="SoapService" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="soapOperation"
- type="SoapOperation" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="annotations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:simpleType name="ResourceType">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="Annotation"></xsd:enumeration>
- <xsd:enumeration value="AnnotationAttribute"></xsd:enumeration>
- <xsd:enumeration value="Annotations"></xsd:enumeration>
- <xsd:enumeration value="BioCatalogue"></xsd:enumeration>
- <xsd:enumeration value="Categories"></xsd:enumeration>
- <xsd:enumeration value="Category"></xsd:enumeration>
-
- <xsd:enumeration value="Filters"></xsd:enumeration>
- <xsd:enumeration value="Registries"></xsd:enumeration>
- <xsd:enumeration value="Registry"></xsd:enumeration>
- <xsd:enumeration value="RestService"></xsd:enumeration>
- <xsd:enumeration value="Search"></xsd:enumeration>
- <xsd:enumeration value="Service"></xsd:enumeration>
- <xsd:enumeration value="ServiceDeployment"></xsd:enumeration>
- <xsd:enumeration value="ServiceProvider"></xsd:enumeration>
- <xsd:enumeration value="ServiceProviders"></xsd:enumeration>
-
- <xsd:enumeration value="Services"></xsd:enumeration>
- <xsd:enumeration value="SoapInput"></xsd:enumeration>
- <xsd:enumeration value="SoapOperation"></xsd:enumeration>
- <xsd:enumeration value="SoapOutput"></xsd:enumeration>
- <xsd:enumeration value="SoapService"></xsd:enumeration>
- <xsd:enumeration value="Tag"></xsd:enumeration>
- <xsd:enumeration value="Tags"></xsd:enumeration>
- <xsd:enumeration value="Tags"></xsd:enumeration>
- <xsd:enumeration value="User"></xsd:enumeration>
-
- <xsd:enumeration value="Users"></xsd:enumeration>
- <xsd:enumeration value="Annotations"></xsd:enumeration>
- <xsd:enumeration value="AnnotationAttributes"></xsd:enumeration>
- <xsd:enumeration value="ServiceTest"></xsd:enumeration>
- <xsd:enumeration value="TestResult"></xsd:enumeration>
- <xsd:enumeration value="TestResults"></xsd:enumeration>
- <xsd:enumeration value="UrlMonitor"></xsd:enumeration>
- <xsd:enumeration value="TestScript"></xsd:enumeration>
- <xsd:enumeration value="Errors"></xsd:enumeration>
-
- <xsd:enumeration value="SearchByData"></xsd:enumeration>
- <xsd:enumeration value="SoapOperations"></xsd:enumeration>
- <xsd:enumeration value="Agent"></xsd:enumeration>
- <xsd:enumeration value="Agents"></xsd:enumeration>
- <xsd:enumeration value="RestMethod"></xsd:enumeration>
- <xsd:enumeration value="RestParameter"></xsd:enumeration>
- <xsd:enumeration value="RestRepresentation"></xsd:enumeration>
- <xsd:enumeration value="RestMethods"></xsd:enumeration>
- <xsd:enumeration value="SoapServices"></xsd:enumeration>
-
- <xsd:enumeration value="RestServices"></xsd:enumeration>
- <xsd:enumeration value="RestResources"></xsd:enumeration>
- <xsd:enumeration value="RestResource"></xsd:enumeration>
- <xsd:enumeration value="SavedSearch"></xsd:enumeration>
- <xsd:enumeration value="WsdlLocations"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:element name="annotationAttribute" type="AnnotationAttribute">
-
- </xsd:element>
-
- <xsd:element name="annotationAttributes" type="AnnotationAttributes">
- </xsd:element>
-
- <xsd:complexType name="AnnotationAttributes">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="AnnotationAttributesParameters"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="statistics" type="AnnotationAttributesStatistics"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="results" type="AnnotationAttributesResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="AnnotationAttributesRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="AnnotationAttributesParameters">
- <xsd:sequence>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="AnnotationAttributesStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="AnnotationAttributesResults">
- <xsd:sequence>
- <xsd:element name="annotationAttribute" type="AnnotationAttribute"
- maxOccurs="unbounded" minOccurs="0">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="AnnotationAttributesRelatedLinks">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="annotations" type="Annotations"></xsd:element>
-
- <xsd:complexType name="Annotations">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="AnnotationsParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="AnnotationsStatistics"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="results" type="AnnotationsResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="AnnotationsRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="AnnotationsParameters">
- <xsd:sequence>
- <xsd:element name="filters" type="FiltersParameters"
- maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="sortBy" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="sortOrder" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
-
- <xsd:complexType name="AnnotationsStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="AnnotationsResults">
- <xsd:sequence>
-
- <xsd:element name="annotation" type="Annotation"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="AnnotationsRelatedLinks">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks">
- <xsd:sequence>
-
- <xsd:element name="filters" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="filtersOnCurrentResults" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="annotation" type="Annotation"></xsd:element>
-
- <xsd:element name="testResult" type="TestResult"></xsd:element>
-
- <xsd:complexType name="TestResult">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="testAction" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="resultCode" type="xsd:integer"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="status" type="MonitoringStatus"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
-
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="serviceTest"
- type="ServiceTest" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1" minOccurs="0">
- <xsd:complexType></xsd:complexType>
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:element name="testResults" type="TestResults"></xsd:element>
-
- <xsd:complexType name="TestResults">
- <xsd:complexContent>
-
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element ref="sortBy" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="sortOrder" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
-
- <xsd:element ref="page" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="serviceTest" type="ResourceLink"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="statistics" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="results" maxOccurs="1" minOccurs="1">
-
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="testResult" type="TestResult"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
-
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:element name="serviceTest" type="ServiceTest"></xsd:element>
-
- <xsd:complexType name="ServiceTest">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="testType" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
-
- <xsd:choice>
- <xsd:element name="urlMonitor" type="UrlMonitor"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="testScript" type="TestScript"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="latestStatus" type="MonitoringStatus"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="results" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="UrlMonitor">
- <xsd:sequence>
- <xsd:element name="url" type="xsd:anyURI" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="resource" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="TestScript">
- <xsd:sequence>
- <xsd:element name="name" type="xsd:string" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="contentType" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="programmingLanguage" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="executableFilename" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="download" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="submitter" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="activatedAt" type="xsd:dateTime"
- nillable="true" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
-
- <xsd:element name="errors" type="Errors"></xsd:element>
-
- <xsd:complexType name="Errors">
- <xsd:sequence>
- <xsd:element name="error" type="xsd:string" maxOccurs="unbounded"
- minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="searchByData" type="SearchByData"></xsd:element>
-
- <xsd:complexType name="SearchByData">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
-
- <xsd:element name="data" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="searchType" maxOccurs="1"
- minOccurs="1">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="input">
- </xsd:enumeration>
- <xsd:enumeration value="output">
- </xsd:enumeration>
-
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- <xsd:element name="limit" type="xsd:nonNegativeInteger"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="statistics" maxOccurs="1" minOccurs="1">
-
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="results" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
-
- <xsd:sequence>
- <xsd:element name="resultItem" maxOccurs="unbounded"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="service" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="soapOperation" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="port" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="annotation" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="related" maxOccurs="1" minOccurs="1">
- <xsd:complexType></xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
-
- <xsd:element name="soapOperations" type="SoapOperations"></xsd:element>
-
- <xsd:complexType name="SoapOperations">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
-
- <xsd:element name="filters" maxOccurs="1" minOccurs="1"
- type="FiltersParameters">
- </xsd:element>
- <xsd:element name="query" type="SearchQueryParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="sortBy" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="sortOrder" maxOccurs="1"
- minOccurs="1"></xsd:element>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="statistics" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- </xsd:element>
- <xsd:element name="results" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="soapOperation" type="SoapOperation"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="related" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks">
- <xsd:sequence>
- <xsd:element name="filters" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="filtersOnCurrentResults" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="FilterGroup">
- <xsd:sequence>
- <xsd:element name="type" type="FilterType" maxOccurs="unbounded"
- minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
- </xsd:complexType>
-
- <xsd:complexType name="FilterGroupParameter">
-
- <xsd:sequence>
- <xsd:element name="type" type="FilterTypeParameter"
- maxOccurs="unbounded" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
- </xsd:complexType>
-
- <xsd:element name="agents" type="Agents"></xsd:element>
-
- <xsd:complexType name="Agents">
-
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="AgentsParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="AgentsStatistics"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="results" type="AgentsResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="related" type="AgentsRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="AgentsParameters">
- <xsd:sequence>
-
- <xsd:element ref="sortBy" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="sortOrder" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="page" maxOccurs="1" minOccurs="1"></xsd:element>
- <xsd:element ref="pageSize" maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="AgentsStatistics">
- <xsd:complexContent>
-
- <xsd:extension base="CollectionCoreStatistics">
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="AgentsResults">
- <xsd:sequence>
- <xsd:element name="agent" type="Agent" maxOccurs="unbounded"
- minOccurs="0">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="AgentsRelatedLinks">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="AgentRelatedLinks">
-
- <xsd:sequence>
- <xsd:element name="annotationsBy" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:element name="agent" type="Agent"></xsd:element>
-
- <xsd:complexType name="Agent">
- <xsd:complexContent>
-
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string" minOccurs="1"
- maxOccurs="1">
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="related" type="AgentRelatedLinks"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
-
- <xsd:element name="soapServices" type="SoapServices"></xsd:element>
-
- <xsd:complexType name="SoapServices">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="SoapServicesParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="SoapServicesStatistics"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="results" type="SoapServicesResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="SoapServicesRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="SoapServicesParameters">
- <xsd:sequence>
- <xsd:element name="sortBy" type="SortByParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="sortOrder" type="SortOrderParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="page" type="PageParameter" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
-
- <xsd:element name="pageSize" type="PageSizeParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="SoapServicesStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics"></xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:complexType name="SoapServicesResults">
- <xsd:sequence>
- <xsd:element name="soapService" type="SoapService"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="SoapServicesRelatedLinks">
-
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
- <xsd:element name="restServices" type="RestServices"></xsd:element>
-
- <xsd:complexType name="RestServices">
- <xsd:complexContent>
-
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="RestServicesParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="RestServicesStatistics"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="results" type="RestServicesResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="RestServicesRelatedLinks"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="RestServicesParameters">
- <xsd:sequence>
- <xsd:element name="sortBy" type="SortByParameter"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="sortOrder" type="SortOrderParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="page" type="PageParameter" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="pageSize" type="PageSizeParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="RestServicesStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="RestServicesResults">
- <xsd:sequence>
- <xsd:element name="restService" type="RestService"
- maxOccurs="unbounded" minOccurs="0">
-
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="RestServicesRelatedLinks">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
- <xsd:element name="restResources" type="RestResources"></xsd:element>
-
- <xsd:complexType name="RestResources">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="RestResourcesParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="statistics" type="RestResourcesStatistics"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="results" type="RestResourcesResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="related" type="RestResourcesRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:complexType name="RestResourcesParameters">
- <xsd:sequence>
- <xsd:element name="sortBy" type="SortByParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="sortOrder" type="SortOrderParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="page" type="PageParameter" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="pageSize" type="PageSizeParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="RestResourcesStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics"></xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="RestResourcesResults">
- <xsd:sequence>
- <xsd:element name="restResource" type="RestResource"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="RestResourcesRelatedLinks">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks"></xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
- <xsd:element name="restMethods" type="RestMethods"></xsd:element>
-
- <xsd:complexType name="RestMethods">
-
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters" type="RestMethodsParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="statistics" type="RestMethodsStatistics"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="results" type="RestMethodsResults"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="related" type="RestMethodsRelatedLinks"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="RestMethodsParameters">
- <xsd:sequence>
-
- <xsd:element name="filters" type="FiltersParameters"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="query" type="SearchQueryParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="sortBy" type="SortByParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="sortOrder" type="SortOrderParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="page" type="PageParameter" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="pageSize" type="PageSizeParameter"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="RestMethodsStatistics">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreStatistics"></xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="RestMethodsResults">
- <xsd:sequence>
- <xsd:element name="restMethod" type="RestMethod"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="RestMethodsRelatedLinks">
- <xsd:complexContent>
- <xsd:extension base="CollectionCoreRelatedLinks">
- <xsd:sequence>
- <xsd:element name="filters" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="filtersOnCurrentResults"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="RestResource">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
-
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="path" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="submitter" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="archived" type="xsd:dateTime" maxOccurs="1" minOccurs="0"></xsd:element>
-
- <xsd:element name="methods" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="restMethod"
- type="RestMethod" maxOccurs="unbounded" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="restService"
- type="RestService" maxOccurs="1" minOccurs="1">
-
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="restMethods"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="annotations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:complexType name="RestMethod">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string"
- maxOccurs="1" minOccurs="1">
-
- </xsd:element>
- <xsd:element name="endpointLabel" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="httpMethodType" type="HttpVerb"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="urlTemplate" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
-
- <xsd:element name="documentationUrl"
- type="xsd:string" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="submitter" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="archived" type="xsd:dateTime"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="inputs" maxOccurs="1"
- minOccurs="0">
-
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters"
- maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="restParameter" type="RestParameter"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element
- name="representations" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="restRepresentation" type="RestRepresentation"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="outputs" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
-
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="parameters"
- maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="restParameter" type="RestParameter"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
-
- </xsd:complexType>
- </xsd:element>
- <xsd:element
- name="representations" maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="restRepresentation" type="RestRepresentation"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
-
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="restService"
- type="RestService" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="restResource"
- type="RestResource" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="related" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="inputs"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="outputs"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="annotations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
- <xsd:element name="restResource" type="RestResource"></xsd:element>
-
- <xsd:element name="restMethod" type="RestMethod"></xsd:element>
-
- <xsd:element name="restParameter" type="RestParameter"></xsd:element>
-
- <xsd:complexType name="RestParameter">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element name="name" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="computationalType"
- type="xsd:string" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="defaultValue" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="paramStyle"
- type="RestParameterStyle" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="isOptional" type="xsd:boolean"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="constrainedValues" maxOccurs="1"
- minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value"
- type="xsd:string" maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="submitter" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="archived" type="xsd:dateTime"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
-
- <xsd:element name="ancestors" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="restService"
- type="RestService" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="restResources"
- maxOccurs="1" minOccurs="1">
- <xsd:complexType>
-
- <xsd:sequence>
- <xsd:element
- name="restResource" type="RestResource"
- maxOccurs="unbounded" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="restMethods"
- maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
-
- <xsd:element
- name="restMethod" type="RestMethod" maxOccurs="unbounded"
- minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="related" maxOccurs="1"
- minOccurs="0">
-
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="annotations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
-
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:simpleType name="RestParameterStyle">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="template"></xsd:enumeration>
- <xsd:enumeration value="query"></xsd:enumeration>
- <xsd:enumeration value="matrix"></xsd:enumeration>
- <xsd:enumeration value="header"></xsd:enumeration>
-
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:element name="restRepresentation" type="RestRepresentation"></xsd:element>
-
- <xsd:complexType name="RestRepresentation">
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
-
- </xsd:element>
- <xsd:element ref="dc:description" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="contentType" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="submitter" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
-
- <xsd:element name="archived" type="xsd:dateTime"
- maxOccurs="1" minOccurs="0">
- </xsd:element>
- <xsd:element name="ancestors" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="service"
- type="Service" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="restService"
- type="RestService" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element name="restResources"
- maxOccurs="1" minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="restResource" type="RestResource"
- maxOccurs="unbounded" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="restMethods"
- maxOccurs="1" minOccurs="1">
-
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="restMethod" type="RestMethod" maxOccurs="unbounded"
- minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:element>
- <xsd:element name="related" maxOccurs="1"
- minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="annotations"
- type="ResourceLink" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-
- <xsd:element name="savedSearch" type="SavedSearch"></xsd:element>
-
- <xsd:complexType name="SavedSearch">
- <xsd:complexContent>
-
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element ref="dc:title" maxOccurs="1"
- minOccurs="1">
- </xsd:element>
- <xsd:element name="name" type="xsd:string"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="allScopes" type="xsd:boolean"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element name="query" type="xsd:string"
- maxOccurs="1" minOccurs="1" nillable="true">
-
- </xsd:element>
- <xsd:element name="scopes" maxOccurs="1"
- minOccurs="1">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="scope"
- maxOccurs="unbounded" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element
- name="scopeName" type="SearchScopeName" maxOccurs="1" minOccurs="1">
- </xsd:element>
-
- <xsd:element
- name="scopeUrlValue" type="SearchScopeUrlValue" maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element
- name="scopeResourceType" maxOccurs="1" minOccurs="1"
- type="ResourceType">
- </xsd:element>
- <xsd:element name="filters"
- type="FiltersParameters" maxOccurs="1" minOccurs="1">
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="user" type="ResourceLink"
- maxOccurs="1" minOccurs="1">
- </xsd:element>
- <xsd:element ref="dcterms:created" maxOccurs="1" minOccurs="1"></xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
-
- </xsd:complexType>
-
- <xsd:simpleType name="HttpVerb">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="OPTIONS"></xsd:enumeration>
- <xsd:enumeration value="GET"></xsd:enumeration>
- <xsd:enumeration value="HEAD"></xsd:enumeration>
- <xsd:enumeration value="POST"></xsd:enumeration>
- <xsd:enumeration value="PUT"></xsd:enumeration>
-
- <xsd:enumeration value="DELETE"></xsd:enumeration>
- <xsd:enumeration value="TRACE"></xsd:enumeration>
- <xsd:enumeration value="CONNECT"></xsd:enumeration>
- </xsd:restriction>
- </xsd:simpleType>
-
-
- <xsd:element name="wsdlLocations" type="WsdlLocations"></xsd:element>
-
- <xsd:complexType name="WsdlLocations">
-
- <xsd:complexContent>
- <xsd:extension base="ResourceLink">
- <xsd:sequence>
- <xsd:element name="wsdlLocation" type="xsd:anyURI"
- maxOccurs="unbounded" minOccurs="0">
- </xsd:element>
- </xsd:sequence>
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
-
-</xsd:schema>
diff --git a/taverna-perspective-biocatalogue/src/main/xsd/xlink.xsd b/taverna-perspective-biocatalogue/src/main/xsd/xlink.xsd
deleted file mode 100644
index 6c2034b..0000000
--- a/taverna-perspective-biocatalogue/src/main/xsd/xlink.xsd
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- METS XLink Schema, v. 2, Nov. 15, 2004 -->
-<!-- Downloaded from http://www.loc.gov/standards/mets/xlink.xsd at 2007-04-19 -->
-<!-- Downloaded from http://taverna.cvs.sf.net/viewvc/taverna/taverna-service/taverna-interface/src/main/resources/xlink.xsd?view=log at 2009-10-19 -->
-<schema targetNamespace="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified">
- <!-- global attributes -->
- <attribute name="href" type="anyURI"/>
- <attribute name="role" type="string"/>
- <attribute name="arcrole" type="string"/>
- <attribute name="title" type="string" />
- <attribute name="show">
- <simpleType>
-
- <restriction base="string">
- <enumeration value="new" />
- <enumeration value="replace" />
- <enumeration value="embed" />
- <enumeration value="other" />
- <enumeration value="none" />
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="actuate">
- <simpleType>
-
- <restriction base="string">
- <enumeration value="onLoad" />
- <enumeration value="onRequest" />
- <enumeration value="other" />
- <enumeration value="none" />
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="label" type="string" />
- <attribute name="from" type="string" />
- <attribute name="to" type="string" />
- <attributeGroup name="simpleLink">
-
- <attribute name="type" type="string" fixed="simple" form="qualified" />
- <attribute ref="xlink:href" use="optional" />
- <attribute ref="xlink:role" use="optional" />
- <attribute ref="xlink:arcrole" use="optional" />
- <attribute ref="xlink:title" use="optional" />
- <attribute ref="xlink:show" use="optional" />
- <attribute ref="xlink:actuate" use="optional" />
- </attributeGroup>
- <attributeGroup name="extendedLink">
- <attribute name="type" type="string" fixed="extended" form="qualified" />
- <attribute ref="xlink:role" use="optional" />
- <attribute ref="xlink:title" use="optional" />
- </attributeGroup>
- <attributeGroup name="locatorLink">
-
- <attribute name="type" type="string" fixed="locator" form="qualified" />
- <attribute ref="xlink:href" use="required" />
- <attribute ref="xlink:role" use="optional" />
- <attribute ref="xlink:title" use="optional" />
- <attribute ref="xlink:label" use="optional" />
- </attributeGroup>
- <attributeGroup name="arcLink">
- <attribute name="type" type="string" fixed="arc" form="qualified" />
- <attribute ref="xlink:arcrole" use="optional" />
- <attribute ref="xlink:title" use="optional" />
- <attribute ref="xlink:show" use="optional" />
- <attribute ref="xlink:actuate" use="optional" />
- <attribute ref="xlink:from" use="optional" />
- <attribute ref="xlink:to" use="optional" />
- </attributeGroup>
-
- <attributeGroup name="resourceLink">
- <attribute name="type" type="string" fixed="resource" form="qualified" />
- <attribute ref="xlink:role" use="optional" />
- <attribute ref="xlink:title" use="optional" />
- <attribute ref="xlink:label" use="optional" />
- </attributeGroup>
- <attributeGroup name="titleLink">
- <attribute name="type" type="string" fixed="title" form="qualified" />
- </attributeGroup>
- <attributeGroup name="emptyLink">
- <attribute name="type" type="string" fixed="none" form="qualified" />
- </attributeGroup>
-
-</schema>