static
{
- Platform.addJ2SDirectDatabaseCall("http://rest.ensembl");
- Platform.addJ2SDirectDatabaseCall("https://rest.ensembl");
+ Platform.addJ2SDirectDatabaseCall("http://rest.ensembl.org");
+ Platform.addJ2SDirectDatabaseCall("https://rest.ensembl.org");
}
private static final int DEFAULT_READ_TIMEOUT = 5 * 60 * 1000; // 5 minutes
*/
package jalview.fts.service.pdb;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
import java.net.URI;
-import java.nio.CharBuffer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.DefaultClientConfig;
+import jalview.bin.Console;
import jalview.datamodel.SequenceI;
import jalview.fts.api.FTSData;
import jalview.fts.api.FTSDataColumnI;
import jalview.fts.api.FTSRestClientI;
import jalview.fts.api.StructureFTSRestClientI;
-import jalview.fts.core.FTSDataColumnPreferences;
import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
import jalview.fts.core.FTSRestClient;
import jalview.fts.core.FTSRestRequest;
import jalview.fts.core.FTSRestResponse;
-import jalview.fts.service.alphafold.AlphafoldRestClient;
import jalview.util.JSONUtils;
import jalview.util.MessageManager;
import jalview.util.Platform;
public static final String PDB_SEARCH_ENDPOINT = "https://www.ebi.ac.uk/pdbe/search/pdb/select?";
+ static
+ {
+ Platform.addJ2SDirectDatabaseCall(PDB_SEARCH_ENDPOINT);
+ }
+
protected PDBFTSRestClient()
{
}
URI uri = webResource.getURI();
- jalview.bin.Console.outPrintln(uri);
ClientResponse clientResponse = null;
int responseStatus = -1;
// Get the JSON string from the response object or directly from the
Map<String, Object> jsonObj = null;
String responseString = null;
- jalview.bin.Console
- .outPrintln("query >>>>>>> " + pdbRestRequest.toString());
+ Console.info("REST request: " + uri.toString());
if (!isMocked())
{
for (FTSDataColumnI field : diplayFields)
{
- // jalview.bin.Console.outPrintln("Field " + field);
+ // Console.outPrintln("Field " + field);
String fieldData = (pdbJsonDoc.get(field.getCode()) == null) ? ""
: pdbJsonDoc.get(field.getCode()).toString();
- // jalview.bin.Console.outPrintln("Field Data : " + fieldData);
+ // Console.outPrintln("Field Data : " + fieldData);
if (field.isPrimaryKeyColumn())
{
primaryKey = fieldData;
} catch (Exception e)
{
e.printStackTrace();
- jalview.bin.Console.outPrintln("offending value:" + fieldData);
+ Console.warn("offending value:" + fieldData);
}
}
}
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.DefaultClientConfig;
+import jalview.bin.Console;
import jalview.datamodel.SequenceI;
import jalview.fts.api.FTSData;
import jalview.fts.api.FTSDataColumnI;
public static FTSRestClientI instance = null;
+ static
+ {
+ Platform.addJ2SDirectDatabaseCall(DEFAULT_THREEDBEACONS_DOMAIN);
+ }
+
protected TDBeaconsFTSRestClient()
{
}
webResource = client.resource(DEFAULT_THREEDBEACONS_DOMAIN + query);
URI uri = webResource.getURI();
- jalview.bin.Console.outPrintln(uri.toString());
+ Console.info("3DBeacons URL: " + uri.toString());
// Execute the REST request
ClientResponse clientResponse;
String fieldData = (tdbJsonStructure.get(field.getCode()) == null)
? " "
: tdbJsonStructure.get(field.getCode()).toString();
- // jalview.bin.Console.outPrintln("Field : " + field + " Data : " +
- // fieldData);
+ // Console.outPrintln("Field : " + field + " Data : " + fieldData);
if (field.isPrimaryKeyColumn())
{
primaryKey = fieldData;
} catch (Exception e)
{
// e.printStackTrace();
- jalview.bin.Console
- .outPrintln("offending value:" + fieldData + fieldData);
+ Console.warn("offending value:" + fieldData + fieldData);
}
}
}
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
+import jalview.bin.Console;
import jalview.javascript.json.JSON;
/**
time = mark = t;
if (msg != null)
{
- jalview.bin.Console.errPrintln("Platform: timer reset\t\t\t" + msg);
+ Console.errPrintln("Platform: timer reset\t\t\t" + msg);
}
break;
case TIME_MARK:
}
if (msg != null)
{
- jalview.bin.Console.errPrintln(
- "Platform: timer mark\t" + ((t - time) / 1000f) + "\t"
- + ((t - mark) / 1000f) + "\t" + msg);
+ Console.errPrintln("Platform: timer mark\t" + ((t - time) / 1000f)
+ + "\t" + ((t - mark) / 1000f) + "\t" + msg);
}
mark = t;
}
case TIME_GET:
if (msg != null)
{
- jalview.bin.Console
- .errPrintln("Platform: timer dur\t" + ((t - time) / 1000f)
- + "\t" + ((duration) / 1000f) + "\t" + msg);
+ Console.errPrintln("Platform: timer dur\t" + ((t - time) / 1000f)
+ + "\t" + ((duration) / 1000f) + "\t" + msg);
}
set = 0;
break;
* info[key];
*/
- jalview.bin.Console.outPrintln(
+ Console.outPrintln(
"Platform id=" + id + " reading Info." + key + " = " + value);
p.put(id + "_" + key, value);
* @author hansonr@stolaf.edu
*
*/
- public static void addJ2SDirectDatabaseCall(String domain)
+ public static void addJ2SDirectDatabaseCall(String urlString)
{
if (isJS())
{
- jalview.bin.Console.outPrintln(
+ String domainString = urlString;
+ try
+ {
+ URL url = new URL(urlString);
+ URL domain = new URL(url.getProtocol(), url.getHost(),
+ url.getPort(), "");
+ domainString = domain.toString();
+ } catch (MalformedURLException e)
+ {
+ Console.warn("Could not add '" + urlString
+ + "' in J2SDirectDatabase -- not a recognised URL");
+ }
+ Console.outPrintln(
"Platform adding known access-control-allow-origin * for domain "
- + domain);/**
- * @j2sNative
- *
- * J2S.addDirectDatabaseCall(domain);
- */
+ + domainString);
+ /**
+ * @j2sNative
+ *
+ * J2S.addDirectDatabaseCall(domain);
+ */
}
}
*/
package jalview.ws.dbsources;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Locale;
+import java.util.Vector;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.stevesoft.pat.Regex;
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.schemes.ResidueProperties;
+import jalview.util.Platform;
import jalview.util.StringUtils;
import jalview.ws.seqfetcher.DbSourceProxyImpl;
-import jalview.xml.binding.embl.ROOT;
import jalview.xml.binding.uniprot.DbReferenceType;
import jalview.xml.binding.uniprot.Entry;
import jalview.xml.binding.uniprot.FeatureType;
import jalview.xml.binding.uniprot.PositionType;
import jalview.xml.binding.uniprot.PropertyType;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import com.stevesoft.pat.Regex;
-
/**
* This class queries the Uniprot database for sequence data, unmarshals the
* returned XML, and converts it to Jalview Sequence records (including attached
private static final String DEFAULT_THREEDBEACONS_DOMAIN = "https://wwwdev.ebi.ac.uk/pdbe/pdbe-kb/3dbeacons-hub-api/uniprot/summary/";
+ static
+ {
+ Platform.addJ2SDirectDatabaseCall(DEFAULT_UNIPROT_DOMAIN);
+ Platform.addJ2SDirectDatabaseCall(DEFAULT_THREEDBEACONS_DOMAIN);
+ }
+
/**
* Constructor
*/
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.schemes.ResidueProperties;
+import jalview.util.Platform;
import jalview.util.StringUtils;
import jalview.ws.seqfetcher.DbSourceProxyImpl;
import jalview.xml.binding.uniprot.DbReferenceType;
private static final String BAR_DELIMITER = "|";
+ static
+ {
+ Platform.addJ2SDirectDatabaseCall(DEFAULT_UNIPROT_DOMAIN);
+ }
+
/**
* Constructor
*/
*/
package jalview.ws.ebi;
-import java.util.Locale;
-
-import jalview.datamodel.DBRefSource;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
import java.util.StringTokenizer;
+import jalview.datamodel.DBRefSource;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+
/**
* DOCUMENT ME!
*
*/
public class EBIFetchClient
{
+ static
+ {
+ Platform.addJ2SDirectDatabaseCall("https://www.ebi.ac.uk/");
+ }
/**
* Creates a new EBIFetchClient object.
return null;
}
- static
- {
- Platform.addJ2SDirectDatabaseCall("https://www.ebi.ac.uk/");
- }
-
/**
* Constructs the URL to fetch from
*