comparison 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
comparison
equal deleted inserted replaced
637:f0c1250d1e7b 638:9c565eb46f06
23 23
24 public class AttributeParser { 24 public class AttributeParser {
25 25
26 /** Constant XPath that points to the outputmodes of an artifact.*/ 26 /** Constant XPath that points to the outputmodes of an artifact.*/
27 public static final String XPATH_ARTIFACT_OUTPUTMODES = 27 public static final String XPATH_ARTIFACT_OUTPUTMODES =
28 "/art:output"; 28 "/art:attribute/art:outputs/art:output";
29 29
30 30
31 private static Logger logger = Logger.getLogger(AttributeParser.class); 31 private static Logger logger = Logger.getLogger(AttributeParser.class);
32 32
33 33
101 101
102 for (int i = 0; i < num; i++) { 102 for (int i = 0; i < num; i++) {
103 Node theme = themes.item(i); 103 Node theme = themes.item(i);
104 104
105 String name = XMLUtils.xpathString( 105 String name = XMLUtils.xpathString(
106 theme, "@facet", ArtifactNamespaceContext.INSTANCE); 106 theme, "@art:facet", ArtifactNamespaceContext.INSTANCE);
107
108 if (name == null || name.length() == 0) {
109 continue;
110 }
107 111
108 String uuid = XMLUtils.xpathString( 112 String uuid = XMLUtils.xpathString(
109 theme, "@artifact", ArtifactNamespaceContext.INSTANCE); 113 theme, "@art:artifact", ArtifactNamespaceContext.INSTANCE);
114
115 if (uuid == null || uuid.length() == 0) {
116 continue;
117 }
110 118
111 String pos = XMLUtils.xpathString( 119 String pos = XMLUtils.xpathString(
112 theme, "@pos", ArtifactNamespaceContext.INSTANCE); 120 theme, "@art:pos", ArtifactNamespaceContext.INSTANCE);
121
122 if (pos == null || pos.length() == 0) {
123 continue;
124 }
113 125
114 String active = XMLUtils.xpathString( 126 String active = XMLUtils.xpathString(
115 theme, "@active", ArtifactNamespaceContext.INSTANCE); 127 theme, "@art:active", ArtifactNamespaceContext.INSTANCE);
128
129 if (active == null || active.length() == 0) {
130 continue;
131 }
116 132
117 ManagedFacet item = new ManagedFacet( 133 ManagedFacet item = new ManagedFacet(
118 name, "", uuid, 134 name, "", uuid,
119 Integer.parseInt(pos), 135 Integer.parseInt(pos),
120 Integer.parseInt(active)); 136 Integer.parseInt(active));

http://dive4elements.wald.intevation.org