X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FPDBEntry.java;h=b3e17bf43e29fc6c30786639e931cfada239d8a9;hb=00c42e936827790e689ecd5ff7d7781ecabe2313;hp=672a59e9904c6097e1c2dabc2945bd801c289b15;hpb=023163e0fe8837c1ddb75eb30abc058f7747b5c2;p=jalview.git diff --git a/src/jalview/datamodel/PDBEntry.java b/src/jalview/datamodel/PDBEntry.java index 672a59e..b3e17bf 100755 --- a/src/jalview/datamodel/PDBEntry.java +++ b/src/jalview/datamodel/PDBEntry.java @@ -384,21 +384,37 @@ public class PDBEntry return false; // shouldn't happen } - /* - * id has to match (ignoring case) - */ - if (!getId().equalsIgnoreCase(newId)) - { - return false; - } + boolean idMatches = getId().equalsIgnoreCase(newId); /* * Don't update if associated with different structure files */ String newFile = newEntry.getFile(); - if (newFile != null && getFile() != null && !newFile.equals(getFile())) + if (newFile != null && getFile() != null) { - return false; + if (!newFile.equals(getFile())) + { + return false; + } + else + { + // files match. + if (!idMatches) + { + // this shouldn't happen, but could do if the id from the + // file is not the same as the id from the authority that provided + // the file + return false; + } + } + } + else + { + // one has data, one doesn't .. + if (!idMatches) + { + return false; + } // otherwise maybe can update } /* @@ -461,16 +477,32 @@ public class PDBEntry return true; } + private boolean _hasProperty(final String key) + { + return (properties != null && properties.containsKey(key)); + } + + private static final String RETRIEVE_FROM = "RETRIEVE_FROM"; + + private static final String PROVIDER = "PROVIDER"; + + private static final String MODELPAGE = "PROVIDERPAGE"; - private static final String RETRIEVE_FROM="RETRIEVE_FROM"; /** * Permanent URI for retrieving the original structure data + * * @param urlStr */ public void setRetrievalUrl(String urlStr) { setProperty(RETRIEVE_FROM, urlStr); } + + public boolean hasRetrievalUrl() + { + return _hasProperty(RETRIEVE_FROM); + } + /** * get the Permanent URI for retrieving the original structure data */ @@ -479,8 +511,50 @@ public class PDBEntry return (String) getProperty(RETRIEVE_FROM); } - public boolean hasRetrievalUrl() + /** + * Data provider name - from 3D Beacons + * + * @param provider + */ + public void setProvider(String provider) + { + setProperty(PROVIDER, provider); + } + + /** + * Get Data provider name - from 3D Beacons + * + */ + public String getProvider() + { + return (String) getProperty(PROVIDER); + } + + /** + * Permanent URI for retrieving the original structure data + * + * @param urlStr + */ + public void setProviderPage(String urlStr) + { + setProperty(MODELPAGE, urlStr); + } + + /** + * get the Permanent URI for retrieving the original structure data + */ + public String getProviderPage() + { + return (String) getProperty(MODELPAGE); + } + + public boolean hasProviderPage() + { + return _hasProperty(MODELPAGE); + } + + public boolean hasProvider() { - return (properties!=null && properties.containsKey(RETRIEVE_FROM)); + return _hasProperty(PROVIDER); } }