diff 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
line wrap: on
line diff
--- 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