# HG changeset patch # User Felix Wolfsteller # Date 1318240398 0 # Node ID 5f1156d61e9e826f1196b846b66666c4e76aeec3 # Parent 5201173c3db5a4133a4a3a4d6d594e9b05f94d89 Let WaterlevelPairSelect send "old" data. flys-artifacts/trunk@2919 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 5201173c3db5 -r 5f1156d61e9e flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Oct 10 08:35:30 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Oct 10 09:53:18 2011 +0000 @@ -1,3 +1,12 @@ +2011-10-10 Felix Wolfsteller + + Let WaterlevelPairSelectState include diffids-data (if any) to enable + future work on repopulation of Grid in GUI when jumping back + (reparameterization). + + * src/main/java/de/intevation/flys/artifacts/states/WaterlevelPairSelectState.java: + (createItems): Override to include old data. + 2011-10-10 Ingo Weinzierl flys/issue150 (Diagramm: Anzeige von W bergauf) diff -r 5201173c3db5 -r 5f1156d61e9e flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelPairSelectState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelPairSelectState.java Mon Oct 10 08:35:30 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelPairSelectState.java Mon Oct 10 09:53:18 2011 +0000 @@ -6,8 +6,10 @@ import org.w3c.dom.Element; +import de.intevation.artifacts.Artifact; import de.intevation.artifacts.CallContext; +import de.intevation.artifactdatabase.ProtocolUtils; import de.intevation.artifactdatabase.state.Facet; import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; @@ -22,13 +24,13 @@ import de.intevation.flys.utils.StringUtil; - public class WaterlevelPairSelectState extends DefaultState implements FacetTypes { /** The logger that is used in this state. */ - private static Logger logger = Logger.getLogger(WaterlevelPairSelectState.class); + private static Logger logger = Logger.getLogger( + WaterlevelPairSelectState.class); // TODO fix (state.winfo.waterlevel) @@ -56,7 +58,34 @@ Object old ) { //Get data and do stuff, do not calculate - return ""; + return old; + } + + + + /** + * Create elements for document (prepopulated with data, if any). + */ + @Override + protected Element[] createItems( + XMLUtils.ElementCreator cr, + Artifact artifact, + String name, + CallContext context) + { + logger.debug("createItems: " + name); + if (name.equals("diffids")) { + Element item = ProtocolUtils.createArtNode(cr, "item", null, null); + Element label = ProtocolUtils.createArtNode(cr, "label", null, null); + Element value = ProtocolUtils.createArtNode(cr, "value", null, null); + FLYSArtifact flys = (FLYSArtifact) artifact; + String s = flys.getDataAsString("diffids"); + value.setTextContent(s); + item.appendChild(label); + item.appendChild(value); + return new Element[] { item }; + } + return new Element[] {}; } @@ -112,7 +141,6 @@ .unbracket(recommendations[i+1]) .split(";"); - FLYSArtifact artifact1 = FLYSUtils.getArtifact(minuendParts[0], cc); CalculationResult rawData1 = (CalculationResult) artifact1.compute(