Skip to end of metadata
Go to start of metadata

This is part of the Activity Plugin Migration Guide

Summary of changes

Taverna 2Taverna 3Changes
java files
ExampleConfigurationPanel.javaExampleConfigurationPanel.java

ActivityConfigurationPanel no longer generic

ExampleConfigureAction.javaExampleConfigureAction.java

ActivityConfigurationAction no longer generic

Uses JsonNode instead of ExampleActivityConfigBean

ExampleConfigureMenuAction.javaExampleConfigureMenuAction.java

AbstractConfigureActivityMenuAction no longer generic

ExampleServiceDesc.javaExampleServiceDesc.java

ServcieDescription no longer generic

Uses SCUFL2 Configuration instead of ExampleActivityConfigurationBean

ExampleServiceIcon.javaExampleServiceIcon.javaUses activity type URI instead of activity instance
ExampleServiceProvider.javaExampleServiceProvider.javaNo changes
ExampleActivityContextViewFactory.javaExampleActivityContextViewFactory.java 
ExampleContextualView.javaExampleContextualView.java 
resource files
META-INF/services/net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider-

Removed

META-INF/services/net.sf.taverna.t2.ui.menu.MenuComponent-Removed
META-INF/services/net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI-Removed
META-INF/services/net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory-Removed
-META-INF/spring/context-osgi.xmlAdded OSGi service registration
-META-INF/spring/context.xmlAdded OSGi service instantiation
project files
pom.xmlpom.xml

Updates to dependency versions

Add jackson dependency (for JSON support)

pom.xml
  1. Change version of activity-palette-api dependency to 2.0-SNAPSHOT
  2. Change version of menu-api dendency to 2.0-SNAPSHOT
  3. Change version of contextual-views-api dendency to 2.0-SNAPSHOT
  4. Change version of activity-tools dendency to 2.0-SNAPSHOT
  5. Add dependency for jackson-databind

  6. Add maven-bundle-plugin (unless already added to parent pom) 

  7. Change packaging type to bundle

ExampleConfigurationPanel.java

The abstract superclass ActivityConfigurationPanel is no longer generic and now requires less methods to be implemented by the subclass. Support for setting up the JSON configuration has been added along with convenience methods for getting and setting simple string configuration properties. Activity ports are now added directly to the Activity instead of the configuration so methods have been added to handle port editing.

  1. Remove parameters for superclass ActivityConfigurationPanel.

  2. Change constructor parameter ExampleActivity to uk.org.taverna.scufl2.api.Activity and add parameter ServiceRegistry 

  3. Change initialise() method to call super.initialise() and also populate the UI components with values from the configuration

  4. Change noteConfiguration() method to set JSON configuration properties and set the Activity ports 

  5. Remove getConfiguration() method

  6. Remove isConfigurationChanged() method 

  7. Remove refreshConfiguration() method

     

ExampleConfigurationAction.java

The abstract superclass ActivityConfigurationAction is no longer generic and the constructor now takes ActivityIconManager and ServiceDescriptionRegistry as parameters.

  1. Remove parameters for superclass ActivityConfigurationAction

     

  2. Change constructor parameter from ExampleActivity to SCUFL2 Activity and add parameters for EditManager, FileManager, ActivityIconManager, ServiceDescriptionRegistry and ServiceRegistry

  3. Update actionPerformed() method:

    1. add ServiceRegistry parameter to ExampleConfigurationPanel() constructor

    2. add EditManager parameter to ActivityConfigurationDialog() constructor

    3. add FileManager parameter to setDialog() method

ExampleConfigureMenuAction.java

The abstract superclass AbstractConfigureActivityMenuAction is no longer generic and now takes an activity type URI, instead of a class, as its constructor parameter. ExampleConfigureMenuAction has property setter methods added which are used by Spring to inject OSGi services. The property names have to match to bean property names used in the context.xml file.

  1. Remove parameter for superclass AbstractConfigureActivityMenuAction. Notice that the implemented interfaces have been explicitly listed as this class will be registered with the OSGi service registry using the interfaces (see context-osgi.xml file)

  2. Change constructor's super() method parameter to be the activity type URI 

  3. Add property fields and setter methods for EditManagerFileManagerActivityIconManagerServiceDescriptionRegistry and ServiceRegistry 

     

     

  4. Update createAction() method to add EditManagerFileManagerActivityIconManagerServiceDescriptionRegistry and ServiceRegistry parameters to ExampleConfigureAction() constructor 

ExampleServiceDesc.java

The abstract superclass ServiceDescription is no longer generic, the getActivityClass() method has been replaced with getActivityType() and the getActivityConfiguration() method now returns SCUFL2 Configuration 

  1. Remove parameter for superclass ServiceDescription

     

     

  2. Replace the getActivityClass() method with getActivityType()

     

  3. Update getActivityConfiguration() method to return SCUFL2 Configuration 

ExampleServiceIcon.java

The interface ActivityIconSPI has changed the parameter for method canProvideIconScore() to be an activity type URI

  1. Update canProvideIconScore() method's parameter to 

ExampleServiceProvider.java

No changes

ExampleActivityContextViewFactory.java

Interface ContextualViewFactory is now parameterised with SCUFL2 Activity. ExampleActivityContextViewFactory has property setter methods added which are used by Spring to inject OSGi services. The property names have to match to bean property names used in the context.xml file.

  1. Change parameter for interface ContextualViewFactory from ExampleActivity to SCUFL2 Activity  

     

     

  2. Change canHandle() method to check activity type URI 

  3. Add property fields and setter methods for EditManagerFileManagerActivityIconManagerServiceDescriptionRegistry and ServiceRegistry 

  4. Update getViews() method to take SCUFL2 Activity as a parameter and add EditManagerFileManagerActivityIconManagerServiceDescriptionRegistry and ServiceRegistry parameters to ExampleConfigureView() constructor 


 

ExampleContextualView.java

Abstract supertype ActivityContextualView has been updated to handle fetching the SCUFL2 ConfigurationExampleContextualView has property setter methods added which are used by Spring to inject OSGi services. The property names have to match to bean property names used in the context.xml file

  1. Make sure that the superclass is ActivityContextualView (not ContextualView) 

  2. Change constructor parameter from ExampleActivity to SCUFL2 Activity and add parameters for EditManagerFileManagerActivityIconManagerServiceDescriptionRegistry and ServiceRegistry

  3. Update getViewTitle() method to use JSON configuration 

  4. Update refreshView() method to use JSON configuration 

  5. Update geConfigureAction() method to add EditManagerFileManagerActivityIconManagerServiceDescriptionRegistry and ServiceRegistry parameters to getConfigureAction() constructor 


META-INF/spring/context-osgi.xml
  1. Create the Spring DM context-osgi.xml file. This is where services (created in the context.xml file) are registered with the OSGi service register and also where references to services exported by other modules are created.

  2. Add services to be exported by this module.

  3. Add references to services required by this module.

META-INF/spring/context.xml
  1. Create the Spring context.xml file. This is where services are instantiated and any services required from other modules are injected as properties.

  2. Create the services that will be registered with the OSGi service register in the context-osgi.xml file. 

META-INF/services
  1. Delete this directory