*/
package jalview.fts.service.pdb;
++import jalview.bin.Jalview;
import jalview.datamodel.SequenceI;
import jalview.fts.api.FTSData;
import jalview.fts.api.FTSDataColumnI;
// BH 2018 the trick here is to coerce the classes in Javascript to be
// different from the ones in Java yet still allow this to be correct for Java
+ Client client;
Class<ClientResponse> clientResponseClass;
-- if (/** @j2sNative true || */
-- false)
++ if (Jalview.isJS())
{
// JavaScript only -- coerce types to Java types for Java
client = (Client) (Object) new jalview.javascript.web.Client();
}
@Override
-- public FTSRestResponse executeRequest(FTSRestRequest uniportRestRequest)
++ public FTSRestResponse executeRequest(FTSRestRequest uniprotRestRequest)
throws Exception
{
try
{
- ClientConfig clientConfig = new DefaultClientConfig();
- Client client = Client.create(clientConfig);
-
String wantedFields = getDataColumnsFieldsAsCommaDelimitedString(
-- uniportRestRequest.getWantedFields());
-- int responseSize = (uniportRestRequest.getResponseSize() == 0)
++ uniprotRestRequest.getWantedFields());
++ int responseSize = (uniprotRestRequest.getResponseSize() == 0)
? getDefaultResponsePageSize()
-- : uniportRestRequest.getResponseSize();
++ : uniprotRestRequest.getResponseSize();
-- int offSet = uniportRestRequest.getOffSet();
++ int offSet = uniprotRestRequest.getOffSet();
String query;
-- if (isAdvancedQuery(uniportRestRequest.getSearchTerm()))
++ if (isAdvancedQuery(uniprotRestRequest.getSearchTerm()))
{
-- query = uniportRestRequest.getSearchTerm();
++ query = uniprotRestRequest.getSearchTerm();
}
else
{
-- query = uniportRestRequest.getFieldToSearchBy()
++ query = uniprotRestRequest.getFieldToSearchBy()
.equalsIgnoreCase("Search All")
-- ? uniportRestRequest.getSearchTerm()
++ ? uniprotRestRequest.getSearchTerm()
+ " or mnemonic:"
-- + uniportRestRequest.getSearchTerm()
-- : uniportRestRequest.getFieldToSearchBy() + ":"
-- + uniportRestRequest.getSearchTerm();
++ + uniprotRestRequest.getSearchTerm()
++ : uniprotRestRequest.getFieldToSearchBy() + ":"
++ + uniprotRestRequest.getSearchTerm();
+ }
+
+ // BH 2018 the trick here is to coerce the classes in Javascript to be
+ // different from the ones in Java yet still allow this to be correct for
+ // Java
+ Client client;
+ Class<ClientResponse> clientResponseClass;
- if (/** @j2sNative true || */
- false)
++ if (Jalview.isJS())
+ {
+ // JavaScript only -- coerce types to Java types for Java
+ client = (Client) (Object) new jalview.javascript.web.Client();
+ clientResponseClass = (Class<ClientResponse>) (Object) jalview.javascript.web.ClientResponse.class;
+ }
+ else
+ {
+ // Java only
+ client = Client.create(new DefaultClientConfig());
+ clientResponseClass = ClientResponse.class;
}
WebResource webResource = null;
clientResponse = null;
client = null;
return parseUniprotResponse(uniProtTabDelimittedResponseString,
-- uniportRestRequest, xTotalResults);
++ uniprotRestRequest, xTotalResults);
} catch (Exception e)
{
String exceptionMsg = e.getMessage();