comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 1176:28154920e0b3

Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact. flys-artifacts/trunk@2761 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 15 Sep 2011 15:05:24 +0000
parents 073c36bb94ed
children 47ecf98f09eb
comparison
equal deleted inserted replaced
1175:e6b513495281 1176:28154920e0b3
556 int count = nodes.getLength(); 556 int count = nodes.getLength();
557 logger.debug("Try to save " + count + " data items."); 557 logger.debug("Try to save " + count + " data items.");
558 558
559 String uri = ArtifactNamespaceContext.NAMESPACE_URI; 559 String uri = ArtifactNamespaceContext.NAMESPACE_URI;
560 560
561 DefaultState current = (DefaultState) getCurrentState(context);
562
561 for (int i = 0; i < count; i++) { 563 for (int i = 0; i < count; i++) {
562 Element node = (Element)nodes.item(i); 564 Element node = (Element)nodes.item(i);
563 565
564 String name = node.getAttributeNS(uri, "name"); 566 String name = node.getAttributeNS(uri, "name");
565 String value = node.getAttributeNS(uri, "value"); 567 String value = node.getAttributeNS(uri, "value");
566 568
567 if (name.length() > 0 && value.length() > 0) { 569 if (name.length() > 0 && value.length() > 0) {
568 logger.debug("Save data item for '" + name + "' : " + value); 570 logger.debug("Save data item for '" + name + "' : " + value);
569 571
570 addData(name, new DefaultStateData(name, null, null, value)); 572 addData(name, current.transform(this, context, name, value));
571 } 573 }
572 } 574 }
573 575
574 DefaultState current = (DefaultState) getCurrentState(context);
575 current.validate(this); 576 current.validate(this);
576 } 577 }
577 578
578 579
579 /** 580 /**

http://dive4elements.wald.intevation.org