You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/02/17 12:32:24 UTC
[18/50] [abbrv] incubator-taverna-engine git commit:
taverna-activity-archetype/
taverna-activity-archetype/
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/commit/8dd0a1ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/tree/8dd0a1ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/diff/8dd0a1ed
Branch: refs/heads/master
Commit: 8dd0a1ed0602c3cdad955484c49fa8362f994f0a
Parents: 359f9e2
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Sat Dec 27 13:28:29 2014 -0600
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Sat Dec 27 13:28:29 2014 -0600
----------------------------------------------------------------------
.gitignore | 24 ---
.travis.yml | 1 -
README.md | 4 -
activity-archetype/pom.xml | 31 ---
.../META-INF/maven/archetype-metadata.xml | 58 ------
.../__rootArtifactId__-activity-ui/pom.xml | 47 -----
.../__classPrefix__ConfigurationPanel.java | 87 ---------
.../config/__classPrefix__ConfigureAction.java | 49 -----
.../__classPrefix__ConfigureMenuAction.java | 67 -------
.../__classPrefix__ServiceDesc.java | 106 ----------
.../__classPrefix__ServiceIcon.java | 40 ----
.../__classPrefix__ServiceProvider.java | 75 --------
...classPrefix__ActivityContextViewFactory.java | 62 ------
.../ui/view/__classPrefix__ContextualView.java | 91 ---------
.../resources/META-INF/spring/context-osgi.xml | 26 ---
.../main/resources/META-INF/spring/context.xml | 31 ---
.../src/main/resources/exampleIcon.png | Bin 3654 -> 0 bytes
.../__rootArtifactId__-activity/pom.xml | 51 -----
.../src/main/java/__classPrefix__Activity.java | 135 -------------
.../java/__classPrefix__ActivityFactory.java | 97 ----------
.../__classPrefix__ActivityHealthChecker.java | 66 -------
.../resources/META-INF/spring/context-osgi.xml | 17 --
.../main/resources/META-INF/spring/context.xml | 12 --
.../src/main/resources/schema.json | 25 ---
.../__classPrefix__ActivityFactoryTest.java | 103 ----------
.../test/java/__classPrefix__ActivityTest.java | 76 --------
.../__rootArtifactId__-plugin/pom.xml | 26 ---
.../main/resources/archetype-resources/pom.xml | 192 -------------------
pom.xml | 53 -----
taverna-activity-archetype/pom.xml | 31 +++
.../META-INF/maven/archetype-metadata.xml | 58 ++++++
.../__rootArtifactId__-activity-ui/pom.xml | 47 +++++
.../__classPrefix__ConfigurationPanel.java | 87 +++++++++
.../config/__classPrefix__ConfigureAction.java | 49 +++++
.../__classPrefix__ConfigureMenuAction.java | 67 +++++++
.../__classPrefix__ServiceDesc.java | 106 ++++++++++
.../__classPrefix__ServiceIcon.java | 40 ++++
.../__classPrefix__ServiceProvider.java | 75 ++++++++
...classPrefix__ActivityContextViewFactory.java | 62 ++++++
.../ui/view/__classPrefix__ContextualView.java | 91 +++++++++
.../resources/META-INF/spring/context-osgi.xml | 26 +++
.../main/resources/META-INF/spring/context.xml | 31 +++
.../src/main/resources/exampleIcon.png | Bin 0 -> 3654 bytes
.../__rootArtifactId__-activity/pom.xml | 51 +++++
.../src/main/java/__classPrefix__Activity.java | 135 +++++++++++++
.../java/__classPrefix__ActivityFactory.java | 97 ++++++++++
.../__classPrefix__ActivityHealthChecker.java | 66 +++++++
.../resources/META-INF/spring/context-osgi.xml | 17 ++
.../main/resources/META-INF/spring/context.xml | 12 ++
.../src/main/resources/schema.json | 25 +++
.../__classPrefix__ActivityFactoryTest.java | 103 ++++++++++
.../test/java/__classPrefix__ActivityTest.java | 76 ++++++++
.../__rootArtifactId__-plugin/pom.xml | 26 +++
.../main/resources/archetype-resources/pom.xml | 192 +++++++++++++++++++
54 files changed, 1570 insertions(+), 1652 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index ebe0e5b..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,24 +0,0 @@
-# ignore project files #
-.classpath
-.project
-.settings/
-catalog-v001.xml
-
-# ignore target files #
-target/
-bin/
-build/
-dist/
-apidoc/
-*.swp
-
-# ignore svn files if there
-.svn
-
-# ignore log files #
-*.log
-/logs/*
-*/logs/*
-
-
-
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index dff5f3a..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1 +0,0 @@
-language: java
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index 458f346..0000000
--- a/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-Maven archetypes for creating Taverna plugins
-
-This code was previously hosted at http://taverna.googlecode.com/svn/taverna/dev/archetypes/
-
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/pom.xml b/activity-archetype/pom.xml
deleted file mode 100644
index 548df6a..0000000
--- a/activity-archetype/pom.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>net.sf.taverna.t2.archetypes</groupId>
- <artifactId>archetypes</artifactId>
- <version>2.0-SNAPSHOT</version>
- </parent>
- <groupId>net.sf.taverna.t2.archetypes</groupId>
- <artifactId>taverna-activity-archetype</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Taverna activity archetype</name>
- <description>Archetype to build a Taverna 3 service activity.
- Includes engine and UI parts, and a test class to run the workbench with the new activity.
- </description>
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.2</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- </plugins>
- </build>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
deleted file mode 100644
index 719227f..0000000
--- a/activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archetype-descriptor
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
- name="myfancytool"
- xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <requiredProperties>
- <requiredProperty key="classPrefix">
- <defaultValue>Example</defaultValue>
- </requiredProperty>
- </requiredProperties>
- <modules>
- <module id="${rootArtifactId}-activity" dir="__rootArtifactId__-activity"
- name="${rootArtifactId}-activity">
- <fileSets>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <fileSet encoding="UTF-8" filtered="true">
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.json</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/test/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- </fileSets>
- </module>
- <module id="${rootArtifactId}-activity-ui" dir="__rootArtifactId__-activity-ui"
- name="${rootArtifactId}-activity-ui">
- <fileSets>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <fileSet encoding="UTF-8" filtered="true">
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.png</include>
- </includes>
- </fileSet>
- </fileSets>
- </module>
- <module id="${rootArtifactId}-plugin" dir="__rootArtifactId__-plugin"
- name="${rootArtifactId}-plugin" />
- </modules>
-</archetype-descriptor>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml
deleted file mode 100644
index 9f01ed6..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>${groupId}</groupId>
- <artifactId>${rootArtifactId}</artifactId>
- <version>${version}</version>
- </parent>
- <artifactId>${artifactId}</artifactId>
- <packaging>bundle</packaging>
- <name>${classPrefix} Taverna activity UI bindings</name>
-
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-activity</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
- <artifactId>activity-palette-api</artifactId>
- <version>${t2.ui.api.version}</version>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
- <artifactId>menu-api</artifactId>
- <version>${t2.ui.api.version}</version>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
- <artifactId>contextual-views-api</artifactId>
- <version>${t2.ui.api.version}</version>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.ui-api</groupId>
- <artifactId>activity-tools</artifactId>
- <version>${t2.ui.api.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.3.0</version>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
deleted file mode 100644
index d92efb7..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
+++ /dev/null
@@ -1,87 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package}.ui.config;
-
-import java.awt.GridLayout;
-import java.net.URI;
-
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JTextField;
-
-import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ActivityConfigurationPanel;
-
-import uk.org.taverna.commons.services.ServiceRegistry;
-import uk.org.taverna.scufl2.api.activity.Activity;
-
-@SuppressWarnings("serial")
-public class ${classPrefix}ConfigurationPanel extends ActivityConfigurationPanel {
-
- private final ServiceRegistry serviceRegistry;
-
- private JTextField fieldString;
- private JTextField fieldURI;
-
- public ${classPrefix}ConfigurationPanel(Activity activity, ServiceRegistry serviceRegistry) {
- super(activity);
- this.serviceRegistry = serviceRegistry;
- initialise();
- }
-
- protected void initialise() {
- // call super.initialise() to initialise the configuration
- super.initialise();
-
- removeAll();
- setLayout(new GridLayout(0, 2));
-
- // FIXME: Create GUI depending on activity configuration bean
- JLabel labelString = new JLabel("Example string:");
- add(labelString);
- fieldString = new JTextField(20);
- add(fieldString);
- labelString.setLabelFor(fieldString);
-
- JLabel labelURI = new JLabel("Example URI:");
- add(labelURI);
- fieldURI = new JTextField(25);
- add(fieldURI);
- labelURI.setLabelFor(fieldURI);
-
- // Populate fields from activity configuration
- fieldString.setText(getProperty("exampleString"));
- fieldURI.setText(getProperty("exampleUri"));
- }
-
- /**
- * Check that user values in UI are valid
- */
- @Override
- public boolean checkValues() {
- try {
- URI.create(fieldURI.getText());
- } catch (IllegalArgumentException ex) {
- JOptionPane.showMessageDialog(this, ex.getCause().getMessage(),
- "Invalid URI", JOptionPane.ERROR_MESSAGE);
- // Not valid, return false
- return false;
- }
- // All valid, return true
- return true;
- }
-
- /**
- * Set the configuration properties from the UI
- */
- @Override
- public void noteConfiguration() {
- // FIXME: Update bean fields from your UI elements
- setProperty("exampleString", fieldString.getText());
- setProperty("exampleUri", fieldURI.getText());
-
- configureInputPorts(serviceRegistry);
- configureOutputPorts(serviceRegistry);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
deleted file mode 100644
index c7d5d10..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigureAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package}.ui.config;
-
-import java.awt.event.ActionEvent;
-
-import uk.org.taverna.commons.services.ServiceRegistry;
-import uk.org.taverna.scufl2.api.activity.Activity;
-
-import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
-import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
-import net.sf.taverna.t2.workbench.edits.EditManager;
-import net.sf.taverna.t2.workbench.file.FileManager;
-import net.sf.taverna.t2.workbench.ui.actions.activity.ActivityConfigurationAction;
-import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ActivityConfigurationDialog;
-
-@SuppressWarnings("serial")
-public class ${classPrefix}ConfigureAction extends ActivityConfigurationAction {
-
- private final EditManager editManager;
- private final FileManager fileManager;
- private final ServiceRegistry serviceRegistry;
-
- public ${classPrefix}ConfigureAction(Activity activity,
- EditManager editManager, FileManager fileManager,
- ActivityIconManager activityIconManager,
- ServiceDescriptionRegistry serviceDescriptionRegistry,
- ServiceRegistry serviceRegistry) {
- super(activity, activityIconManager, serviceDescriptionRegistry);
- this.editManager = editManager;
- this.fileManager = fileManager;
- this.serviceRegistry = serviceRegistry;
- }
-
- public void actionPerformed(ActionEvent e) {
- ActivityConfigurationDialog currentDialog = getDialog(getActivity());
- if (currentDialog != null) {
- currentDialog.toFront();
- return;
- }
-
- ${classPrefix}ConfigurationPanel panel = new ${classPrefix}ConfigurationPanel(getActivity(), serviceRegistry);
- ActivityConfigurationDialog dialog = new ActivityConfigurationDialog(getActivity(), panel, editManager);
-
- setDialog(getActivity(), dialog, fileManager);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/menu/__classPrefix__ConfigureMenuAction.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/menu/__classPrefix__ConfigureMenuAction.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/menu/__classPrefix__ConfigureMenuAction.java
deleted file mode 100644
index a257a4e..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/menu/__classPrefix__ConfigureMenuAction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package}.ui.menu;
-
-import java.net.URI;
-
-import javax.swing.Action;
-
-import uk.org.taverna.commons.services.ServiceRegistry;
-
-import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
-import net.sf.taverna.t2.ui.menu.ContextualMenuComponent;
-import net.sf.taverna.t2.ui.menu.MenuComponent;
-import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
-import net.sf.taverna.t2.workbench.activitytools.AbstractConfigureActivityMenuAction;
-import net.sf.taverna.t2.workbench.edits.EditManager;
-import net.sf.taverna.t2.workbench.file.FileManager;
-
-import ${package}.ui.config.${classPrefix}ConfigureAction;
-
-public class ${classPrefix}ConfigureMenuAction extends AbstractConfigureActivityMenuAction implements
- MenuComponent, ContextualMenuComponent {
-
- private static final URI ACTIVITY_TYPE = URI
- .create("http://example.com/2013/activity/${rootArtifactId}");
-
- private EditManager editManager;
- private FileManager fileManager;
- private ActivityIconManager activityIconManager;
- private ServiceDescriptionRegistry serviceDescriptionRegistry;
- private ServiceRegistry serviceRegistry;
-
- public ${classPrefix}ConfigureMenuAction() {
- super(ACTIVITY_TYPE);
- }
-
- @Override
- protected Action createAction() {
- Action result = new ${classPrefix}ConfigureAction(findActivity(), editManager, fileManager,
- activityIconManager, serviceDescriptionRegistry, serviceRegistry);
- result.putValue(Action.NAME, "Configure example service");
- addMenuDots(result);
- return result;
- }
-
- public void setEditManager(EditManager editManager) {
- this.editManager = editManager;
- }
-
- public void setFileManager(FileManager fileManager) {
- this.fileManager = fileManager;
- }
-
- public void setActivityIconManager(ActivityIconManager activityIconManager) {
- this.activityIconManager = activityIconManager;
- }
-
- public void setServiceDescriptionRegistry(ServiceDescriptionRegistry serviceDescriptionRegistry) {
- this.serviceDescriptionRegistry = serviceDescriptionRegistry;
- }
-
- public void setServiceRegistry(ServiceRegistry serviceRegistry) {
- this.serviceRegistry = serviceRegistry;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
deleted file mode 100644
index 5de7bc4..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceDesc.java
+++ /dev/null
@@ -1,106 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package}.ui.serviceprovider;
-
-import java.net.URI;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import uk.org.taverna.scufl2.api.configurations.Configuration;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-import net.sf.taverna.t2.servicedescriptions.ServiceDescription;
-
-public class ${classPrefix}ServiceDesc extends ServiceDescription {
-
- private static final URI ACTIVITY_TYPE = URI
- .create("http://example.com/2013/activity/${rootArtifactId}");
-
- // FIXME: Replace example fields and getters/setters with any required
- // and optional fields. (All fields are searchable in the Service palette,
- // for instance try a search for exampleString:3)
- private String exampleString;
- private String exampleUri;
-
- public String getExampleString() {
- return exampleString;
- }
- public void setExampleString(String exampleString) {
- this.exampleString = exampleString;
- }
-
- public String getExampleUri() {
- return exampleUri;
- }
- public void setExampleUri(String exampleUri) {
- this.exampleUri = exampleUri;
- }
-
- /**
- * The type of Activity which should be instantiated when adding a service
- * for this description
- */
- @Override
- public URI getActivityType() {
- return ACTIVITY_TYPE;
- }
-
- /**
- * The configuration which is to be used for configuring the instantiated activity.
- * Making this configuration will typically require some of the fields set on this service
- * description, like an endpoint URL or method name.
- *
- */
- @Override
- public Configuration getActivityConfiguration() {
- Configuration configuration = new Configuration();
- configuration.setType(ACTIVITY_TYPE.resolve("#Config"));
- ObjectNode json = configuration.getJsonAsObjectNode();
- json.put("exampleString", exampleString);
- json.put("exampleUri", exampleUri);
- return configuration;
- }
-
- /**
- * An icon to represent this service description in the service palette.
- */
- @Override
- public Icon getIcon() {
- return ${classPrefix}ServiceIcon.getIcon();
- }
-
- /**
- * 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 exampleString;
- }
-
- /**
- * The path to this service description in the service palette. Folders
- * will be created for each element of the returned path.
- */
- @Override
- public List<String> getPath() {
- // For deeper paths you may return several strings
- return Arrays.asList("${classPrefix}s " + exampleUri);
- }
-
- /**
- * 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() {
- // FIXME: Use your fields instead of example fields
- return Arrays.<Object>asList(exampleString, exampleUri);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceIcon.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceIcon.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceIcon.java
deleted file mode 100644
index 023edcb..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceIcon.java
+++ /dev/null
@@ -1,40 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package}.ui.serviceprovider;
-
-import java.net.URI;
-
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-
-import net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI;
-
-public class ${classPrefix}ServiceIcon implements ActivityIconSPI {
-
- private static final URI ACTIVITY_TYPE = URI
- .create("http://example.com/2013/activity/${rootArtifactId}");
-
- private static Icon icon;
-
- @Override
- public int canProvideIconScore(URI activityType) {
- if (ACTIVITY_TYPE.equals(activityType)) {
- return DEFAULT_ICON + 1;
- }
- return NO_ICON;
- }
-
- @Override
- public Icon getIcon(URI activityType) {
- return getIcon();
- }
-
- public static Icon getIcon() {
- if (icon == null) {
- icon = new ImageIcon(${classPrefix}ServiceIcon.class.getResource("/exampleIcon.png"));
- }
- return icon;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceProvider.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceProvider.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceProvider.java
deleted file mode 100644
index 8a30c6f..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/serviceprovider/__classPrefix__ServiceProvider.java
+++ /dev/null
@@ -1,75 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package}.ui.serviceprovider;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.Icon;
-
-import net.sf.taverna.t2.servicedescriptions.ServiceDescription;
-import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider;
-
-public class ${classPrefix}ServiceProvider implements ServiceDescriptionProvider {
-
- private static final URI providerId = URI
- .create("http://example.com/2011/service-provider/${rootArtifactId}");
-
- /**
- * Do the actual search for services. Return using the callBack parameter.
- */
- public void findServiceDescriptionsAsync(
- FindServiceDescriptionsCallBack callBack) {
- // Use callback.status() for long-running searches
- // callBack.status("Resolving example services");
-
- List<ServiceDescription> results = new ArrayList<ServiceDescription>();
-
- // FIXME: Implement the actual service search/lookup instead
- // of dummy for-loop
- for (int i = 1; i <= 5; i++) {
- ${classPrefix}ServiceDesc service = new ${classPrefix}ServiceDesc();
- // Populate the service description bean
- service.setExampleString("Example " + i);
- service.setExampleUri("http://localhost:8192/service");
-
- // Optional: set description
- service.setDescription("Service example number " + i);
- results.add(service);
- }
-
- // partialResults() can also be called several times from inside
- // for-loop if the full search takes a long time
- callBack.partialResults(results);
-
- // No more results will be coming
- callBack.finished();
- }
-
- /**
- * Icon for service provider
- */
- public Icon getIcon() {
- return ${classPrefix}ServiceIcon.getIcon();
- }
-
- /**
- * Name of service provider, appears in right click for 'Remove service
- * provider'
- */
- public String getName() {
- return "My example service";
- }
-
- @Override
- public String toString() {
- return getName();
- }
-
- public String getId() {
- return providerId.toASCIIString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
deleted file mode 100644
index de87ef3..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ActivityContextViewFactory.java
+++ /dev/null
@@ -1,62 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package}.ui.view;
-
-import java.net.URI;
-import java.util.Arrays;
-import java.util.List;
-
-import uk.org.taverna.commons.services.ServiceRegistry;
-import uk.org.taverna.scufl2.api.activity.Activity;
-
-import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
-import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
-import net.sf.taverna.t2.workbench.edits.EditManager;
-import net.sf.taverna.t2.workbench.file.FileManager;
-import net.sf.taverna.t2.workbench.ui.views.contextualviews.ContextualView;
-import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory;
-
-public class ${classPrefix}ActivityContextViewFactory implements ContextualViewFactory<Activity> {
-
- private static final URI ACTIVITY_TYPE = URI
- .create("http://example.com/2013/activity/${rootArtifactId}");
-
- private EditManager editManager;
- private FileManager fileManager;
- private ActivityIconManager activityIconManager;
- private ServiceDescriptionRegistry serviceDescriptionRegistry;
- private ServiceRegistry serviceRegistry;
-
- @Override
- public boolean canHandle(Object object) {
- return object instanceof Activity && ((Activity) object).getType().equals(ACTIVITY_TYPE);
- }
-
- @Override
- public List<ContextualView> getViews(Activity selection) {
- return Arrays.<ContextualView>asList(new ${classPrefix}ContextualView(selection, editManager,
- fileManager, activityIconManager, serviceDescriptionRegistry, serviceRegistry));
- }
-
- public void setEditManager(EditManager editManager) {
- this.editManager = editManager;
- }
-
- public void setFileManager(FileManager fileManager) {
- this.fileManager = fileManager;
- }
-
- public void setActivityIconManager(ActivityIconManager activityIconManager) {
- this.activityIconManager = activityIconManager;
- }
-
- public void setServiceDescriptionRegistry(ServiceDescriptionRegistry serviceDescriptionRegistry) {
- this.serviceDescriptionRegistry = serviceDescriptionRegistry;
- }
-
- public void setServiceRegistry(ServiceRegistry serviceRegistry) {
- this.serviceRegistry = serviceRegistry;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
deleted file mode 100644
index b7066a0..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java
+++ /dev/null
@@ -1,91 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package}.ui.view;
-
-import java.awt.Frame;
-
-import javax.swing.Action;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-import uk.org.taverna.commons.services.ServiceRegistry;
-
-import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry;
-import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager;
-import net.sf.taverna.t2.workbench.edits.EditManager;
-import net.sf.taverna.t2.workbench.file.FileManager;
-import net.sf.taverna.t2.workbench.ui.actions.activity.ActivityContextualView;
-
-import uk.org.taverna.scufl2.api.activity.Activity;
-
-import ${package}.ui.config.${classPrefix}ConfigureAction;
-
-@SuppressWarnings("serial")
-public class ${classPrefix}ContextualView extends ActivityContextualView {
-
- private final EditManager editManager;
- private final FileManager fileManager;
- private final ActivityIconManager activityIconManager;
- private final ServiceDescriptionRegistry serviceDescriptionRegistry;
- private final ServiceRegistry serviceRegistry;
-
- private JLabel description = new JLabel("ads");
-
- public ${classPrefix}ContextualView(Activity activity, EditManager editManager,
- FileManager fileManager, ActivityIconManager activityIconManager,
- ServiceDescriptionRegistry serviceDescriptionRegistry, ServiceRegistry serviceRegistry) {
- super(activity);
- this.editManager = editManager;
- this.fileManager = fileManager;
- this.activityIconManager = activityIconManager;
- this.serviceDescriptionRegistry = serviceDescriptionRegistry;
- this.serviceRegistry = serviceRegistry;
- initView();
- }
-
- @Override
- public JComponent getMainFrame() {
- JPanel jPanel = new JPanel();
- jPanel.add(description);
- refreshView();
- return jPanel;
- }
-
- @Override
- public String getViewTitle() {
- JsonNode configuration = getConfigBean().getJson();
- return "${classPrefix} service " + configuration.get("exampleString").asText();
- }
-
- /**
- * Typically called when the activity configuration has changed.
- */
- @Override
- public void refreshView() {
- JsonNode configuration = getConfigBean().getJson();
- description.setText("${classPrefix} service " + configuration.get("exampleUri").asText()
- + " - " + configuration.get("exampleString").asText());
- // TODO: Might also show extra service information looked
- // up dynamically from endpoint/registry
- }
-
- /**
- * View position hint
- */
- @Override
- public int getPreferredPosition() {
- // We want to be on top
- return 100;
- }
-
- @Override
- public Action getConfigureAction(final Frame owner) {
- return new ${classPrefix}ConfigureAction(getActivity(), editManager, fileManager,
- activityIconManager, serviceDescriptionRegistry, serviceRegistry);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml
deleted file mode 100644
index 32ad4f1..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:beans="http://www.springframework.org/schema/beans"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/osgi
- http://www.springframework.org/schema/osgi/spring-osgi.xsd">
-
- <service ref="${classPrefix}ServiceIcon" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI" />
-
- <service ref="${classPrefix}ServiceProvider" interface="net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider" />
-
- <service ref="${classPrefix}ConfigureMenuAction" auto-export="interfaces" />
-
- <service ref="${classPrefix}ActivityContextViewFactory" interface="net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory" />
-
- <reference id="editManager" interface="net.sf.taverna.t2.workbench.edits.EditManager" />
- <reference id="fileManager" interface="net.sf.taverna.t2.workbench.file.FileManager" />
- <reference id="menuManager" interface="net.sf.taverna.t2.ui.menu.MenuManager" />
- <reference id="selectionManager" interface="net.sf.taverna.t2.workbench.selection.SelectionManager" />
- <reference id="activityIconManager" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconManager" />
- <reference id="colourManager" interface="net.sf.taverna.t2.workbench.configuration.colour.ColourManager" />
- <reference id="serviceDescriptionRegistry" interface="net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry" />
- <reference id="serviceRegistry" interface="uk.org.taverna.commons.services.ServiceRegistry" />
-
-</beans:beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml
deleted file mode 100644
index cfc5a00..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="${classPrefix}ServiceIcon"
- class="${package}.ui.serviceprovider.${classPrefix}ServiceIcon" />
-
- <bean id="${classPrefix}ServiceProvider"
- class="${package}.ui.serviceprovider.${classPrefix}ServiceProvider" />
-
- <bean id="${classPrefix}ConfigureMenuAction"
- class="${package}.ui.menu.${classPrefix}ConfigureMenuAction">
- <property name="editManager" ref="editManager" />
- <property name="fileManager" ref="fileManager" />
- <property name="activityIconManager" ref="activityIconManager" />
- <property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" />
- <property name="serviceRegistry" ref="serviceRegistry" />
- </bean>
-
- <bean id="${classPrefix}ActivityContextViewFactory"
- class="${package}.ui.view.${classPrefix}ActivityContextViewFactory">
- <property name="editManager" ref="editManager" />
- <property name="fileManager" ref="fileManager" />
- <property name="activityIconManager" ref="activityIconManager" />
- <property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" />
- <property name="serviceRegistry" ref="serviceRegistry" />
- </bean>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png
deleted file mode 100644
index 3ef7be4..0000000
Binary files a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml
deleted file mode 100644
index 755b218..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>${groupId}</groupId>
- <artifactId>${rootArtifactId}</artifactId>
- <version>${version}</version>
- </parent>
- <artifactId>${artifactId}</artifactId>
- <packaging>bundle</packaging>
- <name>${classPrefix} Taverna activity</name>
-
- <dependencies>
- <dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
- <artifactId>workflowmodel-api</artifactId>
- <version>${t2.core.version}</version>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
- <artifactId>reference-api</artifactId>
- <version>${t2.core.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.3.0</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.core</groupId>
- <artifactId>workflowmodel-impl</artifactId>
- <version>${t2.core.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>net.sf.taverna.t2.activities</groupId>
- <artifactId>activity-test-utils</artifactId>
- <version>${t2.activities.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java
deleted file mode 100644
index 6696cfe..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java
+++ /dev/null
@@ -1,135 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package};
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-import net.sf.taverna.t2.invocation.InvocationContext;
-import net.sf.taverna.t2.reference.ReferenceService;
-import net.sf.taverna.t2.reference.T2Reference;
-import net.sf.taverna.t2.workflowmodel.processor.activity.AbstractAsynchronousActivity;
-import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException;
-import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivity;
-import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivityCallback;
-
-/**
- * ${classPrefix} <code>Activity<code>.
- */
-public class ${classPrefix}Activity extends AbstractAsynchronousActivity<JsonNode>
- implements AsynchronousActivity<JsonNode> {
-
- public static final String ACTIVITY_TYPE = "http://example.com/2013/activity/${rootArtifactId}";
-
- /*
- * Best practice: Keep port names as constants to avoid misspelling. This
- * would not apply if port names are looked up dynamically from the service
- * operation, like done for WSDL services.
- */
- public static final String IN_FIRST_INPUT = "firstInput";
- public static final String IN_EXTRA_DATA = "extraData";
- public static final String OUT_MORE_OUTPUTS = "moreOutputs";
- public static final String OUT_SIMPLE_OUTPUT = "simpleOutput";
- public static final String OUT_REPORT = "report";
-
- private JsonNode configuration;
-
- @Override
- public void configure(JsonNode configuration) throws ActivityConfigurationException {
-
- // Any pre-config sanity checks
- if (configuration.get("exampleString").asText().equals("invalidExample")) {
- throw new ActivityConfigurationException(
- "Example string can't be 'invalidExample'");
- }
- // Store for getConfiguration(), but you could also make
- // getConfiguration() return a new bean from other sources
- this.configuration = configuration;
-
- // OPTIONAL:
- // Do any server-side lookups and configuration, like resolving WSDLs
-
- // myClient = new MyClient(configuration.get("exampleUri").asText());
- // this.service = myClient.getService(configuration.get("exampleString").asText());
-
- }
-
- @Override
- public JsonNode getConfiguration() {
- return configuration;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void executeAsynch(final Map<String, T2Reference> inputs,
- final AsynchronousActivityCallback callback) {
- // Don't execute service directly now, request to be run ask to be run
- // from thread pool and return asynchronously
- callback.requestRun(new Runnable() {
-
- public void run() {
- InvocationContext context = callback
- .getContext();
- ReferenceService referenceService = context
- .getReferenceService();
- // Resolve inputs
- String firstInput = (String) referenceService.renderIdentifier(inputs.get(IN_FIRST_INPUT),
- String.class, context);
-
- // Support our configuration-dependendent input
- boolean optionalPorts = configuration.get("exampleString").asText().equals("specialCase");
-
- List<byte[]> special = null;
- // We'll also allow IN_EXTRA_DATA to be optionally not provided
- if (optionalPorts && inputs.containsKey(IN_EXTRA_DATA)) {
- // Resolve as a list of byte[]
- special = (List<byte[]>) referenceService.renderIdentifier(
- inputs.get(IN_EXTRA_DATA), byte[].class, context);
- }
-
-
- // TODO: Do the actual service invocation
-// try {
-// results = this.service.invoke(firstInput, special)
-// } catch (ServiceException ex) {
-// callback.fail("Could not invoke ${classPrefix} service " + configBean.getExampleUri(),
-// ex);
-// // Make sure we don't call callback.receiveResult later
-// return;
-// }
-
- // Register outputs
- Map<String, T2Reference> outputs = new HashMap<>();
- String simpleValue = "simple";
- T2Reference simpleRef = referenceService.register(simpleValue, 0, true, context);
- outputs.put(OUT_SIMPLE_OUTPUT, simpleRef);
-
- // For list outputs, only need to register the top level list
- List<String> moreValues = new ArrayList<>();
- moreValues.add("Value 1");
- moreValues.add("Value 2");
- T2Reference moreRef = referenceService.register(moreValues, 1, true, context);
- outputs.put(OUT_MORE_OUTPUTS, moreRef);
-
- if (optionalPorts) {
- // Populate our optional output port
- // NOTE: Need to return output values for all defined output ports
- String report = "Everything OK";
- outputs.put(OUT_REPORT, referenceService.register(report,
- 0, true, context));
- }
-
- // return map of output data, with empty index array as this is
- // the only and final result (this index parameter is used if
- // pipelining output)
- callback.receiveResult(outputs, new int[0]);
- }
- });
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java
deleted file mode 100644
index 0fcb08b..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java
+++ /dev/null
@@ -1,97 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package};
-
-import static ${package}.${classPrefix}Activity.*;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.HashSet;
-import java.util.Set;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import net.sf.taverna.t2.workflowmodel.Edits;
-import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory;
-import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
-import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
-
-/**
- * ${classPrefix} <code>ActivityFactory<code>.
- */
-public class ${classPrefix}ActivityFactory implements ActivityFactory {
-
- private Edits edits;
-
- @Override
- public ${classPrefix}Activity createActivity() {
- return new ${classPrefix}Activity();
- }
-
- @Override
- public URI getActivityType() {
- return URI.create(${classPrefix}Activity.ACTIVITY_TYPE);
- }
-
- @Override
- public JsonNode getActivityConfigurationSchema() {
- ObjectMapper objectMapper = new ObjectMapper();
- try {
- return objectMapper.readTree(getClass().getResource("/schema.json"));
- } catch (IOException e) {
- return objectMapper.createObjectNode();
- }
- }
-
- @Override
- public Set<ActivityInputPort> getInputPorts(JsonNode configuration) {
- Set<ActivityInputPort> 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));
- }
-
- return inputPorts;
- }
-
- @Override
- public Set<ActivityOutputPort> getOutputPorts(JsonNode configuration) {
- Set<ActivityOutputPort> 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));
- }
-
- // 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;
- }
-
- /**
- * Sets the edits property.
- * <p>
- * This method is used by Spring. The property name must match the property specified
- * in the Spring context file.
- *
- * @param edits the <code>Edits</code> used to create input/output ports
- */
- public void setEdits(Edits edits) {
- this.edits = edits;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java
deleted file mode 100644
index f5568fc..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package};
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-import net.sf.taverna.t2.visit.VisitReport;
-import net.sf.taverna.t2.visit.VisitReport.Status;
-import net.sf.taverna.t2.workflowmodel.health.HealthCheck;
-import net.sf.taverna.t2.workflowmodel.health.HealthChecker;
-
-/**
- * ${classPrefix} <code>HealthChecker</code>.
- */
-public class ${classPrefix}ActivityHealthChecker implements
- HealthChecker<${classPrefix}Activity> {
-
- public boolean canVisit(Object o) {
- // Return True if we can visit the object. We could do
- // deeper (but not time consuming) checks here, for instance
- // if the health checker only deals with ${classPrefix}Activity where
- // a certain configuration option is enabled.
- return o instanceof ${classPrefix}Activity;
- }
-
- public boolean isTimeConsuming() {
- // Return true if the health checker does a network lookup
- // or similar time consuming checks, in which case
- // it would only be performed when using File->Validate workflow
- // or File->Run.
- return false;
- }
-
- public VisitReport visit(${classPrefix}Activity activity, List<Object> ancestry) {
- JsonNode config = activity.getConfiguration();
-
- // We'll build a list of subreports
- List<VisitReport> subReports = new ArrayList<>();
-
- if (!URI.create(config.get("exampleUri").asText()).isAbsolute()) {
- // Report Severe problems we know won't work
- VisitReport report = new VisitReport(HealthCheck.getInstance(),
- activity, "Example URI must be absolute", HealthCheck.INVALID_URL,
- Status.SEVERE);
- subReports.add(report);
- }
-
- if (config.get("exampleString").asText().equals("")) {
- // Warning on possible problems
- subReports.add(new VisitReport(HealthCheck.getInstance(), activity,
- "Example string empty", HealthCheck.NO_CONFIGURATION,
- Status.WARNING));
- }
-
- // The default explanation here will be used if the subreports list is
- // empty
- return new VisitReport(HealthCheck.getInstance(), activity,
- "${classPrefix} service OK", HealthCheck.NO_PROBLEM, subReports);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml
deleted file mode 100644
index e8d6e12..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:beans="http://www.springframework.org/schema/beans"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/osgi
- http://www.springframework.org/schema/osgi/spring-osgi.xsd">
-
- <!-- Services to be registered with the OSGi service register -->
- <service ref="${classPrefix}ActivityHealthChecker" interface="net.sf.taverna.t2.workflowmodel.health.HealthChecker" />
-
- <service ref="${classPrefix}ActivityFactory" interface="net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory" />
-
- <!-- References to services required from the OSGi service register -->
- <reference id="edits" interface="net.sf.taverna.t2.workflowmodel.Edits" />
-
-</beans:beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml
deleted file mode 100644
index 49f5428..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd">
-
- <bean id="${classPrefix}ActivityHealthChecker" class="${package}.${classPrefix}ActivityHealthChecker" />
-
- <bean id="${classPrefix}ActivityFactory" class="${package}.${classPrefix}ActivityFactory">
- <property name="edits" ref="edits" />
- </bean>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json
deleted file mode 100644
index 2916b11..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-03/schema#",
- "id": "http://example.com/2013/activity/${rootArtifactId}.schema.json",
- "title": "${classPrefix} activity configuration",
- "type": "object",
- "properties": {
- "@context": {
- "description": "JSON-LD context for interpreting the configuration as RDF",
- "required": true,
- "enum": ["http://example.com/2013/activity/${rootArtifactId}.context.json"]
- },
- "exampleString": {
- "title": "Example String",
- "description": "An example string property",
- "type": "string",
- "required": true
- },
- "exampleUri": {
- "title": "Example URI",
- "description": "An example uri property",
- "type": "string",
- "required": true
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java
deleted file mode 100644
index 4de382e..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package};
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URI;
-import java.util.HashSet;
-import java.util.Set;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.JsonNodeFactory;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-import net.sf.taverna.t2.workflowmodel.impl.EditsImpl;
-import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
-import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ${classPrefix}ActivityFactoryTest {
-
- private ObjectNode configuration;
-
- private ${classPrefix}ActivityFactory activityFactory;
-
- @Before
- public void setUp() throws Exception {
- configuration = JsonNodeFactory.instance.objectNode();
- configuration.put("exampleString", "something");
- configuration.put("exampleUri", "http://localhost:8080/myEndPoint");
-
- activityFactory = new ${classPrefix}ActivityFactory();
- activityFactory.setEdits(new EditsImpl());
- }
-
- @Test
- public void testCreateActivity() {
- ${classPrefix}Activity activity = activityFactory.createActivity();
- assertNotNull(activity);
- assertNotSame(activity, activityFactory.createActivity());
- }
-
- @Test
- public void testGetActivityURI() {
- assertEquals(URI.create(${classPrefix}Activity.ACTIVITY_TYPE), activityFactory.getActivityType());
- }
-
- @Test
- public void testGetActivityConfigurationSchema() {
- JsonNode configurationSchema = activityFactory.getActivityConfigurationSchema();
- assertNotNull(configurationSchema);
- assertTrue(configurationSchema.has("properties"));
- JsonNode propertiesNode = configurationSchema.get("properties");
- assertTrue(propertiesNode.has("exampleString"));
- assertTrue(propertiesNode.has("exampleUri"));
- }
-
- @Test
- public void testGetInputPorts() {
- Set<String> expectedInputs = new HashSet<String>();
- expectedInputs.add("firstInput");
-
- Set<ActivityInputPort> inputPorts = activityFactory.getInputPorts(configuration);
- assertEquals("Unexpected inputs", expectedInputs.size(), inputPorts.size());
- for (ActivityInputPort inputPort : inputPorts) {
- assertTrue("Wrong input : " + inputPort.getName(), expectedInputs
- .remove(inputPort.getName()));
- }
-
- ObjectNode specialConfiguration = JsonNodeFactory.instance.objectNode();
- specialConfiguration.put("exampleString", "specialCase");
- specialConfiguration.put("exampleUri", "http://localhost:8080/myEndPoint");
-
- assertEquals("Unexpected inputs", 2, activityFactory.getInputPorts(specialConfiguration).size());
- }
-
- @Test
- public void testGetOutputPorts() {
- Set<String> expectedOutputs = new HashSet<String>();
- expectedOutputs.add("simpleOutput");
- expectedOutputs.add("moreOutputs");
-
- Set<ActivityOutputPort> outputPorts = activityFactory.getOutputPorts(configuration);
- assertEquals("Unexpected outputs", expectedOutputs.size(), outputPorts.size());
- for (ActivityOutputPort outputPort : outputPorts) {
- assertTrue("Wrong output : " + outputPort.getName(),
- expectedOutputs.remove(outputPort.getName()));
- }
-
- ObjectNode specialConfiguration = JsonNodeFactory.instance.objectNode();
- specialConfiguration.put("exampleString", "specialCase");
- specialConfiguration.put("exampleUri", "http://localhost:8080/myEndPoint");
-
- assertEquals("Unexpected outputs", 3, activityFactory.getOutputPorts(specialConfiguration).size());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java
deleted file mode 100644
index e992290..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package};
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URI;
-import java.util.Arrays;
-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.node.JsonNodeFactory;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-import net.sf.taverna.t2.activities.testutils.ActivityInvoker;
-import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException;
-import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort;
-import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ${classPrefix}ActivityTest {
-
- private ObjectNode configuration;
-
- private ${classPrefix}Activity activity = new ${classPrefix}Activity();
-
- @Before
- public void makeConfiguration() throws Exception {
- configuration = JsonNodeFactory.instance.objectNode();
- configuration.put("exampleString", "something");
- configuration.put("exampleUri", "http://localhost:8080/myEndPoint");
- }
-
- @Test
- public void configureActivity() throws Exception {
- activity.configure(configuration);
- assertTrue(configuration.equals(activity.getConfiguration()));
- }
-
- @Test(expected = ActivityConfigurationException.class)
- public void invalidConfiguration() throws ActivityConfigurationException {
- ObjectNode invalidBean = JsonNodeFactory.instance.objectNode();
- invalidBean.put("exampleString", "invalidExample");
- // Should throw ActivityConfigurationException
- activity.configure(invalidBean);
- }
-
- @Test
- public void executeAsynch() throws Exception {
- activity.configure(configuration);
-
- Map<String, Object> inputs = new HashMap<String, Object>();
- inputs.put("firstInput", "hello");
-
- Map<String, Class<?>> expectedOutputTypes = new HashMap<String, Class<?>>();
- expectedOutputTypes.put("simpleOutput", String.class);
- expectedOutputTypes.put("moreOutputs", String.class);
-
- Map<String, Object> outputs = ActivityInvoker.invokeAsyncActivity(
- activity, inputs, expectedOutputTypes);
-
- assertEquals("Unexpected outputs", 2, outputs.size());
- assertEquals("simple", outputs.get("simpleOutput"));
- assertEquals(Arrays.asList("Value 1", "Value 2"), outputs
- .get("moreOutputs"));
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml b/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml
deleted file mode 100644
index 72c44ed..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>${groupId}</groupId>
- <artifactId>${rootArtifactId}</artifactId>
- <version>${version}</version>
- </parent>
- <artifactId>${artifactId}</artifactId>
- <packaging>taverna-plugin</packaging>
- <name>${classPrefix} Taverna plugin</name>
- <description>Description of Example Taverna plugin</description>
- <dependencies>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-activity</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>${rootArtifactId}-activity-ui</artifactId>
- <version>${version}</version>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/activity-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/activity-archetype/src/main/resources/archetype-resources/pom.xml b/activity-archetype/src/main/resources/archetype-resources/pom.xml
deleted file mode 100644
index 57b4aa9..0000000
--- a/activity-archetype/src/main/resources/archetype-resources/pom.xml
+++ /dev/null
@@ -1,192 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}</artifactId>
- <version>${version}</version>
- <packaging>pom</packaging>
- <name>${classPrefix} Taverna project</name>
-
- <properties>
- <t2.core.version>2.0.1-SNAPSHOT</t2.core.version>
- <t2.activities.version>2.0.1-SNAPSHOT</t2.activities.version>
- <t2.ui.api.version>2.0-SNAPSHOT</t2.ui.api.version>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.2</version>
- <executions>
- <execution>
- <goals>
- <goal>jar</goal>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.3.1</version>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.7.1</version>
- <configuration>
- <skip>false</skip>
- <systemProperties>
- <property>
- <name>java.awt.headless</name>
- <value>true</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>net.sf.taverna.t2.maven.plugins</groupId>
- <artifactId>taverna-maven-plugin</artifactId>
- <version>0.3.1-SNAPSHOT</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>2.3.7</version>
- <extensions>true</extensions>
- </plugin>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- net.sf.taverna.t2.maven.plugins
- </groupId>
- <artifactId>
- taverna-maven-plugin
- </artifactId>
- <versionRange>
- [0.3.1-SNAPSHOT,)
- </versionRange>
- <goals>
- <goal>plugin-generate</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <repositories>
- <repository>
- <!-- The myGrid repository for Taverna dependencies -->
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- </repository>
- <repository>
- <!-- The myGrid snapshot repository for Taverna dependencies -->
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>mygrid-snapshot-repository</id>
- <name>myGrid Snapshot Repository</name>
- <url>http://www.mygrid.org.uk/maven/snapshot-repository</url>
- </repository>
- <repository>
- <!-- The repository that your jars are deployed to -->
- <id>my-repository</id>
- <name>My Repository</name>
- <url>http://www.example.com/maven/repository</url>
- </repository>
- <repository>
- <!-- The repository that your snapshot jars are deployed to -->
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots />
- <id>my-snapshot-repository</id>
- <name>My snapshot Repository</name>
- <url>file:///tmp/test-plugins/</url>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- </pluginRepository>
- </pluginRepositories>
-
- <!-- The location of your plugin site -->
- <distributionManagement>
- <repository>
- <id>my-plugin-site</id>
- <name>My Plugin Site</name>
- <url>scpexe://example.com/www/taverna/plugins/</url>
- </repository>
- <snapshotRepository>
- <id>my-test-plugin-site</id>
- <name>My Test Plugin Site</name>
- <url>file:///tmp/test-plugins/</url>
- </snapshotRepository>
- </distributionManagement>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 5b8a03f..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<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>
- <artifactId>parent</artifactId>
- <groupId>net.sf.taverna</groupId>
- <version>0.2.2011-02-17</version>
- </parent>
- <groupId>net.sf.taverna.t2.archetypes</groupId>
- <artifactId>archetypes</artifactId>
- <name>Archetypes</name>
- <packaging>pom</packaging>
-
- <version>2.0-SNAPSHOT</version>
- <scm>
- <connection>scm:svn:http://taverna.googlecode.com/svn/taverna/dev/archetypes/trunk/</connection>
- <developerConnection>scm:svn:https://taverna.googlecode.com/svn/taverna/dev/archetypes/trunk/</developerConnection>
- <url>http://code.google.com/p/taverna/source/browse/#svn/taverna/dev/archetypes/trunk/</url>
- </scm>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0</version>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0</version>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <releases />
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <id>mygrid-repository</id>
- <name>myGrid Repository</name>
- <url>http://www.mygrid.org.uk/maven/repository</url>
- </repository>
- </repositories>
- <modules>
- <module>activity-archetype</module>
- </modules>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/taverna-activity-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/pom.xml b/taverna-activity-archetype/pom.xml
new file mode 100644
index 0000000..548df6a
--- /dev/null
+++ b/taverna-activity-archetype/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>net.sf.taverna.t2.archetypes</groupId>
+ <artifactId>archetypes</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+ <groupId>net.sf.taverna.t2.archetypes</groupId>
+ <artifactId>taverna-activity-archetype</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Taverna activity archetype</name>
+ <description>Archetype to build a Taverna 3 service activity.
+ Includes engine and UI parts, and a test class to run the workbench with the new activity.
+ </description>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.2</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/taverna-activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/taverna-activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..719227f
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archetype-descriptor
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
+ name="myfancytool"
+ xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <requiredProperties>
+ <requiredProperty key="classPrefix">
+ <defaultValue>Example</defaultValue>
+ </requiredProperty>
+ </requiredProperties>
+ <modules>
+ <module id="${rootArtifactId}-activity" dir="__rootArtifactId__-activity"
+ name="${rootArtifactId}-activity">
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet encoding="UTF-8" filtered="true">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.json</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ </module>
+ <module id="${rootArtifactId}-activity-ui" dir="__rootArtifactId__-activity-ui"
+ name="${rootArtifactId}-activity-ui">
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet encoding="UTF-8" filtered="true">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.png</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ </module>
+ <module id="${rootArtifactId}-plugin" dir="__rootArtifactId__-plugin"
+ name="${rootArtifactId}-plugin" />
+ </modules>
+</archetype-descriptor>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml
new file mode 100644
index 0000000..9f01ed6
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/pom.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>${groupId}</groupId>
+ <artifactId>${rootArtifactId}</artifactId>
+ <version>${version}</version>
+ </parent>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>bundle</packaging>
+ <name>${classPrefix} Taverna activity UI bindings</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${rootArtifactId}-activity</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <artifactId>activity-palette-api</artifactId>
+ <version>${t2.ui.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <artifactId>menu-api</artifactId>
+ <version>${t2.ui.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <artifactId>contextual-views-api</artifactId>
+ <version>${t2.ui.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.taverna.t2.ui-api</groupId>
+ <artifactId>activity-tools</artifactId>
+ <version>${t2.ui.api.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/8dd0a1ed/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
----------------------------------------------------------------------
diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
new file mode 100644
index 0000000..d92efb7
--- /dev/null
+++ b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/config/__classPrefix__ConfigurationPanel.java
@@ -0,0 +1,87 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.ui.config;
+
+import java.awt.GridLayout;
+import java.net.URI;
+
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JTextField;
+
+import net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ActivityConfigurationPanel;
+
+import uk.org.taverna.commons.services.ServiceRegistry;
+import uk.org.taverna.scufl2.api.activity.Activity;
+
+@SuppressWarnings("serial")
+public class ${classPrefix}ConfigurationPanel extends ActivityConfigurationPanel {
+
+ private final ServiceRegistry serviceRegistry;
+
+ private JTextField fieldString;
+ private JTextField fieldURI;
+
+ public ${classPrefix}ConfigurationPanel(Activity activity, ServiceRegistry serviceRegistry) {
+ super(activity);
+ this.serviceRegistry = serviceRegistry;
+ initialise();
+ }
+
+ protected void initialise() {
+ // call super.initialise() to initialise the configuration
+ super.initialise();
+
+ removeAll();
+ setLayout(new GridLayout(0, 2));
+
+ // FIXME: Create GUI depending on activity configuration bean
+ JLabel labelString = new JLabel("Example string:");
+ add(labelString);
+ fieldString = new JTextField(20);
+ add(fieldString);
+ labelString.setLabelFor(fieldString);
+
+ JLabel labelURI = new JLabel("Example URI:");
+ add(labelURI);
+ fieldURI = new JTextField(25);
+ add(fieldURI);
+ labelURI.setLabelFor(fieldURI);
+
+ // Populate fields from activity configuration
+ fieldString.setText(getProperty("exampleString"));
+ fieldURI.setText(getProperty("exampleUri"));
+ }
+
+ /**
+ * Check that user values in UI are valid
+ */
+ @Override
+ public boolean checkValues() {
+ try {
+ URI.create(fieldURI.getText());
+ } catch (IllegalArgumentException ex) {
+ JOptionPane.showMessageDialog(this, ex.getCause().getMessage(),
+ "Invalid URI", JOptionPane.ERROR_MESSAGE);
+ // Not valid, return false
+ return false;
+ }
+ // All valid, return true
+ return true;
+ }
+
+ /**
+ * Set the configuration properties from the UI
+ */
+ @Override
+ public void noteConfiguration() {
+ // FIXME: Update bean fields from your UI elements
+ setProperty("exampleString", fieldString.getText());
+ setProperty("exampleUri", fieldURI.getText());
+
+ configureInputPorts(serviceRegistry);
+ configureOutputPorts(serviceRegistry);
+ }
+
+}