You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2016/06/08 12:40:51 UTC

[10/15] incubator-taverna-common-activities git commit: add CWL icon

add CWL icon


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/commit/17cdbdd0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/tree/17cdbdd0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/diff/17cdbdd0

Branch: refs/heads/cwl-browse
Commit: 17cdbdd08fe3e9f0ad19700919fbf048172b7d85
Parents: 00dd951
Author: ThilinaManamgoda <ma...@gmail.com>
Authored: Mon Jun 6 09:09:15 2016 +0530
Committer: ThilinaManamgoda <ma...@gmail.com>
Committed: Mon Jun 6 09:09:15 2016 +0530

----------------------------------------------------------------------
 .../CWLFiles/customtool1.cwl                    |  42 +++++++++
 .../CWLFiles/customtoolrecord.cwl               |  41 +++++++++
 .../Icon/cwl-logo-header.png                    | Bin 0 -> 4344 bytes
 taverna-cwl-activity-ui/pom.xml                 |  92 +++++++++++++++++++
 .../cwl/ui/serviceprovider/CwlServiceDesc.java  |  13 +--
 .../cwl/ui/serviceprovider/CwlServiceIcon.java  |  49 ++++++++++
 .../ui/serviceprovider/CwlServiceProvider.java  |  13 ++-
 .../taverna/cwl/ui/serviceprovider/Testing.java |  60 ++++++------
 .../apache/taverna/cwl/ui/TestWorkBench.java    |  11 +++
 9 files changed, 276 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/17cdbdd0/taverna-cwl-activity-ui/CWLFiles/customtool1.cwl
----------------------------------------------------------------------
diff --git a/taverna-cwl-activity-ui/CWLFiles/customtool1.cwl b/taverna-cwl-activity-ui/CWLFiles/customtool1.cwl
new file mode 100644
index 0000000..762f9d0
--- /dev/null
+++ b/taverna-cwl-activity-ui/CWLFiles/customtool1.cwl
@@ -0,0 +1,42 @@
+################################################################################
+#  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.
+#################################################################################
+
+
+#!/usr/bin/env cwl-runner
+
+class: CommandLineTool
+cwlVersion: cwl:draft-3
+
+inputs:
+  - id: input_1
+    type: int
+
+  - id: input_2
+    type:
+      type: array
+      items: int
+  - id: input_3
+    type: String
+
+outputs:
+  - id: output_1
+    type: int
+
+  - id: ouput_2
+    type: String
+
+basecommand: echo

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/17cdbdd0/taverna-cwl-activity-ui/CWLFiles/customtoolrecord.cwl
----------------------------------------------------------------------
diff --git a/taverna-cwl-activity-ui/CWLFiles/customtoolrecord.cwl b/taverna-cwl-activity-ui/CWLFiles/customtoolrecord.cwl
new file mode 100644
index 0000000..f008bdb
--- /dev/null
+++ b/taverna-cwl-activity-ui/CWLFiles/customtoolrecord.cwl
@@ -0,0 +1,41 @@
+################################################################################
+#  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.
+#################################################################################
+
+#!/usr/bin/env cwl-runner
+
+class: CommandLineTool
+cwlVersion: cwl:draft-3
+
+inputs:
+  - id: input_1
+    type: record
+
+  - id: input_2
+    type:
+      type: array
+      items: int
+  - id: input_3
+    type: String
+
+outputs:
+  - id: output_1
+    type: int
+
+  - id: ouput_2
+    type: String
+
+basecommand: echo

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/17cdbdd0/taverna-cwl-activity-ui/Icon/cwl-logo-header.png
----------------------------------------------------------------------
diff --git a/taverna-cwl-activity-ui/Icon/cwl-logo-header.png b/taverna-cwl-activity-ui/Icon/cwl-logo-header.png
new file mode 100644
index 0000000..c24484e
Binary files /dev/null and b/taverna-cwl-activity-ui/Icon/cwl-logo-header.png differ

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/17cdbdd0/taverna-cwl-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-cwl-activity-ui/pom.xml b/taverna-cwl-activity-ui/pom.xml
index e14b203..70e436c 100644
--- a/taverna-cwl-activity-ui/pom.xml
+++ b/taverna-cwl-activity-ui/pom.xml
@@ -81,6 +81,97 @@
 			<groupId>${project.groupId}</groupId>
 			<version>${project.version}</version>
 		</dependency>
+		<dependency>
+			<groupId>net.sf.taverna.t2.taverna-workbench</groupId>
+			<artifactId>workbench-dev</artifactId>
+			<version>${t2.workbench.version}</version>
+			<scope>test</scope>
+
+			<exclusions>
+
+				<!-- Disable various activities that are not relevant to testing our 
+					example activity. If you want to re-enable for instance WSDL activity, remember 
+					to comment out the exclusion for both wsdl-activity-ui and wsdl-activity 
+					further down. -->
+				<exclusion>
+					<groupId>net.sf.taverna.t2.ui-activities</groupId>
+					<artifactId>apiconsumer-activity-ui</artifactId>
+				</exclusion>
+
+				<exclusion>
+					<groupId>net.sf.taverna.t2.ui-activities</groupId>
+					<artifactId>biomoby-activity-ui</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.ui-activities</groupId>
+					<artifactId>biomart-activity-ui</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.ui-activities</groupId>
+					<artifactId>soaplab-activity-ui</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.ui-activities</groupId>
+					<artifactId>ncbi-activity-ui</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.ui-activities</groupId>
+					<artifactId>rshell-activity-ui</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.ui-activities</groupId>
+					<artifactId>spreadsheet-import-activity-ui</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.ui-activities</groupId>
+					<artifactId>wsdl-activity-ui</artifactId>
+				</exclusion>
+
+				<!-- .. and the t2.activities counterparts -->
+				<exclusion>
+					<groupId>net.sf.taverna.t2.activities</groupId>
+					<artifactId>apiconsumer-activity</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.activities</groupId>
+					<artifactId>biomoby-activity</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.activities</groupId>
+					<artifactId>biomart-activity</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.activities</groupId>
+					<artifactId>soaplab-activity</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.activities</groupId>
+					<artifactId>ncbi-activity</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.activities</groupId>
+					<artifactId>rshell-activity</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.activities</groupId>
+					<artifactId>spreadsheet-import-activity</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.activities</groupId>
+					<artifactId>wsdl-activity</artifactId>
+				</exclusion>
+				<!-- Perspectives pulling in too many dependencies -->
+				<exclusion>
+					<!-- fails due to direct dependency to WSDL -->
+					<groupId>net.sf.taverna.t2.ui-exts</groupId>
+					<artifactId>perspective-biocatalogue</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>net.sf.taverna.t2.ui-exts</groupId>
+					<artifactId>perspective-myexperiment</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
 		<!-- ==================================================================================================== -->
 
 	</dependencies>
@@ -88,6 +179,7 @@
 	<!-- Added these properties to configure new dependencies -->
 	<properties>
 		<t2.ui.api.version>1.5</t2.ui.api.version>
+		<t2.workbench.version>2.5.0</t2.workbench.version>
 	</properties>
 	<repositories>
 		<repository>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/17cdbdd0/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceDesc.java
----------------------------------------------------------------------
diff --git a/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceDesc.java b/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceDesc.java
index 6dc4879..dc6a969 100644
--- a/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceDesc.java
+++ b/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceDesc.java
@@ -16,12 +16,14 @@
  *******************************************************************************/
 package org.apache.taverna.cwl.ui.serviceprovider;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
 import javax.swing.Icon;
 
 import org.apache.taverna.cwl.CwlActivityConfigurationBean;
+import org.apache.taverna.cwl.CwlDumyActivity;
 
 import net.sf.taverna.t2.servicedescriptions.ServiceDescription;
 import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
@@ -32,8 +34,7 @@ public class CwlServiceDesc extends ServiceDescription<CwlActivityConfigurationB
 	private String toolName;
 	@Override
 	public Class<? extends Activity<CwlActivityConfigurationBean>> getActivityClass() {
-		// TODO Auto-generated method stub
-		return null;
+		return (Class<? extends Activity<CwlActivityConfigurationBean>>) CwlDumyActivity.class;
 	}
 
 	@Override
@@ -54,26 +55,22 @@ public class CwlServiceDesc extends ServiceDescription<CwlActivityConfigurationB
 
 	@Override
 	public Icon getIcon() {
-		// TODO Auto-generated method stub
-		return null;
+		return CwlServiceIcon.getIcon();
 	}
 
 	@Override
 	public String getName() {
-		// TODO Auto-generated method stub
 		return toolName;
 	}
 
 	@Override
 	public List<? extends Comparable> getPath() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
 	protected List<? extends Object> getIdentifyingData() {
-		// TODO Auto-generated method stub
-		return null;
+		return Arrays.asList("CWL Services " + toolName);
 	}
 
 	public String getToolName() {

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/17cdbdd0/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceIcon.java
----------------------------------------------------------------------
diff --git a/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceIcon.java b/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceIcon.java
new file mode 100644
index 0000000..46ab810
--- /dev/null
+++ b/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceIcon.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ *  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.cwl.ui.serviceprovider;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+
+import org.apache.taverna.cwl.CwlDumyActivity;
+
+import net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI;
+import net.sf.taverna.t2.workflowmodel.processor.activity.Activity;
+
+public class CwlServiceIcon implements ActivityIconSPI {
+	private static Icon icon;
+
+	@Override
+	public int canProvideIconScore(Activity<?> activity) {
+		if (activity instanceof CwlDumyActivity) {
+			return DEFAULT_ICON;
+		}
+		return NO_ICON;
+	}
+
+	@Override
+	public Icon getIcon(Activity<?> arg0) {
+		return getIcon();
+	}
+
+	public static Icon getIcon() {
+		if (icon == null) {
+			icon = new ImageIcon("/Icon/cwl-logo-header.png");
+		}
+		return icon;
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/17cdbdd0/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceProvider.java
----------------------------------------------------------------------
diff --git a/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceProvider.java b/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceProvider.java
index 1e5193b..0fd36d4 100644
--- a/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceProvider.java
+++ b/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/CwlServiceProvider.java
@@ -20,6 +20,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FilenameFilter;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -37,7 +38,9 @@ public class CwlServiceProvider extends AbstractConfigurableServiceProvider<CwlS
 	CwlServiceProvider() {
 		super(new CwlServiceProviderConfig());
 	}
-
+	private static final String providerName ="CWL Services";
+	private static final URI providerId = URI
+			.create("http://cwl.com/2016/service-provider/cwlcommandlinetools");
 	private File cwlFilesLocation;
 
 	@Override
@@ -82,20 +85,17 @@ public class CwlServiceProvider extends AbstractConfigurableServiceProvider<CwlS
 
 	@Override
 	public Icon getIcon() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 
 	@Override
 	public String getId() {
-		// TODO Auto-generated method stub
-		return null;
+		return providerId.toASCIIString();
 	}
 
 	@Override
 	public String getName() {
-		// TODO Auto-generated method stub
-		return null;
+		return providerName;
 	}
 
 	private File[] getCwlFiles() {
@@ -125,7 +125,6 @@ public class CwlServiceProvider extends AbstractConfigurableServiceProvider<CwlS
 
 	@Override
 	protected List<? extends Object> getIdentifyingData() {
-		// TODO Auto-generated method stub
 		return null;
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/17cdbdd0/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/Testing.java
----------------------------------------------------------------------
diff --git a/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/Testing.java b/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/Testing.java
index ef03f5b..92deb34 100644
--- a/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/Testing.java
+++ b/taverna-cwl-activity-ui/src/main/java/org/apache/taverna/cwl/ui/serviceprovider/Testing.java
@@ -42,36 +42,36 @@ public class Testing {
 	private static final int DEPTH_1 = 1;
 	private static final int DEPTH_2 = 2;
 
-	public static void main(String[] args) {
-		File[] cwlFiles = getCwlFiles();
-
-		for (File file : cwlFiles) {
-
-			Map cwlFile = null;
-			// Load the CWL file using SnakeYaml lib
-			Yaml cwlReader = new Yaml();
-			try {
-				cwlFile = (Map) cwlReader.load(new FileInputStream(file));
-				System.out.println(file.getName().split("\\.")[0]);
-				HashMap<String, Integer> map =processInputs(cwlFile);
-				for (String s : map.keySet()) {
-					//System.out.println(map.get(s));
-				}
-			} catch (FileNotFoundException e) {
-				e.printStackTrace();
-			}
-			if (cwlFile != null) {
-				// Creating the CWL configuration bean
-				CwlActivityConfigurationBean configurationBean = new CwlActivityConfigurationBean();
-				configurationBean.setCwlConfigurations(cwlFile);
-			
-				
-			}
-
-		}
-		
-	
-	}
+//	public static void main(String[] args) {
+//		File[] cwlFiles = getCwlFiles();
+//
+//		for (File file : cwlFiles) {
+//
+//			Map cwlFile = null;
+//			// Load the CWL file using SnakeYaml lib
+//			Yaml cwlReader = new Yaml();
+//			try {
+//				cwlFile = (Map) cwlReader.load(new FileInputStream(file));
+//				System.out.println(file.getName().split("\\.")[0]);
+//				HashMap<String, Integer> map =processInputs(cwlFile);
+//				for (String s : map.keySet()) {
+//					//System.out.println(map.get(s));
+//				}
+//			} catch (FileNotFoundException e) {
+//				e.printStackTrace();
+//			}
+//			if (cwlFile != null) {
+//				// Creating the CWL configuration bean
+//				CwlActivityConfigurationBean configurationBean = new CwlActivityConfigurationBean();
+//				configurationBean.setCwlConfigurations(cwlFile);
+//			
+//				
+//			}
+//
+//		}
+//		
+//	
+//	}
 
 	private static HashMap<String, Integer> processInputs(Map cwlFile) {
 		

http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/17cdbdd0/taverna-cwl-activity-ui/src/test/java/org/apache/taverna/cwl/ui/TestWorkBench.java
----------------------------------------------------------------------
diff --git a/taverna-cwl-activity-ui/src/test/java/org/apache/taverna/cwl/ui/TestWorkBench.java b/taverna-cwl-activity-ui/src/test/java/org/apache/taverna/cwl/ui/TestWorkBench.java
new file mode 100644
index 0000000..e36a6e0
--- /dev/null
+++ b/taverna-cwl-activity-ui/src/test/java/org/apache/taverna/cwl/ui/TestWorkBench.java
@@ -0,0 +1,11 @@
+package org.apache.taverna.cwl.ui;
+
+import java.net.URISyntaxException;
+
+import net.sf.taverna.t2.workbench.dev.DeveloperWorkbench;
+
+public class TestWorkBench {
+public static void main(String[] args) throws URISyntaxException {
+	DeveloperWorkbench.main(args);
+}
+}