Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 308:677da0e143cc
Added dependencies for esri and ibm libraries required for unit tests.
gnv-artifacts/trunk@366 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 24 Nov 2009 14:40:53 +0000 |
parents | ce408af0ee57 |
children | 251f16a083f8 |
rev | line source |
---|---|
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 package de.intevation.gnv.transition; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 import java.util.ArrayList; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
7 import java.util.Collection; |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
8 import java.util.Date; |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
9 import java.util.GregorianCalendar; |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
10 import java.util.HashMap; |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
11 import java.util.HashSet; |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
12 import java.util.Iterator; |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
79
diff
changeset
|
13 import java.util.List; |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
14 import java.util.Map; |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
15 import java.util.Set; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 import org.apache.log4j.Logger; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 import org.w3c.dom.Document; |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
19 import org.w3c.dom.Element; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 import org.w3c.dom.Node; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 import org.w3c.dom.NodeList; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.artifactdatabase.Config; |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
116
diff
changeset
|
24 import de.intevation.artifacts.CallMeta; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 import de.intevation.gnv.artifacts.GNVArtifactBase; |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
26 import de.intevation.gnv.artifacts.cache.CacheFactory; |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
116
diff
changeset
|
27 import de.intevation.gnv.artifacts.ressource.RessourceFactory; |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
28 import de.intevation.gnv.geobackend.base.Result; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
29 import de.intevation.gnv.geobackend.base.query.QueryExecutor; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
30 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
31 import de.intevation.gnv.geobackend.base.query.exception.QueryException; |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
32 import de.intevation.gnv.geobackend.util.DateUtils; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
33 import de.intevation.gnv.transition.describedata.DefaultKeyValueDescribeData; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
34 import de.intevation.gnv.transition.describedata.KeyValueDescibeData; |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
35 import de.intevation.gnv.transition.describedata.MinMaxDescribeData; |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
36 import de.intevation.gnv.transition.describedata.NamedArrayList; |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
37 import de.intevation.gnv.transition.describedata.NamedCollection; |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
79
diff
changeset
|
38 import de.intevation.gnv.transition.describedata.SingleValueDescribeData; |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
39 import de.intevation.gnv.transition.exception.TransitionException; |
76
2473440671ce
Integrate UI-Representation for Describe into the FISArtifact.
Tim Englich <tim.englich@intevation.de>
parents:
68
diff
changeset
|
40 import de.intevation.gnv.utils.ArtifactXMLUtilities; |
101
e01c163ea5b0
Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
41 import de.intevation.gnv.utils.InputValidator; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 * @author Tim Englich <tim.englich@intevation.de> |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
45 * |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 public abstract class TransitionBase implements Transition { |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
48 |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
49 /** |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
50 * The UID of this Class |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
51 */ |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
52 private static final long serialVersionUID = 2411169179001645426L; |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
53 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
54 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
55 * the logger, used to log exceptions and additonaly information |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 private static Logger log = Logger.getLogger(GNVArtifactBase.class); |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
58 |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
59 private final static String MINVALUEFIELDNAME = "minvalue"; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
60 private final static String MAXVALUEFIELDNAME = "maxvalue"; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
61 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
62 private final static String NODATASELECTIONKEY = "n/n"; |
220
ee2d4134d0b3
General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
63 |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
64 private final static String DESCRIBEDATAKEY = "_DESCRIBEDATA"; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
65 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
66 private String id = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
67 |
53
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
68 private String description = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
69 |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
79
diff
changeset
|
70 protected String dataName = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
71 |
116
820238357bab
Added Horizontal-Profile-Support for Meshes.
Tim Englich <tim.englich@intevation.de>
parents:
101
diff
changeset
|
72 protected boolean dataMultiSelect = false; |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
73 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
74 protected boolean dataNoSelect = false; |
53
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
75 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
76 protected String queryID = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
77 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
78 private Collection<String> reachableTransitions = null; |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
79 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
80 private Transition alternativeTransition = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
81 |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
82 protected Collection<String> inputValueNames = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
83 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
84 private Map<String, InputValue> inputValues = null; |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
85 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
86 private Transition parent = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
87 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
88 protected Map<String, InputData> inputData = null; |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
89 |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
90 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
91 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
92 * Constructor |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
93 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
94 public TransitionBase() { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
95 super(); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
96 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
97 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
98 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
99 * @see de.intevation.gnv.transition.Transition#getID() |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
100 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
101 public String getID() { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
102 return this.id; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
103 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
104 |
53
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
105 /** |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
106 * @see de.intevation.gnv.transition.Transition#getDescription() |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
107 */ |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
108 public String getDescription() { |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
109 return this.description; |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
110 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
111 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
113 * @see de.intevation.gnv.transition.Transition#reachableTransitions() |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
115 public Collection<String> reachableTransitions() { |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
116 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
117 if (this.couldAlternativeTransitionUsed()){ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
118 return this.alternativeTransition.reachableTransitions(); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
119 }else{ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
120 return this.reachableTransitions; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
121 } |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
122 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
123 } |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
124 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
125 /** |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
126 * @return |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
127 */ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
128 private boolean couldAlternativeTransitionUsed() { |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
129 // TODO das muss hier noch etwas freier gestaltet werden. |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
130 Object[] inputValues = this.inputValueNames.toArray(); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
131 String key = (String)inputValues[inputValues.length-1]; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
132 boolean returnValue= this.alternativeTransition != null && |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
133 this.inputData != null && |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
134 this.inputData.containsKey(key) && |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
135 this.inputData.get(key).getValue(). |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
136 equals(NODATASELECTIONKEY); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
137 return returnValue; |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
138 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
139 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
140 /** |
55
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
141 * @see de.intevation.gnv.transition.Transition#getRequiredInputValues() |
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
142 */ |
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
143 public Collection<InputValue> getRequiredInputValues() { |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
144 return this.inputValues.values(); |
55
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
145 } |
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
146 |
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
147 /** |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
148 * @see de.intevation.gnv.transition.Transition#setup(org.w3c.dom.Node) |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
149 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
150 public void setup(Node configuration) { |
118
5ebc059064a6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
151 log.debug("TransitionBase.setup"); |
204
734ac082c8d1
Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents:
195
diff
changeset
|
152 this.id = ((Element)configuration).getAttribute("id"); |
734ac082c8d1
Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents:
195
diff
changeset
|
153 this.description = ((Element)configuration).getAttribute("description"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
154 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
155 log.info("Transition-ID = " + this.id); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
156 NodeList nodes = Config.getNodeSetXPath(configuration, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
157 "reachableTransitions/transition"); |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
158 this.reachableTransitions = new ArrayList<String>(nodes.getLength()); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
159 for (int i = 0; i < nodes.getLength(); i++) { |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
160 String reachableTransition = nodes.item(i).getTextContent(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
161 log.info("ReachableTransition ==> " + reachableTransition); |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
162 this.reachableTransitions.add(reachableTransition); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
163 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
164 } |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
165 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
166 Node alternativeTransitionNode = Config.getNodeXPath(configuration, |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
167 "alternativeTransition/transition"); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
168 if (alternativeTransitionNode != null){ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
169 this.alternativeTransition = TransitionFactory.getInstance() |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
170 .createTransition(alternativeTransitionNode); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
171 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
172 NodeList inputValuesNodes = Config.getNodeSetXPath(configuration, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
173 "inputvalues/inputvalue"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
174 this.inputValues = new HashMap<String, InputValue>(inputValuesNodes |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
175 .getLength()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
176 this.inputValueNames = new ArrayList<String>(inputValuesNodes |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
177 .getLength()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
178 for (int i = 0; i < inputValuesNodes.getLength(); i++) { |
204
734ac082c8d1
Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents:
195
diff
changeset
|
179 Element inputValueNode = (Element)inputValuesNodes.item(i); |
734ac082c8d1
Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents:
195
diff
changeset
|
180 String usedinQueryValue = inputValueNode.getAttribute("usedinquery"); |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
79
diff
changeset
|
181 int usedinQuery = 1; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
182 if (usedinQueryValue != null) { |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
79
diff
changeset
|
183 try { |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
79
diff
changeset
|
184 usedinQuery = Integer.parseInt(usedinQueryValue); |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
79
diff
changeset
|
185 } catch (NumberFormatException e) { |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
186 log |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
187 .warn("Used in Query Value cannot be transformed into a Number"); |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
79
diff
changeset
|
188 } |
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
79
diff
changeset
|
189 } |
204
734ac082c8d1
Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents:
195
diff
changeset
|
190 InputValue inputValue = new DefaultInputValue(inputValueNode.getAttribute("name"), |
734ac082c8d1
Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents:
195
diff
changeset
|
191 inputValueNode.getAttribute("type"), |
734ac082c8d1
Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents:
195
diff
changeset
|
192 Boolean.parseBoolean(inputValueNode. |
734ac082c8d1
Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents:
195
diff
changeset
|
193 getAttribute("multiselect")), usedinQuery); |
56
737d8bf63701
Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents:
55
diff
changeset
|
194 log.debug(inputValue.toString()); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
195 this.inputValues.put(inputValue.getName(), inputValue); |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
196 this.inputValueNames.add(inputValue.getName()); |
55
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
197 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
198 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
199 this.queryID = Config.getStringXPath(configuration, "queryID"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
200 log.info("QueryID ==> " + this.queryID); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
201 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
202 this.dataName = Config.getStringXPath(configuration, "dataname"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
203 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
204 String dataMultiSelectValue = Config.getStringXPath(configuration, |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
205 "data-multiselect"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
206 if (dataMultiSelectValue != null) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
207 this.dataMultiSelect = Boolean.parseBoolean(dataMultiSelectValue); |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
208 } |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
209 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
210 String dataNoSelectValue =Config.getStringXPath(configuration, |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
211 "data-noselect"); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
212 if (dataNoSelectValue != null) { |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
213 this. dataNoSelect = Boolean.parseBoolean(dataNoSelectValue); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
214 } |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
215 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
216 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
217 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
218 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
219 * @see de.intevation.gnv.transition.Transition#getParent() |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
220 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
221 public Transition getParent() { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
222 return this.parent; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
223 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
224 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
225 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
226 * @see de.intevation.gnv.transition.Transition#setParent(de.intevation.gnv.transition.Transition) |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
227 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
228 public void setParent(Transition transition) { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
229 this.parent = transition; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
230 } |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
231 |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
232 /** |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
233 * @see de.intevation.gnv.transition.Transition#putInputData(java.util.Collection) |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
234 */ |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
235 public void putInputData(Collection<InputData> inputData, String uuid) |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
236 throws TransitionException { |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
237 log.debug("TransitionBase.putInputData"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
238 if (inputData != null) { |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
239 Iterator<InputData> it = inputData.iterator(); |
101
e01c163ea5b0
Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
240 InputValidator iv = new InputValidator(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
241 while (it.hasNext()) { |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
242 InputData tmpItem = it.next(); |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
243 InputValue inputValue = this.inputValues.get(tmpItem.getName()); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
244 if (inputValue != null) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
245 if (this.inputData == null) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
246 this.inputData = new HashMap<String, InputData>( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
247 inputData.size()); |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
248 } |
252
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
249 |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
250 boolean valid = iv.isInputValid(tmpItem.getValue(), |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
251 inputValue.getType()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
252 if (valid) { |
252
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
253 if (tmpItem.getName().equals(MINVALUEFIELDNAME)){ |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
254 String minValue = tmpItem.getValue(); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
255 String maxValue = this.getInputValue4ID(inputData, MAXVALUEFIELDNAME); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
256 valid = iv.isInputValid(maxValue,inputValue.getType()); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
257 if (!valid){ |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
258 String errMsg = "Wrong input for " + tmpItem.getValue() |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
259 + " is not an " + inputValue.getType() |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
260 + " Value."; |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
261 log.warn(errMsg); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
262 throw new TransitionException(errMsg); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
263 } |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
264 |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
265 valid = iv.isInputValid(minValue, |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
266 maxValue, |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
267 inputValue.getType()); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
268 if (!valid){ |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
269 String errMsg = "MaxValue-Input is less than MinValue-Input "; |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
270 log.warn(errMsg); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
271 throw new TransitionException(errMsg); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
272 } |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
273 }else if (tmpItem.getName().equals(MAXVALUEFIELDNAME)){ |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
274 String minValue = this.getInputValue4ID(inputData, MINVALUEFIELDNAME); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
275 String maxValue = tmpItem.getValue(); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
276 valid = iv.isInputValid(minValue,inputValue.getType()); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
277 if (!valid){ |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
278 String errMsg = "Wrong input for " + tmpItem.getValue() |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
279 + " is not an " + inputValue.getType() |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
280 + " Value."; |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
281 log.warn(errMsg); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
282 throw new TransitionException(errMsg); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
283 } |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
284 |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
285 valid = iv.isInputValid(minValue, |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
286 maxValue, |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
287 inputValue.getType()); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
288 if (!valid){ |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
289 String errMsg = "MaxValue-Input is less than MinValue-Input "; |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
290 log.warn(errMsg); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
291 throw new TransitionException(errMsg); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
292 } |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
293 } |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
294 this.setSelection(tmpItem, uuid); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
295 this.inputData.put(tmpItem.getName(), tmpItem); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
296 } else { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
297 String errMsg = "Wrong input for " + tmpItem.getValue() |
192
17987acf20d0
Correct misspelled Exception-Message as an Result of fixing issue35
Tim Englich <tim.englich@intevation.de>
parents:
190
diff
changeset
|
298 + " is not an " + inputValue.getType() |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
299 + " Value."; |
101
e01c163ea5b0
Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
300 log.warn(errMsg); |
e01c163ea5b0
Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
301 throw new TransitionException(errMsg); |
e01c163ea5b0
Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
302 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
303 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
304 } else { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
305 String errMsg = "No Inputvalue given for Inputdata " |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
306 + tmpItem.getName(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
307 log.warn(errMsg + "Value will be ignored"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
308 |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
309 } |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
310 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
311 } else { |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
312 log.warn("No Inputdata given"); |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
313 } |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
314 } |
252
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
315 |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
316 private String getInputValue4ID(Collection<InputData> inputData, String inputName){ |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
317 Iterator<InputData> it = inputData.iterator(); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
318 while (it.hasNext()) { |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
319 InputData tmpItem = it.next(); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
320 if (tmpItem.getName().equals(inputName)){ |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
321 return tmpItem.getValue(); |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
322 } |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
323 } |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
324 return null; |
f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
Tim Englich <tim.englich@intevation.de>
parents:
251
diff
changeset
|
325 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
326 |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
327 private void setSelection(InputData inputData, String uuid) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
328 log.debug("TransitionBase.setSelection"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
329 |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
330 Object o = this.getDescribeData(inputData.getName(),uuid); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
331 if (o != null) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
332 if (o instanceof Collection<?>) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
333 Collection<KeyValueDescibeData> values = (Collection<KeyValueDescibeData>) o; |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
334 |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
335 String value = inputData.getValue(); |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
336 String[] selectedValues = value.split(","); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
337 Set<String> selectedItems = new HashSet<String>( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
338 selectedValues.length); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
339 for (int i = 0; i < selectedValues.length; i++) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
340 selectedItems.add(selectedValues[i].trim()); |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
341 } |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
342 // Selektion umsetzen |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
343 Iterator<KeyValueDescibeData> it = values.iterator(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
344 while (it.hasNext()) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
345 KeyValueDescibeData data = it.next(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
346 String key = "" + data.getKey(); |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
347 boolean selected = selectedItems.contains(key); |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
348 data.setSelected(selected); |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
349 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
350 } else if (o instanceof MinMaxDescribeData) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
351 MinMaxDescribeData data = (MinMaxDescribeData) o; |
220
ee2d4134d0b3
General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
352 if (inputData.getName().equals(MINVALUEFIELDNAME)) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
353 data.setMinValue(inputData.getValue()); |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
354 } |
220
ee2d4134d0b3
General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
355 if (inputData.getName().equals(MAXVALUEFIELDNAME)) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
356 data.setMaxValue(inputData.getValue()); |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
357 } |
251
113b06ab2110
BugFix: The Value of SingleInputFields will now also be shown in the static ui. issue81
Tim Englich <tim.englich@intevation.de>
parents:
250
diff
changeset
|
358 } else if (o instanceof SingleValueDescribeData) { |
113b06ab2110
BugFix: The Value of SingleInputFields will now also be shown in the static ui. issue81
Tim Englich <tim.englich@intevation.de>
parents:
250
diff
changeset
|
359 ((SingleValueDescribeData)o).setValue(inputData.getValue()); |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
360 } |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
361 } |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
362 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
363 |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
364 private Object getDescribeData(String name, String uuid) { |
118
5ebc059064a6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
365 log.debug("TransitionBase.getDescribeData"); |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
366 Collection<Object> descibeData = this.getDescibeData(uuid); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
367 if (descibeData != null) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
368 Iterator<Object> it = descibeData.iterator(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
369 while (it.hasNext()) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
370 Object o = it.next(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
371 if (o instanceof NamedCollection<?>) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
372 if (name.equals(((NamedCollection<?>) o).getName())) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
373 return o; |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
374 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
375 } else if (o instanceof MinMaxDescribeData) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
376 if (name.equals(((MinMaxDescribeData) o).getMinName())) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
377 return o; |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
378 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
379 if (name.equals(((MinMaxDescribeData) o).getMaxName())) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
380 return o; |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
381 } |
251
113b06ab2110
BugFix: The Value of SingleInputFields will now also be shown in the static ui. issue81
Tim Englich <tim.englich@intevation.de>
parents:
250
diff
changeset
|
382 }else if (o instanceof SingleValueDescribeData) { |
113b06ab2110
BugFix: The Value of SingleInputFields will now also be shown in the static ui. issue81
Tim Englich <tim.englich@intevation.de>
parents:
250
diff
changeset
|
383 if (name.equals(((SingleValueDescribeData)o).getName())){ |
113b06ab2110
BugFix: The Value of SingleInputFields will now also be shown in the static ui. issue81
Tim Englich <tim.englich@intevation.de>
parents:
250
diff
changeset
|
384 return o; |
113b06ab2110
BugFix: The Value of SingleInputFields will now also be shown in the static ui. issue81
Tim Englich <tim.englich@intevation.de>
parents:
250
diff
changeset
|
385 } |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
386 } |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
387 } |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
388 } |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
389 return null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
390 |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
391 } |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
392 |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
393 /** |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
394 * @see de.intevation.gnv.transition.Transition#isTransitionReachable(java.lang.String) |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
395 */ |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
396 public boolean isTransitionReachable(String transitionID) { |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
397 log.debug("TransitionBase.isTransitionReachable"); |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
398 boolean returnValue = false; |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
399 if (this.couldAlternativeTransitionUsed()){ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
400 return alternativeTransition.isTransitionReachable(transitionID); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
401 }else{ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
402 Iterator<String> transitions = reachableTransitions.iterator(); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
403 while (transitions.hasNext()) { |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
404 if (transitions.next().equals(transitionID)) { |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
405 log.debug("Transition " + transitionID + " wird unterst�tzt."); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
406 returnValue = true; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
407 break; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
408 } |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
409 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
410 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
411 return returnValue; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
412 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
413 |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
414 /** |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
415 * @see de.intevation.gnv.transition.Transition#advance(java.lang.String, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
416 * de.intevation.artifacts.CallMeta) |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
417 */ |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
418 public void advance(String uuid, CallMeta callMeta) |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
419 throws TransitionException { |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
420 log.debug("TransitionBase.advance"); |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
421 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
422 if (this.couldAlternativeTransitionUsed()){ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
423 this.alternativeTransition.setParent(this.getParent()); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
424 this.alternativeTransition.putInputData(this.inputData != null ? |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
425 this.inputData.values() : |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
426 null,uuid); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
427 this.alternativeTransition.advance(uuid, callMeta); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
428 }else{ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
429 try { |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
430 String[] filterValues = this.generateFilterValuesFromInputData(); |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
431 Collection<Result> result = null; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
432 try { |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
433 if (this.queryID != null) { |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
434 QueryExecutor queryExecutor = QueryExecutorFactory |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
435 .getInstance().getQueryExecutor(); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
436 result = queryExecutor.executeQuery(this.queryID, |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
437 filterValues); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
438 } |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
439 this.purifyResult(result, uuid); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
440 } catch (RuntimeException e) { |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
441 log.error(e, e); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
442 } |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
443 } catch (QueryException e) { |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
444 log.error(e, e); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
445 throw new TransitionException(e); |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
446 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
447 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
448 } |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
449 |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
450 /** |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
451 * @return |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
452 */ |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
453 protected String[] generateFilterValuesFromInputData() { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
454 List<String> list = new ArrayList<String>(); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
455 Iterator<String> it = this.inputValueNames.iterator(); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
456 while (it.hasNext()) { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
457 String value = it.next(); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
458 InputData data = this.inputData.get(value); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
459 if (data != null |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
460 && this.inputValues.containsKey(data.getName())) { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
461 int size = this.inputValues.get(data.getName()) |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
462 .usedInQueries(); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
463 String type = this.inputValues.get(data.getName()) |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
464 .getType(); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
465 String requestValue = data.getValue(); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
466 if (type.equalsIgnoreCase("string")) { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
467 requestValue = this |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
468 .prepareInputData4DBQuery(requestValue); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
469 } else if (type.equalsIgnoreCase("date")) { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
470 requestValue = this |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
471 .prepareInputData4DateDBQuery(requestValue); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
472 } else if (type.equalsIgnoreCase("coordinate")){ |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
473 requestValue = this |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
474 .prepareInputData4RegionDBQuery(requestValue); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
475 } |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
476 for (int j = 0; j < size; j++) { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
477 list.add(requestValue); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
478 } |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
479 } |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
480 } |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
481 String[] filterValues = list.toArray(new String[0]); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
482 return filterValues; |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
222
diff
changeset
|
483 } |
173
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
484 |
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
485 protected String prepareInputData4RegionDBQuery(String value){ |
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
486 return value; |
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
487 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
488 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
489 private String prepareInputData4DateDBQuery(String value) { |
118
5ebc059064a6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
490 log.debug("TransitionBase.prepareInputData4DateDBQuery"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
491 if (value != null) { |
83
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
492 String[] values = value.split(","); |
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
493 String newValue = ""; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
494 for (int i = 0; i < values.length; i++) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
495 if (newValue.length() > 0) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
496 newValue = newValue + " , "; |
83
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
497 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
498 // TODO JUST HACK FIND A BETTER RESOLUTION |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
499 newValue = newValue + "to_date('" + values[i].trim() |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
500 + "', 'YYYY.MM.DD HH24:MI:SS')"; |
83
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
501 } |
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
502 return newValue; |
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
503 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
504 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
505 return value; |
83
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
506 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
507 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
508 private String prepareInputData4DBQuery(String value) { |
118
5ebc059064a6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
509 log.debug("TransitionBase.prepareInputData4DBQuery"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
510 if (value != null) { |
83
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
511 String[] values = value.split(","); |
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
512 String newValue = ""; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
513 for (int i = 0; i < values.length; i++) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
514 if (newValue.length() > 0) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
515 newValue = newValue + " , "; |
83
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
516 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
517 newValue = newValue + "'" + values[i].trim() + "'"; |
83
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
518 } |
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
519 return newValue; |
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
520 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
521 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
522 return value; |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
523 |
83
5c8e54726a58
Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
524 } |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
525 |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
526 /** |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
527 * @param result |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
528 */ |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
88
diff
changeset
|
529 protected void purifyResult(Collection<Result> result, String uuid) { |
118
5ebc059064a6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
530 log.debug("TransitionBase.purifyResult"); |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
531 Collection<Object> describeData = this.getDescibeData(uuid); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
532 if (describeData == null) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
533 describeData = new ArrayList<Object>(); |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
534 } |
173
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
535 NamedCollection<KeyValueDescibeData> keyValueDescibeData = extractKVP(result, "KEY", "VALUE"); |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
536 describeData.add(keyValueDescibeData); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
537 this.setDescibeData(uuid, describeData); |
173
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
538 } |
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
539 |
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
540 /** |
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
541 * @param result |
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
542 * @return |
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
543 */ |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
544 protected NamedCollection<KeyValueDescibeData> extractKVP(Collection<Result> result, |
173
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
545 String keyid, |
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
546 String valueid) { |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
547 Iterator<Result> rit = result.iterator(); |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
548 int dataSize = (this.dataNoSelect ? result.size()+1 : result.size()); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
549 |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
550 NamedCollection<KeyValueDescibeData> keyValueDescibeData = new NamedArrayList<KeyValueDescibeData>( |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
551 this.dataName, dataSize); |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
552 keyValueDescibeData.setMultiSelect(this.dataMultiSelect); |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
553 |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
554 if (this.dataNoSelect){ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
555 keyValueDescibeData.add(new DefaultKeyValueDescribeData(NODATASELECTIONKEY, |
254
ce408af0ee57
Translated "Keine Auswahl" to "No Selection" according to the Specification that
Tim Englich <tim.englich@intevation.de>
parents:
252
diff
changeset
|
556 "No Selection")); |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
557 } |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
558 String previousKey = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
559 while (rit.hasNext()) { |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
560 Result resultValue = rit.next(); |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
561 String tmpKey = resultValue.getString(keyid); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
562 // TODO: HACK da die ARCSDE kein DISTINCT auf r�umlichen Anfragen unterst�tzt. |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
563 if (previousKey == null || !tmpKey.equals(previousKey)){ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
564 previousKey = tmpKey; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
565 keyValueDescibeData.add(new DefaultKeyValueDescribeData(tmpKey, resultValue.getString(valueid))); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
566 } |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
567 } |
173
1b2fc94766c9
Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
568 return keyValueDescibeData; |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
569 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
570 |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
571 /** |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
572 * @see de.intevation.gnv.transition.Transition#describe(org.w3c.dom.Document, |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
573 * org.w3c.dom.Node, de.intevation.artifacts.CallMeta, |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
574 * java.lang.String) |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
575 */ |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
576 public void describe(Document document, Node rootNode, CallMeta callMeta,String uuid) { |
118
5ebc059064a6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
577 log.debug("TransitionBase.describe"); |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
578 Collection<Object> descibeData = this.getDescibeData(uuid); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
579 if (descibeData != null) { |
76
2473440671ce
Integrate UI-Representation for Describe into the FISArtifact.
Tim Englich <tim.englich@intevation.de>
parents:
68
diff
changeset
|
580 ArtifactXMLUtilities xmlutilities = new ArtifactXMLUtilities(); |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
581 Iterator<Object> it = descibeData.iterator(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
582 Node staticNode = xmlutilities.createArtifactElement(document, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
583 "static"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
584 Node dynamic = xmlutilities.createArtifactElement(document, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
585 "dynamic"); |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
586 rootNode.appendChild(staticNode); |
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
587 rootNode.appendChild(dynamic); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
588 while (it.hasNext()) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
589 |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
590 Object o = it.next(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
591 if (o instanceof Collection<?>) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
592 String name = null; |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
593 boolean multiselect = false; |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
594 if (o instanceof NamedCollection<?>) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
595 NamedCollection<?> nc = ((NamedCollection<?>) o); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
596 name = nc.getName(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
597 multiselect = nc.isMultiSelect(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
598 } else { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
599 Object[] names = this.inputValueNames.toArray(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
600 name = names[names.length - 1].toString(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
601 } |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
602 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
603 Element selectNode = xmlutilities.createXFormElement( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
604 document, multiselect ? "select" : "select1"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
605 selectNode.setAttribute("ref", name); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
606 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
607 Element lableNode = xmlutilities.createXFormElement( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
608 document, "label"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
609 lableNode.setTextContent(RessourceFactory.getInstance() |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
610 .getRessource(callMeta.getLanguages(), name, name)); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
611 Element choiceNode = xmlutilities.createXFormElement( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
612 document, "choices"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
613 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
614 Collection<KeyValueDescibeData> values = (Collection<KeyValueDescibeData>) o; |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
615 Iterator<KeyValueDescibeData> resultIt = values.iterator(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
616 while (resultIt.hasNext()) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
617 KeyValueDescibeData result = resultIt.next(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
618 Element itemNode = xmlutilities.createXFormElement( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
619 document, "item"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
620 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
621 if (result.isSelected()) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
622 itemNode.setAttribute("selected", "true"); |
79
e33c61735a4e
Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents:
78
diff
changeset
|
623 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
624 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
625 Element choiceLableNode = xmlutilities |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
626 .createXFormElement(document, "label"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
627 choiceLableNode.setTextContent(result.getValue()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
628 itemNode.appendChild(choiceLableNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
629 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
630 Element choicValueNode = xmlutilities |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
631 .createXFormElement(document, "value"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
632 choicValueNode.setTextContent("" + result.getKey()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
633 itemNode.appendChild(choicValueNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
634 choiceNode.appendChild(itemNode); |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
635 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
636 selectNode.appendChild(lableNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
637 selectNode.appendChild(choiceNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
638 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
639 if (!it.hasNext()) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
640 dynamic.appendChild(selectNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
641 } else { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
642 staticNode.appendChild(selectNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
643 } |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
644 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
645 } else if (o instanceof MinMaxDescribeData) { |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
646 MinMaxDescribeData minMaxDescibeData = (MinMaxDescribeData) o; |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
647 Object min = minMaxDescibeData.getMinValue(); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
648 Object max = minMaxDescibeData.getMaxValue(); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
649 if (min instanceof GregorianCalendar) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
650 Date d = ((GregorianCalendar) min).getTime(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
651 min = DateUtils.getPatternedDateAmer(d); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
652 } |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
653 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
654 if (max instanceof GregorianCalendar) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
655 Date d = ((GregorianCalendar) max).getTime(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
656 max = DateUtils.getPatternedDateAmer(d); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
657 } |
190
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
658 |
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
659 Element groupNode = xmlutilities.createXFormElement( |
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
660 document, "group"); |
250
4e8f0fd8ed79
BugFix: Storage of "feeded" MinMaxValues will now work. issue79
Tim Englich <tim.englich@intevation.de>
parents:
232
diff
changeset
|
661 groupNode.setAttribute("ref", minMaxDescibeData.getName()); |
190
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
662 Element groupNodeLableNode = xmlutilities |
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
663 .createXFormElement(document, "label"); |
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
664 groupNodeLableNode.setTextContent(RessourceFactory |
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
665 .getInstance().getRessource( |
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
666 callMeta.getLanguages(), |
250
4e8f0fd8ed79
BugFix: Storage of "feeded" MinMaxValues will now work. issue79
Tim Englich <tim.englich@intevation.de>
parents:
232
diff
changeset
|
667 minMaxDescibeData.getName(), |
4e8f0fd8ed79
BugFix: Storage of "feeded" MinMaxValues will now work. issue79
Tim Englich <tim.englich@intevation.de>
parents:
232
diff
changeset
|
668 minMaxDescibeData.getName())); |
190
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
669 groupNode.appendChild(groupNodeLableNode); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
670 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
671 Element inputMinNode = xmlutilities.createXFormElement( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
672 document, "input"); |
220
ee2d4134d0b3
General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
673 inputMinNode.setAttribute("ref", MINVALUEFIELDNAME); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
674 Element inputMinLableNode = xmlutilities |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
675 .createXFormElement(document, "label"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
676 inputMinLableNode.setTextContent(RessourceFactory |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
677 .getInstance().getRessource( |
220
ee2d4134d0b3
General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
678 callMeta.getLanguages(), MINVALUEFIELDNAME, |
ee2d4134d0b3
General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
679 MINVALUEFIELDNAME)); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
680 inputMinNode.appendChild(inputMinLableNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
681 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
682 Element inputMinValueNode = xmlutilities |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
683 .createXFormElement(document, "value"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
684 inputMinValueNode.setTextContent(min.toString()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
685 inputMinNode.appendChild(inputMinValueNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
686 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
687 Element inputMaxNode = xmlutilities.createXFormElement( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
688 document, "input"); |
220
ee2d4134d0b3
General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
689 inputMaxNode.setAttribute("ref", MAXVALUEFIELDNAME); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
690 Element inputMaxLableNode = xmlutilities |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
691 .createXFormElement(document, "label"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
692 inputMaxLableNode.setTextContent(RessourceFactory |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
693 .getInstance().getRessource( |
220
ee2d4134d0b3
General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
694 callMeta.getLanguages(), MAXVALUEFIELDNAME, |
ee2d4134d0b3
General CodecCleanup:
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
695 MAXVALUEFIELDNAME)); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
696 inputMaxNode.appendChild(inputMaxLableNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
697 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
698 Element inputMaxValueNode = xmlutilities |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
699 .createXFormElement(document, "value"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
700 inputMaxValueNode.setTextContent(max.toString()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
701 inputMaxNode.appendChild(inputMaxValueNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
702 |
190
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
703 groupNode.appendChild(inputMinNode); |
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
704 groupNode.appendChild(inputMaxNode); |
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
705 |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
706 if (!it.hasNext()) { |
190
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
707 dynamic.appendChild(groupNode); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
708 } else { |
190
baaa1618fa27
Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents:
173
diff
changeset
|
709 staticNode.appendChild(groupNode); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
710 } |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
711 } else if (o instanceof SingleValueDescribeData) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
712 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
713 SingleValueDescribeData svdb = (SingleValueDescribeData) o; |
195
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
714 |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
715 Element groupNode = xmlutilities.createXFormElement( |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
716 document, "group"); |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
717 groupNode.setAttribute("ref", svdb.getName()); |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
718 Element groupNodeLableNode = xmlutilities |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
719 .createXFormElement(document, "label"); |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
720 groupNodeLableNode.setTextContent(RessourceFactory |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
721 .getInstance().getRessource( |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
722 callMeta.getLanguages(), |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
723 svdb.getName(), |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
724 svdb.getName())); |
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
725 groupNode.appendChild(groupNodeLableNode); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
726 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
727 Element inputNode = xmlutilities.createXFormElement( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
728 document, "input"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
729 inputNode.setAttribute("ref", svdb.getName()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
730 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
731 Element inputLableNode = xmlutilities.createXFormElement( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
732 document, "label"); |
195
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
733 inputLableNode.setTextContent(""); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
734 inputNode.appendChild(inputLableNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
735 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
736 Element inputValueNode = xmlutilities.createXFormElement( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
737 document, "value"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
738 inputValueNode.setTextContent(svdb.getValue()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
739 inputNode.appendChild(inputValueNode); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
740 |
195
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
741 groupNode.appendChild(inputNode); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
742 if (!it.hasNext()) { |
195
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
743 dynamic.appendChild(groupNode); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
744 } else { |
195
63f65fb9f210
Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents:
192
diff
changeset
|
745 staticNode.appendChild(groupNode); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
746 } |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
747 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
748 |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
749 } |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
750 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
118
diff
changeset
|
751 } |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
752 |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
753 /** |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
754 * @see de.intevation.gnv.transition.Transition#getDescibeData() |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
755 */ |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
756 protected Collection<Object> getDescibeData(String uuid) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
757 if (CacheFactory.getInstance().isInitialized()) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
758 String key = uuid + DESCRIBEDATAKEY; |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
759 log.debug("Hash for Queryelements: " + key); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
760 net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
761 if (value != null) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
762 return (Collection<Object>) (value.getObjectValue()); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
763 } |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
764 } |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
765 return null; |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
766 } |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
767 |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
768 /** |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
769 * @see de.intevation.gnv.transition.Transition#getDescibeData() |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
770 */ |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
771 protected void setDescibeData(String uuid, Collection<Object> describeData) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
772 |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
773 if (CacheFactory.getInstance().isInitialized()) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
774 String key = uuid + DESCRIBEDATAKEY; |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
775 log.debug("Hash for Queryelements: " + key); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
776 CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, describeData)); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
204
diff
changeset
|
777 } |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
778 } |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
779 |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
780 /** |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
781 * @see de.intevation.gnv.transition.Transition#getInputData() |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
782 */ |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
783 public Collection<InputData> getInputData() throws TransitionException { |
222
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
784 if (this.couldAlternativeTransitionUsed()){ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
785 return this.alternativeTransition.getInputData(); |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
786 }else{ |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
787 return this.inputData != null ? this.inputData.values() : null; |
3e82b4f1c455
Removed some Compilation-Errors according to API-Changes in the ArtifactDatabase.
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
788 } |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
789 } |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
790 } |