JAL-1852 disable querying of unpublished PDB entries by default
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 30 Sep 2015 13:20:22 +0000 (14:20 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 30 Sep 2015 13:20:22 +0000 (14:20 +0100)
src/jalview/ws/uimodel/PDBRestRequest.java

index 7826fbd..5442b65 100644 (file)
@@ -44,6 +44,8 @@ public class PDBRestRequest
 
   private boolean allowEmptySequence;
 
+  private boolean allowUnpublishedEntries;
+
   private int responseSize;
 
   private boolean isSortAscending;
@@ -130,7 +132,8 @@ public class PDBRestRequest
   public String getQuery()
   {
     return fieldToSearchBy + searchTerm
-            + (isAllowEmptySeq() ? "" : " AND molecule_sequence:['' TO *]");
+            + (isAllowEmptySeq() ? "" : " AND molecule_sequence:['' TO *]")
+            + (isAllowUnpublishedEntries() ? "" : " AND status:REL");
   }
 
   public String toString()
@@ -139,4 +142,14 @@ public class PDBRestRequest
             + " isAsc: " + isAscending() + " Associated Seq : "
             + associatedSequence;
   }
+
+  public boolean isAllowUnpublishedEntries()
+  {
+    return allowUnpublishedEntries;
+  }
+
+  public void setAllowUnpublishedEntries(boolean allowUnpublishedEntries)
+  {
+    this.allowUnpublishedEntries = allowUnpublishedEntries;
+  }
 }