# HG changeset patch # User Ingo Weinzierl # Date 1314107874 0 # Node ID f14cefeed2434a5ba8100569d93a81a411115607 # Parent 910b03de6857c078c62dd110bea26bb2ee30c6a7 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 diff -r 910b03de6857 -r f14cefeed243 flys-client/ChangeLog --- a/flys-client/ChangeLog Tue Aug 23 09:43:12 2011 +0000 +++ b/flys-client/ChangeLog Tue Aug 23 13:57:54 2011 +0000 @@ -1,3 +1,9 @@ +2011-08-23 Ingo Weinzierl + + * src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java: + Parse the output modes of the first Artifact only. The output modes of + the other artifacts shouldn't be visible to the user. + 2011-08-23 Ingo Weinzierl * src/main/java/de/intevation/flys/client/shared/model/MapInfo.java: New. diff -r 910b03de6857 -r f14cefeed243 flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java Tue Aug 23 09:43:12 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java Tue Aug 23 13:57:54 2011 +0000 @@ -162,7 +162,9 @@ int size = items.getLength(); for (int i = 0; i < size; i++) { - CollectionItem item = parseCollectionItem((Element)items.item(i)); + CollectionItem item = parseCollectionItem( + (Element)items.item(i), + i == 0); if (item != null) { c.addItem(item); @@ -264,7 +266,7 @@ * * @return a CollectionItem. */ - protected CollectionItem parseCollectionItem(Element node) { + protected CollectionItem parseCollectionItem(Element node, boolean outs) { System.out.println("AddArtifactServiceImpl.parseCollectionItem"); if (node == null) { @@ -282,16 +284,21 @@ return null; } - NodeList outputmodes = node.getElementsByTagNameNS(uri, "outputmodes"); + List modes = new ArrayList(); - if (outputmodes.getLength() < 1) { - return null; + if (outs) { + NodeList outputmodes = node.getElementsByTagNameNS( + uri, "outputmodes"); + + if (outputmodes.getLength() < 1) { + return null; + } + + Element om = (Element)outputmodes.item(0); + + modes = parseOutputModes(om); } - Element om = (Element)outputmodes.item(0); - - List modes = parseOutputModes(om); - return new DefaultCollectionItem(uuid, hash, modes); }