# HG changeset patch # User Raimund Renkert # Date 1347019121 0 # Node ID 1cfe788325d58db1cdf69b45a3375d1895eba433 # Parent 181e250bf989e0eeab674833b97d9a140bb1a8c6 Issue 791. Add start km to data to compare reference and target km in next state. flys-artifacts/trunk@5379 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 181e250bf989 -r 1cfe788325d5 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Fri Sep 07 09:26:45 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Sep 07 11:58:41 2012 +0000 @@ -1,3 +1,10 @@ +2012-09-07 Raimund Renkert + + Issue 791. + + * src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java: + Add start km to data to compare reference and target km in next state. + 2012-09-07 Ingo Weinzierl Tagged RELEASE 2.9 diff -r 181e250bf989 -r 1cfe788325d5 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java Fri Sep 07 09:26:45 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java Fri Sep 07 11:58:41 2012 +0000 @@ -1,16 +1,25 @@ package de.intevation.flys.artifacts.states; +import org.apache.log4j.Logger; +import org.w3c.dom.Element; + +import de.intevation.artifacts.Artifact; import de.intevation.artifacts.CallContext; import de.intevation.artifacts.common.utils.StringUtils; +import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; +import de.intevation.flys.artifacts.WINFOArtifact; /** * Get me doubles (km). */ public class EnterMultipleLocationsState extends EnterLocationState { + /** The logger for this class. */ + private static Logger logger = Logger.getLogger(EnterMultipleLocationsState.class); @Override protected String getUIProvider() { + logger.debug("multi location panel"); return "multi_location_panel"; } @@ -31,5 +40,34 @@ return StringUtils.join(" ", vals); } + + /** + * This method creates a list of items. These items represent the amount of + * input data that is possible for this state. + * + * @param cr The ElementCreator. + * @param name The name of the amount of data. + * + * @return a list of items. + */ + @Override + protected Element[] createItems( + ElementCreator cr, + Artifact artifact, + String name, + CallContext context + ) { + if (name.equals("reference_endpoint")) { + Element[] elements = new Element[1]; + WINFOArtifact winfo = (WINFOArtifact) artifact; + Double km = winfo.getReferenceStartKm(); + elements[0] = createItem( + cr, + new String[] {"start_km", km.toString()}); + return elements; + } + return null; + } + } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :