Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/FixationArtifact.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 | 0ca00d547f35 |
children | 306b9d0f0fb3 |
rev | line source |
---|---|
2651
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
2 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
3 import java.util.List; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
4 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
5 import org.apache.log4j.Logger; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
6 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
7 import org.w3c.dom.Element; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
8 import org.w3c.dom.Document; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
9 import org.w3c.dom.Node; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.artifacts.CallContext; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.common.utils.XMLUtils; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.common.ArtifactNamespaceContext; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
15 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifactdatabase.ProtocolUtils; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.artifactdatabase.state.State; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.artifactdatabase.state.StateEngine; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.artifactdatabase.state.Output; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.artifactdatabase.transition.TransitionEngine; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.artifacts.model.FacetTypes; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 import de.intevation.flys.artifacts.context.FLYSContext; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
24 import de.intevation.flys.artifacts.states.DefaultState; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
25 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
26 import de.intevation.flys.utils.FLYSUtils; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 /** |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
29 * The default fixation analysis artifact. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 * |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
32 */ |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
33 public class FixationArtifact |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 extends FLYSArtifact |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 implements FacetTypes { |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 /** The logger for this class. */ |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
38 private static Logger logger = Logger.getLogger(FixationArtifact.class); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
39 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 /** The name of the artifact. */ |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 public static final String ARTIFACT_NAME = "fixanalysis"; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
43 /** |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
44 * The default constructor. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
45 */ |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
46 public FixationArtifact() { |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
47 } |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
48 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
49 /** |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
50 * Returns the name of the concrete artifact. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
51 * |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
52 * @return the name of the concrete artifact. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
53 */ |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
54 public String getName() { |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
55 return ARTIFACT_NAME; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
56 } |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
57 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
58 public Document describe(Document data, CallContext context) { |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
59 logger.debug("Describe: the current state is: " + getCurrentStateId()); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
60 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
61 if (logger.isDebugEnabled()) { |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
62 dumpArtifact(); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
63 } |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
65 FLYSContext flysContext = FLYSUtils.getFlysContext(context); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 StateEngine stateEngine = (StateEngine) flysContext.get( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 FLYSContext.STATE_ENGINE_KEY); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
69 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
70 TransitionEngine transitionEngine = (TransitionEngine) flysContext.get( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 FLYSContext.TRANSITION_ENGINE_KEY); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
72 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 List<State> reachable = transitionEngine.getReachableStates( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 this, getCurrentState(context), stateEngine); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
75 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
76 Document description = XMLUtils.newDocument(); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
78 description, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
79 ArtifactNamespaceContext.NAMESPACE_URI, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
80 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
81 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
82 Element root = ProtocolUtils.createRootNode(creator); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
83 description.appendChild(root); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
84 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
85 State current = getCurrentState(context); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
86 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
87 ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash()); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
88 ProtocolUtils.appendState(creator, root, current); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
89 ProtocolUtils.appendReachableStates(creator, root, reachable); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
90 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
91 Element ui = ProtocolUtils.createArtNode( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
92 creator, "ui", null, null); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
93 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
94 Element staticUI = ProtocolUtils.createArtNode( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
95 creator, "static", null, null); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
96 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
97 Element outs = ProtocolUtils.createArtNode( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
98 creator, "outputmodes", null, null); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
99 appendOutputModes(description, outs, context, identifier()); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
100 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
101 appendStaticUI(description, staticUI, context, identifier()); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
102 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
103 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
104 Element name = ProtocolUtils.createArtNode( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
105 creator, "name", |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
106 new String[] { "value" }, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
107 new String[] { getName() }); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
108 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
109 Element dynamic = current.describe( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
110 this, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
111 description, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
112 root, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
113 context, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
114 identifier()); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
115 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
116 if (dynamic != null) { |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
117 ui.appendChild(dynamic); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
118 } |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
119 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
120 ui.appendChild(staticUI); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
121 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
122 root.appendChild(name); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
123 root.appendChild(ui); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
124 root.appendChild(outs); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
125 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
126 return description; |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
127 } |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
128 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
129 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
130 /** |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
131 * Append output mode nodes to a document. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
132 */ |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
133 protected void appendOutputModes( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
134 Document doc, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
135 Element outs, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
136 CallContext context, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
137 String uuid) |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
138 { |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
139 List<Output> generated = getOutputs(context); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
140 logger.debug("This Artifact has " + generated.size() + " Outputs."); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
141 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
142 ProtocolUtils.appendOutputModes(doc, outs, generated); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
143 } |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
144 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
145 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
146 /** |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
147 * This method appends the static data - that has already been inserted by |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
148 * the user - to the static node of the DESCRIBE document. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
149 * |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
150 * @param doc The document. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
151 * @param ui The root node. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
152 * @param context The CallContext. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
153 * @param uuid The identifier of the artifact. |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
154 */ |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
155 protected void appendStaticUI( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
156 Document doc, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
157 Node ui, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
158 CallContext context, |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
159 String uuid) |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
160 { |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
161 List<String> stateIds = getPreviousStateIds(); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
162 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
163 FLYSContext flysContext = FLYSUtils.getFlysContext(context); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
164 StateEngine engine = (StateEngine) flysContext.get( |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
165 FLYSContext.STATE_ENGINE_KEY); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
166 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
167 for (String stateId: stateIds) { |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
168 logger.debug("Append static data for state: " + stateId); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
169 DefaultState state = (DefaultState) engine.getState(stateId); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
170 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
171 ui.appendChild(state.describeStatic(this, doc, ui, context, uuid)); |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
172 } |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
173 } |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
174 |
9e9eb9d97548
Initial transition configuration and artifact/state stubs for fixation
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
175 } |