Merge branch 'develop' into features/JAL-518_justify_seqs_in_region
[jalview.git] / src / jalview / fts / service / threedbeacons / TDBeaconsFTSRestClient.java
index ac02a5f..67ed7e6 100644 (file)
@@ -26,7 +26,6 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 
 import javax.ws.rs.core.MediaType;
 
@@ -42,11 +41,10 @@ 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.PreferenceSource;
 import jalview.fts.core.FTSRestClient;
 import jalview.fts.core.FTSRestRequest;
 import jalview.fts.core.FTSRestResponse;
-import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
-import jalview.fts.service.pdb.PDBFTSRestClient;
 import jalview.util.JSONUtils;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
@@ -103,7 +101,7 @@ public class TDBeaconsFTSRestClient extends FTSRestClient
       webResource = client.resource(DEFAULT_THREEDBEACONS_DOMAIN + query);
 
       URI uri = webResource.getURI();
-      System.out.println(uri.toString());
+      jalview.bin.Console.outPrintln(uri.toString());
 
       // Execute the REST request
       ClientResponse clientResponse;
@@ -243,7 +241,8 @@ public class TDBeaconsFTSRestClient extends FTSRestClient
     return searchResult;
   }
 
-  private static FTSData getFTSData(Map<String, Object> tdbJsonStructure,
+  private static FTSData getFTSData(
+          Map<String, Object> tdbJsonStructureSummary,
           FTSRestRequest tdbRequest)
   {
     String primaryKey = null;
@@ -263,13 +262,15 @@ public class TDBeaconsFTSRestClient extends FTSRestClient
       summaryRowData[0] = associatedSequence;
       colCounter = 1;
     }
-
+    Map<String, Object> tdbJsonStructure = (Map<String, Object>) tdbJsonStructureSummary
+            .get("summary");
     for (FTSDataColumnI field : displayFields)
     {
       String fieldData = (tdbJsonStructure.get(field.getCode()) == null)
               ? " "
               : tdbJsonStructure.get(field.getCode()).toString();
-      // System.out.println("Field : " + field + " Data : " + fieldData);
+      // jalview.bin.Console.outPrintln("Field : " + field + " Data : " +
+      // fieldData);
       if (field.isPrimaryKeyColumn())
       {
         primaryKey = fieldData;
@@ -293,7 +294,8 @@ public class TDBeaconsFTSRestClient extends FTSRestClient
         } catch (Exception e)
         {
           // e.printStackTrace();
-          System.out.println("offending value:" + fieldData + fieldData);
+          jalview.bin.Console
+                  .outPrintln("offending value:" + fieldData + fieldData);
         }
       }
     }
@@ -341,6 +343,7 @@ public class TDBeaconsFTSRestClient extends FTSRestClient
 
   private Collection<FTSDataColumnI> allDefaultDisplayedStructureDataColumns;
 
+  @Override
   public Collection<FTSDataColumnI> getAllDefaultDisplayedStructureDataColumns()
   {
     if (allDefaultDisplayedStructureDataColumns == null