comparison flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java @ 587:53ad6dd2cb2b

The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project. flys-client/trunk@2181 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 21 Jun 2011 16:22:39 +0000
parents 78907f0fb939
children 942bd0e7e332
comparison
equal deleted inserted replaced
586:e3c8e045737b 587:53ad6dd2cb2b
110 String uuid = XMLUtils.xpathString( 110 String uuid = XMLUtils.xpathString(
111 description, 111 description,
112 "art:artifact-collection/@art:uuid", 112 "art:artifact-collection/@art:uuid",
113 ArtifactNamespaceContext.INSTANCE); 113 ArtifactNamespaceContext.INSTANCE);
114 114
115 if (uuid == null || uuid.length() == 0) { 115 String ttlStr = XMLUtils.xpathString(
116 description,
117 "art:artifact-collection/@art:ttl",
118 ArtifactNamespaceContext.INSTANCE);
119
120 if (uuid.length() == 0 || ttlStr.length() == 0) {
116 System.err.println("Found an invalid Collection!"); 121 System.err.println("Found an invalid Collection!");
117 return null; 122 return null;
118 } 123 }
119 124
125
126 long ttl = -1;
127 try {
128 ttl = Long.valueOf(ttlStr);
129 }
130 catch (NumberFormatException nfe) {
131 // do nothing
132 }
133
120 Map<String, ThemeList> themeList = parseThemeLists(description); 134 Map<String, ThemeList> themeList = parseThemeLists(description);
121 135
122 Collection c = !themeList.isEmpty() 136 Collection c = !themeList.isEmpty()
123 ? new DefaultCollection(uuid, themeList) 137 ? new DefaultCollection(uuid, ttl, themeList)
124 : new DefaultCollection(uuid); 138 : new DefaultCollection(uuid, ttl);
125 139
126 NodeList items = (NodeList) XMLUtils.xpath( 140 NodeList items = (NodeList) XMLUtils.xpath(
127 description, 141 description,
128 "art:artifact-collection/art:artifacts/art:artifact", 142 "art:artifact-collection/art:artifacts/art:artifact",
129 XPathConstants.NODESET, 143 XPathConstants.NODESET,
258 String uri = ArtifactNamespaceContext.NAMESPACE_URI; 272 String uri = ArtifactNamespaceContext.NAMESPACE_URI;
259 273
260 String uuid = node.getAttributeNS(uri, "uuid"); 274 String uuid = node.getAttributeNS(uri, "uuid");
261 String hash = node.getAttributeNS(uri, "hash"); 275 String hash = node.getAttributeNS(uri, "hash");
262 276
263 if (uuid.length() == 0) { 277 if (uuid == null || uuid.length() == 0) {
264 System.err.println("Found an invalid CollectionItem!"); 278 System.err.println("Found an invalid CollectionItem!");
265 return null; 279 return null;
266 } 280 }
267 281
268 NodeList outputmodes = node.getElementsByTagNameNS(uri, "outputmodes"); 282 NodeList outputmodes = node.getElementsByTagNameNS(uri, "outputmodes");

http://dive4elements.wald.intevation.org