annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/ChartArtifact.java @ 2144:a4bdf7d8527e

Use FastAnnotations for LocationProvider. flys-artifacts/trunk@3723 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 19 Jan 2012 13:43:58 +0000
parents f021080cb409
children 734d5f5e55c0
rev   line source
2113
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 import org.apache.log4j.Logger;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5 import java.util.List;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 import org.w3c.dom.Document;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8 import org.w3c.dom.Element;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
9 import org.w3c.dom.Node;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 import de.intevation.artifacts.Artifact;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13 import de.intevation.artifacts.ArtifactFactory;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 import de.intevation.artifacts.CallMeta;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15 import de.intevation.artifacts.CallContext;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 import de.intevation.artifacts.common.utils.XMLUtils;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 import de.intevation.artifacts.common.ArtifactNamespaceContext;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
21 import de.intevation.artifactdatabase.ProtocolUtils;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 import de.intevation.artifactdatabase.state.Facet;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 import de.intevation.artifactdatabase.state.State;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 import de.intevation.artifactdatabase.state.StateEngine;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 import de.intevation.artifactdatabase.state.Output;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 import de.intevation.artifactdatabase.transition.TransitionEngine;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 import de.intevation.flys.utils.FLYSUtils;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 import de.intevation.flys.artifacts.states.DefaultState;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 import de.intevation.flys.artifacts.context.FLYSContext;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32 import de.intevation.flys.artifacts.resources.Resources;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 public class ChartArtifact extends FLYSArtifact {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 private static final Logger logger =
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 Logger.getLogger(ChartArtifact.class);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 @Override
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 public void setup(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 String identifier,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 ArtifactFactory factory,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 Object context,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 CallMeta callmeta,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 Document data)
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 logger.debug("ChartArtifact.setup");
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 this.identifier = identifier;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 name = "new_chart";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 List<State> states = getStates(context);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 setCurrentState(states.get(0));
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58 @Override
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 public Document describe(Document data, CallContext context) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 logger.debug("Describe: the current state is: " + getCurrentStateId());
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 if (logger.isDebugEnabled()) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 dumpArtifact();
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 FLYSContext flysContext = FLYSUtils.getFlysContext(context);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 StateEngine stateEngine = (StateEngine) flysContext.get(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 FLYSContext.STATE_ENGINE_KEY);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71 TransitionEngine transitionEngine = (TransitionEngine) flysContext.get(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 FLYSContext.TRANSITION_ENGINE_KEY);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 List<State> reachable = transitionEngine.getReachableStates(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75 this, getCurrentState(context), stateEngine);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77 Document description = XMLUtils.newDocument();
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 description,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80 ArtifactNamespaceContext.NAMESPACE_URI,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 ArtifactNamespaceContext.NAMESPACE_PREFIX);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
82
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
83 Element root = ProtocolUtils.createRootNode(creator);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
84 description.appendChild(root);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
85
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
86 State current = getCurrentState(context);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
87
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash());
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 ProtocolUtils.appendState(creator, root, current);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 ProtocolUtils.appendReachableStates(creator, root, reachable);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
91
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
92 appendBackgroundActivity(creator, root, context);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
93
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94 Element name = ProtocolUtils.createArtNode(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
95 creator, "name",
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
96 new String[] { "value" },
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
97 new String[] { getName() });
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
98
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
99 Element ui = ProtocolUtils.createArtNode(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
100 creator, "ui", null, null);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
101
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
102 Element staticUI = ProtocolUtils.createArtNode(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
103 creator, "static", null, null);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 Element outs = ProtocolUtils.createArtNode(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106 creator, "outputmodes", null, null);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107 appendOutputModes(description, outs, context, identifier());
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
108
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
109 appendStaticUI(description, staticUI, context, identifier());
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111 Element dynamic = current.describe(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 this,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 description,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 root,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 context,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 identifier());
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
117
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
118 if (dynamic != null) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
119 ui.appendChild(dynamic);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
120 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
121
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
122 ui.appendChild(staticUI);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
123
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
124 root.appendChild(name);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
125 root.appendChild(ui);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
126 root.appendChild(outs);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
127
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
128 return description;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
129
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
130 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
131
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
132
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
133 protected static void appendBackgroundActivity(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
134 ElementCreator cr,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
135 Element root,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
136 CallContext context
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
137 ) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
138 Element inBackground = cr.create("background-processing");
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
139 root.appendChild(inBackground);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
140
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
141 cr.addAttr(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
142 inBackground,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
143 "value",
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
144 String.valueOf(context.isInBackground()),
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
145 true);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
146 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
147
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
148
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
149 /**
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
150 * Append output mode nodes to a document.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
151 */
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
152 protected void appendOutputModes(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
153 Document doc,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
154 Element outs,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
155 CallContext context,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
156 String uuid)
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
158 List<String> stateIds = getPreviousStateIds();
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
159
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
160 XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
161 doc,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
162 ArtifactNamespaceContext.NAMESPACE_URI,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
163 ArtifactNamespaceContext.NAMESPACE_PREFIX);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
164
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
165 FLYSContext flysContext = FLYSUtils.getFlysContext(context);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
166 StateEngine engine = (StateEngine) flysContext.get(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
167 FLYSContext.STATE_ENGINE_KEY);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
168
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
169 for (String stateId: stateIds) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
170 logger.debug("Append output modes for state: " + stateId);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
171 DefaultState state = (DefaultState) engine.getState(stateId);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
172
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
173 List<Output> list = state.getOutputs();
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
174 if (list == null || list.size() == 0) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
175 logger.debug("-> No output modes for this state.");
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
176 continue;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
177 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
178
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
179 List<Facet> fs = facets.get(stateId);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
180
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
181 if (fs == null || fs.size() == 0) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
182 logger.debug("No facets for previous state found.");
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
183 continue;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
184 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
185
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
186 logger.debug("Found " + fs.size() + " facets in previous states.");
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
187
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
188 List<Output> generated = generateOutputs(list, fs);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
189
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
190 ProtocolUtils.appendOutputModes(doc, outs, generated);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
191 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
192
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
193 try {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
194 DefaultState cur = (DefaultState) getCurrentState(context);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
195 if (cur.validate(this)) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
196 List<Output> list = cur.getOutputs();
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
197 if (list != null && list.size() > 0) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
198 logger.debug(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
199 "Append output modes for current state: " + cur.getID());
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
200
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
201 List<Facet> fs = facets.get(cur.getID());
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
202
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
203 if (fs != null && fs.size() > 0) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
204 List<Output> generated = generateOutputs(list, fs);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
205
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
206 logger.debug("Found " + fs.size() + " current facets.");
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
207 if (!generated.isEmpty()) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
208 ProtocolUtils.appendOutputModes(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
209 doc, outs, generated);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
210 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
211 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
212 else {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
213 logger.debug("No facets found for the current state.");
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
214 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
215 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
216 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
217 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
218 catch (IllegalArgumentException iae) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
219 // state is not valid, so we do not append its outputs.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
220 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
221 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
222
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
223
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
224 /**
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
225 * This method appends the static data - that has already been inserted by
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
226 * the user - to the static node of the DESCRIBE document.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
227 *
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
228 * @param doc The document.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
229 * @param ui The root node.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
230 * @param context The CallContext.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
231 * @param uuid The identifier of the artifact.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
232 */
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
233 protected void appendStaticUI(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
234 Document doc,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
235 Node ui,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
236 CallContext context,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
237 String uuid)
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
238 {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
239 List<String> stateIds = getPreviousStateIds();
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
240
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
241 logger.debug("previous states: " + stateIds);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
242 FLYSContext flysContext = FLYSUtils.getFlysContext(context);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
243 StateEngine engine = (StateEngine) flysContext.get(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
244 FLYSContext.STATE_ENGINE_KEY);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
245
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
246 for (String stateId: stateIds) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
247 logger.debug("Append static data for state: " + stateId);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
248 DefaultState state = (DefaultState) engine.getState(stateId);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
249
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
250 ui.appendChild(state.describeStatic(this, doc, ui, context, uuid));
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
251 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
252 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
253
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
254
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
255 public static class ChartState extends DefaultState {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
256
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
257 public static final String FIELD_MODE = "chart_type";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
258
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
259 public static final String DURATION_CURVE =
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
260 "chart.new.durationcurve";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
261
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
262 public static final String COMPUTED_DISCHARGE_CURVE =
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
263 "chart.new.computeddischargecurve";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
264
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
265 public static final String DISCHARGE_LONGITUDINAL_CURVE =
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
266 "chart.new.discharge_longitudinal_section";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
267
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
268 public static final String W_DIFFERENCES =
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
269 "chart.new.w_differences";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
270
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
271 public static final String WATERLEVEL =
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
272 "chart.new.waterlevel";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
273
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
274 public static final String[] CHARTS = {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
275 COMPUTED_DISCHARGE_CURVE,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
276 DURATION_CURVE,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
277 DISCHARGE_LONGITUDINAL_CURVE,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
278 W_DIFFERENCES,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
279 WATERLEVEL };
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
280
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
281
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
282
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
283 @Override
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
284 public Object computeAdvance(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
285 FLYSArtifact artifact,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
286 String hash,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
287 CallContext context,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
288 List<Facet> facets,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
289 Object old)
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
290 {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
291 logger.debug("ChartState.computeAdvance");
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
292
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
293
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
294 return null;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
295 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
296
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
297
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
298 @Override
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
299 protected Element[] createItems(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
300 XMLUtils.ElementCreator cr,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
301 Artifact artifact,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
302 String name,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
303 CallContext context)
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
304 {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
305 CallMeta meta = context.getMeta();
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
306 Element[] charts = new Element[CHARTS.length];
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
307
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
308 int i = 0;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
309
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
310 for (String chart: CHARTS) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
311 charts[i++] = createItem(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
312 cr, new String[] {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
313 Resources.getMsg(meta, chart, chart),
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
314 chart
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
315 });
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
316 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
317
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
318 return charts;
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
319 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
320
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
321
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
322 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
323 }

http://dive4elements.wald.intevation.org