Mercurial > dive4elements > river
changeset 1064:13784581ab0c
Moved the input of user defined barriers for the floodmap to an earlier state.
flys-artifacts/trunk@2542 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 24 Aug 2011 08:22:09 +0000 |
parents | e7c1ebfc2701 |
children | 193c49b7f6a3 |
files | flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifacts/winfo.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ScenarioSelect.java |
diffstat | 4 files changed, 50 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Aug 24 07:51:12 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Aug 24 08:22:09 2011 +0000 @@ -1,3 +1,16 @@ +2011-08-24 Ingo Weinzierl <ingo@intevation.de> + + * doc/conf/artifacts/winfo.xml: Moved the input of barriers one state + earlier where the scenario is selected as well. + + * src/main/java/de/intevation/flys/artifacts/states/ScenarioSelect.java: + This state now desires the "map_digitize" UI provider and returns both + items "scenario" and "uesk.barriers" in the dynamic describe part. + + * src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java: + Removed the UI provider and the computeFeed() which is no longer needed, + because there is no more user input in this state. + 2011-08-24 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/artifacts/states/WMSBackgroundState.java,
--- a/flys-artifacts/doc/conf/artifacts/winfo.xml Wed Aug 24 07:51:12 2011 +0000 +++ b/flys-artifacts/doc/conf/artifacts/winfo.xml Wed Aug 24 08:22:09 2011 +0000 @@ -269,6 +269,7 @@ <state id="state.winfo.uesk.scenario" description="state.winfo.uesk.scenario" state="de.intevation.flys.artifacts.states.ScenarioSelect"> <data name="scenario" type="String" /> + <data name="uesk.barriers" type="String" /> </state> <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition"> @@ -277,7 +278,6 @@ </transition> <state id="state.winfo.uesk.uesk" description="state.winfo.uesk.uesk" state="de.intevation.flys.artifacts.states.FloodMapState"> - <data name="uesk.barriers" type="String" /> <outputmodes> <outputmode name="floodmap" description="output.uesk.map.description" type="map"> <facets>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java Wed Aug 24 07:51:12 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java Wed Aug 24 08:22:09 2011 +0000 @@ -21,10 +21,6 @@ private static Logger logger = Logger.getLogger(FloodMapState.class); - @Override - protected String getUIProvider() { - return "noinput"; - } @Override public Object computeAdvance( @@ -38,19 +34,5 @@ return null; } - - - @Override - public Object computeFeed( - FLYSArtifact artifact, - String hash, - CallContext context, - List<Facet> facets, - Object old - ) { - facets.add(new WSPLGENFacet(0, FLOODMAP_WSPLGEN, "WSPLGEN")); - - return null; - } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ScenarioSelect.java Wed Aug 24 07:51:12 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ScenarioSelect.java Wed Aug 24 08:22:09 2011 +0000 @@ -12,6 +12,7 @@ import de.intevation.artifactdatabase.ProtocolUtils; +import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.resources.Resources; /** @@ -23,7 +24,8 @@ private static Logger logger = Logger.getLogger(ScenarioSelect.class); - public static final String FIELD_MODE = "szenario"; + public static final String FIELD_MODE = "scenario"; + public static final String FIELD_BARRIERS = "uesk.barriers"; public static final String SCENARIO_CURRENT = "scenario.current"; public static final String SCENARIO_POTENTIEL = "scenario.potentiel"; @@ -35,6 +37,13 @@ SCENARIO_SCENRAIO }; + + @Override + protected String getUIProvider() { + return "map_digitize"; + } + + @Override protected Element[] createItems( XMLUtils.ElementCreator cr, @@ -42,20 +51,35 @@ String name, CallContext context) { - CallMeta meta = context.getMeta(); - Element[] scenarios = new Element[SCENARIOS.length]; - - int i = 0; + CallMeta meta = context.getMeta(); - for (String scenario: SCENARIOS) { - scenarios[i++] = createItem( - cr, new String[] { - Resources.getMsg(meta, scenario, scenario), - scenario - }); + if (name.equals(FIELD_MODE)) { + Element[] scenarios = new Element[SCENARIOS.length]; + + int i = 0; + + for (String scenario: SCENARIOS) { + scenarios[i++] = createItem( + cr, new String[] { + Resources.getMsg(meta, scenario, scenario), + scenario + }); + } + + return scenarios; } + else { + FLYSArtifact flys = (FLYSArtifact) artifact; + String data = flys.getDataAsString(name); - return scenarios; + return new Element[] { createItem( + cr, + new String[] { + Resources.getMsg(meta, name, name), + data + } + )}; + } }