*/
package jalview.ws.jws2.jabaws2;
-import jalview.gui.AlignFrame;
import jalview.gui.Desktop;
import jalview.util.MessageManager;
import jalview.ws.api.JalviewServiceEndpointProviderI;
import jalview.ws.api.ServiceWithParameters;
import jalview.ws.jws2.JabaParamStore;
-import jalview.ws.jws2.MsaWSClient;
-import jalview.ws.jws2.SequenceAnnotationWSClient;
import jalview.ws.params.ParamDatastoreI;
import jalview.ws.params.ParamManager;
import java.io.Closeable;
import java.net.URL;
-import javax.swing.JMenu;
-
import compbio.data.msa.JABAService;
import compbio.data.msa.MsaWS;
import compbio.data.msa.SequenceAnnotation;
{
super(action, action, serviceType, description, hosturl);
this.service = service;
+ if (service instanceof MsaWS<?>)
+ {
+ style = ServiceClient.MSAWSCLIENT;
+ }
+ else if (service instanceof SequenceAnnotation<?>)
+ {
+ style = ServiceClient.SEQUENCEANNOTATIONWSCLIENT;
+ }
+
int p = description.indexOf("MORE INFORMATION:");
if (p > -1)
{
try
{
paramStore = new JabaParamStore(this,
- (Desktop.instance != null ? Desktop.getUserParameterStore()
+ (Desktop.getInstance() != null ? Desktop.getUserParameterStore()
: null));
} catch (Exception ex)
{
return paramStore;
}
- public String getUri()
- {
- // TODO verify that service parameter sets in projects are consistent with
- // Jalview 2.10.4
- // this is only valid for Jaba 1.0 - this formula might have to change!
- return getHostURL()
- + (getHostURL().lastIndexOf("/") == (getHostURL().length() - 1)
- ? ""
- : "/")
- + getName();
- }
-
private boolean hasParams = false, lookedForParams = false;
@Override
return hasParams;
}
- public void attachWSMenuEntry(JMenu atpoint, AlignFrame alignFrame)
- {
- if (service instanceof MsaWS<?>)
- {
- new MsaWSClient().attachWSMenuEntry(atpoint, this, alignFrame);
- }
- else if (service instanceof SequenceAnnotation<?>)
- {
- new SequenceAnnotationWSClient().attachWSMenuEntry(atpoint, this,
- alignFrame);
- }
- }
-
- public String getNameURI()
- {
- return "java:" + getName();
- }
-
- jalview.ws.uimodel.AlignAnalysisUIText aaui;
-
- public jalview.ws.uimodel.AlignAnalysisUIText getAlignAnalysisUI()
- {
- return aaui;
- }
-
/**
* initialise a parameter store for this service
*
@Override
public Object getEndpoint()
{
- if (aaui!=null) {
- // TODO complete
- return null;
- } else {
- if (service instanceof MsaWS<?>)
+ if (service instanceof MsaWS<?>)
+ {
+ if (aaui != null)
+ {
+ throw new Error(
+ "JABAWS MsaWS based instant calculation not implemented.");
+
+ }
+ else
+ {
+ return new JabawsMsaInstance(this);
+ }
+ }
+ else
+ {
+ if (service instanceof compbio.data.msa.SequenceAnnotation)
{
- return new JabawsMsaInstance(this);
- } else {
- // TODO complete
- // service is for sequence analysis
- return null;
+ if (aaui != null)
+ {
+ try
+ {
+ // probably a factory would be nicer but..
+ return aaui.getClient().getConstructor(getClass())
+ .newInstance(this);
+ } catch (Throwable t)
+ {
+ throw new Error("Implementation Error in web service framework",
+ t);
+ }
+ }
+ return new AADisorderClient(this);
+ }
+ return null;
}
}
}
-}