diff flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java @ 856:ec5c75da5c7a

Bugfix flys/issue166: Parse Collection names from DESCRIBE. flys-client/trunk@2648 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 06 Sep 2011 07:47:15 +0000
parents 6a1cd38e6e18
children 478a571f1f94
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java	Tue Sep 06 07:14:17 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java	Tue Sep 06 07:47:15 2011 +0000
@@ -125,6 +125,11 @@
             "art:artifact-collection/@art:ttl",
             ArtifactNamespaceContext.INSTANCE);
 
+        String name = XMLUtils.xpathString(
+            description,
+            "art:artifact-collection/@art:name",
+            ArtifactNamespaceContext.INSTANCE);
+
         if (uuid.length() == 0 || ttlStr.length() == 0) {
             System.err.println("Found an invalid Collection!");
             return null;
@@ -142,9 +147,11 @@
         Map<String, ThemeList> themeList = parseThemeLists(description);
         List<Recommendation> recommended = parseRecommendations(description);
 
+        name = (name != null && name.length() > 0) ? name : uuid;
+
         Collection c = !themeList.isEmpty()
-            ? new DefaultCollection(uuid, ttl, recommended, themeList)
-            : new DefaultCollection(uuid, ttl, recommended);
+            ? new DefaultCollection(uuid, ttl, name, recommended, themeList)
+            : new DefaultCollection(uuid, ttl, name, recommended);
 
         NodeList items = (NodeList) XMLUtils.xpath(
             description,

http://dive4elements.wald.intevation.org