diff flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeParser.java @ 638:9c565eb46f06

Fixed the process of creating and storing the attribute of a collection. flys-artifacts/trunk@2015 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 27 May 2011 08:46:26 +0000
parents 6167ae622ce0
children 68c6c75a6f7c
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeParser.java	Thu May 26 16:54:16 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeParser.java	Fri May 27 08:46:26 2011 +0000
@@ -25,7 +25,7 @@
 
     /** Constant XPath that points to the outputmodes of an artifact.*/
     public static final String XPATH_ARTIFACT_OUTPUTMODES =
-        "/art:output";
+        "/art:attribute/art:outputs/art:output";
 
 
     private static Logger logger = Logger.getLogger(AttributeParser.class);
@@ -103,16 +103,32 @@
             Node theme = themes.item(i);
 
             String name = XMLUtils.xpathString(
-                theme, "@facet", ArtifactNamespaceContext.INSTANCE);
+                theme, "@art:facet", ArtifactNamespaceContext.INSTANCE);
+
+            if (name == null || name.length() == 0) {
+                continue;
+            }
 
             String uuid = XMLUtils.xpathString(
-                theme, "@artifact", ArtifactNamespaceContext.INSTANCE);
+                theme, "@art:artifact", ArtifactNamespaceContext.INSTANCE);
+
+            if (uuid == null || uuid.length() == 0) {
+                continue;
+            }
 
             String pos = XMLUtils.xpathString(
-                theme, "@pos", ArtifactNamespaceContext.INSTANCE);
+                theme, "@art:pos", ArtifactNamespaceContext.INSTANCE);
+
+            if (pos == null || pos.length() == 0) {
+                continue;
+            }
 
             String active = XMLUtils.xpathString(
-                theme, "@active", ArtifactNamespaceContext.INSTANCE);
+                theme, "@art:active", ArtifactNamespaceContext.INSTANCE);
+
+            if (active == null || active.length() == 0) {
+                continue;
+            }
 
             ManagedFacet item = new ManagedFacet(
                 name, "", uuid,

http://dive4elements.wald.intevation.org