Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java @ 870:dfd02f8d3602
Removed trailing whitespace.
gnv-artifacts/trunk@1010 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 28 Apr 2010 06:53:44 +0000 |
parents | 797a6264b89b |
children | c07d9f9a738c |
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 |
839
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
3 import java.text.DateFormat; |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
4 import java.text.SimpleDateFormat; |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
5 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 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
|
7 import java.util.Arrays; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 import java.util.Collection; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 import java.util.Date; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
10 import java.util.GregorianCalendar; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
11 import java.util.HashMap; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
12 import java.util.Iterator; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 import java.util.List; |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
14 import java.util.Locale; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 import java.util.Map; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
17 import javax.xml.xpath.XPathConstants; |
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
18 |
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
|
19 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
|
20 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 import org.apache.log4j.Logger; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 import org.w3c.dom.Document; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 import org.w3c.dom.Element; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
24 import org.w3c.dom.Node; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 import org.w3c.dom.NodeList; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 |
823
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
27 import de.intevation.artifactdatabase.Config; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
28 import de.intevation.artifactdatabase.XMLUtils; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
29 import de.intevation.artifacts.ArtifactNamespaceContext; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
30 import de.intevation.artifacts.CallContext; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
31 import de.intevation.artifacts.CallMeta; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
32 import de.intevation.gnv.artifacts.cache.CacheFactory; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
33 import de.intevation.gnv.artifacts.ressource.RessourceFactory; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
34 import de.intevation.gnv.geobackend.base.Result; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
35 import de.intevation.gnv.geobackend.base.query.QueryExecutor; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
36 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
37 import de.intevation.gnv.geobackend.base.query.exception.QueryException; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
38 import de.intevation.gnv.geobackend.util.DateUtils; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
39 import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
40 import de.intevation.gnv.state.describedata.KeyValueDescibeData; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
41 import de.intevation.gnv.state.describedata.MinMaxDescribeData; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
42 import de.intevation.gnv.state.describedata.NamedArrayList; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
43 import de.intevation.gnv.state.describedata.NamedCollection; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
44 import de.intevation.gnv.state.describedata.SingleValueDescribeData; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
45 import de.intevation.gnv.state.exception.StateException; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
46 import de.intevation.gnv.utils.ArtifactXMLUtilities; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
47 import de.intevation.gnv.utils.InputValidator; |
499cfbbb61bc
Removed obsolet SuppressWarnings-Annotations.
Tim Englich <tim.englich@intevation.de>
parents:
815
diff
changeset
|
48 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 /** |
796
a5526908f92f
Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
50 * This is the major implementation of <code>State</code>. Nearly every other |
a5526908f92f
Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
51 * state is derived by this class. |
a5526908f92f
Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
52 * |
780
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
53 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
54 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
55 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 public abstract class StateBase implements State { |
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 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
60 * The UID of this Class |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
61 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 private static final long serialVersionUID = 2411169179001645426L; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
63 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 * the logger, used to log exceptions and additonaly information |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
66 */ |
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
|
67 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
|
68 |
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
|
69 protected final static String MINVALUEFIELDNAME = "minvalue"; |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
70 |
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
|
71 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
|
72 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
73 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
|
74 |
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
|
75 public final static String DESCRIBEDATAKEY = "_DESCRIBEDATA"; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
76 |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
77 public final static String XPATH_STATIC_UI = "art:static"; |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
78 |
488
d265f5dc2979
Appended the selected fis to the describe document.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
481
diff
changeset
|
79 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
|
80 |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
81 public static final String EXCEPTION_NO_INPUT = "no.input.data"; |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
82 |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
83 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
|
84 "input.is.not.valid"; |
870
dfd02f8d3602
Removed trailing whitespace.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
845
diff
changeset
|
85 |
845
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
839
diff
changeset
|
86 public final static String HASH_ID_SEPARATOR = "#"; |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
87 |
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
|
88 /** 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
|
89 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
|
90 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
91 private String id = null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
92 |
609
22e65fb4c64a
Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
93 protected String hash; |
22e65fb4c64a
Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
94 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
95 private String description = null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
96 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
97 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
|
98 |
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
|
99 protected String preSettingsName = null; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
100 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
101 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
|
102 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
103 protected boolean dataNoSelect = false; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
104 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
105 protected String queryID = null; |
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 protected Collection<String> inputValueNames = null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
108 |
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
|
109 protected Map<String, InputValue> inputValues = null; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 |
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
|
111 protected State parent = null; |
335
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 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
|
114 |
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
|
115 protected Map<String, InputData> preSettings = null; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
116 |
839
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
117 |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
118 /** |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
119 * The source date format as string. |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
120 */ |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
121 public static String srcDateFormat = "yyyy.MM.dd hh:mm:ss"; |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
122 |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
123 |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
124 /** |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
125 * The source date format used to read string represented strings. |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
126 */ |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
127 public static DateFormat srcFormat; |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
128 |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
129 |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
130 static { |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
131 srcFormat = new SimpleDateFormat(srcDateFormat); |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
132 } |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
133 |
ac5988f27714
Added the time interval into the subtitle of timeseries charts (issue152).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
836
diff
changeset
|
134 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
135 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
136 * Constructor |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
137 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
138 public StateBase() { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
139 super(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
140 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
141 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
142 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
143 public String getID() { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
144 return this.id; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
145 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
146 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
147 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
148 public String getDescription() { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
149 return this.description; |
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 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
152 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
153 public Collection<InputValue> getRequiredInputValues() { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
154 return this.inputValues.values(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
155 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
156 |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
157 |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
158 public void reset(String uuid) { |
614
e80e37b78302
Repaired broken step-back-history.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
612
diff
changeset
|
159 inputData.remove(dataName); |
470
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
160 } |
b7bb66440cc8
Added mechanism for advancing to previous states.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
464
diff
changeset
|
161 |
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
|
162 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
163 public void setup(Node configuration) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
164 this.id = ((Element)configuration).getAttribute("id"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
165 this.description = ((Element)configuration).getAttribute("description"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
166 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
167 log.info("State-ID = " + this.id); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
168 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
169 NodeList inputValuesNodes = Config.getNodeSetXPath(configuration, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
170 "inputvalues/inputvalue"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
171 this.inputValues = new HashMap<String, InputValue>(inputValuesNodes |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
172 .getLength()); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
173 this.inputValueNames = new ArrayList<String>(inputValuesNodes |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
174 .getLength()); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
175 for (int i = 0; i < inputValuesNodes.getLength(); i++) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
176 Element inputValueNode = (Element)inputValuesNodes.item(i); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
177 String usedinQueryValue = inputValueNode.getAttribute("usedinquery"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
178 int usedinQuery = 1; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
179 if (usedinQueryValue != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
180 try { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
181 usedinQuery = Integer.parseInt(usedinQueryValue); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
182 } catch (NumberFormatException e) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
183 log |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
184 .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
|
185 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
186 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
187 InputValue inputValue = new DefaultInputValue(inputValueNode.getAttribute("name"), |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
188 inputValueNode.getAttribute("type"), |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
189 Boolean.parseBoolean(inputValueNode. |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
190 getAttribute("multiselect")), usedinQuery); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
191 this.inputValues.put(inputValue.getName(), inputValue); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
192 this.inputValueNames.add(inputValue.getName()); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
193 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
194 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
195 this.queryID = Config.getStringXPath(configuration, "queryID"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
196 log.info("QueryID ==> " + this.queryID); |
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 this.dataName = Config.getStringXPath(configuration, "dataname"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
199 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
200 String dataMultiSelectValue = Config.getStringXPath(configuration, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
201 "data-multiselect"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
202 if (dataMultiSelectValue != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
203 this.dataMultiSelect = Boolean.parseBoolean(dataMultiSelectValue); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
204 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
205 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
206 String dataNoSelectValue =Config.getStringXPath(configuration, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
207 "data-noselect"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
208 if (dataNoSelectValue != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
209 this. dataNoSelect = Boolean.parseBoolean(dataNoSelectValue); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
210 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
211 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
212 this.preSettingsName = Config.getStringXPath(configuration, "presettings-name"); |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
213 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
214 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
215 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
216 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
217 public State getParent() { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
218 return this.parent; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
219 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
220 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
221 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
222 public void setParent(State state) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
223 this.parent = state; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
224 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
225 |
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
|
226 |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
227 public Document feed( |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
228 CallContext context, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
229 Collection<InputData> inputData, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
230 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
|
231 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
|
232 { |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
233 RessourceFactory resFactory = RessourceFactory.getInstance(); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
234 Locale[] serverLocales = resFactory.getLocales(); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
235 Locale locale = context.getMeta().getPreferredLocale( |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
236 serverLocales); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
237 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
238 if (inputData != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
239 Iterator<InputData> it = inputData.iterator(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
240 InputValidator iv = new InputValidator(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
241 while (it.hasNext()) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
242 InputData tmpItem = it.next(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
243 InputValue inputValue = this.inputValues.get(tmpItem.getName()); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
244 if (inputValue != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
245 if (this.inputData == null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
246 this.inputData = new HashMap<String, InputData>( |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
247 inputData.size()); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
248 } |
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
|
249 |
796
a5526908f92f
Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
250 boolean valid = InputValidator.isInputValid(tmpItem.getValue(), |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
251 inputValue.getType()); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
252 if (valid) { |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
253 |
763
e4d1fded433b
Bugfix: The Description of an InputData-Object will now only be fetched if
Tim Englich <tim.englich@intevation.de>
parents:
759
diff
changeset
|
254 if (tmpItem.getName().equals(this.dataName)){ |
e4d1fded433b
Bugfix: The Description of an InputData-Object will now only be fetched if
Tim Englich <tim.englich@intevation.de>
parents:
759
diff
changeset
|
255 String[] desc = getDescriptionForInputData(tmpItem, uuid); |
e4d1fded433b
Bugfix: The Description of an InputData-Object will now only be fetched if
Tim Englich <tim.englich@intevation.de>
parents:
759
diff
changeset
|
256 tmpItem.setDescription(desc); |
e4d1fded433b
Bugfix: The Description of an InputData-Object will now only be fetched if
Tim Englich <tim.englich@intevation.de>
parents:
759
diff
changeset
|
257 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
258 this.inputData.put(tmpItem.getName(), tmpItem); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
259 } else { |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
260 String msg = resFactory.getRessource( |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
261 locale, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
262 EXCEPTION_INVALID_INPUT, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
263 EXCEPTION_INVALID_INPUT); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
264 log.warn(msg); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
265 return feedFailure(msg); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
266 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
267 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
268 } else { |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
269 String msg = resFactory.getRessource( |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
270 locale, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
271 EXCEPTION_INVALID_INPUT, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
272 EXCEPTION_INVALID_INPUT); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
273 log.warn(msg); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
274 return feedFailure(msg); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
275 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
276 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
277 } |
725
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 return feedSuccess(); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
280 } else { |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
281 String msg = resFactory.getRessource( |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
282 locale, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
283 EXCEPTION_NO_INPUT, |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
284 EXCEPTION_NO_INPUT); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
285 log.warn(msg); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
286 return feedFailure(msg); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
287 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
288 } |
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
|
289 |
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 |
725
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
291 protected Document feedSuccess() { |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
292 return ArtifactXMLUtilities.createSuccessReport( |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
293 "Initialize success", XMLUtils.newDocument()); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
294 } |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
295 |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
296 |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
297 protected Document feedFailure(String msg) { |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
298 return ArtifactXMLUtilities.createInputExceptionReport( |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
299 msg, XMLUtils.newDocument()); |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
300 } |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
301 |
dde7f51dbe1e
Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
652
diff
changeset
|
302 |
736
b8c7105f2b94
Revoke Changes of r771 and override affected Methods in DefaultAutoResumeState
Tim Englich <tim.englich@intevation.de>
parents:
733
diff
changeset
|
303 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
|
304 // 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
|
305 Object obj = getDescibeData(uuid).get(0); |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
306 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
|
307 |
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
|
308 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
|
309 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
|
310 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
|
311 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
|
312 |
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
|
313 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
|
314 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
|
315 |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
316 // 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
|
317 // 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
|
318 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
|
319 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
|
320 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
|
321 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
|
322 |
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
|
323 // 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
|
324 // '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
|
325 // 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
|
326 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
|
327 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
|
328 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
|
329 tmp.add(selected.get(j)); |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
330 } |
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
|
331 |
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
|
332 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
|
333 } |
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
|
334 } |
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
|
335 } |
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
|
336 |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
337 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
|
338 } |
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
|
339 |
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
|
340 |
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
|
341 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
|
342 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
|
343 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
|
344 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
|
345 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
|
346 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
|
347 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
|
348 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
|
349 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
|
350 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
|
351 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
|
352 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
|
353 } |
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 |
796
a5526908f92f
Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
355 boolean valid = InputValidator.isInputValid(tmpItem.getValue(), |
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
|
356 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
|
357 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
|
358 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
|
359 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
|
360 String maxValue = this.getInputValue4ID(inputData, MAXVALUEFIELDNAME); |
796
a5526908f92f
Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
361 valid = InputValidator.isInputValid(maxValue,inputValue.getType()); |
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
|
362 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
|
363 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
|
364 + " 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
|
365 + " 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
|
366 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
|
367 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
|
368 } |
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 |
796
a5526908f92f
Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
370 valid = InputValidator.isInputValid(minValue, |
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
|
371 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
|
372 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
|
373 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
|
374 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
|
375 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
|
376 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
|
377 } |
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 }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
|
379 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
|
380 String maxValue = tmpItem.getValue(); |
796
a5526908f92f
Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
381 valid = InputValidator.isInputValid(minValue,inputValue.getType()); |
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
|
382 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
|
383 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
|
384 + " 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
|
385 + " 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
|
386 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
|
387 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
|
388 } |
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 |
796
a5526908f92f
Added javadoc in state package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
390 valid = InputValidator.isInputValid(minValue, |
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
|
391 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
|
392 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
|
393 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
|
394 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
|
395 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
|
396 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
|
397 } |
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 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
|
400 } 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
|
401 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
|
402 + " 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
|
403 + " 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
|
404 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
|
405 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
|
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 } 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
|
409 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
|
410 + 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
|
411 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
|
412 |
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
|
413 } |
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
|
414 } |
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
|
415 } 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
|
416 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
|
417 } |
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
|
418 |
609
22e65fb4c64a
Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
419 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
|
420 } |
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
|
421 |
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
|
422 |
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
|
423 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
|
424 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
|
425 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
426 |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
427 |
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
|
428 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
|
429 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
|
430 } |
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
|
431 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
432 |
610
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
609
diff
changeset
|
433 protected String getInputValue4ID(Collection<InputData> inputData, String inputName){ |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
434 Iterator<InputData> it = inputData.iterator(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
435 while (it.hasNext()) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
436 InputData tmpItem = it.next(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
437 if (tmpItem.getName().equals(inputName)){ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
438 return tmpItem.getValue(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
439 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
440 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
441 return null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
442 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
443 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
444 |
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
|
445 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
|
446 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
|
447 { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
448 } |
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
|
449 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
450 |
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
|
451 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
|
452 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
|
453 { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
454 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
455 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
456 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
457 protected String[] generateFilterValuesFromInputData() { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
458 List<String> list = new ArrayList<String>(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
459 Iterator<String> it = this.inputValueNames.iterator(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
460 while (it.hasNext()) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
461 String value = it.next(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
462 InputData data = this.inputData.get(value); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
463 if (data != null |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
464 && this.inputValues.containsKey(data.getName())) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
465 int size = this.inputValues.get(data.getName()) |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
466 .usedInQueries(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
467 String type = this.inputValues.get(data.getName()) |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
468 .getType(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
469 String requestValue = data.getValue(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
470 if (type.equalsIgnoreCase("string")) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
471 requestValue = this |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
472 .prepareInputData4DBQuery(requestValue); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
473 } else if (type.equalsIgnoreCase("date")) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
474 requestValue = this |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
475 .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
|
476 } 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
|
477 requestValue = this |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
478 .prepareInputData4RegionDBQuery(requestValue); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
479 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
480 for (int j = 0; j < size; j++) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
481 list.add(requestValue); |
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 } |
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
|
485 String[] filterValues = list.toArray(new String[list.size()]); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
486 return filterValues; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
487 } |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
488 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
489 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
490 protected String prepareInputData4RegionDBQuery(String value){ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
491 return value; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
492 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
493 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
494 private String prepareInputData4DateDBQuery(String value) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
495 if (value != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
496 String[] values = value.split(","); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
497 String newValue = ""; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
498 for (int i = 0; i < values.length; i++) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
499 if (newValue.length() > 0) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
500 newValue = 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 // TODO JUST HACK FIND A BETTER RESOLUTION |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
503 newValue = newValue + "to_date('" + values[i].trim() |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
504 + "', 'YYYY.MM.DD HH24:MI:SS')"; |
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 return newValue; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
507 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
508 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
509 return value; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
510 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
511 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
512 private String prepareInputData4DBQuery(String value) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
513 if (value != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
514 String[] values = value.split(","); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
515 String newValue = ""; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
516 for (int i = 0; i < values.length; i++) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
517 if (newValue.length() > 0) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
518 newValue = newValue + " , "; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
519 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
520 newValue = newValue + "'" + values[i].trim() + "'"; |
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 return newValue; |
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 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
525 return value; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
526 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
527 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
528 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
529 |
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
|
530 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
|
531 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
|
532 |
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 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
|
534 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
|
535 |
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
|
536 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
|
537 |
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
|
538 return describeData; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
539 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
540 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
541 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
542 protected NamedCollection<KeyValueDescibeData> extractKVP(Collection<Result> result, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
543 String keyid, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
544 String valueid) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
545 Iterator<Result> rit = result.iterator(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
546 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
|
547 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
548 NamedCollection<KeyValueDescibeData> keyValueDescibeData = new NamedArrayList<KeyValueDescibeData>( |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
549 this.dataName, dataSize); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
550 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
|
551 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
552 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
|
553 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
|
554 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
|
555 "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
|
556 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
|
557 )); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
558 } |
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
|
559 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
560 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
|
561 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
|
562 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
|
563 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
|
564 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
|
565 (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
|
566 ? 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
|
567 : 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
|
568 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
|
569 |
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
|
570 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
|
571 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
|
572 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
|
573 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
574 while (rit.hasNext()) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
575 Result resultValue = rit.next(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
576 if (!initialized){ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
577 keyPos = resultValue.getResultDescriptor().getColumnIndex(keyid); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
578 valuePos = resultValue.getResultDescriptor().getColumnIndex(valueid); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
579 if (valuePos < 0){ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
580 valuePos = 1; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
581 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
582 initialized = true; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
583 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
584 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
|
585 |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
586 // TODO: FIXME: We have to do that because the arcsde does not |
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
|
587 // support a distinct Query on Layers. |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
588 if (previousKey == null || !tmpKey.equals(previousKey)){ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
589 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
|
590 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
|
591 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
|
592 new DefaultKeyValueDescribeData( |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
763
diff
changeset
|
593 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
|
594 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
|
595 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
|
596 ); |
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
|
597 } |
335
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 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
600 return keyValueDescibeData; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
601 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
602 |
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
|
603 |
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 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
|
605 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
|
606 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
|
607 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
|
608 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
|
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 |
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 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
|
613 } |
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
|
614 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
615 |
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
|
616 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
|
617 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
|
618 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
|
619 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
|
620 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
|
621 { |
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 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
|
623 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
|
624 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
|
625 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
|
626 ); |
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 |
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.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
|
629 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
|
630 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
|
631 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
|
632 ); |
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 |
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 // 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
|
635 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
|
636 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
|
637 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
|
638 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
|
639 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
|
640 ); |
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 |
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 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
|
643 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
|
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 // 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
|
646 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
|
647 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
|
648 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
|
649 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
|
650 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
|
651 ); |
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 |
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
|
653 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
|
654 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
|
655 ((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
|
656 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
|
657 } |
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
|
658 } |
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
|
659 |
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
|
660 |
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 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
|
662 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
|
663 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
|
664 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
|
665 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
|
666 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
|
667 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
|
668 { |
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 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
|
670 |
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
|
671 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
|
672 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
|
673 |
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
|
674 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
|
675 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
|
676 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
|
677 |
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 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
|
679 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
|
680 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
|
681 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
|
682 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
|
683 } |
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 } |
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 } |
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 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
|
690 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
|
691 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
|
692 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
|
693 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
|
694 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
|
695 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
|
696 { |
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 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
|
698 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
|
699 ((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
|
700 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
|
701 } |
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 |
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 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
|
704 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
|
705 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
706 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
707 |
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
|
708 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
|
709 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
|
710 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
|
711 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
|
712 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
|
713 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
|
714 ) { |
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
|
715 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
|
716 |
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
|
717 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
|
718 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
|
719 } |
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
|
720 |
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
|
721 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
|
722 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
|
723 |
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
|
724 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
|
725 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
|
726 .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
|
727 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
|
728 |
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
|
729 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
|
730 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
|
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 |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
733 String[] descriptions = data.getDescription(); |
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
734 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
|
735 |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
736 for (int i = 0; i < size; i++) { |
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
737 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
|
738 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
|
739 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
|
740 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
|
741 |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
742 creator.addAttr(itemNode, "selected", "true"); |
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
743 |
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
744 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
|
745 choiceLableNode.setTextContent(desc); |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
746 itemNode.appendChild(choiceLableNode); |
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
747 |
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
748 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
|
749 choiceValueNode.setTextContent(value); |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
750 itemNode.appendChild(choiceValueNode); |
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
751 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
|
752 } |
615
01054ddccb0f
Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
614
diff
changeset
|
753 |
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
|
754 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
|
755 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
|
756 |
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 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
|
758 } |
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
|
759 |
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
|
760 |
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 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
|
762 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
|
763 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
|
764 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
|
765 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
|
766 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
|
767 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
|
768 ) { |
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
|
769 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
|
770 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
|
771 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
|
772 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
|
773 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
|
774 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
|
775 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
|
776 } 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
|
777 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
|
778 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
|
779 } |
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
|
780 |
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
|
781 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
|
782 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
|
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 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
|
785 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
|
786 .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
|
787 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
|
788 |
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 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
|
790 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
|
791 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
|
792 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
|
793 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
|
794 |
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 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
|
796 itemNode.setAttribute("selected", "true"); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
797 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
798 |
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
|
799 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
|
800 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
|
801 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
|
802 |
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
|
803 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
|
804 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
|
805 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
|
806 choiceNode.appendChild(itemNode); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
807 } |
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
|
808 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
|
809 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
|
810 |
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 dynamicNode.appendChild(selectNode); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
812 } |
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
|
813 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
|
814 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
|
815 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
|
816 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
|
817 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
|
818 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
|
819 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
|
820 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
|
821 } |
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 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
|
823 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
|
824 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
|
825 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
|
826 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
|
827 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
|
828 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
|
829 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
|
830 } |
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 } |
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 |
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 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
|
835 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
|
836 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
|
837 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
|
838 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
|
839 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
|
840 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
|
841 ) { |
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
|
842 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
|
843 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
|
844 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
|
845 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
|
846 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
|
847 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
|
848 } |
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 |
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 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
|
851 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
|
852 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
|
853 } |
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 |
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
|
855 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
|
856 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
|
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 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
|
859 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
|
860 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
|
861 .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
|
862 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
|
863 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
|
864 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
|
865 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
|
866 |
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
|
867 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
|
868 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
|
869 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
|
870 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
|
871 .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
|
872 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
|
873 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
|
874 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
|
875 |
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
|
876 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
|
877 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
|
878 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
|
879 |
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
|
880 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
|
881 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
|
882 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
|
883 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
|
884 .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
|
885 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
|
886 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
|
887 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
|
888 |
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
|
889 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
|
890 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
|
891 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
|
892 |
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 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
|
894 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
|
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 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
|
897 } |
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 |
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 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
|
901 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
|
902 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
|
903 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
|
904 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
|
905 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
|
906 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
|
907 ) { |
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
|
908 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
|
909 |
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
|
910 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
|
911 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
|
912 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
|
913 |
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
|
914 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
|
915 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
|
916 .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
|
917 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
|
918 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
|
919 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
|
920 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
|
921 |
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
|
922 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
|
923 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
|
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 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
|
926 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
|
927 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
|
928 |
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
|
929 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
|
930 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
|
931 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
|
932 |
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 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
|
934 |
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 node.appendChild(groupNode); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
936 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
937 |
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
|
938 |
609
22e65fb4c64a
Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
939 protected void setHash(String uuid) { |
845
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
839
diff
changeset
|
940 this.hash = uuid + |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
839
diff
changeset
|
941 HASH_ID_SEPARATOR + |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
839
diff
changeset
|
942 id + |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
839
diff
changeset
|
943 HASH_ID_SEPARATOR + |
797a6264b89b
Integrated the CacheCleaner for the ThematicDataCache
Tim Englich <tim.englich@intevation.de>
parents:
839
diff
changeset
|
944 inputData.hashCode(); |
609
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 |
22e65fb4c64a
Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
948 protected String getHash() { |
22e65fb4c64a
Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
949 return this.hash; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
950 } |
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
|
951 |
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
|
952 |
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
|
953 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
|
954 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
|
955 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
|
956 // we use a cache |
609
22e65fb4c64a
Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
957 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
|
958 Cache cache = factory.getCache(); |
609
22e65fb4c64a
Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
959 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
|
960 |
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
|
961 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
|
962 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
|
963 // 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
|
964 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
|
965 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
|
966 } |
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 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
|
968 // 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
|
969 // 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
|
970 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
|
971 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
|
972 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
|
973 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
|
974 |
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 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
|
976 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
|
977 } |
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 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
|
979 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
|
980 } |
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 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
982 } |
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
|
983 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
|
984 // 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
|
985 // single time |
609
22e65fb4c64a
Improved hash creation in each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
986 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
|
987 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
|
988 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
|
989 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
|
990 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
|
991 } |
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 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
|
993 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
|
994 } |
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 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
|
996 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
|
997 } |
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 } |
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 return null; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1001 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1002 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
1003 |
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
|
1004 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
|
1005 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
|
1006 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
|
1007 |
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 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
|
1009 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
|
1010 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
|
1011 |
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 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
|
1013 } |
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 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
|
1015 } |
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 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
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 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
1023 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1024 public Collection<InputData> getInputData() throws StateException { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1025 return this.inputData != null ? this.inputData.values() : null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1026 } |
481
20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
473
diff
changeset
|
1027 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
diff
changeset
|
1028 |
740
0563389138bb
Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
736
diff
changeset
|
1029 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
|
1030 State state = this; |
0563389138bb
Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
736
diff
changeset
|
1031 |
0563389138bb
Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
736
diff
changeset
|
1032 while (state != null) { |
0563389138bb
Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
736
diff
changeset
|
1033 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
|
1034 if (data != null) { |
0563389138bb
Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
736
diff
changeset
|
1035 return data; |
0563389138bb
Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
736
diff
changeset
|
1036 } |
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 state = state.getParent(); |
0563389138bb
Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
736
diff
changeset
|
1039 } |
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 return null; |
0563389138bb
Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
736
diff
changeset
|
1042 } |
0563389138bb
Changed source of displayed coordinate in 'HorizontalProfil'-charts' subtitle (issue120).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
736
diff
changeset
|
1043 |
815
22c18083225e
Removed compiler warnings while JavaDoc generation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
803
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 } |
759
93489a0c1328
Added a cleanup mechanism to do some things before an artifact is being exported (issue208).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
745
diff
changeset
|
1047 |
93489a0c1328
Added a cleanup mechanism to do some things before an artifact is being exported (issue208).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
745
diff
changeset
|
1048 |
93489a0c1328
Added a cleanup mechanism to do some things before an artifact is being exported (issue208).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
745
diff
changeset
|
1049 public void cleanup(Object context) { |
93489a0c1328
Added a cleanup mechanism to do some things before an artifact is being exported (issue208).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
745
diff
changeset
|
1050 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1051 } |
836
05bf8534a35a
Using unix line endings only.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
823
diff
changeset
|
1052 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |