Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWQKmsArtifact.java @ 3445:b6c301cb3871
Handle FixationArtifacts in WQAdapted-State.
flys-artifacts/trunk@5108 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 23 Jul 2012 15:11:12 +0000 |
parents | b0ba96bbf01d |
children | afc7bfb4800b |
rev | line source |
---|---|
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 import org.apache.log4j.Logger; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 import org.w3c.dom.Document; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
9 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.artifactdatabase.state.Facet; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.Artifact; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.ArtifactFactory; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.CallMeta; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
16 import de.intevation.artifacts.common.utils.XMLUtils; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
17 |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.artifacts.model.FacetTypes; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.artifacts.model.WQKms; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.artifacts.model.WKmsFactory; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.artifacts.model.WQKmsFactory; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
23 import de.intevation.flys.artifacts.states.DefaultState; |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 * Artifact to access additional "waterlevel/discharge"-type of data, like |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 * fixation measurements. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 * |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 * This artifact neglects (Static)FLYSArtifacts capabilities of interaction |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 * with the StateEngine by overriding the getState*-methods. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 public class StaticWQKmsArtifact |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 extends StaticFLYSArtifact |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 implements FacetTypes |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 /** The logger for this class. */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 private static Logger logger = |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 Logger.getLogger(StaticWQKmsArtifact.class); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 public static final String STATIC_STATE_NAME = |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 "state.additional_wqkms.static"; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 * Trivial Constructor. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 public StaticWQKmsArtifact() { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 logger.debug("StaticWQKmsArtifact.StaticWQKmsArtifact"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
51 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 * Gets called from factory, to set things up. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 @Override |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 public void setup( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 String identifier, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 ArtifactFactory factory, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 Object context, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 CallMeta callMeta, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 Document data) |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
63 { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
64 logger.debug("StaticWQKmsArtifact.setup"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
66 // Store the 'ids' (from datacage). |
3405
b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
67 if (logger.isDebugEnabled()) { |
b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
68 logger.debug("StaticWQKmsArtiact.setup" + XMLUtils.toString(data)); |
b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
69 } |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 |
2741
0251393f037c
Refactor usage of now static xpath, other artifacts will follow in later commits.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2740
diff
changeset
|
71 String code = getDatacageIDValue(data); |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
72 addStringData("ids", code); |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 if (code != null) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 String [] parts = code.split("-"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 if (parts.length >= 4) { |
3405
b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
77 int col = Integer.parseInt(parts[2]); |
b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
78 int wst = Integer.parseInt(parts[3]); |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 |
1900
64ffc371afe7
Adjusted implementation to match implementation in StaticWKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1825
diff
changeset
|
80 addStringData("col_pos", parts[2]); |
64ffc371afe7
Adjusted implementation to match implementation in StaticWKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1825
diff
changeset
|
81 addStringData("wst_id", parts[3]); |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
83 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
84 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
85 // Do this AFTER we have set the col_pos etc. |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
86 super.setup(identifier, factory, context, callMeta, data); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
88 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 * Called via setup. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 * |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 * @param artifact The master-artifact. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 @Override |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 protected void initialize( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 Artifact artifact, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 Object context, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 CallMeta meta) |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 logger.debug("StaticWQKmsArtifact.initialize"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 WINFOArtifact winfo = (WINFOArtifact) artifact; |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
103 // TODO: The river is of no interest, so far., also use importData |
2141
79a94c4171cb
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2124
diff
changeset
|
104 importData(winfo, "river"); |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
106 List<Facet> fs = new ArrayList<Facet>(); |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
108 DefaultState state = (DefaultState) getCurrentState(context); |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
109 state.computeInit(this, hash(), context, meta, fs); |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2763
diff
changeset
|
110 if (!fs.isEmpty()) { |
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2763
diff
changeset
|
111 logger.debug("Facets to add in StaticWQKmsArtifact.initialize ."); |
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2763
diff
changeset
|
112 facets.put(getCurrentStateId(), fs); |
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2763
diff
changeset
|
113 } |
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2763
diff
changeset
|
114 else { |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
115 logger.debug("No facets to add in StaticWQKmsArtifact.initialize (" |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
116 + state.getID() + ")."); |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
117 } |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
118 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
119 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
120 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
121 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
122 * Get WQKms from factory. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 * @return WQKms according to parameterization (can be null); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 */ |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
125 public WQKms getWQKms() { |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
126 logger.debug("StaticWQKmsArtifact.getWQKms"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 |
3405
b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
128 int col = Integer.parseInt(getDataAsString("col_pos")); |
b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
129 int wst = Integer.parseInt(getDataAsString("wst_id")); |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
130 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
131 /** TODO do not run twice against db to do this. */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
132 String wkmsName = WKmsFactory.getWKmsName(col, wst); |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
133 |
3405
b0ba96bbf01d
Use Integer.parseInt() instead of Integer.valueOf() + Autounboxing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
134 WQKms res = WQKmsFactory.getWQKms(col, wst); |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
135 res.setName(wkmsName); |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
136 return res; |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
139 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
140 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
141 * Determines Facets initial disposition regarding activity (think of |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
142 * selection in Client ThemeList GUI). This will be checked one time |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
143 * when the facet enters a collections describe document. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 * |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
145 * @param facetName name of the facet. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
146 * @param index index of the facet. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
147 * |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
148 * @return Always 0. Static Data will enter plots inactive. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
149 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
150 @Override |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
151 public int getInitialFacetActivity( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
152 String outputName, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
153 String facetName, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
154 int index) |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
155 { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
156 return 0; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
157 } |
2124
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
158 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
159 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
160 /** Return specific name. */ |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
161 public String getName() { |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
162 return "staticwqkms"; |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
163 } |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
164 |
a202a9e048a5
Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1900
diff
changeset
|
165 // TODO implement deepCopy. |
1825
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
166 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
167 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |