changeset 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 910b03de6857
children 3dde14f0bd98
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/server/DescribeCollectionServiceImpl.java
diffstat 2 files changed, 22 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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 <ingo@intevation.de>
+
+	* 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 <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/shared/model/MapInfo.java: New.
--- 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<OutputMode> modes = new ArrayList<OutputMode>();
 
-        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<OutputMode> modes = parseOutputModes(om);
-
         return new DefaultCollectionItem(uuid, hash, modes);
     }
 

http://dive4elements.wald.intevation.org