comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 708:757ff56b43b3

Added calculation "am Pegel" version to the "Wasserspiegellage" calculation. flys-artifacts/trunk@2161 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 18 Jun 2011 20:20:34 +0000
parents b6f57d927905
children 4800230fba8a
comparison
equal deleted inserted replaced
707:b6f57d927905 708:757ff56b43b3
17 17
18 import org.apache.log4j.Logger; 18 import org.apache.log4j.Logger;
19 19
20 import org.w3c.dom.Document; 20 import org.w3c.dom.Document;
21 import org.w3c.dom.Element; 21 import org.w3c.dom.Element;
22 import org.w3c.dom.Node;
23 import org.w3c.dom.NodeList; 22 import org.w3c.dom.NodeList;
24 23
25 import de.intevation.artifacts.ArtifactFactory; 24 import de.intevation.artifacts.ArtifactFactory;
26 import de.intevation.artifacts.CallContext; 25 import de.intevation.artifacts.CallContext;
27 26
398 } 397 }
399 398
400 int count = nodes.getLength(); 399 int count = nodes.getLength();
401 logger.debug("Try to save " + count + " data items."); 400 logger.debug("Try to save " + count + " data items.");
402 401
402 String uri = ArtifactNamespaceContext.NAMESPACE_URI;
403
403 for (int i = 0; i < count; i++) { 404 for (int i = 0; i < count; i++) {
404 Node node = nodes.item(i); 405 Element node = (Element)nodes.item(i);
405 406
406 String name = XMLUtils.xpathString( 407 String name = node.getAttributeNS(uri, "name");
407 node, "@art:name", ArtifactNamespaceContext.INSTANCE); 408 String value = node.getAttributeNS(uri, "value");
408 String value = XMLUtils.xpathString( 409
409 node, "@art:value", ArtifactNamespaceContext.INSTANCE); 410 if (name.length() > 0 && value.length() > 0) {
410
411 if (name != null && value != null) {
412 logger.debug("Save data item for '" + name + "' : " + value); 411 logger.debug("Save data item for '" + name + "' : " + value);
413 412
414 addData(name, new DefaultStateData(name, null, null, value)); 413 addData(name, new DefaultStateData(name, null, null, value));
415 } 414 }
416 } 415 }

http://dive4elements.wald.intevation.org