annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/DefaultState.java @ 8202:e4606eae8ea5

sed src/**/*.java 's/logger/log/g'
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 12:58:17 +0200
parents 799af7909e8d
children 97e148487186
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5909
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5909
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
9 package org.dive4elements.river.artifacts.states;
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
669
23fced04ffdb #103 PART 1: The numbers which are written into the static DESCRIBE part are i18n formatted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 660
diff changeset
11 import java.text.NumberFormat;
23fced04ffdb #103 PART 1: The numbers which are written into the static DESCRIBE part are i18n formatted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 660
diff changeset
12 import java.util.Locale;
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import java.util.Map;
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
14 import java.util.List;
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import org.apache.log4j.Logger;
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import org.w3c.dom.Document;
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 import org.w3c.dom.Element;
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import org.w3c.dom.Node;
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
22 import org.dive4elements.artifacts.Artifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
23 import org.dive4elements.artifacts.ArtifactNamespaceContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
24 import org.dive4elements.artifacts.CallContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
25 import org.dive4elements.artifacts.CallMeta;
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
27 import org.dive4elements.artifacts.common.utils.XMLUtils;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
28 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator;
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
29
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
30 import org.dive4elements.artifactdatabase.ProtocolUtils;
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
32 import org.dive4elements.artifactdatabase.data.StateData;
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
33
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
34 import org.dive4elements.artifactdatabase.state.AbstractState;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
35 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
36
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
37 import org.dive4elements.river.artifacts.D4EArtifact;
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
38
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4155
diff changeset
39 import org.dive4elements.river.artifacts.resources.Resources;
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 /**
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 */
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 public abstract class DefaultState extends AbstractState {
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6052
diff changeset
47 /** The log that is used in this class. */
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6052
diff changeset
48 private static Logger log = Logger.getLogger(DefaultState.class);
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49
2015
61667c3a0003 Disabled default values in Artifact's DESCRIBE document - added a system property to re-enable those default values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1768
diff changeset
50
61667c3a0003 Disabled default values in Artifact's DESCRIBE document - added a system property to re-enable those default values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1768
diff changeset
51 /** Determines, if the DESCRIBE document should contain default values or
61667c3a0003 Disabled default values in Artifact's DESCRIBE document - added a system property to re-enable those default values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1768
diff changeset
52 * not. */
61667c3a0003 Disabled default values in Artifact's DESCRIBE document - added a system property to re-enable those default values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1768
diff changeset
53 public static final boolean USE_DEFAULTS =
61667c3a0003 Disabled default values in Artifact's DESCRIBE document - added a system property to re-enable those default values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1768
diff changeset
54 Boolean.getBoolean("flys.use.default.values");
61667c3a0003 Disabled default values in Artifact's DESCRIBE document - added a system property to re-enable those default values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1768
diff changeset
55
1768
41ba2276d785 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1743
diff changeset
56 /** The three possible compute types. */
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
57 public static enum ComputeType {
942
796c54058dc4 Added artifacts/states for WMS background an river axis and a configuration for the output-defaults.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 941
diff changeset
58 FEED, ADVANCE, INIT
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
59 }
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60
1768
41ba2276d785 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1743
diff changeset
61
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
62 protected StateData getData(D4EArtifact artifact, String name) {
624
929137ee8154 ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 379
diff changeset
63 return artifact.getData(name);
929137ee8154 ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 379
diff changeset
64 }
929137ee8154 ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 379
diff changeset
65
929137ee8154 ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 379
diff changeset
66
1136
8da5f5a9ed3c Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1050
diff changeset
67 /**
8da5f5a9ed3c Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1050
diff changeset
68 * Append to a node and return xml description relevant for gui.
8da5f5a9ed3c Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1050
diff changeset
69 */
134
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
70 public Element describeStatic(
624
929137ee8154 ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 379
diff changeset
71 Artifact artifact,
134
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
72 Document document,
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
73 Node root,
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
74 CallContext context,
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
75 String uuid)
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
76 {
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
77 ElementCreator creator = new ElementCreator(
134
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
78 document,
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
79 ArtifactNamespaceContext.NAMESPACE_URI,
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
80 ArtifactNamespaceContext.NAMESPACE_PREFIX);
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
81
142
b43671a551d1 Append human readable strings of the selected values to the DESCRIBE output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 136
diff changeset
82 CallMeta meta = context.getMeta();
b43671a551d1 Append human readable strings of the selected values to the DESCRIBE output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 136
diff changeset
83
5909
6dfd967dcae9 D4E river: Fixed substitution on help URL.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
84 String helpText = getHelpText();
6dfd967dcae9 D4E river: Fixed substitution on help URL.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
85 if (helpText != null) {
6dfd967dcae9 D4E river: Fixed substitution on help URL.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
86 helpText = replaceHelpUrl(
6dfd967dcae9 D4E river: Fixed substitution on help URL.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
87 Resources.getMsg(meta, helpText, helpText));
6dfd967dcae9 D4E river: Fixed substitution on help URL.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5867
diff changeset
88 }
2661
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
89
142
b43671a551d1 Append human readable strings of the selected values to the DESCRIBE output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 136
diff changeset
90 String label = Resources.getMsg(meta, getID(), getID());
136
2e510c998adb New state for the location/distance input and some litte modifications of the DefaultState.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 135
diff changeset
91 Element ui = ProtocolUtils.createArtNode(
134
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
92 creator, "state",
2661
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
93 new String[] { "name", "uiprovider", "label", "helpText"},
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
94 new String[] { getID(), getUIProvider(), label, helpText });
134
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
95
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
96 Map<String, StateData> theData = getData();
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
97 if (theData == null) {
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
98 return ui;
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
99 }
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
100
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
101 D4EArtifact flys = (D4EArtifact)artifact;
134
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
102
3732
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
103 for (String name: theData.keySet()) {
1180
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
104 appendStaticData(flys, context, creator, ui, name);
134
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
105 }
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
106
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
107 return ui;
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
108 }
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
109
f3dfa188d8b2 Let the states describe the static ui part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 129
diff changeset
110
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
111 protected void appendStaticData(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
112 D4EArtifact flys,
1180
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
113 CallContext context,
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
114 ElementCreator cr,
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
115 Element ui,
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
116 String name
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
117 ) {
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
118 StateData data = getData(flys, name);
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
119 String value = (data != null) ? (String) data.getValue() : null;
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
120
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
121 if (value == null) {
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
122 return;
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
123 }
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
124
2205
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
125 String type = data.getType();
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
126
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6052
diff changeset
127 if (log.isDebugEnabled()) {
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6052
diff changeset
128 log.debug(
3732
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
129 "Append element " + type + "'" +
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
130 name + "' (" + value + ")");
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
131 }
2205
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
132
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
133 Element e = createStaticData(flys, cr, context, name, value, type);
1180
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
134
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
135 ui.appendChild(e);
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
136
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
137 }
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
138
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
139
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
140 /**
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
141 * Creates a <i>data</i> element used in the static part of the DESCRIBE
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
142 * document.
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
143 *
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
144 * @param creator The ElementCreator that is used to build new Elements.
3284
d9af29a4bb85 Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2661
diff changeset
145 * @param cc The CallContext object used for nested i18n retrieval.
1180
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
146 * @param name The name of the data item.
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
147 * @param value The value as string.
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
148 *
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
149 * @return an Element.
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
150 */
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
151 protected Element createStaticData(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
152 D4EArtifact flys,
1180
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
153 ElementCreator creator,
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
154 CallContext cc,
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
155 String name,
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
156 String value,
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
157 String type
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
158 ) {
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
159 Element dataElement = creator.create("data");
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
160 creator.addAttr(dataElement, "name", name, true);
1180
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
161 creator.addAttr(dataElement, "type", type, true);
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
162
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
163 Element itemElement = creator.create("item");
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
164 creator.addAttr(itemElement, "value", value, true);
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
165
2205
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
166 creator.addAttr(
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
167 itemElement,
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
168 "label",
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
169 getLabelFor(cc, name, value, type),
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
170 true);
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
171
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
172 dataElement.appendChild(itemElement);
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
173
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
174 return dataElement;
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
175 }
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
176
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
177
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
178 /**
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
179 * @param cc
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
180 * @param name
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
181 * @param value
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
182 * @param type
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
183 *
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
184 * @return
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
185 */
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
186 protected String getLabelFor(
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
187 CallContext cc,
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
188 String name,
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
189 String value,
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
190 String type
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
191 ) {
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
192 CallMeta meta = cc.getMeta();
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
193
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
194 try {
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
195 // XXX A better way to format the output would be to use the
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
196 // 'type' value of the data objects.
3732
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
197 double doubleVal = Double.parseDouble(value);
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
198 Locale l = Resources.getLocale(meta);
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
199 NumberFormat nf = NumberFormat.getInstance(l);
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
200
2205
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
201 return nf.format(doubleVal);
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
202 }
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
203 catch (NumberFormatException nfe) {
2205
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
204 return Resources.getMsg(meta, value, value);
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
205 }
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
206 }
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
207
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
208
3407
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
209 /**
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
210 * This method returns the default value and description for <i>data</i>.
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
211 * Note, that this method returns the defaults only if <i>USE_DEFAULTS</i>
3414
1bb6fb621167 FixA: Added stub for the "Ausgelagerte Wasserspiegellagen" calculation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3407
diff changeset
212 * is set; otherwise, null is returned.
3407
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
213 * @param context The CallContext used for i18n.
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
214 * @param data The data objects that the defaults are for.
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
215 * @return a String[] with [default value, default label].
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
216 */
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
217 protected String[] getDefaultsFor(CallContext context, StateData data) {
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
218 if (USE_DEFAULTS) {
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
219 String defValue = (String) data.getValue();
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
220 String defDesc = null;
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
221
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
222 if (defValue != null && defValue.length() > 0) {
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
223 defDesc = Resources.getMsg(
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
224 context.getMeta(),
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
225 defValue,
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
226 defValue);
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
227 }
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
228
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
229 if (defValue != null && defDesc != null) {
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
230 return new String[] { defValue, defDesc };
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
231 }
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
232 }
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
233
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
234 return null;
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
235 }
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
236
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
237
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
238 public Element describe(
306
35301cc3b875 Modified the states' describe() method - related to the last commit.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 142
diff changeset
239 Artifact artifact,
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
240 Document document,
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
241 Node root,
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
242 CallContext context,
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
243 String uuid)
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
244 {
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
245 ElementCreator creator = new ElementCreator(
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
246 document,
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
247 ArtifactNamespaceContext.NAMESPACE_URI,
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
248 ArtifactNamespaceContext.NAMESPACE_PREFIX);
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
249
6052
799af7909e8d Expand the Help Url also in the describe method
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
250 String helpText = getHelpText();
799af7909e8d Expand the Help Url also in the describe method
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
251 if (helpText != null) {
799af7909e8d Expand the Help Url also in the describe method
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
252 helpText = replaceHelpUrl(
799af7909e8d Expand the Help Url also in the describe method
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
253 Resources.getMsg(context.getMeta(), helpText, helpText));
799af7909e8d Expand the Help Url also in the describe method
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
254 }
2661
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
255
135
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
256 Element ui = null;
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
257 String uiprovider = getUIProvider();
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
258 if (uiprovider != null) {
1136
8da5f5a9ed3c Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1050
diff changeset
259 ui = ProtocolUtils.createArtNode(
135
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
260 creator, "dynamic",
2661
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
261 new String[] { "uiprovider", "helpText" },
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
262 new String[] { uiprovider, helpText });
135
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
263 }
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
264 else {
2661
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
265 ui = ProtocolUtils.createArtNode(
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
266 creator, "dynamic",
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
267 new String[] { "helpText" },
17927c60ac1c Added 'helpText' fields to the transition model.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2214
diff changeset
268 new String[] { helpText });
135
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
269 }
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
270
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
271 Map<String, StateData> theData = getData();
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
272 if (theData == null) {
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
273 return ui;
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
274 }
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
275
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
276 D4EArtifact flys = (D4EArtifact)artifact;
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
277
3732
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
278 for (String name: theData.keySet()) {
624
929137ee8154 ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 379
diff changeset
279 StateData data = getData(flys, name);
929137ee8154 ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 379
diff changeset
280
3732
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
281 if (data == null) {
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
282 data = getData(name);
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
283 }
624
929137ee8154 ISSUE-62 (part I/II) States are no longer filled with data - if a state needs user input, it needs to query the owner artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 379
diff changeset
284
313
89bd0417418f The location/distance state now writes default values into DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 306
diff changeset
285 Element select = createData(creator, artifact, data, context);
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
286
3407
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
287 String[] defaults = getDefaultsFor(context, data);
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
288 if (defaults != null && defaults.length > 1) {
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
289 creator.addAttr(select, "defaultValue", defaults[0], true);
70e9d56e21fc Set default value of MINFO SQ relation's outliers parameter to 3.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3284
diff changeset
290 creator.addAttr(select, "defaultLabel", defaults[1], true);
630
40d3039f85ac ISSUE-40 (part I/II) Write values that the user had former selected / inserted into DESCRIBE document to preselect such data in the UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 624
diff changeset
291 }
40d3039f85ac ISSUE-40 (part I/II) Write values that the user had former selected / inserted into DESCRIBE document to preselect such data in the UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 624
diff changeset
292
2189
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
293 appendItems(artifact, creator, name, context, select);
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
294 ui.appendChild(select);
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
295 }
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
296
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
297 return ui;
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
298 }
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
299
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
300
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
301 /**
2189
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
302 * @param artifact
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
303 * @param creator
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
304 * @param name
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
305 * @param context
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
306 * @param select
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
307 */
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
308 protected void appendItems(
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
309 Artifact artifact,
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
310 ElementCreator creator,
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
311 String name,
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
312 CallContext context,
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
313 Element select
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
314 ) {
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
315 Element choices = ProtocolUtils.createArtNode(
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
316 creator, "choices", null, null);
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
317
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
318 select.appendChild(choices);
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
319
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
320 Element[] items = createItems(creator, artifact, name, context);
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
321 if (items != null) {
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
322 for (Element item: items) {
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
323 choices.appendChild(item);
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
324 }
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
325 }
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
326 }
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
327
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
328
19518116a49a Refactored some code in DefaultState to better override the base class.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2015
diff changeset
329 /**
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
330 * This method creates the root node that contains the list of selectable
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
331 * items.
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
332 *
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
333 * @param cr The ElementCreator.
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
334 *
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
335 * @return the root node of the item list.
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
336 */
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
337 protected Element createData(
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
338 ElementCreator cr,
313
89bd0417418f The location/distance state now writes default values into DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 306
diff changeset
339 Artifact artifact,
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
340 StateData data,
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
341 CallContext context)
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
342 {
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
343 Element select = ProtocolUtils.createArtNode(
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
344 cr, "select", null, null);
129
b06cd117b565 Appended a missing node to the DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 128
diff changeset
345 cr.addAttr(select, "name", data.getName(), true);
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
346
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
347 Element label = ProtocolUtils.createArtNode(
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
348 cr, "label", null, null);
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
349
129
b06cd117b565 Appended a missing node to the DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 128
diff changeset
350 select.appendChild(label);
b06cd117b565 Appended a missing node to the DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 128
diff changeset
351
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
352 label.setTextContent(Resources.getMsg(
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
353 context.getMeta(),
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
354 getID(),
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
355 getID()));
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
356
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
357 return select;
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
358 }
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
359
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
360
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
361 /**
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
362 * This method creates a list of items. These items represent the amount of
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
363 * input data that is possible for this state.
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
364 *
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
365 * @param cr The ElementCreator.
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
366 * @param name The name of the amount of data.
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
367 *
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
368 * @return a list of items.
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
369 */
660
627be3ca1ab6 code clean up in states
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 635
diff changeset
370 protected Element[] createItems(
1159
fb5a7ff9feb8 Suppress the GeoJSON string for the FloodMap creation to be included in the static DESCRIBE part.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1136
diff changeset
371 ElementCreator cr,
313
89bd0417418f The location/distance state now writes default values into DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 306
diff changeset
372 Artifact artifact,
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
373 String name,
660
627be3ca1ab6 code clean up in states
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 635
diff changeset
374 CallContext context
627be3ca1ab6 code clean up in states
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 635
diff changeset
375 ) {
627be3ca1ab6 code clean up in states
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 635
diff changeset
376 return null;
627be3ca1ab6 code clean up in states
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 635
diff changeset
377 }
135
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
378
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
379
322
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
380 /**
1180
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
381 * This method is used to create an <i>item</i> Element that contains two
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
382 * further elements <i>label</i> and <i>value</i>. The label and value
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
383 * elements both have text nodes.
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
384 *
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
385 * @param cr The ElementCreator used to build new Elements.
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
386 * @param obj This implementation awaits a String array with [0] = label and
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
387 * [1] = value.
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
388 *
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
389 * @return an Element.
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
390 */
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
391 protected Element createItem(XMLUtils.ElementCreator cr, Object obj) {
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
392 Element item = ProtocolUtils.createArtNode(cr, "item", null, null);
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
393 Element label = ProtocolUtils.createArtNode(cr, "label", null, null);
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
394 Element value = ProtocolUtils.createArtNode(cr, "value", null, null);
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
395
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
396 String[] arr = (String[]) obj;
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
397
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
398 label.setTextContent(arr[0]);
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
399 value.setTextContent(arr[1]);
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
400
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
401 item.appendChild(label);
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
402 item.appendChild(value);
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
403
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
404 return item;
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
405 }
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
406
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
407
1aba1a75beb2 Write the name of the selected waterlevels (used for the floodmap) into the static DESCRIBE.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1176
diff changeset
408 /**
1176
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
409 * This method transform a given value into a StateData object.
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
410 *
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
411 * @param flys The D4EArtifact.
1176
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
412 * @param name The name of the data object.
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
413 * @param val The value of the data object.
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
414 *
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
415 * @return a StateData object with <i>name</i> and <i>val</i>ue.
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
416 */
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
417 public StateData transform(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
418 D4EArtifact flys,
1176
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
419 CallContext cc,
2205
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
420 StateData stateData,
1176
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
421 String name,
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
422 String val
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
423 ) {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6052
diff changeset
424 if (log.isDebugEnabled()) {
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 6052
diff changeset
425 log.debug("Transform data ('" + name + "','" + val + "')");
3732
fe29b0226faf More iterator code simplification.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3414
diff changeset
426 }
2205
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
427
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
428 stateData.setValue(val);
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
429
a22e0cb6eace Format the timerange (static ui) inserted in the 'historical discharge curves' calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2189
diff changeset
430 return stateData;
1176
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
431 }
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
432
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
433
28154920e0b3 Introduced the possibility for States to transform/modify input before the data is added to FLYSArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1159
diff changeset
434 /**
322
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
435 * This method validates the inserted data and returns true, if everything
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
436 * was correct, otherwise an exception is thrown.
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
437 *
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
438 * @param artifact A reference to the owner artifact.
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
439 *
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
440 * @return true, if everything was fine.
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
441 */
1050
eccf966fb677 State engine: Removed CallContext from state validation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1029
diff changeset
442 public boolean validate(Artifact artifact)
322
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
443 throws IllegalArgumentException
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
444 {
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
445 return true;
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
446 }
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
447
448d0dc64357 The inserted ranges (distance and WQ ranges) are validated in the feed() operation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 313
diff changeset
448
1691
17648043429f Cosmetics, docs, annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1180
diff changeset
449 /**
17648043429f Cosmetics, docs, annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1180
diff changeset
450 * Returns which UIProvider shall be used to aid user input.
17648043429f Cosmetics, docs, annotations.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1180
diff changeset
451 */
135
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
452 protected String getUIProvider() {
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
453 return null;
2d6e02787d00 Added a method to retrieve the UIProvider for a state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 134
diff changeset
454 }
687
06689035024c Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 669
diff changeset
455
1136
8da5f5a9ed3c Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1050
diff changeset
456
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
457 public Object computeAdvance(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
458 D4EArtifact artifact,
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
459 String hash,
742
c09c9e05ecfa Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 697
diff changeset
460 CallContext context,
c09c9e05ecfa Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 697
diff changeset
461 List<Facet> facets,
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
462 Object old
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
463 ) {
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
464 return null;
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
465 }
687
06689035024c Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 669
diff changeset
466
1136
8da5f5a9ed3c Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1050
diff changeset
467
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
468 public Object computeFeed(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
469 D4EArtifact artifact,
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
470 String hash,
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
471 CallContext context,
742
c09c9e05ecfa Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 697
diff changeset
472 List<Facet> facets,
697
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
473 Object old
b972eba2ed8a Removed ComputeCallback because this was thought too complicated. Fixed issue with facets not be re-generated if same state is entered again.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 687
diff changeset
474 ) {
687
06689035024c Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 669
diff changeset
475 return null;
06689035024c Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 669
diff changeset
476 }
941
1b509e4cf99b Added a computeInit() method to intialize data/facets after creating new artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 742
diff changeset
477
1136
8da5f5a9ed3c Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1050
diff changeset
478
941
1b509e4cf99b Added a computeInit() method to intialize data/facets after creating new artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 742
diff changeset
479 public Object computeInit(
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
480 D4EArtifact artifact,
941
1b509e4cf99b Added a computeInit() method to intialize data/facets after creating new artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 742
diff changeset
481 String hash,
958
ae198bef4ba0 Added configurations for river WMSe (currently for Saar, Mosel, Elbe).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 942
diff changeset
482 Object context,
941
1b509e4cf99b Added a computeInit() method to intialize data/facets after creating new artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 742
diff changeset
483 CallMeta meta,
1b509e4cf99b Added a computeInit() method to intialize data/facets after creating new artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 742
diff changeset
484 List<Facet> facets)
1b509e4cf99b Added a computeInit() method to intialize data/facets after creating new artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 742
diff changeset
485 {
1b509e4cf99b Added a computeInit() method to intialize data/facets after creating new artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 742
diff changeset
486 return null;
1b509e4cf99b Added a computeInit() method to intialize data/facets after creating new artifacts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 742
diff changeset
487 }
126
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
488 }
b18aebd1342f Added an abstract base class DefaultState for States.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
489 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org