annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWQKmsArtifact.java @ 2740:64dc2997b2dd

Refactor static xpath, other artifacts will come in a later commit. flys-artifacts/trunk@4474 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 23 May 2012 10:04:11 +0000
parents 79a94c4171cb
children 0251393f037c
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.ArtifactNamespaceContext;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15 import de.intevation.artifacts.CallMeta;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
17 import de.intevation.artifacts.common.utils.XMLUtils;
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
18
1825
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.WKmsFactory;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22 import de.intevation.flys.artifacts.model.WQKmsFactory;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
23
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
24 import de.intevation.flys.artifacts.states.DefaultState;
1825
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 /**
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 * 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
29 * fixation measurements.
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 * This artifact neglects (Static)FLYSArtifacts capabilities of interaction
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
32 * with the StateEngine by overriding the getState*-methods.
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 public class StaticWQKmsArtifact
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
35 extends StaticFLYSArtifact
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
36 implements FacetTypes
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37 {
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38 /** The logger for this class. */
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
39 private static Logger logger =
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40 Logger.getLogger(StaticWQKmsArtifact.class);
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
41
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
42 public static final String STATIC_STATE_NAME =
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
43 "state.additional_wqkms.static";
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 /**
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
47 * Trivial Constructor.
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 StaticWQKmsArtifact() {
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
50 logger.debug("StaticWQKmsArtifact.StaticWQKmsArtifact");
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 /**
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
55 * Gets called from factory, to set things up.
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 @Override
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
58 public void setup(
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
59 String identifier,
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
60 ArtifactFactory factory,
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61 Object context,
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62 CallMeta callMeta,
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
63 Document data)
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 logger.debug("StaticWQKmsArtifact.setup");
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
66
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
67 // Store the 'ids' (from datacage).
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
68 logger.debug("StaticWQKmsArtiact.setup" + XMLUtils.toString(data));
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
69
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
70 String code = XMLUtils.xpathString(
2740
64dc2997b2dd Refactor static xpath, other artifacts will come in a later commit.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2141
diff changeset
71 data, XPATH_IDS, ArtifactNamespaceContext.INSTANCE);
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) {
1900
64ffc371afe7 Adjusted implementation to match implementation in StaticWKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
77 int col = Integer.valueOf(parts[2]);
64ffc371afe7 Adjusted implementation to match implementation in StaticWKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1825
diff changeset
78 int wst = Integer.valueOf(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);
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
110 if (!fs.isEmpty()) {
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
111 logger.debug("Facets to add in StaticWQKmsArtifact.initialize .");
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
112 facets.put(getCurrentStateId(), fs);
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
113 }
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
114 else {
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
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
128 int col = Integer.valueOf(getDataAsString("col_pos"));
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
129 int wst = Integer.valueOf(getDataAsString("wst_id"));
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
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
134 WQKms res = WQKmsFactory.getWQKms(
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
135 Integer.valueOf(getDataAsString("col_pos")),
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
136 Integer.valueOf(getDataAsString("wst_id")));
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
137 res.setName(wkmsName);
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
138 return res;
1825
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
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 * Determines Facets initial disposition regarding activity (think of
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
144 * 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
145 * when the facet enters a collections describe document.
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 * @param facetName name of the facet.
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
148 * @param index index of the facet.
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 * @return Always 0. Static Data will enter plots inactive.
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 @Override
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
153 public int getInitialFacetActivity(
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
154 String outputName,
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
155 String facetName,
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
156 int index)
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
157 {
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
158 return 0;
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
159 }
2124
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
160
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
161
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
162 /** Return specific name. */
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
163 public String getName() {
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
164 return "staticwqkms";
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
165 }
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
166
a202a9e048a5 Made StaticWQKmsArtifact a fully featured Artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1900
diff changeset
167 // TODO implement deepCopy.
1825
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
168 }
02cd002205a3 Added 'static' wqkms data access.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
169 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org