private static final int PDB_ID_LENGTH = 4;
+ private static final String FAKED_ID = "faked_pdbid";
+
private String file;
private String type;
// 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;
+ if (!newEntry.fakedPDBId())
+ {
+ return false;
+ } // otherwise we can update
}
}
}
*/
String key = newProps.nextElement();
Object value = newEntry.getProperty(key);
+ if (FAKED_ID.equals(key))
+ {
+ // we never update the fake ID property
+ continue;
+ }
if (!value.equals(getProperty(key)))
{
setProperty(key, value);
return true;
}
+ /**
+ * set when Jalview has manufactured the ID using a local filename
+ * @return
+ */
+ public boolean fakedPDBId()
+ {
+ if (_hasProperty(FAKED_ID))
+ {
+ return true;
+ }
+ return false;
+ }
+ public void setFakedPDBId(boolean faked)
+ {
+ if (faked)
+ {
+ setProperty(FAKED_ID, Boolean.TRUE);
+ }
+ else
+ {
+ if (properties!=null) {
+ properties.remove(FAKED_ID);
+ }
+ }
+ }
+
+ 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
*/
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);
}
}