X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdbsources%2Fdas%2Fdatamodel%2FDasSourceRegistry.java;h=e7f51f2d26f0eb3d22d545cf6467a16e9cac6b35;hb=59d682209891099d46b960509907c79e3fb276fe;hp=2bc33b6979524a4797d1782e46bab8a1749a910c;hpb=1dd6842f276f27ba69d7e1cfbc1c9b6519f3d22c;p=jalview.git
diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java
index 2bc33b6..e7f51f2 100644
--- a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java
+++ b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java
@@ -1,5 +1,19 @@
-/**
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
+ * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
*
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
*/
package jalview.ws.dbsources.das.datamodel;
@@ -70,6 +84,14 @@ public class DasSourceRegistry implements DasSourceRegistryI,
DEFAULT_REGISTRY);
registry = DEFAULT_REGISTRY;
}
+ if (registry.lastIndexOf("sources.xml") == registry.length() - 11)
+ {
+ // no trailing sources.xml document for registry in JDAS
+ jalview.bin.Cache.setProperty(
+ jalview.bin.Cache.DAS_REGISTRY_URL,
+ registry = registry.substring(0,
+ registry.lastIndexOf("sources.xml")));
+ }
return registry;
}
@@ -83,7 +105,7 @@ public class DasSourceRegistry implements DasSourceRegistryI,
private List getDASSources()
{
- return getDASSources(getDasRegistryURL());
+ return getDASSources(getDasRegistryURL(), this);
}
/**
@@ -92,7 +114,8 @@ public class DasSourceRegistry implements DasSourceRegistryI,
* @param registryURL
* return sources from registryURL
*/
- private static List getDASSources(String registryURL)
+ private static List getDASSources(String registryURL,
+ MultipleConnectionPropertyProviderI registry)
{
try
{
@@ -104,21 +127,26 @@ public class DasSourceRegistry implements DasSourceRegistryI,
List dassources = sources.getSOURCE();
ArrayList dsrc = new ArrayList();
- HashMap latests=new HashMap();
+ HashMap latests = new HashMap();
Integer latest;
for (SOURCE src : dassources)
{
- JalviewSource jsrc=new JalviewSource(src, false);
- latest=latests.get(jsrc.getSourceURL());
- if (latest!=null)
+ JalviewSource jsrc = new JalviewSource(src, registry, false);
+ latest = latests.get(jsrc.getSourceURL());
+ if (latest != null)
{
if (jsrc.isNewerThan(dsrc.get(latest.intValue())))
{
dsrc.set(latest.intValue(), jsrc);
- } else {
- System.out.println("Debug: Ingored older source "+jsrc.getTitle());
}
- } else {
+ else
+ {
+ System.out.println("Debug: Ignored older source "
+ + jsrc.getTitle());
+ }
+ }
+ else
+ {
latests.put(jsrc.getSourceURL(), Integer.valueOf(dsrc.size()));
dsrc.add(jsrc);
}
@@ -147,7 +175,7 @@ public class DasSourceRegistry implements DasSourceRegistryI,
}
return appendLocalSources();
}
-
+
/**
* generate Sources from the local das source list
*
@@ -223,7 +251,7 @@ public class DasSourceRegistry implements DasSourceRegistryI,
{
localSources = new Hashtable();
}
- jalviewSourceI src = new JalviewSource(local, true);
+ jalviewSourceI src = new JalviewSource(local, this, true);
localSources.put(local.getTitle(), src);
return src;
}