Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWQKmsArtifact.java @ 1841:90df645985d4
Removed orphanded datacage config which is no longer loadable.
flys-artifacts/trunk@3178 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 08 Nov 2011 11:50:08 +0000 |
parents | 02cd002205a3 |
children | 64ffc371afe7 |
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 import de.intevation.artifactdatabase.state.DefaultOutput; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifactdatabase.state.State; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.Artifact; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifacts.ArtifactFactory; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifacts.ArtifactNamespaceContext; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.artifacts.CallMeta; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.artifacts.model.FacetTypes; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.artifacts.model.WQKms; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 import de.intevation.flys.artifacts.model.WQKmsFacet; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.artifacts.model.WKmsFactory; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.flys.artifacts.model.WQKmsFactory; |
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 import de.intevation.flys.artifacts.states.StaticState; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 import de.intevation.flys.artifacts.resources.Resources; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 import de.intevation.artifacts.common.utils.XMLUtils; |
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 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 * 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
|
32 * fixation measurements. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 * |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 * This artifact neglects (Static)FLYSArtifacts capabilities of interaction |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 * with the StateEngine by overriding the getState*-methods. |
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 public class StaticWQKmsArtifact |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 extends StaticFLYSArtifact |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 implements FacetTypes |
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 /** The logger for this class. */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 private static Logger logger = |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 Logger.getLogger(StaticWQKmsArtifact.class); |
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 /** XPath to access initial parameter. */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 public static final String XPATH_DATA = |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 "/art:action/art:ids/@value"; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 public static final String STATIC_STATE_NAME = |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 "state.additional_wqkms.static"; |
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 /** One and only state to be in. */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 protected transient State state = null; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 |
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 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 * Trivial Constructor. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 public StaticWQKmsArtifact() { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 logger.debug("StaticWQKmsArtifact.StaticWQKmsArtifact"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 |
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 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 * Gets called from factory, to set things up. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
66 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 @Override |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 public void setup( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
69 String identifier, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 ArtifactFactory factory, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 Object context, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 CallMeta callMeta, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 Document data) |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 logger.debug("StaticWQKmsArtifact.setup"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
77 state = new StaticState(STATIC_STATE_NAME); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
78 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 List<Facet> fs = new ArrayList<Facet>(); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
80 logger.debug(XMLUtils.toString(data)); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
81 String code = XMLUtils.xpathString( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 data, XPATH_DATA, ArtifactNamespaceContext.INSTANCE); |
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 // TODO Go for JSON, one day. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
85 //ex.: flood_protection-wstv-114-12 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
86 if (code != null) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 String [] parts = code.split("-"); |
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 if (parts.length >= 4) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 try { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 int col = Integer.valueOf(parts[2]); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 int wst = Integer.valueOf(parts[3]); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 addStringData("col_pos", parts[2]); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 addStringData("wst_id", parts[3]); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 String wkmsName = WKmsFactory.getWKmsName(col, wst); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 String name; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 if (parts[0].equals(HEIGHTMARKS_POINTS)) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 name = HEIGHTMARKS_POINTS; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 else { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 name = STATIC_WQKMS; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
106 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 Facet facet = new WQKmsFacet( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
108 name, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
109 Resources.getMsg( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
110 callMeta, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
111 wkmsName, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
112 wkmsName)); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
113 fs.add(facet); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
114 facets.put(state.getID(), fs); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
115 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
116 catch (Exception e) {} |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
117 } |
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 spawnState(); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
121 super.setup(identifier, factory, context, callMeta, data); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
122 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
125 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
126 * Initialize the static state with output. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 * @return static state |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
128 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
129 protected State spawnState() { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
130 state = new StaticState(STATIC_STATE_NAME); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
131 List<Facet> fs = facets.get(STATIC_STATE_NAME); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
132 DefaultOutput output1 = new DefaultOutput( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
133 "w_differences", |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
134 "w_differences.longitudinal_section", "image/png", |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
135 fs, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
136 "chart"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
137 DefaultOutput output2 = new DefaultOutput( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
138 "longitudinal_section", |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
139 "longitudinal_section.longitudinal_section", "image/png", |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
140 fs, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
141 "chart"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
142 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
143 state.getOutputs().add(output1); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 state.getOutputs().add(output2); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
145 return state; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
146 } |
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 |
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 * Called via setup. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
151 * |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
152 * @param artifact The master-artifact. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
153 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
154 @Override |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
155 protected void initialize( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
156 Artifact artifact, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
157 Object context, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
158 CallMeta meta) |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
159 { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
160 logger.debug("StaticWQKmsArtifact.initialize"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
161 WINFOArtifact winfo = (WINFOArtifact) artifact; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
162 // TODO: The river is of no interest, so far. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
163 addData("river", winfo.getData("river")); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
164 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
165 |
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 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
168 * Get a list containing the one and only State. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
169 * @param context ignored. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
170 * @return list with one and only state. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
171 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
172 @Override |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
173 protected List<State> getStates(Object context) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
174 ArrayList<State> states = new ArrayList<State>(); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
175 states.add(getState()); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
176 return states; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
177 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
178 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
179 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
180 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
181 * Get the "current" state (there is but one). |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
182 * @param cc ignored. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
183 * @return the "current" (only possible) state. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
184 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
185 @Override |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
186 public State getCurrentState(Object cc) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
187 return getState(); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
188 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
189 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
190 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
191 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
192 * Get the only possible state. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
193 * @return the state. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
194 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
195 protected State getState() { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
196 return getState(null, null); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
197 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
198 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
199 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
200 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
201 * Get the state. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
202 * @param context ignored. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
203 * @param stateID ignored. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
204 * @return the state. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
205 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
206 @Override |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
207 protected State getState(Object context, String stateID) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
208 return (state != null) |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
209 ? state |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
210 : spawnState(); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
211 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
212 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
213 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
214 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
215 * Get WQKms from factory. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
216 * @param TODO idx param is not needed |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
217 * @return WQKms according to parameterization (can be null); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
218 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
219 public WQKms getWQKms(int idx) { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
220 logger.debug("StaticWQKmsArtifact.getWQKms"); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
221 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
222 return WQKmsFactory.getWQKms( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
223 Integer.valueOf(getDataAsString("col_pos")), |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
224 Integer.valueOf(getDataAsString("wst_id"))); |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
225 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
226 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
227 |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
228 /** |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
229 * Determines Facets initial disposition regarding activity (think of |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
230 * 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
|
231 * when the facet enters a collections describe document. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
232 * |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
233 * @param facetName name of the facet. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
234 * @param index index of the facet. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
235 * |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
236 * @return Always 0. Static Data will enter plots inactive. |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
237 */ |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
238 @Override |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
239 public int getInitialFacetActivity( |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
240 String outputName, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
241 String facetName, |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
242 int index) |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
243 { |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
244 return 0; |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
245 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
246 } |
02cd002205a3
Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
247 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |