package net.sf.taverna.t2.activities.beanshell.servicedescriptions;

import javax.swing.Icon;

import net.sf.taverna.t2.activities.beanshell.BeanshellActivity;
import net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean;
import net.sf.taverna.t2.servicedescriptions.AbstractTemplateService;
import net.sf.taverna.t2.servicedescriptions.ServiceDescription;

public class BeanshellTemplateService extends
		AbstractTemplateService<BeanshellActivityConfigurationBean> {

	private static final String BEANSHELL = "Beanshell";

	public String getName() {
		return BEANSHELL;
	}

	@Override
	public Class<BeanshellActivity> getActivityClass() {
		return BeanshellActivity.class;
	}

	@Override
	public BeanshellActivityConfigurationBean getActivityConfiguration() {
		return new BeanshellActivityConfigurationBean();
	}

	@Override
	public Icon getIcon() {
		return BeanshellActivityIcon.getBeanshellIcon();
	}
	
	@Override
	public String getDescription() {
		return "A service that allows Beanshell scripts, with dependencies on libraries";	
	}
	
	public static ServiceDescription getServiceDescription() {
		BeanshellTemplateService bts = new BeanshellTemplateService();
		return bts.templateService;
	}
}

@@ -62,16 +62,38 @@
 tions;%0A%0A
+import java.net.URI;%0A%0A
 import j
@@ -109,16 +109,16 @@
 g.Icon;%0A
-
 %0Aimport 
@@ -557,16 +557,128 @@
 nshell%22;
+%0A%09%0A%09private static final URI providerId = URI%0A%09.create(%22http://taverna.sf.net/2010/service-provider/beanshell%22);
 %0A%0A%09publi
@@ -1190,16 +1190,48 @@
 ;%09%0A%09%7D%0A%09%0A
+%09@SuppressWarnings(%22unchecked%22)%0A
 %09public 
@@ -1347,16 +1347,16 @@
 vice();%0A
-
 %09%09return
@@ -1379,11 +1379,72 @@
 vice;%0A%09%7D
+%0A%0A%09public String getId() %7B%0A%09%09return providerId.toString();%0A%09%7D
 %0A%7D%0A

Fix for T2-674: Hardcoded default locations. System default configurable providers are now read from a file in Taverna startup/conf directory. Failing that - they are read from a hard coded list. User can now import and export services from such files as well.