Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 2205:a22e0cb6eace
Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
flys-artifacts/trunk@3829 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 30 Jan 2012 13:29:07 +0000 |
parents | b817e680cf18 |
children | 619f6dfec901 |
comparison
equal
deleted
inserted
replaced
2204:45f7762767e2 | 2205:a22e0cb6eace |
---|---|
721 | 721 |
722 String uri = ArtifactNamespaceContext.NAMESPACE_URI; | 722 String uri = ArtifactNamespaceContext.NAMESPACE_URI; |
723 | 723 |
724 DefaultState current = (DefaultState) getCurrentState(context); | 724 DefaultState current = (DefaultState) getCurrentState(context); |
725 | 725 |
726 FLYSContext flysContext = FLYSUtils.getFlysContext(context); | |
727 StateEngine engine = (StateEngine) flysContext.get( | |
728 FLYSContext.STATE_ENGINE_KEY); | |
729 | |
726 for (int i = 0; i < count; i++) { | 730 for (int i = 0; i < count; i++) { |
727 Element node = (Element)nodes.item(i); | 731 Element node = (Element)nodes.item(i); |
728 | 732 |
729 String name = node.getAttributeNS(uri, "name"); | 733 String name = node.getAttributeNS(uri, "name"); |
730 String value = node.getAttributeNS(uri, "value"); | 734 String value = node.getAttributeNS(uri, "value"); |
731 | 735 |
732 if (name.length() > 0 && value.length() > 0) { | 736 if (name.length() > 0 && value.length() > 0) { |
733 logger.debug("Save data item for '" + name + "' : " + value); | 737 logger.debug("Save data item for '" + name + "' : " + value); |
734 | 738 |
735 addData(name, current.transform(this, context, name, value)); | 739 StateData model = engine.getStateData(getName(), name); |
740 | |
741 StateData sd = model != null | |
742 ? model.deepCopy() | |
743 : new DefaultStateData(name, null, null, value); | |
744 | |
745 addData( | |
746 name, current.transform(this, context, sd, name, value)); | |
736 } | 747 } |
737 else if (name.length() > 0 && value.length() == 0) { | 748 else if (name.length() > 0 && value.length() == 0) { |
738 if (removeData(name) != null) { | 749 if (removeData(name) != null) { |
739 logger.debug("Removed data '" + name + "' successfully."); | 750 logger.debug("Removed data '" + name + "' successfully."); |
740 } | 751 } |