Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/MINFOArtifact.java @ 2708:282db12a5bdf
Adapted the dynamic DESCRIBE creation of MultiIntArrayState to be able to use default mechanisms in FLYS client.
flys-artifacts/trunk@4430 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 16 May 2012 14:56:28 +0000 |
parents | 4c00cf83fff1 |
children | b60751cfdd6c |
rev | line source |
---|---|
2693
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import de.intevation.artifactdatabase.ProtocolUtils; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import de.intevation.artifactdatabase.state.Output; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import de.intevation.artifactdatabase.state.State; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import de.intevation.artifactdatabase.state.StateEngine; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import de.intevation.artifactdatabase.transition.TransitionEngine; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.CallContext; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.Message; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.artifacts.common.utils.XMLUtils; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.flys.artifacts.context.FLYSContext; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.artifacts.model.CalculationMessage; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.flys.artifacts.model.FacetTypes; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 import de.intevation.flys.artifacts.states.DefaultState; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 import de.intevation.flys.utils.FLYSUtils; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 import java.util.LinkedList; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 import java.util.List; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 import org.apache.log4j.Logger; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 import org.w3c.dom.Document; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 import org.w3c.dom.Element; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 import org.w3c.dom.Node; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 /** |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 * The default MINFO artifact. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 * |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 public class MINFOArtifact |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 extends FLYSArtifact |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 implements FacetTypes { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 /** The logger for this class. */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 private static Logger logger = Logger.getLogger(MINFOArtifact.class); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 /** The name of the artifact. */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 public static final String ARTIFACT_NAME = "minfo"; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 /** XPath */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 public static final String XPATH_STATIC_UI ="/art:result/art:ui/art:static"; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 /** |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 * The default constructor. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 public MINFOArtifact() { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 /** |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 * This method returns a description of this artifact. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 * |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 * @param data Some data. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 * @param context The CallContext. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 * |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 * @return the description of this artifact. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 public Document describe(Document data, CallContext context) { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 logger.debug("Describe: the current state is: " + getCurrentStateId()); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 FLYSContext flysContext = FLYSUtils.getFlysContext(context); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 StateEngine stateEngine = (StateEngine) flysContext.get( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 FLYSContext.STATE_ENGINE_KEY); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 TransitionEngine transitionEngine = (TransitionEngine) flysContext.get( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 FLYSContext.TRANSITION_ENGINE_KEY); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 List<State> reachable = transitionEngine.getReachableStates( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 this, getCurrentState(context), stateEngine); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 Document description = XMLUtils.newDocument(); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 description, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 ArtifactNamespaceContext.NAMESPACE_URI, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 Element root = ProtocolUtils.createRootNode(creator); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 description.appendChild(root); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 State current = getCurrentState(context); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash()); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 ProtocolUtils.appendState(creator, root, current); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 ProtocolUtils.appendReachableStates(creator, root, reachable); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 appendBackgroundActivity(creator, root, context); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 Element name = ProtocolUtils.createArtNode( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 creator, "name", |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 new String[] { "value" }, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 new String[] { getName() }); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 Element ui = ProtocolUtils.createArtNode( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 creator, "ui", null, null); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 Element staticUI = ProtocolUtils.createArtNode( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 creator, "static", null, null); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 Element outs = ProtocolUtils.createArtNode( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 creator, "outputmodes", null, null); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 appendOutputModes(description, outs, context, identifier()); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 appendStaticUI(description, staticUI, context, identifier()); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 Element dynamic = current.describe( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 this, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 description, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 root, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 context, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 identifier()); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 if (dynamic != null) { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 ui.appendChild(dynamic); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 ui.appendChild(staticUI); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 root.appendChild(name); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 root.appendChild(ui); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 root.appendChild(outs); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 return description; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 /** |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 * Returns the name of the concrete artifact. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 * |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 * @return the name of the concrete artifact. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 public String getName() { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 return ARTIFACT_NAME; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 protected static void appendBackgroundActivity( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 ElementCreator cr, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 Element root, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 CallContext context |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 ) { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 Element inBackground = cr.create("background-processing"); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 root.appendChild(inBackground); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 cr.addAttr( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 inBackground, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 "value", |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
161 String.valueOf(context.isInBackground()), |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 true); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
164 LinkedList<Message> messages = context.getBackgroundMessages(); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
165 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
166 if (messages == null) { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
167 return; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
168 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
169 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
170 CalculationMessage message = (CalculationMessage) messages.getLast(); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
171 cr.addAttr( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
172 inBackground, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 "steps", |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
174 String.valueOf(message.getSteps()), |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
175 true); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
176 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
177 cr.addAttr( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
178 inBackground, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
179 "currentStep", |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
180 String.valueOf(message.getCurrentStep()), |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
181 true); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
182 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
183 inBackground.setTextContent(message.getMessage()); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
184 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
185 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
186 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
187 /** |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
188 * Append output mode nodes to a document. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
189 */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
190 protected void appendOutputModes( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
191 Document doc, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
192 Element outs, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 CallContext context, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 String uuid) |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 List<Output> generated = getOutputs(context); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 logger.debug("This Artifact has " + generated.size() + " Outputs."); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 ProtocolUtils.appendOutputModes(doc, outs, generated); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 /** |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 * This method appends the static data - that has already been inserted by |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 * the user - to the static node of the DESCRIBE document. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 * |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 * @param doc The document. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 * @param ui The root node. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 * @param context The CallContext. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 * @param uuid The identifier of the artifact. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 protected void appendStaticUI( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 Document doc, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 Node ui, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 CallContext context, |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
216 String uuid) |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 List<String> stateIds = getPreviousStateIds(); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 FLYSContext flysContext = FLYSUtils.getFlysContext(context); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 StateEngine engine = (StateEngine) flysContext.get( |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 FLYSContext.STATE_ENGINE_KEY); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 for (String stateId: stateIds) { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 logger.debug("Append static data for state: " + stateId); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
226 DefaultState state = (DefaultState) engine.getState(stateId); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
227 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
228 ui.appendChild(state.describeStatic(this, doc, ui, context, uuid)); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
229 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
230 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
231 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
232 |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
233 /** |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
234 * Determines Facets initial disposition regarding activity (think of |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 * selection in Client ThemeList GUI). This will be checked one time |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
236 * when the facet enters a collections describe document. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
237 * |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
238 * @param facetName name of the facet. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
239 * @param index index of the facet. |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
240 * @return 0 if not active |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
241 */ |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 @Override |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
243 public int getInitialFacetActivity(String outputName, String facetName, int index) { |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
244 logger.warn("MINFOArtifact.getInitialFacetActivity: not implemented!"); |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
245 return 1; |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
246 } |
2702
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
247 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
248 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
249 public int[] getMainChannels() { |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
250 String data = getDataAsString("main.channel"); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
251 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
252 if (data == null) { |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
253 logger.warn("No 'main.channel' parameter specified!"); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
254 return null; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
255 } |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
256 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
257 return FLYSUtils.intArrayFromString(data); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
258 } |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
259 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
260 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
261 public int[] getTotalChannels() { |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
262 String data = getDataAsString("total.channel"); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
263 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
264 if (data == null) { |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
265 logger.warn("No 'total.channel' parameter specified!"); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
266 return null; |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
267 } |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
268 |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
269 return FLYSUtils.intArrayFromString(data); |
4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2693
diff
changeset
|
270 } |
2693
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
271 } |
edaa2297aea3
Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
272 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |