# HG changeset patch # User Ingo Weinzierl # Date 1314174129 0 # Node ID 13784581ab0c055745b4a48c63d678fa4162038a # Parent e7c1ebfc2701efe2249d24d094ac8d2a64c6badd Moved the input of user defined barriers for the floodmap to an earlier state. flys-artifacts/trunk@2542 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r e7c1ebfc2701 -r 13784581ab0c flys-artifacts/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/artifacts/states/WMSBackgroundState.java, diff -r e7c1ebfc2701 -r 13784581ab0c flys-artifacts/doc/conf/artifacts/winfo.xml --- 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 @@ + @@ -277,7 +278,6 @@ - diff -r e7c1ebfc2701 -r 13784581ab0c flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java --- 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 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 : diff -r e7c1ebfc2701 -r 13784581ab0c flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ScenarioSelect.java --- 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 + } + )}; + } }