annotate gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java @ 745:d194939ecbaf

Improvement: Values of Type Geometry which are Points will be prepared as Regions for DB-Query. gnv-artifacts/trunk@785 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 16 Mar 2010 12:53:37 +0000
parents 0563389138bb
children 93489a0c1328
rev   line source
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 package de.intevation.gnv.state;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
3 import java.util.ArrayList;
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
4 import java.util.Arrays;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
5 import java.util.Collection;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
6 import java.util.Date;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
7 import java.util.GregorianCalendar;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
8 import java.util.HashMap;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9 import java.util.Iterator;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10 import java.util.List;
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
11 import java.util.Locale;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
12 import java.util.Map;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13
488
d265f5dc2979 Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
14 import javax.xml.xpath.XPathConstants;
d265f5dc2979 Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
15
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
16 import net.sf.ehcache.Cache;
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
17
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18 import org.apache.log4j.Logger;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19 import org.w3c.dom.Document;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 import org.w3c.dom.Element;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 import org.w3c.dom.Node;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22 import org.w3c.dom.NodeList;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23
733
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
24 import de.intevation.artifactdatabase.Config;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
25 import de.intevation.artifactdatabase.XMLUtils;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
26 import de.intevation.artifacts.ArtifactNamespaceContext;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
27 import de.intevation.artifacts.CallContext;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
28 import de.intevation.artifacts.CallMeta;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
29 import de.intevation.gnv.artifacts.cache.CacheFactory;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
30 import de.intevation.gnv.artifacts.ressource.RessourceFactory;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
31 import de.intevation.gnv.geobackend.base.Result;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
32 import de.intevation.gnv.geobackend.base.query.QueryExecutor;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
33 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
34 import de.intevation.gnv.geobackend.base.query.exception.QueryException;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
35 import de.intevation.gnv.geobackend.util.DateUtils;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
36 import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
37 import de.intevation.gnv.state.describedata.KeyValueDescibeData;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
38 import de.intevation.gnv.state.describedata.MinMaxDescribeData;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
39 import de.intevation.gnv.state.describedata.NamedArrayList;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
40 import de.intevation.gnv.state.describedata.NamedCollection;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
41 import de.intevation.gnv.state.describedata.SingleValueDescribeData;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
42 import de.intevation.gnv.state.exception.StateException;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
43 import de.intevation.gnv.utils.ArtifactXMLUtilities;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
44 import de.intevation.gnv.utils.InputValidator;
18dc6a99f4f4 Fixed NPE will using StateBase without a given Query.
Tim Englich <tim.englich@intevation.de>
parents: 725
diff changeset
45
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 /**
481
20dde2b6f1b5 Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 473
diff changeset
47 * @author Tim Englich (tim.englich@intevation.de)
20dde2b6f1b5 Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 473
diff changeset
48 * @author Ingo Weinzierl (ingo.weinzierl@intevation.de)
20dde2b6f1b5 Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 473
diff changeset
49 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de)
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
50 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
51 public abstract class StateBase implements State {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
52
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54 * The UID of this Class
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56 private static final long serialVersionUID = 2411169179001645426L;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
58 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
59 * the logger, used to log exceptions and additonaly information
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
60 */
630
a72ecacccc91 Changed cache initialization so that we can use GNV without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 623
diff changeset
61 private static Logger log = Logger.getLogger(StateBase.class);
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
62
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
63 protected final static String MINVALUEFIELDNAME = "minvalue";
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
64 protected final static String MAXVALUEFIELDNAME = "maxvalue";
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
65
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66 private final static String NODATASELECTIONKEY = "n/n";
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
67
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
68 public final static String DESCRIBEDATAKEY = "_DESCRIBEDATA";
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
69
488
d265f5dc2979 Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
70 public final static String XPATH_STATIC_UI = "art:static";
d265f5dc2979 Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
71 public final static String XPATH_DYNAMIC_UI = "art:dynamic";
d265f5dc2979 Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
72
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
73 public static final String EXCEPTION_NO_INPUT = "no.input.data";
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
74 public static final String EXCEPTION_INVALID_INPUT =
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
75 "input.is.not.valid";
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
76
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
77 /** input value names which should not be rendered from State itself */
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
78 public final static String[] BLACKLIST = {"sourceid", "fisname"};
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
79
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
80 private String id = null;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
81
609
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
82 protected String hash;
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
83
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
84 private String description = null;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
85
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
86 protected String dataName = null;
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
87
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
88 protected String preSettingsName = null;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
89
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
90 protected boolean dataMultiSelect = false;
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
91
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
92 protected boolean dataNoSelect = false;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
93
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
94 protected String queryID = null;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
95
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
96 protected Collection<String> inputValueNames = null;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
97
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
98 protected Map<String, InputValue> inputValues = null;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
99
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
100 protected State parent = null;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
101
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
102 protected Map<String, InputData> inputData = null;
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
103
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
104 protected Map<String, InputData> preSettings = null;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
105
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
106 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
107 * Constructor
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
108 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
109 public StateBase() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
110 super();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
111 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
112
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
113 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
114 * @see de.intevation.gnv.state.State#getID()
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
115 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
116 public String getID() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
117 return this.id;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
118 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
119
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
120 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
121 * @see de.intevation.gnv.state.State#getDescription()
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
122 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
123 public String getDescription() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
124 return this.description;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
125 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
126
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
127
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
128
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
129 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
130 * @see de.intevation.gnv.state.State#getRequiredInputValues()
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
131 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
132 public Collection<InputValue> getRequiredInputValues() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
133 return this.inputValues.values();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
134 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
135
470
b7bb66440cc8 Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 464
diff changeset
136
b7bb66440cc8 Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 464
diff changeset
137 public void reset(String uuid) {
614
e80e37b78302 Repaired broken step-back-history.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 612
diff changeset
138 inputData.remove(dataName);
470
b7bb66440cc8 Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 464
diff changeset
139 }
b7bb66440cc8 Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 464
diff changeset
140
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
141
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
142 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
143 * @see de.intevation.gnv.state.State#setup(org.w3c.dom.Node)
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
144 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
145 public void setup(Node configuration) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
146 this.id = ((Element)configuration).getAttribute("id");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
147 this.description = ((Element)configuration).getAttribute("description");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
148
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
149 log.info("State-ID = " + this.id);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
150
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
151 NodeList inputValuesNodes = Config.getNodeSetXPath(configuration,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
152 "inputvalues/inputvalue");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
153 this.inputValues = new HashMap<String, InputValue>(inputValuesNodes
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
154 .getLength());
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
155 this.inputValueNames = new ArrayList<String>(inputValuesNodes
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
156 .getLength());
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
157 for (int i = 0; i < inputValuesNodes.getLength(); i++) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
158 Element inputValueNode = (Element)inputValuesNodes.item(i);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
159 String usedinQueryValue = inputValueNode.getAttribute("usedinquery");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
160 int usedinQuery = 1;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
161 if (usedinQueryValue != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
162 try {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
163 usedinQuery = Integer.parseInt(usedinQueryValue);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
164 } catch (NumberFormatException e) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
165 log
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
166 .warn("Used in Query Value cannot be transformed into a Number");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
167 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
168 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
169 InputValue inputValue = new DefaultInputValue(inputValueNode.getAttribute("name"),
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
170 inputValueNode.getAttribute("type"),
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
171 Boolean.parseBoolean(inputValueNode.
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
172 getAttribute("multiselect")), usedinQuery);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
173 this.inputValues.put(inputValue.getName(), inputValue);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
174 this.inputValueNames.add(inputValue.getName());
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
175 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
176
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
177 this.queryID = Config.getStringXPath(configuration, "queryID");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
178 log.info("QueryID ==> " + this.queryID);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
179
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
180 this.dataName = Config.getStringXPath(configuration, "dataname");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
181
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
182 String dataMultiSelectValue = Config.getStringXPath(configuration,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
183 "data-multiselect");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
184 if (dataMultiSelectValue != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
185 this.dataMultiSelect = Boolean.parseBoolean(dataMultiSelectValue);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
186 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
187
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
188 String dataNoSelectValue =Config.getStringXPath(configuration,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
189 "data-noselect");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
190 if (dataNoSelectValue != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
191 this. dataNoSelect = Boolean.parseBoolean(dataNoSelectValue);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
192 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
193
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
194 this.preSettingsName = Config.getStringXPath(configuration, "presettings-name");
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
195
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
196 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
197
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
198 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
199 * @see de.intevation.gnv.state.State#getParent()
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
200 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
201 public State getParent() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
202 return this.parent;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
203 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
204
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
205 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
206 * @see de.intevation.gnv.state.State#setParent(de.intevation.gnv.state.State)
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
207 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
208 public void setParent(State state) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
209 this.parent = state;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
210 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
211
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
212
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
213 public Document feed(
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
214 CallContext context,
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
215 Collection<InputData> inputData,
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
216 String uuid)
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
217 throws StateException
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
218 {
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
219 RessourceFactory resFactory = RessourceFactory.getInstance();
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
220 Locale[] serverLocales = resFactory.getLocales();
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
221 Locale locale = context.getMeta().getPreferredLocale(
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
222 serverLocales);
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
223
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
224 if (inputData != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
225 Iterator<InputData> it = inputData.iterator();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
226 InputValidator iv = new InputValidator();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
227 while (it.hasNext()) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
228 InputData tmpItem = it.next();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
229 InputValue inputValue = this.inputValues.get(tmpItem.getName());
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
230 if (inputValue != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
231 if (this.inputData == null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
232 this.inputData = new HashMap<String, InputData>(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
233 inputData.size());
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
234 }
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
235
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
236 boolean valid = iv.isInputValid(tmpItem.getValue(),
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
237 inputValue.getType());
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
238 if (valid) {
736
b8c7105f2b94 Revoke Changes of r771 and override affected Methods in DefaultAutoResumeState
Tim Englich <tim.englich@intevation.de>
parents: 733
diff changeset
239 String[] desc = getDescriptionForInputData(tmpItem, uuid);
b8c7105f2b94 Revoke Changes of r771 and override affected Methods in DefaultAutoResumeState
Tim Englich <tim.englich@intevation.de>
parents: 733
diff changeset
240 tmpItem.setDescription(desc);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
241 this.inputData.put(tmpItem.getName(), tmpItem);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
242 } else {
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
243 String msg = resFactory.getRessource(
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
244 locale,
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
245 EXCEPTION_INVALID_INPUT,
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
246 EXCEPTION_INVALID_INPUT);
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
247 log.warn(msg);
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
248 return feedFailure(msg);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
249 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
250
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
251 } else {
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
252 String msg = resFactory.getRessource(
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
253 locale,
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
254 EXCEPTION_INVALID_INPUT,
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
255 EXCEPTION_INVALID_INPUT);
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
256 log.warn(msg);
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
257 return feedFailure(msg);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
258
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
259 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
260 }
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
261
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
262 return feedSuccess();
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
263 } else {
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
264 String msg = resFactory.getRessource(
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
265 locale,
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
266 EXCEPTION_NO_INPUT,
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
267 EXCEPTION_NO_INPUT);
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
268 log.warn(msg);
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
269 return feedFailure(msg);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
270 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
271 }
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
272
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
273
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
274 protected Document feedSuccess() {
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
275 return ArtifactXMLUtilities.createSuccessReport(
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
276 "Initialize success", XMLUtils.newDocument());
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
277 }
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
278
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
279
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
280 protected Document feedFailure(String msg) {
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
281 return ArtifactXMLUtilities.createInputExceptionReport(
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
282 msg, XMLUtils.newDocument());
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
283 }
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
284
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
285
736
b8c7105f2b94 Revoke Changes of r771 and override affected Methods in DefaultAutoResumeState
Tim Englich <tim.englich@intevation.de>
parents: 733
diff changeset
286 protected String[] getDescriptionForInputData(InputData data, String uuid) {
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
287 // there is only one element in the list, so take the first
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
288 Object obj = getDescibeData(uuid).get(0);
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
289 List descs = new ArrayList();
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
290
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
291 if (obj instanceof NamedArrayList) {
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
292 NamedArrayList list = (NamedArrayList) obj;
634
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
293 List selected = Arrays.asList(data.splitValue());
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
294 int size = list.size();
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
295
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
296 for (int i = 0; i < size; i++) {
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
297 KeyValueDescibeData kv = (KeyValueDescibeData) list.get(i);
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
298
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
299 // values are concatinated in InputData, so one InputData object can
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
300 // contain many input
634
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
301 String key = kv.getKey();
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
302 int idx = selected.indexOf(key);
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
303 if (idx >= 0) {
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
304 descs.add(kv.getValue());
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
305
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
306 // XXX Workarround: I just wanted to remove the element at
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
307 // 'idx' from selected, but for any reason this is not
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
308 // possible (throws an exception) (iw)
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
309 List tmp = new ArrayList();
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
310 for (int j = 0; j < selected.size(); j++) {
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
311 if (j != idx)
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
312 tmp.add(selected.get(j));
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
313 }
634
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
314
58c32df1a44d Improved the describe document so that we are able to render a measurement-parameter-matrix with these data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 630
diff changeset
315 selected = tmp;
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
316 }
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
317 }
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
318 }
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
319
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
320 return (String[]) descs.toArray(new String[descs.size()]);
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
321 }
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
322
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
323
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
324 /**
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
325 * @see de.intevation.gnv.state.State#putInputData(java.util.Collection)
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
326 */
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
327 public void putInputData(Collection<InputData> inputData, String uuid)
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
328 throws StateException {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
329 if (inputData != null) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
330 Iterator<InputData> it = inputData.iterator();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
331 InputValidator iv = new InputValidator();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
332 while (it.hasNext()) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
333 InputData tmpItem = it.next();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
334 InputValue inputValue = this.inputValues.get(tmpItem.getName());
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
335 if (inputValue != null) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
336 if (this.inputData == null) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
337 this.inputData = new HashMap<String, InputData>(
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
338 inputData.size());
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
339 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
340
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
341 boolean valid = iv.isInputValid(tmpItem.getValue(),
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
342 inputValue.getType());
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
343 if (valid) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
344 if (tmpItem.getName().equals(MINVALUEFIELDNAME)){
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
345 String minValue = tmpItem.getValue();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
346 String maxValue = this.getInputValue4ID(inputData, MAXVALUEFIELDNAME);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
347 valid = iv.isInputValid(maxValue,inputValue.getType());
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
348 if (!valid){
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
349 String errMsg = "Wrong input for " + tmpItem.getValue()
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
350 + " is not an " + inputValue.getType()
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
351 + " Value.";
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
352 log.warn(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
353 throw new StateException(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
354 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
355
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
356 valid = iv.isInputValid(minValue,
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
357 maxValue,
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
358 inputValue.getType());
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
359 if (!valid){
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
360 String errMsg = "MaxValue-Input is less than MinValue-Input ";
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
361 log.warn(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
362 throw new StateException(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
363 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
364 }else if (tmpItem.getName().equals(MAXVALUEFIELDNAME)){
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
365 String minValue = this.getInputValue4ID(inputData, MINVALUEFIELDNAME);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
366 String maxValue = tmpItem.getValue();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
367 valid = iv.isInputValid(minValue,inputValue.getType());
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
368 if (!valid){
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
369 String errMsg = "Wrong input for " + tmpItem.getValue()
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
370 + " is not an " + inputValue.getType()
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
371 + " Value.";
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
372 log.warn(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
373 throw new StateException(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
374 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
375
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
376 valid = iv.isInputValid(minValue,
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
377 maxValue,
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
378 inputValue.getType());
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
379 if (!valid){
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
380 String errMsg = "MaxValue-Input is less than MinValue-Input ";
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
381 log.warn(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
382 throw new StateException(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
383 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
384 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
385 this.inputData.put(tmpItem.getName(), tmpItem);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
386 } else {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
387 String errMsg = "Wrong input for " + tmpItem.getValue()
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
388 + " is not an " + inputValue.getType()
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
389 + " Value.";
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
390 log.warn(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
391 throw new StateException(errMsg);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
392 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
393
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
394 } else {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
395 String errMsg = "No Inputvalue given for Inputdata "
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
396 + tmpItem.getName();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
397 log.warn(errMsg + "Value will be ignored");
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
398
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
399 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
400 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
401 } else {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
402 log.warn("No Inputdata given");
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
403 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
404
609
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
405 setHash(uuid);
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
406 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
407
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
408
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
409 /**
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
410 *
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
411 * @see de.intevation.gnv.state.State#setPreSettings(java.util.Map)
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
412 */
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
413 public void setPreSettings(Map<String, InputData> preSettings) {
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
414 this.preSettings = preSettings;
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
415 }
612
e86d37008fd1 Added new Transition and State for using the PreSettingsValue for the decision if a Transition could be used
Tim Englich <tim.englich@intevation.de>
parents: 610
diff changeset
416
e86d37008fd1 Added new Transition and State for using the PreSettingsValue for the decision if a Transition could be used
Tim Englich <tim.englich@intevation.de>
parents: 610
diff changeset
417
e86d37008fd1 Added new Transition and State for using the PreSettingsValue for the decision if a Transition could be used
Tim Englich <tim.englich@intevation.de>
parents: 610
diff changeset
418
e86d37008fd1 Added new Transition and State for using the PreSettingsValue for the decision if a Transition could be used
Tim Englich <tim.englich@intevation.de>
parents: 610
diff changeset
419 public Map<String, InputData> getPreSettings() {
e86d37008fd1 Added new Transition and State for using the PreSettingsValue for the decision if a Transition could be used
Tim Englich <tim.englich@intevation.de>
parents: 610
diff changeset
420 return this.preSettings;
e86d37008fd1 Added new Transition and State for using the PreSettingsValue for the decision if a Transition could be used
Tim Englich <tim.englich@intevation.de>
parents: 610
diff changeset
421 }
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
422
610
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 609
diff changeset
423 protected String getInputValue4ID(Collection<InputData> inputData, String inputName){
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
424 Iterator<InputData> it = inputData.iterator();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
425 while (it.hasNext()) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
426 InputData tmpItem = it.next();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
427 if (tmpItem.getName().equals(inputName)){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
428 return tmpItem.getValue();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
429 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
430 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
431 return null;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
432 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
433
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
434
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
435 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
436 * @see de.intevation.gnv.state.State#advance(java.lang.String,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
437 * de.intevation.artifacts.CallMeta)
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
438 */
493
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 488
diff changeset
439 public void advance(String uuid, CallContext context)
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 488
diff changeset
440 throws StateException
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 488
diff changeset
441 {
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
442 }
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
443
493
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 488
diff changeset
444 public void initialize(String uuid, CallContext context)
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 488
diff changeset
445 throws StateException
cef17cc90fd0 Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 488
diff changeset
446 {
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
447 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
448
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
449 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
450 * @return
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
451 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
452 protected String[] generateFilterValuesFromInputData() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
453 List<String> list = new ArrayList<String>();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
454 Iterator<String> it = this.inputValueNames.iterator();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
455 while (it.hasNext()) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
456 String value = it.next();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
457 InputData data = this.inputData.get(value);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
458 if (data != null
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
459 && this.inputValues.containsKey(data.getName())) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
460 int size = this.inputValues.get(data.getName())
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
461 .usedInQueries();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
462 String type = this.inputValues.get(data.getName())
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
463 .getType();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
464 String requestValue = data.getValue();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
465 if (type.equalsIgnoreCase("string")) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
466 requestValue = this
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
467 .prepareInputData4DBQuery(requestValue);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
468 } else if (type.equalsIgnoreCase("date")) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
469 requestValue = this
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
470 .prepareInputData4DateDBQuery(requestValue);
745
d194939ecbaf Improvement: Values of Type Geometry which are Points will be prepared as Regions for DB-Query.
Tim Englich <tim.englich@intevation.de>
parents: 740
diff changeset
471 } else if (type.equalsIgnoreCase("coordinate") || (type.equalsIgnoreCase("geometry") && requestValue.toLowerCase().startsWith("point"))){
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
472 requestValue = this
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
473 .prepareInputData4RegionDBQuery(requestValue);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
474 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
475 for (int j = 0; j < size; j++) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
476 list.add(requestValue);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
477 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
478 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
479 }
428
88cd37c3b5e4 Adjusted sql queries and configuration for verticalcrosssection products. Some code refactoring and improved error handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 337
diff changeset
480 String[] filterValues = list.toArray(new String[list.size()]);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
481 return filterValues;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
482 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
483
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
484 protected String prepareInputData4RegionDBQuery(String value){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
485 return value;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
486 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
487
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
488 private String prepareInputData4DateDBQuery(String value) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
489 if (value != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
490 String[] values = value.split(",");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
491 String newValue = "";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
492 for (int i = 0; i < values.length; i++) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
493 if (newValue.length() > 0) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
494 newValue = newValue + " , ";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
495 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
496 // TODO JUST HACK FIND A BETTER RESOLUTION
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
497 newValue = newValue + "to_date('" + values[i].trim()
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
498 + "', 'YYYY.MM.DD HH24:MI:SS')";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
499 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
500 return newValue;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
501 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
502
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
503 return value;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
504 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
505
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
506 private String prepareInputData4DBQuery(String value) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
507 if (value != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
508 String[] values = value.split(",");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
509 String newValue = "";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
510 for (int i = 0; i < values.length; i++) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
511 if (newValue.length() > 0) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
512 newValue = newValue + " , ";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
513 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
514 newValue = newValue + "'" + values[i].trim() + "'";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
515 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
516 return newValue;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
517 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
518
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
519 return value;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
520
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
521 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
522
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
523 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
524 * @param result
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
525 */
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
526 protected List<Object> purifyResult(Collection<Result> result, String uuid) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
527 List<Object> describeData = new ArrayList<Object>();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
528
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
529 NamedCollection<KeyValueDescibeData> keyValueDescibeData =
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
530 extractKVP(result, "KEY", "VALUE");
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
531
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
532 describeData.add(keyValueDescibeData);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
533
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
534 return describeData;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
535 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
536
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
537 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
538 * @param result
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
539 * @return
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
540 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
541 protected NamedCollection<KeyValueDescibeData> extractKVP(Collection<Result> result,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
542 String keyid,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
543 String valueid) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
544 Iterator<Result> rit = result.iterator();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
545 int dataSize = (this.dataNoSelect ? result.size()+1 : result.size());
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
546
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
547 NamedCollection<KeyValueDescibeData> keyValueDescibeData = new NamedArrayList<KeyValueDescibeData>(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
548 this.dataName, dataSize);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
549 keyValueDescibeData.setMultiSelect(this.dataMultiSelect);
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
550
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
551 if (this.dataNoSelect){
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
552 keyValueDescibeData.add(new DefaultKeyValueDescribeData(
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
553 NODATASELECTIONKEY,
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
554 "No Selection",
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
555 getID()
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
556 ));
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
557 }
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
558
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
559 boolean initialized = false;
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
560 int keyPos = 0;
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
561 int valuePos = 1;
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
562 String previousKey = null;
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
563 InputData preSettingsData =
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
564 (this.preSettings != null && this.preSettingsName != null)
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
565 ? this.preSettings.get(this.preSettingsName)
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
566 : null;
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
567 boolean filterWithPresettings = preSettingsData != null;
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
568
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
569 List<String> preSettingValues = null;
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
570 if(filterWithPresettings){
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
571 preSettingValues = Arrays.asList(preSettingsData.splitValue());
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
572 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
573 while (rit.hasNext()) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
574 Result resultValue = rit.next();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
575 if (!initialized){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
576 keyPos = resultValue.getResultDescriptor().getColumnIndex(keyid);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
577 valuePos = resultValue.getResultDescriptor().getColumnIndex(valueid);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
578 if (valuePos < 0){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
579 valuePos = 1;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
580 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
581 initialized = true;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
582 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
583 String tmpKey = resultValue.getString(keyPos);
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
584
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
585 // TODO: FIXME: We have to do that because the arcsde does not
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
586 // support a distinct Query on Layers.
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
587 if (previousKey == null || !tmpKey.equals(previousKey)){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
588 previousKey = tmpKey;
598
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
589 if (!filterWithPresettings || preSettingValues.contains(tmpKey)){
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
590 keyValueDescibeData.add(
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
591 new DefaultKeyValueDescribeData(
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
592 tmpKey,
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
593 resultValue.getString(valuePos),
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
594 getID())
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
595 );
9681ac6b6527 Added the possibility to use the data which are send using the MapServer-Interface during the Workflow of the GNV-Artifacts.
Tim Englich <tim.englich@intevation.de>
parents: 493
diff changeset
596 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
597 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
598 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
599 return keyValueDescibeData;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
600 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
601
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
602
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
603 public static boolean inBlackList(String key) {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
604 int length = BLACKLIST.length;
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
605 for (int i = 0; i < length; i++) {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
606 if (BLACKLIST[i].equals(key)) {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
607 return true;
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
608 }
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
609 }
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
610
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
611 return false;
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
612 }
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
613
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
614 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
615 * @see de.intevation.gnv.state.State#describe(org.w3c.dom.Document,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
616 * org.w3c.dom.Node, de.intevation.artifacts.CallMeta,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
617 * java.lang.String)
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
618 */
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
619 public void describe(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
620 Document document,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
621 Node rootNode,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
622 CallContext context,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
623 String uuid)
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
624 {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
625 XMLUtils.ElementCreator xCreator = new XMLUtils.ElementCreator(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
626 document,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
627 XMLUtils.XFORM_URL,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
628 XMLUtils.XFORM_PREFIX
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
629 );
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
630
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
631 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
632 document,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
633 ArtifactNamespaceContext.NAMESPACE_URI,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
634 ArtifactNamespaceContext.NAMESPACE_PREFIX
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
635 );
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
636
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
637 // append dynamic node
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
638 Node dynamic = (Node) XMLUtils.xpath(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
639 rootNode,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
640 XPATH_DYNAMIC_UI,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
641 XPathConstants.NODE,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
642 ArtifactNamespaceContext.INSTANCE
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
643 );
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
644
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
645 describeDynamic(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
646 creator, xCreator, document, dynamic, context, uuid);
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
647
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
648 // append static nodes
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
649 Node staticNode = (Node) XMLUtils.xpath(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
650 rootNode,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
651 XPATH_STATIC_UI,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
652 XPathConstants.NODE,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
653 ArtifactNamespaceContext.INSTANCE
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
654 );
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
655
636
22cc12b1622c Take parent states only to describe static user interface part - not the current state itself.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 634
diff changeset
656 State parent = getParent();
22cc12b1622c Take parent states only to describe static user interface part - not the current state itself.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 634
diff changeset
657 if (parent != null && parent instanceof StateBase) {
22cc12b1622c Take parent states only to describe static user interface part - not the current state itself.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 634
diff changeset
658 ((StateBase) parent).describeStatic(
22cc12b1622c Take parent states only to describe static user interface part - not the current state itself.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 634
diff changeset
659 creator,xCreator, document, staticNode, context,uuid);
22cc12b1622c Take parent states only to describe static user interface part - not the current state itself.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 634
diff changeset
660 }
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
661 }
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
662
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
663
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
664 protected void describeDynamic(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
665 XMLUtils.ElementCreator artCreator,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
666 XMLUtils.ElementCreator creator,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
667 Document document,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
668 Node dynamic,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
669 CallContext context,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
670 String uuid)
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
671 {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
672 CallMeta callMeta = context.getMeta();
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
673
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
674 if (dataName == null)
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
675 return;
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
676
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
677 List<Object> descibeData = getDescibeData(uuid);
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
678 if (descibeData != null) {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
679 Iterator<Object> it = descibeData.iterator();
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
680
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
681 while (it.hasNext()) {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
682 Object o = it.next();
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
683 if ((!it.hasNext() && dataName != null)) {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
684 appendToDynamicNode(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
685 artCreator, creator, document, dynamic, callMeta, o);
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
686 }
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
687 }
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
688 }
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
689 }
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
690
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
691
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
692 protected void describeStatic(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
693 XMLUtils.ElementCreator artCreator,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
694 XMLUtils.ElementCreator creator,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
695 Document document,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
696 Node staticNode,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
697 CallContext context,
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
698 String uuid)
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
699 {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
700 State parent = getParent();
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
701 if (parent != null && parent instanceof StateBase) {
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
702 ((StateBase) parent).describeStatic(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
703 artCreator, creator, document, staticNode, context, uuid);
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
704 }
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
705
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
706 CallMeta callMeta = context.getMeta();
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
707 appendToStaticNode(artCreator, creator, document, staticNode, callMeta);
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
708 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
709
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
710
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
711 protected void appendToStaticNode(
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
712 XMLUtils.ElementCreator artCreator,
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
713 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
714 Document document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
715 Node staticNode,
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
716 CallMeta callMeta
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
717 ) {
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
718 InputData data = inputData.get(dataName);
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
719
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
720 if (data == null) {
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
721 return;
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
722 }
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
723
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
724 Element selectNode = creator.create("select1");
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
725 creator.addAttr(selectNode, "ref", dataName);
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
726
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
727 Element lableNode = creator.create("label");
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
728 lableNode.setTextContent(RessourceFactory.getInstance()
608
74dfb9346574 Added descriptions to the selected input data and use them for rendering the GUI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 607
diff changeset
729 .getRessource(callMeta.getLanguages(), dataName, dataName));
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
730 Element choiceNode = creator.create("choices");
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
731
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
732 artCreator.addAttr(
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
733 selectNode, "state", getID(), true
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
734 );
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
735
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
736 String[] descriptions = data.getDescription();
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
737 int size = descriptions.length;
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
738
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
739 for (int i = 0; i < size; i++) {
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
740 Element itemNode = creator.create("item");
637
154d158238d3 Display the selected value if there is no description avaible. WKT-strings will be displayed again (issue182).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 636
diff changeset
741 String value = data.getValue();
154d158238d3 Display the selected value if there is no description avaible. WKT-strings will be displayed again (issue182).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 636
diff changeset
742 String desc = descriptions[i];
154d158238d3 Display the selected value if there is no description avaible. WKT-strings will be displayed again (issue182).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 636
diff changeset
743 desc = desc == null ? value : desc;
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
744
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
745 creator.addAttr(itemNode, "selected", "true");
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
746
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
747 Element choiceLableNode = creator.create("label");
637
154d158238d3 Display the selected value if there is no description avaible. WKT-strings will be displayed again (issue182).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 636
diff changeset
748 choiceLableNode.setTextContent(desc);
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
749 itemNode.appendChild(choiceLableNode);
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
750
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
751 Element choiceValueNode = creator.create("value");
637
154d158238d3 Display the selected value if there is no description avaible. WKT-strings will be displayed again (issue182).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 636
diff changeset
752 choiceValueNode.setTextContent(value);
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
753 itemNode.appendChild(choiceValueNode);
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
754 choiceNode.appendChild(itemNode);
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
755 }
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 614
diff changeset
756
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
757 selectNode.appendChild(lableNode);
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
758 selectNode.appendChild(choiceNode);
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
759
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
760 staticNode.appendChild(selectNode);
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
761 }
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
762
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
763
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
764 protected void appendToDynamicNode(
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
765 XMLUtils.ElementCreator artCreator,
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
766 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
767 Document document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
768 Node dynamicNode,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
769 CallMeta callMeta,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
770 Object o
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
771 ) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
772 if (o instanceof Collection<?>) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
773 String name = null;
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
774 boolean multiselect = false;
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
775 if (o instanceof NamedCollection<?>) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
776 NamedCollection<?> nc = ((NamedCollection<?>) o);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
777 name = nc.getName();
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
778 multiselect = nc.isMultiSelect();
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
779 } else {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
780 Object[] names = this.inputValueNames.toArray();
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
781 name = names[names.length - 1].toString();
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
782 }
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
783
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
784 Element selectNode = creator.create(multiselect?"select":"select1");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
785 creator.addAttr(selectNode, "ref", name);
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
786
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
787 Element lableNode = creator.create("label");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
788 lableNode.setTextContent(RessourceFactory.getInstance()
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
789 .getRessource(callMeta.getLanguages(), name, name));
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
790 Element choiceNode = creator.create("choices");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
791
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
792 Collection<KeyValueDescibeData> values = (Collection<KeyValueDescibeData>) o;
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
793 Iterator<KeyValueDescibeData> resultIt = values.iterator();
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
794 while (resultIt.hasNext()) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
795 KeyValueDescibeData result = resultIt.next();
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
796 Element itemNode = creator.create("item");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
797
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
798 if (result.isSelected()) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
799 itemNode.setAttribute("selected", "true");
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
800 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
801
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
802 Element choiceLableNode = creator.create("label");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
803 choiceLableNode.setTextContent(result.getValue());
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
804 itemNode.appendChild(choiceLableNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
805
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
806 Element choicValueNode = creator.create("value");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
807 choicValueNode.setTextContent("" + result.getKey());
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
808 itemNode.appendChild(choicValueNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
809 choiceNode.appendChild(itemNode);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
810 }
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
811 selectNode.appendChild(lableNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
812 selectNode.appendChild(choiceNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
813
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
814 dynamicNode.appendChild(selectNode);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
815 }
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
816 else if (o instanceof MinMaxDescribeData) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
817 appendMinMaxDescribeData(
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
818 artCreator,
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
819 creator,
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
820 document,
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
821 dynamicNode,
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
822 callMeta,
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
823 o);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
824 }
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
825 else if (o instanceof SingleValueDescribeData) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
826 appendSingleValueDescribeData(
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
827 artCreator,
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
828 creator,
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
829 document,
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
830 dynamicNode,
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
831 callMeta,
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
832 o);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
833 }
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
834 }
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
835
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
836
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
837 protected void appendMinMaxDescribeData(
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
838 XMLUtils.ElementCreator artCreator,
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
839 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
840 Document document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
841 Node node,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
842 CallMeta callMeta,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
843 Object o
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
844 ) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
845 MinMaxDescribeData minMaxDescibeData = (MinMaxDescribeData) o;
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
846 Object min = minMaxDescibeData.getMinValue();
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
847 Object max = minMaxDescibeData.getMaxValue();
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
848 if (min instanceof GregorianCalendar) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
849 Date d = ((GregorianCalendar) min).getTime();
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
850 min = DateUtils.getPatternedDateAmer(d);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
851 }
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
852
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
853 if (max instanceof GregorianCalendar) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
854 Date d = ((GregorianCalendar) max).getTime();
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
855 max = DateUtils.getPatternedDateAmer(d);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
856 }
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
857
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
858 Element groupNode = creator.create("group");
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
859 artCreator.addAttr(groupNode, "state", minMaxDescibeData.getState(), true);
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
860
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
861 creator.addAttr(groupNode, "ref", minMaxDescibeData.getName());
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
862 Element groupNodeLableNode = creator.create("label");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
863 groupNodeLableNode.setTextContent(RessourceFactory
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
864 .getInstance().getRessource(
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
865 callMeta.getLanguages(),
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
866 minMaxDescibeData.getName(),
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
867 minMaxDescibeData.getName()));
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
868 groupNode.appendChild(groupNodeLableNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
869
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
870 Element inputMinNode = creator.create("input");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
871 creator.addAttr(inputMinNode, "ref", MINVALUEFIELDNAME);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
872 Element inputMinLableNode = creator.create("label");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
873 inputMinLableNode.setTextContent(RessourceFactory
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
874 .getInstance().getRessource(
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
875 callMeta.getLanguages(), MINVALUEFIELDNAME,
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
876 MINVALUEFIELDNAME));
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
877 inputMinNode.appendChild(inputMinLableNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
878
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
879 Element inputMinValueNode = creator.create("value");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
880 inputMinValueNode.setTextContent(min.toString());
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
881 inputMinNode.appendChild(inputMinValueNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
882
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
883 Element inputMaxNode = creator.create("input");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
884 creator.addAttr(inputMaxNode, "ref", MAXVALUEFIELDNAME);
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
885 Element inputMaxLableNode = creator.create("label");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
886 inputMaxLableNode.setTextContent(RessourceFactory
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
887 .getInstance().getRessource(
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
888 callMeta.getLanguages(), MAXVALUEFIELDNAME,
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
889 MAXVALUEFIELDNAME));
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
890 inputMaxNode.appendChild(inputMaxLableNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
891
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
892 Element inputMaxValueNode = creator.create("value");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
893 inputMaxValueNode.setTextContent(max.toString());
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
894 inputMaxNode.appendChild(inputMaxValueNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
895
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
896 groupNode.appendChild(inputMinNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
897 groupNode.appendChild(inputMaxNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
898
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
899 node.appendChild(groupNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
900 }
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
901
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
902
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
903 protected void appendSingleValueDescribeData(
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
904 XMLUtils.ElementCreator artCreator,
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
905 XMLUtils.ElementCreator creator,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
906 Document document,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
907 Node node,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
908 CallMeta callMeta,
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
909 Object o
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
910 ) {
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
911 SingleValueDescribeData svdb = (SingleValueDescribeData) o;
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
912
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
913 Element groupNode = creator.create("group");
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
914 artCreator.addAttr(groupNode, "state", svdb.getState(), true);
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
915 creator.addAttr(groupNode, "ref", svdb.getName());
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
916
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
917 Element groupNodeLableNode = creator.create("label");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
918 groupNodeLableNode.setTextContent(RessourceFactory
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
919 .getInstance().getRessource(
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
920 callMeta.getLanguages(),
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
921 svdb.getName(),
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
922 svdb.getName()));
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
923 groupNode.appendChild(groupNodeLableNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
924
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
925 Element inputNode = creator.create("input");
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
926 creator.addAttr(inputNode, "ref", svdb.getName());
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
927
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
928 Element inputLableNode = creator.create("label");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
929 inputLableNode.setTextContent("");
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
930 inputNode.appendChild(inputLableNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
931
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
932 Element inputValueNode = creator.create("value");
456
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
933 inputValueNode.setTextContent(svdb.getValue());
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
934 inputNode.appendChild(inputValueNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
935
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
936 groupNode.appendChild(inputNode);
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
937
b8080695ea62 Splitted code pathes of dynamic and static nodes. Static nodes contain the selected value only instead of transfering the whole stack of options again.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 428
diff changeset
938 node.appendChild(groupNode);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
939 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
940
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
941
609
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
942 protected void setHash(String uuid) {
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
943 this.hash = uuid + id + inputData.hashCode();
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
944 }
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
945
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
946
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
947 protected String getHash() {
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
948 return this.hash;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
949 }
605
e8ebdbc7f1e3 First step of removing the cache blob. The static part of the describe document will be created by using the input data stored at each state. Some TODOs left (see ChangeLog).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 598
diff changeset
950
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
951
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
952 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
953 * @see de.intevation.gnv.state.State#getDescibeData()
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
954 */
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
955 public List<Object> getDescibeData(String uuid) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
956 CacheFactory factory = CacheFactory.getInstance();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
957 if (factory.isInitialized()) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
958 // we use a cache
609
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
959 log.debug("Using cache.");
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
960 Cache cache = factory.getCache();
609
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
961 String key = getHash();
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
962
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
963 net.sf.ehcache.Element value = cache.get(key);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
964 if (value != null) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
965 // element already in cache, so return it.
609
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
966 log.debug("Found element in cache.");
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
967 return (List<Object>) (value.getObjectValue());
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
968 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
969 else {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
970 // element is not in cache yet, so we need to fetch data from
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
971 // database and put it into cache right now
609
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
972 log.debug("Element not in cache, we need to ask the database");
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
973 try {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
974 String[] filterValues = generateFilterValuesFromInputData();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
975 List<Object> data = queryDatabase(filterValues, uuid);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
976
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
977 cache.put(new net.sf.ehcache.Element(key, data));
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
978 return data;
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
979 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
980 catch (QueryException qe) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
981 log.error(qe, qe);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
982 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
983 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
984 }
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
985 else {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
986 // we don't use a cache, so we have to query the database every
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
987 // single time
609
22e65fb4c64a Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 608
diff changeset
988 log.debug("Not using cache.");
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
989 String[] filterValues = generateFilterValuesFromInputData();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
990 Collection<Result> result = null;
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
991 try {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
992 return queryDatabase(filterValues, uuid);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
993 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
994 catch (RuntimeException e) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
995 log.error(e, e);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
996 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
997 catch (QueryException e) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
998 log.error(e, e);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
999 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1000 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1001
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1002 return null;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1003 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1004
607
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1005 protected List<Object> queryDatabase(String[] filterValues, String uuid)
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1006 throws QueryException {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1007 Collection<Result> result = null;
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1008
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1009 if (queryID != null) {
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1010 QueryExecutor queryExecutor =
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1011 QueryExecutorFactory.getInstance().getQueryExecutor();
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1012
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1013 result = queryExecutor.executeQuery(queryID, filterValues);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1014 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1015 return purifyResult(result, uuid);
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1016 }
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1017
292fbcd5e9ac Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
1018
473
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
1019 public Map<String, InputData> inputData() {
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
1020 return inputData;
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
1021 }
a6a33ef35809 Added support to step back to previous states. Add state names to xform nodes in describe document and append old targets to list of reachable targets.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 470
diff changeset
1022
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1023 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1024 * @see de.intevation.gnv.state.State#getInputData()
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1025 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1026 public Collection<InputData> getInputData() throws StateException {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1027 return this.inputData != null ? this.inputData.values() : null;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1028 }
481
20dde2b6f1b5 Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 473
diff changeset
1029
740
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1030 public InputData getInputDataByName(String name) {
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1031 State state = this;
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1032
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1033 while (state != null) {
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1034 InputData data = state.inputData().get(name);
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1035 if (data != null) {
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1036 return data;
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1037 }
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1038
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1039 state = state.getParent();
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1040 }
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1041
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1042 return null;
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1043 }
0563389138bb Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 736
diff changeset
1044
481
20dde2b6f1b5 Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 473
diff changeset
1045 public void endOfLife(Object globalContext) {
20dde2b6f1b5 Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 473
diff changeset
1046 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1047 }
464
70df44021a9f Next step of changing the concept how to use the user interface. Adapted namespaces and replaced FISArtifact with a ProxyArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 461
diff changeset
1048 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org