X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fuimodel%2FPDBRestRequest.java;h=24f38d1dc1c770cba7d8b59a2319123403070624;hb=239d28bd8c08790bbc513a09b2b869fff862f63f;hp=70dae0b2fef9575c1a897e03c6b65d4d359985b9;hpb=2cbc2e45a74eb8cf8040f9a71636289ca2db5241;p=jalview.git diff --git a/src/jalview/ws/uimodel/PDBRestRequest.java b/src/jalview/ws/uimodel/PDBRestRequest.java index 70dae0b..24f38d1 100644 --- a/src/jalview/ws/uimodel/PDBRestRequest.java +++ b/src/jalview/ws/uimodel/PDBRestRequest.java @@ -21,7 +21,8 @@ package jalview.ws.uimodel; - +import jalview.bin.Cache; +import jalview.datamodel.SequenceI; import jalview.ws.dbsources.PDBRestClient.PDBDocField; import java.util.Collection; @@ -40,16 +41,18 @@ public class PDBRestRequest private String fieldToSortBy; - private String associatedSequence; + private SequenceI associatedSequence; private boolean allowEmptySequence; + private boolean allowUnpublishedEntries = Cache.getDefault( + "ALLOW_UNPUBLISHED_PDB_QUERYING", false); + private int responseSize; private boolean isSortAscending; - private Collection wantedFields;// = new - // Collection(); + private Collection wantedFields; public String getFieldToSearchBy() { @@ -117,12 +120,12 @@ public class PDBRestRequest return isSortAscending; } - public String getAssociatedSequence() + public SequenceI getAssociatedSequence() { return associatedSequence; } - public void setAssociatedSequence(String associatedSequence) + public void setAssociatedSequence(SequenceI associatedSequence) { this.associatedSequence = associatedSequence; } @@ -130,6 +133,24 @@ 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() + { + return "Query : " + getQuery() + " sort field: " + fieldToSortBy + + " isAsc: " + isAscending() + " Associated Seq : " + + associatedSequence; + } + + public boolean isAllowUnpublishedEntries() + { + return allowUnpublishedEntries; + } + + public void setAllowUnpublishedEntries(boolean allowUnpublishedEntries) + { + this.allowUnpublishedEntries = allowUnpublishedEntries; } }