From: gmungoc Date: Thu, 1 Nov 2018 11:32:20 +0000 (+0000) Subject: Merge branch 'feature/JAL-3144noJTree' into X-Git-Tag: Release_2_11_4_0~45^2~18^2~435 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e58d21a916e1beda1091e286723afb494ab62cc3;p=jalview.git Merge branch 'feature/JAL-3144noJTree' into Jalview-BH/JAL-3026-JAL-3063-JAXB Conflicts: src/jalview/ext/ensembl/EnsemblRestClient.java --- e58d21a916e1beda1091e286723afb494ab62cc3 diff --cc src/jalview/fts/service/pdb/PDBFTSRestClient.java index a5b441f,301cb16..c0ca3a5 --- a/src/jalview/fts/service/pdb/PDBFTSRestClient.java +++ b/src/jalview/fts/service/pdb/PDBFTSRestClient.java @@@ -20,6 -20,6 +20,7 @@@ */ package jalview.fts.service.pdb; ++import jalview.bin.Jalview; import jalview.datamodel.SequenceI; import jalview.fts.api.FTSData; import jalview.fts.api.FTSDataColumnI; @@@ -137,9 -123,10 +124,9 @@@ public class PDBFTSRestClient extends F // 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 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(); diff --cc src/jalview/fts/service/uniprot/UniProtFTSRestClient.java index 262ed86,6a54aa1..b4100cb --- a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java +++ b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java @@@ -59,35 -59,51 +59,50 @@@ public class UniProtFTSRestClient exten } @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 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) (Object) jalview.javascript.web.ClientResponse.class; + } + else + { + // Java only + client = Client.create(new DefaultClientConfig()); + clientResponseClass = ClientResponse.class; } WebResource webResource = null; @@@ -118,7 -135,7 +134,7 @@@ clientResponse = null; client = null; return parseUniprotResponse(uniProtTabDelimittedResponseString, -- uniportRestRequest, xTotalResults); ++ uniprotRestRequest, xTotalResults); } catch (Exception e) { String exceptionMsg = e.getMessage();