From 9e65fc9cab9e9c1e112c01d6a9680de656b420af Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Tue, 12 Jul 2016 14:09:44 +0100 Subject: [PATCH 01/14] Remove wps_config.xml as it is not used --- .../src/main/resources/wps_config.xml | 212 ------------------ 1 file changed, 212 deletions(-) delete mode 100644 taverna-gis-activity/src/main/resources/wps_config.xml diff --git a/taverna-gis-activity/src/main/resources/wps_config.xml b/taverna-gis-activity/src/main/resources/wps_config.xml deleted file mode 100644 index cd73904..0000000 --- a/taverna-gis-activity/src/main/resources/wps_config.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.n52.wps.server.algorithm.JTSConvexHullAlgorithm - org.n52.wps.server.algorithm.test.DummyTestClass - org.n52.wps.server.algorithm.test.LongRunningDummyTestClass - org.n52.wps.server.algorithm.test.MultipleComplexInAndOutputsDummyTestClass - org.n52.wps.server.algorithm.test.MultiReferenceInputAlgorithm - org.n52.wps.server.algorithm.test.MultiReferenceBinaryInputAlgorithm - org.n52.wps.server.algorithm.test.EchoProcess - - - - - - - - - - - - false - - - - true - - PT1H - - P7D - - - - - - \ No newline at end of file From 8d4a3da51602961014881eaad42cb458e4fc1f41 Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Tue, 12 Jul 2016 21:04:11 +0100 Subject: [PATCH 02/14] add taverna-git-client template --- pom.xml | 2 +- .../org/apache/taverna/gis/GisActivity.java | 6 --- .../apache/taverna/gis/client/IGisClient.java | 44 +++++++++++++++++ .../gis/client/impl/NorthClientImpl.java | 48 +++++++++++++++++++ 4 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 taverna-gis-client/src/main/java/org/apache/taverna/gis/client/IGisClient.java create mode 100644 taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java diff --git a/pom.xml b/pom.xml index 283d755..e93f8f5 100644 --- a/pom.xml +++ b/pom.xml @@ -113,7 +113,7 @@ taverna-gis-plugin taverna-gis-activity taverna-gis-activity-ui - taverna-gis-plugin + taverna-gis-client diff --git a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivity.java b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivity.java index 2b8aef0..91986e2 100644 --- a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivity.java +++ b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivity.java @@ -21,19 +21,13 @@ package org.apache.taverna.gis; import java.io.IOException; -import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; -import java.util.List; import java.util.Map; -import org.geotools.ows.ServiceException; import org.n52.wps.client.ExecuteRequestBuilder; import org.n52.wps.client.ExecuteResponseAnalyser; import org.n52.wps.client.WPSClientException; import org.n52.wps.client.WPSClientSession; -import org.n52.wps.io.data.IData; -import org.n52.wps.io.data.binding.complex.GTVectorDataBinding; import net.opengis.wps.x100.DataType; import net.opengis.wps.x100.ExecuteDocument; diff --git a/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/IGisClient.java b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/IGisClient.java new file mode 100644 index 0000000..49ba05a --- /dev/null +++ b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/IGisClient.java @@ -0,0 +1,44 @@ +/* + * + * 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. + * + */ +package org.apache.taverna.gis.client; + +import java.net.URI; +import java.util.HashMap; + +public interface IGisClient { + + // TODO: The interface is specific to WPS services. It should be more generic to handle different + // geospatial web services + + + /** + * @param serviceURI - the URI of the GWS that will return the capabilities + * @return + */ + public String GetServiceCapabilities(URI serviceURI); + + public HashMap GetProcessInputPorts(URI serviceURI, String processID); + + public HashMap GetProcessOutputPorts(URI serviceURI, String processID); + + + +} diff --git a/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java new file mode 100644 index 0000000..730b5d1 --- /dev/null +++ b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java @@ -0,0 +1,48 @@ +/* + * + * 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. + * + */ +package org.apache.taverna.gis.client.impl; + +import java.net.URI; +import java.util.HashMap; + +import org.apache.taverna.gis.client.IGisClient; + +public class NorthClientImpl implements IGisClient { + + @Override + public String GetServiceCapabilities(URI serviceURI) { + // TODO Auto-generated method stub + return null; + } + + @Override + public HashMap GetProcessInputPorts(URI serviceURI, String processID) { + // TODO Auto-generated method stub + return null; + } + + @Override + public HashMap GetProcessOutputPorts(URI serviceURI, String processID) { + // TODO Auto-generated method stub + return null; + } + +} From 96aea111e87260c66fa7831fcb90d4667dce120d Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Tue, 12 Jul 2016 22:34:29 +0100 Subject: [PATCH 03/14] implemented gis-client inteface and corresponding JUnit tests --- .../gis/client/impl/NorthClientImpl.java | 96 +++++++++++++++++-- .../gis/client/impl/NorthClientImplTest.java | 65 +++++++++++++ 2 files changed, 155 insertions(+), 6 deletions(-) create mode 100644 taverna-gis-client/src/test/java/org/apache/taverna/gis/client/impl/NorthClientImplTest.java diff --git a/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java index 730b5d1..1c72c8d 100644 --- a/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java +++ b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java @@ -20,29 +20,113 @@ */ package org.apache.taverna.gis.client.impl; +import java.io.IOException; +import java.math.BigInteger; import java.net.URI; import java.util.HashMap; import org.apache.taverna.gis.client.IGisClient; +import org.n52.wps.client.WPSClientException; +import org.n52.wps.client.WPSClientSession; + +import net.opengis.ows.x11.LanguageStringType; +import net.opengis.wps.x100.CapabilitiesDocument; +import net.opengis.wps.x100.InputDescriptionType; +import net.opengis.wps.x100.OutputDescriptionType; +import net.opengis.wps.x100.ProcessDescriptionType; public class NorthClientImpl implements IGisClient { @Override public String GetServiceCapabilities(URI serviceURI) { - // TODO Auto-generated method stub - return null; + WPSClientSession wpsClient = WPSClientSession.getInstance(); + + try { + wpsClient.connect(serviceURI.toString()); + } catch (WPSClientException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + CapabilitiesDocument capabilities = wpsClient.getWPSCaps(serviceURI.toString()); + + LanguageStringType[] serviceAbstract = capabilities.getCapabilities().getServiceIdentification() + .getTitleArray(); + // + // ProcessBriefType[] processList = capabilities.getCapabilities() + // .getProcessOfferings().getProcessArray(); + // + // for (ProcessBriefType process : processList) { + // System.out.println(process.getIdentifier().getStringValue()); + // } + // return capabilities; + if (serviceAbstract != null && serviceAbstract.length > 0) + return serviceAbstract[0].getStringValue(); + else + return null; } @Override public HashMap GetProcessInputPorts(URI serviceURI, String processID) { - // TODO Auto-generated method stub - return null; + HashMap inputPorts = new HashMap(); + + WPSClientSession wpsClient = WPSClientSession.getInstance(); + + ProcessDescriptionType processDescription = null; + + try { + processDescription = wpsClient.getProcessDescription(serviceURI.toString(), processID); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if (processDescription==null) + return null; + + InputDescriptionType[] inputList = processDescription.getDataInputs().getInputArray(); + + for (InputDescriptionType input : inputList) { + + // if compareTo returns 1 then first value is greater than 1. it means that there is more than one occurrence therefore the depth is more than 0 + int depth = ((input.getMaxOccurs().compareTo(BigInteger.valueOf(1))==1) ? 1 : 0); + + inputPorts.put(input.getIdentifier().getStringValue(), depth); + } + + return inputPorts; + } @Override public HashMap GetProcessOutputPorts(URI serviceURI, String processID) { - // TODO Auto-generated method stub - return null; + HashMap outputPorts = new HashMap(); + + WPSClientSession wpsClient = WPSClientSession.getInstance(); + + ProcessDescriptionType processDescription = null; + + try { + processDescription = wpsClient.getProcessDescription(serviceURI.toString(), processID); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if (processDescription==null) + return null; + + OutputDescriptionType[] outputList = processDescription.getProcessOutputs().getOutputArray(); + + for (OutputDescriptionType output : outputList) { + + // TODO: Calculate output depth + int depth = 0; + + outputPorts.put(output.getIdentifier().getStringValue(), depth); + } + + return outputPorts; } } diff --git a/taverna-gis-client/src/test/java/org/apache/taverna/gis/client/impl/NorthClientImplTest.java b/taverna-gis-client/src/test/java/org/apache/taverna/gis/client/impl/NorthClientImplTest.java new file mode 100644 index 0000000..1603809 --- /dev/null +++ b/taverna-gis-client/src/test/java/org/apache/taverna/gis/client/impl/NorthClientImplTest.java @@ -0,0 +1,65 @@ +package org.apache.taverna.gis.client.impl; + +import static org.junit.Assert.*; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.HashMap; + +import org.junit.Test; + +public class NorthClientImplTest { + + @Test + public void testGetServiceCapabilities() throws URISyntaxException { + + URI uri = new URI("http://localhost:8080/geoserver/ows"); + + String result = new NorthClientImpl().GetServiceCapabilities(uri); + + assertEquals("Incorrect service title",result, "Prototype GeoServer WPS"); + + } + + @Test + public void testGetProcessInputPorts() throws URISyntaxException { + + URI uri = new URI("http://localhost:8080/geoserver/ows"); + + String processID = "gs:StringConcatWPS"; + + HashMap expectedInputResult = new HashMap(); + expectedInputResult.put("name", 0); + expectedInputResult.put("surname", 0); + + HashMap result = new NorthClientImpl().GetProcessInputPorts(uri, processID); + + assertEquals("Incorrect input ports result",result, expectedInputResult); + + } + + @Test + public void testGetProcessOutputPorts() throws URISyntaxException { + + URI uri = new URI("http://localhost:8080/geoserver/ows"); + + String processID = "gs:StringConcatWPS"; + + // check if the ports match + HashMap expectedOutputResult = new HashMap(); + expectedOutputResult.put("result", 0); + + HashMap result = new NorthClientImpl().GetProcessOutputPorts(uri, processID); + + // check if the ports do not match + assertEquals("Incorrect output ports result",result, expectedOutputResult); + + expectedOutputResult.clear(); + expectedOutputResult.put("result1", 0); + + assertNotEquals("The output ports result should not match", result, expectedOutputResult); + + } + + +} From e957dd1dcfbcee829fe47d4bcc2f46208e18f028 Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Fri, 15 Jul 2016 19:13:39 +0100 Subject: [PATCH 04/14] Update 52n-wps-client-lib --- taverna-gis-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taverna-gis-client/pom.xml b/taverna-gis-client/pom.xml index 54143cb..6829ef4 100644 --- a/taverna-gis-client/pom.xml +++ b/taverna-gis-client/pom.xml @@ -30,7 +30,7 @@ org.n52.wps 52n-wps-client-lib - 3.3.1 + 3.5.0 From dddc272a2a0e5a495a5641211eee19d76045496b Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Fri, 15 Jul 2016 19:16:41 +0100 Subject: [PATCH 05/14] format pom code --- pom.xml | 65 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/pom.xml b/pom.xml index e93f8f5..dbfea83 100644 --- a/pom.xml +++ b/pom.xml @@ -52,37 +52,38 @@ - - org.apache.taverna.osgi - taverna-maven-plugin - ${taverna.osgi.version} - true - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.taverna.orgi - taverna-maven-plugin - [${taverna.osgi.version},) - - plugin-generate - - - - - - - - - - + + org.apache.taverna.osgi + taverna-maven-plugin + ${taverna.osgi.version} + true + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.apache.taverna.orgi + taverna-maven-plugin + [${taverna.osgi.version},) + + plugin-generate + + + + + + + + + + @@ -112,7 +113,7 @@ taverna-gis-plugin taverna-gis-activity - taverna-gis-activity-ui + taverna-gis-activity-ui taverna-gis-client From 84613b95cac1dcf54bbbc9d36074acf916df2b80 Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Mon, 18 Jul 2016 00:32:00 +0100 Subject: [PATCH 06/14] Add GisClientFactory for creating the required GisClient Implementation The user should use the GisClientFactory to get the right GisClient parser. Different GisClients that use different libraries might be implemented. --- .../taverna/gis/client/GisClientFactory.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 taverna-gis-client/src/main/java/org/apache/taverna/gis/client/GisClientFactory.java diff --git a/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/GisClientFactory.java b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/GisClientFactory.java new file mode 100644 index 0000000..e9289bc --- /dev/null +++ b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/GisClientFactory.java @@ -0,0 +1,28 @@ +package org.apache.taverna.gis.client; + +import org.apache.taverna.gis.client.impl.NorthClientImpl; + +public class GisClientFactory { + + private static GisClientFactory instance = null; + + private GisClientFactory() + { + // private constructor + } + + public static GisClientFactory getInstance() + { + if (instance == null) + return new GisClientFactory(); + else + return instance; + + } + + public IGisClient getGisClient(String serviceURL) + { + return new NorthClientImpl(serviceURL); + } + +} From 5d022d2f0802eb3466acb28f9d31f3f7008e623a Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Mon, 18 Jul 2016 00:34:27 +0100 Subject: [PATCH 07/14] Update Gis client interface and implementation --- .../org/apache/taverna/gis/client/IGisClient.java | 4 ++-- .../taverna/gis/client/impl/NorthClientImpl.java | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/IGisClient.java b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/IGisClient.java index 49ba05a..9d044f3 100644 --- a/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/IGisClient.java +++ b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/IGisClient.java @@ -35,9 +35,9 @@ public interface IGisClient { */ public String GetServiceCapabilities(URI serviceURI); - public HashMap GetProcessInputPorts(URI serviceURI, String processID); + public HashMap GetProcessInputPorts(String processID); - public HashMap GetProcessOutputPorts(URI serviceURI, String processID); + public HashMap GetProcessOutputPorts(String processID); diff --git a/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java index 1c72c8d..fb8a9b8 100644 --- a/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java +++ b/taverna-gis-client/src/main/java/org/apache/taverna/gis/client/impl/NorthClientImpl.java @@ -35,8 +35,15 @@ import net.opengis.wps.x100.OutputDescriptionType; import net.opengis.wps.x100.ProcessDescriptionType; +// TODO: Change name to a more descriptive one like GisServiceParser public class NorthClientImpl implements IGisClient { + private URI serviceURI = null; + + public NorthClientImpl(String serviceURL) { + this.serviceURI = URI.create(serviceURL); + } + @Override public String GetServiceCapabilities(URI serviceURI) { WPSClientSession wpsClient = WPSClientSession.getInstance(); @@ -67,7 +74,7 @@ public String GetServiceCapabilities(URI serviceURI) { } @Override - public HashMap GetProcessInputPorts(URI serviceURI, String processID) { + public HashMap GetProcessInputPorts(String processID) { HashMap inputPorts = new HashMap(); WPSClientSession wpsClient = WPSClientSession.getInstance(); @@ -99,7 +106,7 @@ public HashMap GetProcessInputPorts(URI serviceURI, String proc } @Override - public HashMap GetProcessOutputPorts(URI serviceURI, String processID) { + public HashMap GetProcessOutputPorts(String processID) { HashMap outputPorts = new HashMap(); WPSClientSession wpsClient = WPSClientSession.getInstance(); From dc01eff6ba8b01f31fc24f79dab75ffa0f6f729a Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Mon, 18 Jul 2016 00:36:33 +0100 Subject: [PATCH 08/14] Add Configuration Bean annotations --- .../apache/taverna/gis/GisActivityConfigurationBean.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityConfigurationBean.java b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityConfigurationBean.java index babafae..b53efdb 100644 --- a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityConfigurationBean.java +++ b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityConfigurationBean.java @@ -27,6 +27,7 @@ import net.opengis.wps.x100.InputDescriptionType; import net.opengis.wps.x100.OutputDescriptionType; import org.apache.taverna.workflowmodel.processor.activity.config.ActivityPortsDefinitionBean; +import org.apache.taverna.workflowmodel.processor.config.ConfigurationProperty; /** * Gis activity configuration bean. @@ -52,19 +53,23 @@ public class GisActivityConfigurationBean extends ActivityPortsDefinitionBean im * be referenced as well, as long as they are part of the same plugin. */ - private URI ogcServiceUri; private String processIdentifier; public URI getOgcServiceUri() { return ogcServiceUri; } + + @ConfigurationProperty(name = "service", label = "OGC Service URI", description = "The location of the GIS Web Service definition") public void setOgcServiceUri(URI ogcServiceUri) { this.ogcServiceUri = ogcServiceUri; } + public String getProcessIdentifier() { return processIdentifier; } + + @ConfigurationProperty(name = "process", label = "Process ID", description = "The identifier of the process provided by the web service") public void setProcessIdentifier(String processIdentifier) { this.processIdentifier = processIdentifier; } From f199915a75dc119e2cd8831721ae0e5f98a3a896 Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Mon, 18 Jul 2016 00:37:11 +0100 Subject: [PATCH 09/14] Update ServiceDescription ACTIVITY_TYPE --- .../apache/taverna/gis/ui/serviceprovider/GisServiceDesc.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taverna-gis-activity-ui/src/main/java/org/apache/taverna/gis/ui/serviceprovider/GisServiceDesc.java b/taverna-gis-activity-ui/src/main/java/org/apache/taverna/gis/ui/serviceprovider/GisServiceDesc.java index c9a93f0..7b389ea 100644 --- a/taverna-gis-activity-ui/src/main/java/org/apache/taverna/gis/ui/serviceprovider/GisServiceDesc.java +++ b/taverna-gis-activity-ui/src/main/java/org/apache/taverna/gis/ui/serviceprovider/GisServiceDesc.java @@ -33,7 +33,7 @@ public class GisServiceDesc extends ServiceDescription { public static final URI ACTIVITY_TYPE = URI - .create("http://ns.taverna.org.uk/2016/activity/gis"); + .create("http://ns.taverna.org.uk/2016/service/gis"); /** From a33f3cce99a06369bb5f43747338a527fdbef64c Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Mon, 18 Jul 2016 00:38:25 +0100 Subject: [PATCH 10/14] Implement GisActivityFactory --- .../taverna/gis/GisActivityFactory.java | 74 +++++++++++-------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityFactory.java b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityFactory.java index 0f43ab0..921bf8b 100644 --- a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityFactory.java +++ b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityFactory.java @@ -20,16 +20,20 @@ */ package org.apache.taverna.gis; -import static org.apache.taverna.gis.GisActivity.*; - import java.io.IOException; import java.net.URI; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.log4j.Logger; +import org.apache.taverna.gis.client.GisClientFactory; +import org.apache.taverna.gis.client.IGisClient; +import org.apache.taverna.gis.client.impl.NorthClientImpl; import org.apache.taverna.workflowmodel.Edits; import org.apache.taverna.workflowmodel.processor.activity.ActivityFactory; import org.apache.taverna.workflowmodel.processor.activity.ActivityInputPort; @@ -40,6 +44,8 @@ */ public class GisActivityFactory implements ActivityFactory { + private static Logger logger = Logger.getLogger(GisActivityFactory.class); + private Edits edits; @Override @@ -64,39 +70,49 @@ public JsonNode getActivityConfigurationSchema() { @Override public Set getInputPorts(JsonNode configuration) { - Set inputPorts = new HashSet<>(); - - // FIXME: Replace with your input port definitions - - // Hard coded input port, expecting a single String - inputPorts.add(edits.createActivityInputPort(IN_FIRST_INPUT, 0, true, null, String.class)); - - // Optional ports depending on configuration - if (configuration.get("exampleString").asText().equals("specialCase")) { - // depth 1, ie. list of binary byte[] arrays - inputPorts.add(edits.createActivityInputPort(IN_EXTRA_DATA, 1, true, null, byte[].class)); + Map inputPorts = new HashMap(); + + IGisClient gisServiceParser = new NorthClientImpl(configuration.get("service").textValue()); + + try { + // get ports name, depth + Map inputPortDescriptions = gisServiceParser.GetProcessInputPorts(configuration.get("process").textValue()); + + for (Map.Entry entry : inputPortDescriptions.entrySet()) { + inputPorts.put(entry.getKey(), edits.createActivityInputPort( + entry.getKey(), entry.getValue(), true, null, String.class)); + } + } catch (Exception e) { + logger.warn( + "Unable to parse the GIS " + configuration.get("service").textValue(), e); } - - return inputPorts; + + return new HashSet(inputPorts.values()); } @Override public Set getOutputPorts(JsonNode configuration) { - Set outputPorts = new HashSet<>(); - - // FIXME: Replace with your output port definitions - - // Optional ports depending on configuration - if (configuration.get("exampleString").asText().equals("specialCase")) { - outputPorts.add(edits.createActivityOutputPort(OUT_REPORT, 0, 0)); + Map outputPorts = new HashMap(); + + IGisClient gisServiceParser = GisClientFactory.getInstance() + .getGisClient(configuration.get("service").textValue()); + + try { + // get ports (name, depth) pairs + Map outputPortDescriptions = gisServiceParser.GetProcessInputPorts(configuration.get("process").textValue()); + + for (Map.Entry outputPortIterator : outputPortDescriptions.entrySet()) { + outputPorts.put(outputPortIterator.getKey(), + edits.createActivityOutputPort(outputPortIterator.getKey(), + outputPortIterator.getValue(),outputPortIterator.getValue())); + } + } catch (Exception e) { + logger.warn( + "Unable to parse the GIS " + configuration.get("service").textValue(), e); } - - // Single value output port (depth 0) - outputPorts.add(edits.createActivityOutputPort(OUT_SIMPLE_OUTPUT, 0, 0)); - // Output port with list of values (depth 1) - outputPorts.add(edits.createActivityOutputPort(OUT_MORE_OUTPUTS, 1, 1)); - - return outputPorts; + + return new HashSet(outputPorts.values()); + } /** From 99d32a7da879edf013c3201e32ef243e0b6e2cc9 Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Mon, 18 Jul 2016 01:33:28 +0100 Subject: [PATCH 11/14] Update GisActivity to use Jackson object instead of ConfigBean --- .../org/apache/taverna/gis/GisActivity.java | 146 +++++++++++------- 1 file changed, 92 insertions(+), 54 deletions(-) diff --git a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivity.java b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivity.java index 91986e2..4849bb6 100644 --- a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivity.java +++ b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivity.java @@ -21,6 +21,7 @@ package org.apache.taverna.gis; import java.io.IOException; +import java.net.URI; import java.util.HashMap; import java.util.Map; @@ -29,11 +30,17 @@ import org.n52.wps.client.WPSClientException; import org.n52.wps.client.WPSClientSession; +import com.fasterxml.jackson.databind.JsonNode; + import net.opengis.wps.x100.DataType; import net.opengis.wps.x100.ExecuteDocument; import net.opengis.wps.x100.ExecuteResponseDocument; import net.opengis.wps.x100.OutputDataType; import net.opengis.wps.x100.ProcessDescriptionType; + +import org.apache.log4j.Logger; +import org.apache.taverna.gis.client.GisClientFactory; +import org.apache.taverna.gis.client.IGisClient; import org.apache.taverna.invocation.InvocationContext; import org.apache.taverna.reference.ReferenceService; import org.apache.taverna.reference.T2Reference; @@ -44,45 +51,64 @@ import org.apache.taverna.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean; import org.apache.taverna.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean; -public class GisActivity extends AbstractAsynchronousActivity - implements AsynchronousActivity { - - private GisActivityConfigurationBean configBean; - - @Override - public void configure(GisActivityConfigurationBean configBean) throws ActivityConfigurationException { - - // TODO: Should I call HealthChecker here?? - // Any pre-config sanity checks - if (configBean.getOgcServiceUri().equals("")) { - throw new ActivityConfigurationException("Geospatial web service URI can't be empty"); - } - // Store for getConfiguration() - this.configBean = configBean; +public class GisActivity extends AbstractAsynchronousActivity implements AsynchronousActivity { - // REQUIRED: (Re)create input/output ports depending on configuration - configurePorts(); - } + public static final String ACTIVITY_TYPE = "http://ns.taverna.org.uk/2016/activity/gis"; - protected void configurePorts() { - // In case we are being reconfigured - remove existing ports first - // to avoid duplicates - removeInputs(); - removeOutputs(); + private static Logger logger = Logger.getLogger(GisActivity.class); - // Add input ports - for(ActivityInputPortDefinitionBean inputPort : configBean.getInputPortDefinitions()) - { - addInput(inputPort.getName(),inputPort.getDepth(),inputPort.getAllowsLiteralValues(),inputPort.getHandledReferenceSchemes(), inputPort.getTranslatedElementType()); - } + private JsonNode configurationBean; - // Add output ports - for(ActivityOutputPortDefinitionBean outputPort : configBean.getOutputPortDefinitions()) - { - addOutput(outputPort.getName(),outputPort.getDepth()); + /** + * Configures the activity according to the information passed by the + * configuration bean.
+ * During this process the WPS is parsed to determine the input and output + * ports. + * + * @param bean + * the {@link GisActivityConfigurationBean} configuration bean + */ + @Override + public void configure(JsonNode bean) throws ActivityConfigurationException { + this.configurationBean = bean; + + try { + parseGISService(); + } catch (Exception ex) { + throw new ActivityConfigurationException( + "Unable to parse the WSDL " + bean.get("service").textValue(), ex); } + } + @Override + public JsonNode getConfiguration() { + return this.configurationBean; } + + // FIXME: Is the procedure needed? +// protected void configurePorts() { +// // In case we are being reconfigured - remove existing ports first +// // to avoid duplicates +// removeInputs(); +// removeOutputs(); +// +// IGisClient gisServiceParser = GisClientFactory.getInstance() +// .getGisClient(configurationBean.get("service").textValue()); +// +// gisServiceParser.GetProcessInputPorts(configurationBean.get("process").textValue()); +// +// // Add input ports +// for (ActivityInputPortDefinitionBean inputPort : configurationBean.getInputPortDefinitions()) { +// addInput(inputPort.getName(), inputPort.getDepth(), inputPort.getAllowsLiteralValues(), +// inputPort.getHandledReferenceSchemes(), inputPort.getTranslatedElementType()); +// } +// +// // Add output ports +// for (ActivityOutputPortDefinitionBean outputPort : configurationBean.getOutputPortDefinitions()) { +// addOutput(outputPort.getName(), outputPort.getDepth()); +// } +// +// } @SuppressWarnings("unchecked") @Override @@ -98,18 +124,21 @@ public void run() { Map outputs = null; try { - + // FIXME: Extract service execution to GisClient // prepare the execute object WPSClientSession wpsClient = WPSClientSession.getInstance(); - ProcessDescriptionType processDescription = wpsClient.getProcessDescription(configBean.getOgcServiceUri().toString(), configBean.getProcessIdentifier()); + ProcessDescriptionType processDescription = wpsClient.getProcessDescription( + configurationBean.get("service").textValue(), configurationBean.get("process").textValue()); ExecuteRequestBuilder executeBuilder = new ExecuteRequestBuilder(processDescription); - for (ActivityInputPortDefinitionBean activityInputPort : configBean.getInputPortDefinitions()) { - String portValue = (String) referenceService.renderIdentifier(inputs.get(activityInputPort.getName()), String.class, context); - executeBuilder.addLiteralData(activityInputPort.getName(), portValue); - } + // FIXME: Provide ports +// for (ActivityInputPortDefinitionBean activityInputPort : configurationBean.getInputPortDefinitions()) { +// String portValue = (String) referenceService +// .renderIdentifier(inputs.get(activityInputPort.getName()), String.class, context); +// executeBuilder.addLiteralData(activityInputPort.getName(), portValue); +// } ExecuteDocument execute = executeBuilder.getExecute(); @@ -119,7 +148,7 @@ public void run() { try { // execute service - responseObject = wpsClient.execute(configBean.getOgcServiceUri().toString(), execute); + responseObject = wpsClient.execute(configurationBean.get("service").textValue(), execute); } catch (WPSClientException e) { // if the an error return from service callback.fail(e.getServerException().xmlText()); @@ -130,27 +159,26 @@ public void run() { T2Reference simpleRef = null; if (responseObject instanceof ExecuteResponseDocument) { - ExecuteResponseDocument response = (ExecuteResponseDocument) responseObject; + ExecuteResponseDocument response = (ExecuteResponseDocument) responseObject; - // analyser is used to get complex data - ExecuteResponseAnalyser analyser = new ExecuteResponseAnalyser( - execute, response, processDescription); + // analyser is used to get complex data + ExecuteResponseAnalyser analyser = new ExecuteResponseAnalyser(execute, response, + processDescription); - for(OutputDataType output : response.getExecuteResponse().getProcessOutputs().getOutputArray()) - { - DataType data = output.getData(); + for (OutputDataType output : response.getExecuteResponse().getProcessOutputs() + .getOutputArray()) { + DataType data = output.getData(); - if (data.isSetLiteralData()) - { - simpleRef = referenceService.register(data.getLiteralData().getStringValue(), 0, true, context); + if (data.isSetLiteralData()) { + simpleRef = referenceService.register(data.getLiteralData().getStringValue(), 0, true, + context); outputs.put(output.getIdentifier().getStringValue(), simpleRef); } } - } - + } } catch (WPSClientException e) { callback.fail(e.getMessage()); @@ -163,9 +191,19 @@ public void run() { }); } - @Override - public GisActivityConfigurationBean getConfiguration() { - return this.configBean; + /** + * This method should ping the gis web service to check if it is live or + * other check like valid URL etc. + */ + private void parseGISService() { + } +// @Override +// public GisActivityConfigurationBean getConfiguration() { +// return this.configBean; +// } + + + } From 223c2921a624090aebad110ad7626cb59bfdc655 Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Fri, 22 Jul 2016 17:05:23 +0100 Subject: [PATCH 12/14] Remove port parsing in GisServiceProvider --- .../serviceprovider/GisServiceProvider.java | 63 ------------------- 1 file changed, 63 deletions(-) diff --git a/taverna-gis-activity-ui/src/main/java/org/apache/taverna/gis/ui/serviceprovider/GisServiceProvider.java b/taverna-gis-activity-ui/src/main/java/org/apache/taverna/gis/ui/serviceprovider/GisServiceProvider.java index 9811100..a03fe93 100644 --- a/taverna-gis-activity-ui/src/main/java/org/apache/taverna/gis/ui/serviceprovider/GisServiceProvider.java +++ b/taverna-gis-activity-ui/src/main/java/org/apache/taverna/gis/ui/serviceprovider/GisServiceProvider.java @@ -20,7 +20,6 @@ */ package org.apache.taverna.gis.ui.serviceprovider; -import java.io.IOException; import java.net.URI; import java.util.ArrayList; import java.util.Arrays; @@ -29,23 +28,14 @@ import javax.swing.Icon; import org.apache.taverna.scufl2.api.common.Visitor; -import org.apache.taverna.scufl2.api.common.WorkflowBean; import org.apache.taverna.scufl2.api.configurations.Configuration; import org.apache.taverna.servicedescriptions.AbstractConfigurableServiceProvider; import org.apache.taverna.servicedescriptions.ConfigurableServiceProvider; import org.apache.taverna.servicedescriptions.ServiceDescription; import org.apache.taverna.servicedescriptions.ServiceDescriptionProvider; -import org.apache.taverna.servicedescriptions.ServiceDescriptionProvider.FindServiceDescriptionsCallBack; -import org.apache.taverna.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean; -import org.apache.taverna.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean; -import org.n52.wps.client.WPSClientSession; import com.fasterxml.jackson.databind.node.ObjectNode; -import net.opengis.wps.x100.InputDescriptionType; -import net.opengis.wps.x100.OutputDescriptionType; -import net.opengis.wps.x100.ProcessDescriptionType; - public class GisServiceProvider extends AbstractConfigurableServiceProvider implements ConfigurableServiceProvider { @@ -68,7 +58,6 @@ private static Configuration defaultConfig() { /** * Do the actual search for services. Return using the callBack parameter. */ - @SuppressWarnings("unchecked") public void findServiceDescriptionsAsync(FindServiceDescriptionsCallBack callBack) { // Use callback.status() for long-running searches callBack.status("Resolving GIS services"); @@ -89,58 +78,6 @@ public void findServiceDescriptionsAsync(FindServiceDescriptionsCallBack callBac // TODO: Optional: set description (Set a better description service.setDescription(processIdentifier); - // TODO: Exctract in a separate method - // Get input ports - - WPSClientSession wpsClient = WPSClientSession.getInstance(); - - ProcessDescriptionType processDescription; - try { - processDescription = wpsClient - .getProcessDescription(serviceUri, processIdentifier); - - InputDescriptionType[] inputList = processDescription.getDataInputs() - .getInputArray(); - - List inputPortDefinitions = new ArrayList(); - - for (InputDescriptionType input : inputList) { - ActivityInputPortDefinitionBean newInputPort = new ActivityInputPortDefinitionBean(); - newInputPort.setName(input.getIdentifier().getStringValue()); - newInputPort.setDepth(0); - newInputPort.setAllowsLiteralValues(true); - newInputPort.setHandledReferenceSchemes(null); - newInputPort.setTranslatedElementType(String.class); - - inputPortDefinitions.add(newInputPort); - - } - - // service.setInputPortDefinitions(inputPortDefinitions); - - - // Get output ports - - OutputDescriptionType[] outputList = processDescription.getProcessOutputs().getOutputArray(); - List outputPortDefinitions = new ArrayList(); - - for( OutputDescriptionType output : outputList ) - { - ActivityOutputPortDefinitionBean newOutputPort = new ActivityOutputPortDefinitionBean(); - newOutputPort.setName(output.getIdentifier().getStringValue()); - newOutputPort.setDepth(0); - - outputPortDefinitions.add(newOutputPort); - - } - - //service.setOutputPortDefinitions(outputPortDefinitions); - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - results.add(service); // partialResults() can also be called several times from inside From d34cd580a14804e216d49bfc9916d04ab3630442 Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Fri, 22 Jul 2016 17:07:01 +0100 Subject: [PATCH 13/14] Fix GisActivityFactory tests --- .../taverna/gis/GisActivityFactory.java | 12 +++++----- .../taverna/gis/GisActivityFactoryTest.java | 24 +++++++++---------- .../apache/taverna/gis/GisActivityTest.java | 4 ++-- .../gis/client/impl/NorthClientImplTest.java | 6 ++--- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityFactory.java b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityFactory.java index 921bf8b..6f64693 100644 --- a/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityFactory.java +++ b/taverna-gis-activity/src/main/java/org/apache/taverna/gis/GisActivityFactory.java @@ -72,11 +72,11 @@ public JsonNode getActivityConfigurationSchema() { public Set getInputPorts(JsonNode configuration) { Map inputPorts = new HashMap(); - IGisClient gisServiceParser = new NorthClientImpl(configuration.get("service").textValue()); - + IGisClient gisServiceParser = GisClientFactory.getInstance().getGisClient(configuration.get("ogcServiceUri").textValue()); + try { // get ports name, depth - Map inputPortDescriptions = gisServiceParser.GetProcessInputPorts(configuration.get("process").textValue()); + Map inputPortDescriptions = gisServiceParser.GetProcessInputPorts(configuration.get("processIdentifier").textValue()); for (Map.Entry entry : inputPortDescriptions.entrySet()) { inputPorts.put(entry.getKey(), edits.createActivityInputPort( @@ -95,11 +95,11 @@ public Set getOutputPorts(JsonNode configuration) { Map outputPorts = new HashMap(); IGisClient gisServiceParser = GisClientFactory.getInstance() - .getGisClient(configuration.get("service").textValue()); + .getGisClient(configuration.get("ogcServiceUri").textValue()); try { // get ports (name, depth) pairs - Map outputPortDescriptions = gisServiceParser.GetProcessInputPorts(configuration.get("process").textValue()); + Map outputPortDescriptions = gisServiceParser.GetProcessOutputPorts(configuration.get("processIdentifier").textValue()); for (Map.Entry outputPortIterator : outputPortDescriptions.entrySet()) { outputPorts.put(outputPortIterator.getKey(), @@ -108,7 +108,7 @@ public Set getOutputPorts(JsonNode configuration) { } } catch (Exception e) { logger.warn( - "Unable to parse the GIS " + configuration.get("service").textValue(), e); + "Unable to parse the GIS " + configuration.get("ogcServiceUri").textValue(), e); } return new HashSet(outputPorts.values()); diff --git a/taverna-gis-activity/src/test/java/org/apache/taverna/gis/GisActivityFactoryTest.java b/taverna-gis-activity/src/test/java/org/apache/taverna/gis/GisActivityFactoryTest.java index 9468849..59e66ad 100644 --- a/taverna-gis-activity/src/test/java/org/apache/taverna/gis/GisActivityFactoryTest.java +++ b/taverna-gis-activity/src/test/java/org/apache/taverna/gis/GisActivityFactoryTest.java @@ -49,8 +49,8 @@ public class GisActivityFactoryTest { @Before public void setUp() throws Exception { configuration = JsonNodeFactory.instance.objectNode(); - configuration.put("exampleString", "something"); - configuration.put("exampleUri", "http://localhost:8080/myEndPoint"); + configuration.put("ogcServiceUri", "http://localhost:8080/geoserver/ows"); + configuration.put("processIdentifier", "custom:splitPolygon"); activityFactory = new GisActivityFactory(); activityFactory.setEdits(new EditsImpl()); @@ -74,14 +74,15 @@ public void testGetActivityConfigurationSchema() { assertNotNull(configurationSchema); assertTrue(configurationSchema.has("properties")); JsonNode propertiesNode = configurationSchema.get("properties"); - assertTrue(propertiesNode.has("exampleString")); - assertTrue(propertiesNode.has("exampleUri")); + assertTrue(propertiesNode.has("ogcServiceUri")); + assertTrue(propertiesNode.has("processIdentifier")); } @Test public void testGetInputPorts() { Set expectedInputs = new HashSet(); - expectedInputs.add("firstInput"); + expectedInputs.add("line"); + expectedInputs.add("polygon"); Set inputPorts = activityFactory.getInputPorts(configuration); assertEquals("Unexpected inputs", expectedInputs.size(), inputPorts.size()); @@ -91,8 +92,8 @@ public void testGetInputPorts() { } ObjectNode specialConfiguration = JsonNodeFactory.instance.objectNode(); - specialConfiguration.put("exampleString", "specialCase"); - specialConfiguration.put("exampleUri", "http://localhost:8080/myEndPoint"); + specialConfiguration.put("ogcServiceUri", "http://localhost:8080/geoserver/ows"); + specialConfiguration.put("processIdentifier", "custom:splitPolygon"); assertEquals("Unexpected inputs", 2, activityFactory.getInputPorts(specialConfiguration).size()); } @@ -100,8 +101,7 @@ public void testGetInputPorts() { @Test public void testGetOutputPorts() { Set expectedOutputs = new HashSet(); - expectedOutputs.add("simpleOutput"); - expectedOutputs.add("moreOutputs"); + expectedOutputs.add("result"); Set outputPorts = activityFactory.getOutputPorts(configuration); assertEquals("Unexpected outputs", expectedOutputs.size(), outputPorts.size()); @@ -111,10 +111,10 @@ public void testGetOutputPorts() { } ObjectNode specialConfiguration = JsonNodeFactory.instance.objectNode(); - specialConfiguration.put("exampleString", "specialCase"); - specialConfiguration.put("exampleUri", "http://localhost:8080/myEndPoint"); + specialConfiguration.put("ogcServiceUri", "http://localhost:8080/geoserver/ows"); + specialConfiguration.put("processIdentifier", "custom:splitPolygon"); - assertEquals("Unexpected outputs", 3, activityFactory.getOutputPorts(specialConfiguration).size()); + assertEquals("Unexpected outputs", 1, activityFactory.getOutputPorts(specialConfiguration).size()); } } diff --git a/taverna-gis-activity/src/test/java/org/apache/taverna/gis/GisActivityTest.java b/taverna-gis-activity/src/test/java/org/apache/taverna/gis/GisActivityTest.java index 6faea0d..78e56db 100644 --- a/taverna-gis-activity/src/test/java/org/apache/taverna/gis/GisActivityTest.java +++ b/taverna-gis-activity/src/test/java/org/apache/taverna/gis/GisActivityTest.java @@ -51,8 +51,8 @@ public class GisActivityTest { @Before public void makeConfiguration() throws Exception { configuration = JsonNodeFactory.instance.objectNode(); - configuration.put("exampleString", "something"); - configuration.put("exampleUri", "http://localhost:8080/myEndPoint"); + configuration.put("serviceUri", "http://localhost:8080/geoserver/ows"); + configuration.put("processID", "gs:StringConcatWPS"); } @Test diff --git a/taverna-gis-client/src/test/java/org/apache/taverna/gis/client/impl/NorthClientImplTest.java b/taverna-gis-client/src/test/java/org/apache/taverna/gis/client/impl/NorthClientImplTest.java index 1603809..31cc1d6 100644 --- a/taverna-gis-client/src/test/java/org/apache/taverna/gis/client/impl/NorthClientImplTest.java +++ b/taverna-gis-client/src/test/java/org/apache/taverna/gis/client/impl/NorthClientImplTest.java @@ -15,7 +15,7 @@ public void testGetServiceCapabilities() throws URISyntaxException { URI uri = new URI("http://localhost:8080/geoserver/ows"); - String result = new NorthClientImpl().GetServiceCapabilities(uri); + String result = new NorthClientImpl(uri.toASCIIString()).GetServiceCapabilities(uri); assertEquals("Incorrect service title",result, "Prototype GeoServer WPS"); @@ -32,7 +32,7 @@ public void testGetProcessInputPorts() throws URISyntaxException { expectedInputResult.put("name", 0); expectedInputResult.put("surname", 0); - HashMap result = new NorthClientImpl().GetProcessInputPorts(uri, processID); + HashMap result = new NorthClientImpl(uri.toASCIIString()).GetProcessInputPorts(processID); assertEquals("Incorrect input ports result",result, expectedInputResult); @@ -49,7 +49,7 @@ public void testGetProcessOutputPorts() throws URISyntaxException { HashMap expectedOutputResult = new HashMap(); expectedOutputResult.put("result", 0); - HashMap result = new NorthClientImpl().GetProcessOutputPorts(uri, processID); + HashMap result = new NorthClientImpl(uri.toASCIIString()).GetProcessOutputPorts(processID); // check if the ports do not match assertEquals("Incorrect output ports result",result, expectedOutputResult); From ee1794046d26c8e074b04347d2c176d2ba91a486 Mon Sep 17 00:00:00 2001 From: Edi Karadumi Date: Thu, 11 Aug 2016 14:20:46 +0100 Subject: [PATCH 14/14] example config --- .../src/main/resources/exampleconfig.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 taverna-gis-activity/src/main/resources/exampleconfig.json diff --git a/taverna-gis-activity/src/main/resources/exampleconfig.json b/taverna-gis-activity/src/main/resources/exampleconfig.json new file mode 100644 index 0000000..0c938eb --- /dev/null +++ b/taverna-gis-activity/src/main/resources/exampleconfig.json @@ -0,0 +1,15 @@ +{ "service": { + "ogcServiceUri": "http://example.com/", + "processIdentifier": "process1", + }, + "portConfig": { + "inputs": { + "in54": { + "mediaType": "application/json", + "isReference": true + } + }, + "outputs": { + } + } +} \ No newline at end of file