Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
855:2c48d75c4ab7 | 856:ec5c75da5c7a |
---|---|
123 String ttlStr = XMLUtils.xpathString( | 123 String ttlStr = XMLUtils.xpathString( |
124 description, | 124 description, |
125 "art:artifact-collection/@art:ttl", | 125 "art:artifact-collection/@art:ttl", |
126 ArtifactNamespaceContext.INSTANCE); | 126 ArtifactNamespaceContext.INSTANCE); |
127 | 127 |
128 String name = XMLUtils.xpathString( | |
129 description, | |
130 "art:artifact-collection/@art:name", | |
131 ArtifactNamespaceContext.INSTANCE); | |
132 | |
128 if (uuid.length() == 0 || ttlStr.length() == 0) { | 133 if (uuid.length() == 0 || ttlStr.length() == 0) { |
129 System.err.println("Found an invalid Collection!"); | 134 System.err.println("Found an invalid Collection!"); |
130 return null; | 135 return null; |
131 } | 136 } |
132 | 137 |
140 } | 145 } |
141 | 146 |
142 Map<String, ThemeList> themeList = parseThemeLists(description); | 147 Map<String, ThemeList> themeList = parseThemeLists(description); |
143 List<Recommendation> recommended = parseRecommendations(description); | 148 List<Recommendation> recommended = parseRecommendations(description); |
144 | 149 |
150 name = (name != null && name.length() > 0) ? name : uuid; | |
151 | |
145 Collection c = !themeList.isEmpty() | 152 Collection c = !themeList.isEmpty() |
146 ? new DefaultCollection(uuid, ttl, recommended, themeList) | 153 ? new DefaultCollection(uuid, ttl, name, recommended, themeList) |
147 : new DefaultCollection(uuid, ttl, recommended); | 154 : new DefaultCollection(uuid, ttl, name, recommended); |
148 | 155 |
149 NodeList items = (NodeList) XMLUtils.xpath( | 156 NodeList items = (NodeList) XMLUtils.xpath( |
150 description, | 157 description, |
151 "art:artifact-collection/art:artifacts/art:artifact", | 158 "art:artifact-collection/art:artifacts/art:artifact", |
152 XPathConstants.NODESET, | 159 XPathConstants.NODESET, |