annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/ChartArtifact.java @ 2231:5648b5b34ae2

Issue 466. Added CSV export for activated chart themes excluding annotations. flys-artifacts/trunk@3874 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 02 Feb 2012 10:54:21 +0000
parents 1ea555bf3c6b
children 4bd3d8bbb60c
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);
2158
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
195 List<Output> list = cur.getOutputs();
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
196 if (list != null && list.size() > 0) {
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
197 logger.debug(
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
198 "Append output modes for current state: " + cur.getID());
2113
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
199
2158
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
200 List<Facet> fs = facets.get(cur.getID());
2113
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
201
2158
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
202 if (fs != null && fs.size() > 0) {
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
203 List<Output> generated = generateOutputs(list, fs);
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
204
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
205 logger.debug("Found " + fs.size() + " current facets.");
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
206 if (!generated.isEmpty()) {
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
207 ProtocolUtils.appendOutputModes(
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
208 doc, outs, generated);
2113
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
209 }
2158
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
210 }
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
211 else {
1ea555bf3c6b Removed state validation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2153
diff changeset
212 logger.debug("No facets found for the current state.");
2113
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
213 }
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 catch (IllegalArgumentException iae) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
217 // 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
218 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
219 }
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 * 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
224 * 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
225 *
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
226 * @param doc The document.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
227 * @param ui The root node.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
228 * @param context The CallContext.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
229 * @param uuid The identifier of the artifact.
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
230 */
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
231 protected void appendStaticUI(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
232 Document doc,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
233 Node ui,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
234 CallContext context,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
235 String uuid)
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
236 {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
237 List<String> stateIds = getPreviousStateIds();
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 logger.debug("previous states: " + stateIds);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
240 FLYSContext flysContext = FLYSUtils.getFlysContext(context);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
241 StateEngine engine = (StateEngine) flysContext.get(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
242 FLYSContext.STATE_ENGINE_KEY);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
243
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
244 for (String stateId: stateIds) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
245 logger.debug("Append static data for state: " + stateId);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
246 DefaultState state = (DefaultState) engine.getState(stateId);
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
247
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
248 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
249 }
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
250 }
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 public static class ChartState extends DefaultState {
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 final String FIELD_MODE = "chart_type";
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 DURATION_CURVE =
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
258 "chart.new.durationcurve";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
259
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
260 public static final String COMPUTED_DISCHARGE_CURVE =
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
261 "chart.new.computeddischargecurve";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
262
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
263 public static final String DISCHARGE_LONGITUDINAL_CURVE =
2153
734d5f5e55c0 'New chart' for cross sections.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2120
diff changeset
264 "chart.new.longitudinal_section";
2113
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
265
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
266 public static final String W_DIFFERENCES =
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
267 "chart.new.w_differences";
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
268
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
269 public static final String WATERLEVEL =
2153
734d5f5e55c0 'New chart' for cross sections.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2120
diff changeset
270 "chart.new.crosssection";
2113
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
271
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
272 public static final String[] CHARTS = {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
273 COMPUTED_DISCHARGE_CURVE,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
274 DURATION_CURVE,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
275 DISCHARGE_LONGITUDINAL_CURVE,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
276 W_DIFFERENCES,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
277 WATERLEVEL };
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
278
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
279
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 @Override
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
282 public Object computeAdvance(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
283 FLYSArtifact artifact,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
284 String hash,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
285 CallContext context,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
286 List<Facet> facets,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
287 Object old)
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
288 {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
289 logger.debug("ChartState.computeAdvance");
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
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
292 return null;
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
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 @Override
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
297 protected Element[] createItems(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
298 XMLUtils.ElementCreator cr,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
299 Artifact artifact,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
300 String name,
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
301 CallContext context)
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
302 {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
303 CallMeta meta = context.getMeta();
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
304 Element[] charts = new Element[CHARTS.length];
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
305
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
306 int i = 0;
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 for (String chart: CHARTS) {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
309 charts[i++] = createItem(
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
310 cr, new String[] {
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
311 Resources.getMsg(meta, chart, chart),
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
312 chart
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
313 });
d109e7702995 Initial implementation for module 'new chart'.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
314 }
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 return charts;
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
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 }

http://dive4elements.wald.intevation.org