URL url = new URL(registryURL);
org.biodas.jdas.client.SourcesClientInterface client = new SourcesClient();
- SOURCES sources = client.fetchDataRegistry(registryURL, null, null, null, null, null, null);
+ SOURCES sources = client.fetchDataRegistry(registryURL, null, null,
+ null, null, null, null);
List<SOURCE> dassources = sources.getSOURCE();
ArrayList<jalviewSourceI> dsrc = new ArrayList<jalviewSourceI>();
}
}
-
public void run()
{
getSources();
*/
private void addLocalDasSources()
{
- String local = jalview.bin.Cache.getProperty("DAS_LOCAL_SOURCE");
- if (local != null)
+ if (localSources == null)
{
- StringTokenizer st = new StringTokenizer(local, "\t");
- while (st.hasMoreTokens())
+ // get local sources from properties and initialise the local source list
+ String local = jalview.bin.Cache.getProperty("DAS_LOCAL_SOURCE");
+ if (local != null)
{
- String token = st.nextToken();
- int bar = token.indexOf("|");
- String url = token.substring(bar + 1);
- boolean features = true, sequence = false;
- if (url.startsWith("sequence:"))
+ StringTokenizer st = new StringTokenizer(local, "\t");
+ while (st.hasMoreTokens())
{
- url = url.substring(9);
- // this source also serves sequences as well as features
- sequence = true;
+ String token = st.nextToken();
+ int bar = token.indexOf("|");
+ String url = token.substring(bar + 1);
+ boolean features = true, sequence = false;
+ if (url.startsWith("sequence:"))
+ {
+ url = url.substring(9);
+ // this source also serves sequences as well as features
+ sequence = true;
+ }
+ createLocalSource(url, token.substring(0, bar), sequence,
+ features);
}
- createLocalSource(url, token.substring(0, bar), sequence, features);
}
}
}
private List<jalviewSourceI> appendLocalSources()
{
- List<jalviewSourceI> srclist=new ArrayList<jalviewSourceI>();
+ List<jalviewSourceI> srclist = new ArrayList<jalviewSourceI>();
addLocalDasSources();
sourceNames = new Hashtable<String, jalviewSourceI>();
if (dasSources != null)
{
localSources = new Hashtable<String, jalviewSourceI>();
}
- jalviewSourceI src=new JalviewSource(local, true);
+ jalviewSourceI src = new JalviewSource(local, true);
localSources.put(local.getTitle(), src);
return src;
}
*/
CAPABILITY cap = new CAPABILITY();
cap.setType("das1:" + Capabilities.SEQUENCE.getName());
- cap.setQueryUri(url+"/sequence");
+ cap.setQueryUri(url + "/sequence");
cp.add(cap);
}
if (features)
{
CAPABILITY cap = new CAPABILITY();
cap.setType("das1:" + Capabilities.FEATURES.getName());
- cap.setQueryUri(url+"/features");
+ cap.setQueryUri(url + "/features");
cp.add(cap);
}
localSources.remove(source.getTitle());
sourceNames.remove(source.getTitle());
dasSources.remove(source);
+ jalview.bin.Cache.setProperty("DAS_LOCAL_SOURCE",
+ getLocalSourceString());
+
return true;
}
return false;