comparison flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java @ 829:f14cefeed243

Display the output modes of the master artifact only - all other artifact's output modes are NOT visible to the user. flys-client/trunk@2535 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 23 Aug 2011 13:57:54 +0000
parents 112f95d7b286
children 0fe456332785
comparison
equal deleted inserted replaced
828:910b03de6857 829:f14cefeed243
160 } 160 }
161 161
162 int size = items.getLength(); 162 int size = items.getLength();
163 163
164 for (int i = 0; i < size; i++) { 164 for (int i = 0; i < size; i++) {
165 CollectionItem item = parseCollectionItem((Element)items.item(i)); 165 CollectionItem item = parseCollectionItem(
166 (Element)items.item(i),
167 i == 0);
166 168
167 if (item != null) { 169 if (item != null) {
168 c.addItem(item); 170 c.addItem(item);
169 } 171 }
170 } 172 }
262 * 264 *
263 * @param node A node that contains information about a CollectionItem. 265 * @param node A node that contains information about a CollectionItem.
264 * 266 *
265 * @return a CollectionItem. 267 * @return a CollectionItem.
266 */ 268 */
267 protected CollectionItem parseCollectionItem(Element node) { 269 protected CollectionItem parseCollectionItem(Element node, boolean outs) {
268 System.out.println("AddArtifactServiceImpl.parseCollectionItem"); 270 System.out.println("AddArtifactServiceImpl.parseCollectionItem");
269 271
270 if (node == null) { 272 if (node == null) {
271 System.err.println("The node for parsing CollectionItem is null!"); 273 System.err.println("The node for parsing CollectionItem is null!");
272 return null; 274 return null;
280 if (uuid == null || uuid.length() == 0) { 282 if (uuid == null || uuid.length() == 0) {
281 System.err.println("Found an invalid CollectionItem!"); 283 System.err.println("Found an invalid CollectionItem!");
282 return null; 284 return null;
283 } 285 }
284 286
285 NodeList outputmodes = node.getElementsByTagNameNS(uri, "outputmodes"); 287 List<OutputMode> modes = new ArrayList<OutputMode>();
286 288
287 if (outputmodes.getLength() < 1) { 289 if (outs) {
288 return null; 290 NodeList outputmodes = node.getElementsByTagNameNS(
289 } 291 uri, "outputmodes");
290 292
291 Element om = (Element)outputmodes.item(0); 293 if (outputmodes.getLength() < 1) {
292 294 return null;
293 List<OutputMode> modes = parseOutputModes(om); 295 }
296
297 Element om = (Element)outputmodes.item(0);
298
299 modes = parseOutputModes(om);
300 }
294 301
295 return new DefaultCollectionItem(uuid, hash, modes); 302 return new DefaultCollectionItem(uuid, hash, modes);
296 } 303 }
297 304
298 305

http://dive4elements.wald.intevation.org