annotate gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java @ 804:9058c08eac3a

Added more Javadoc in some classes of state.profile. gnv-artifacts/trunk@886 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 08 Apr 2010 10:10:04 +0000
parents 5dd94448538d
children bb7afd783321
rev   line source
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 package de.intevation.gnv.state.timeseries;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2
779
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
3 import au.com.bytecode.opencsv.CSVWriter;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
4
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
5 import de.intevation.artifactdatabase.Config;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
6 import de.intevation.artifactdatabase.XMLUtils;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
7
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
8 import de.intevation.artifacts.ArtifactNamespaceContext;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
9 import de.intevation.artifacts.CallContext;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
10 import de.intevation.artifacts.CallMeta;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
11
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
12 import de.intevation.gnv.artifacts.context.GNVArtifactContext;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
13
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
14 import de.intevation.gnv.artifacts.ressource.RessourceFactory;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
15
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
16 import de.intevation.gnv.chart.Chart;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
17 import de.intevation.gnv.chart.ChartLabels;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
18 import de.intevation.gnv.chart.DefaultHistogram;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
19 import de.intevation.gnv.chart.TimeSeriesChart;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
20 import de.intevation.gnv.chart.XMLChartTheme;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
21
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
22 import de.intevation.gnv.chart.exception.TechnicalChartException;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
23
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
24 import de.intevation.gnv.exports.ChartExportHelper;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
25 import de.intevation.gnv.exports.DefaultDataCollector;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
26 import de.intevation.gnv.exports.DefaultExport;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
27 import de.intevation.gnv.exports.DefaultProfile;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
28
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
29 import de.intevation.gnv.exports.Export.Profile;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
30
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
31 import de.intevation.gnv.exports.Export;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
32 import de.intevation.gnv.exports.ODVExport;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
33 import de.intevation.gnv.exports.SimpleOdvDataCollector;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
34
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
35 import de.intevation.gnv.geobackend.base.Result;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
36
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
37 import de.intevation.gnv.histogram.HistogramHelper;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
38
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
39 import de.intevation.gnv.state.InputData;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
40 import de.intevation.gnv.state.OutputStateBase;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
41
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
42 import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
43 import de.intevation.gnv.state.describedata.KeyValueDescibeData;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
44 import de.intevation.gnv.state.describedata.NamedArrayList;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
45 import de.intevation.gnv.state.describedata.NamedCollection;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
46
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
47 import de.intevation.gnv.state.exception.StateException;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
48
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
49 import de.intevation.gnv.statistics.Statistic;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
50 import de.intevation.gnv.statistics.StatisticSet;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
51 import de.intevation.gnv.statistics.Statistics;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
52 import de.intevation.gnv.statistics.TimeseriesStatistics;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
53
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
54 import de.intevation.gnv.statistics.exception.StatisticsException;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
55
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
56 import de.intevation.gnv.timeseries.gap.DefaultTimeGap;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
57 import de.intevation.gnv.timeseries.gap.TimeGap;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
58
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
59 import de.intevation.gnv.utils.ArtifactXMLUtilities;
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
60
480
211cad2fb5ba Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 467
diff changeset
61 import java.io.IOException;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
62 import java.io.OutputStream;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
63 import java.io.UnsupportedEncodingException;
779
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
64
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
65 import java.util.ArrayList;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66 import java.util.Collection;
629
d08b9ba148c5 Implemented logic to adjust number of bins corresponding to user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 627
diff changeset
67 import java.util.HashMap;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
68 import java.util.Iterator;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
69 import java.util.List;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
70 import java.util.Locale;
629
d08b9ba148c5 Implemented logic to adjust number of bins corresponding to user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 627
diff changeset
71 import java.util.Map;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
72 import java.util.Vector;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
73
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
74 import org.apache.log4j.Logger;
779
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
75
480
211cad2fb5ba Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 467
diff changeset
76 import org.jfree.chart.ChartTheme;
779
b1f5f2a8840f Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 778
diff changeset
77
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
78 import org.w3c.dom.Document;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
79 import org.w3c.dom.Element;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
80 import org.w3c.dom.Node;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
81 import org.w3c.dom.NodeList;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
82
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
83 /**
780
c4156275c1e1 Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 779
diff changeset
84 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
c4156275c1e1 Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 779
diff changeset
85 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
86 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
87 public class TimeSeriesOutputState extends OutputStateBase {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
88
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
89 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
90 * A boolean property to enable caching of charts after they have been
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
91 * created. This property can be adjusted via system property 'cache.chart'.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
92 * 'true' of 'false' are valid options - defaults to 'false'.<br>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
93 * <b>NOTE:</b> If chart caching is enabled, charts aren't sensible to
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
94 * changes in the parameterization anymore, after a first chart has been
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
95 * created for an artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
96 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
97 protected static final boolean CACHE_CHART =
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
98 Boolean.parseBoolean(System.getProperty("cache.chart", "false"));
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
99
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
100 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
101 * A field parsing a system property to adjust the alignment of pdf exports.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
102 * The system property is 'export.pdf.landscape' and should be true or
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
103 * false. If this property is true, PDFs will be created in landscape
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
104 * format.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
105 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
106 protected static final boolean PDF_FORMAT_LANDSCAPE =
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
107 Boolean.parseBoolean(System.getProperty("export.pdf.landscape","true"));
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
108
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
109 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
110 * Supported image export formats.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
111 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
112 protected static final String[] IMG_EXPORT_FORMAT = {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
113 "PNG", "JPEG", "GIF"
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
114 };
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
115
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
116 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
117 * The UID of this Class
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
118 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
119 private static final long serialVersionUID = 4178407570503098858L;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
120
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
121 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
122 * the logger, used to log exceptions and additonaly information
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
123 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
124 private static Logger log = Logger
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
125 .getLogger(TimeSeriesOutputState.class);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
126
781
5dd94448538d Added timegap definitions as attribute to each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
127 private List<TimeGap> timeGapDefinitions = null;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
128
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
129 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
130 * Key in resource bundle the x-axis title is stored.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
131 */
342
bb1afbbd93e4 Read x-axis label for timeseries charts from ressources, instead of a hard coded string in source.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 335
diff changeset
132 protected String domainLable = "chart.timeseries.title.xaxis";
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
133
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
134 protected String featureValuesName = "featureid";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
135 protected String parameterValuesName = "parameterid";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
136 protected String measuremenValueName = "measurementid";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
137 protected String dateValueName = "dateid";
368
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
138
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
139
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
140 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
141 * Array used to specify the columns used in csv exports.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
142 */
368
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
143 public static final String [] TIMESERIES_CSV_PROFILE_COLUMNS = {
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
144 "XORDINATE",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
145 "YORDINATE",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
146 "GROUP1",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
147 "GROUP2",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
148 "GROUP3"
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
149 };
368
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
150
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
151
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
152 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
153 * Column labels used in csv exports.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
154 */
368
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
155 public static final String [] TIMESERIES_TIMESERIES_CSV_COLUMN_LABEL = {
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
156 "Date/Time",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
157 "Value",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
158 "ParameterID",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
159 "MeasurementID",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
160 "TimeseriesID"
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
161 };
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
162
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
163
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
164 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
165 * Array used to specify the column in csv exports on meshes.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
166 */
368
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
167 public static final String [] TIMESERIES_MESH_CSV_COLUMN_LABEL = {
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
168 "Date/Time",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
169 "Value",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
170 "ParameterID",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
171 "FeatureID",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
172 "MeshID"
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
173 };
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
174
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
175
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
176 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
177 * Array used to specify the columns in odv exports.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
178 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
179 public static final String [] TIMESERIES_ODV_PROFILE_NAMES = {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
180 "CRUISE",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
181 "STATION",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
182 "TYPE",
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
183 "TIMEVALUE",
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
184 "SHAPE",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
185 "BOTDEPTH",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
186 "DEPTH",
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
187 "QF"
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
188 };
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
189
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
190
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
191 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
192 * Column labels used in odv exports.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
193 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
194 public static final String [] ODV_COLUMN_HEADER = {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
195 "Cruise",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
196 "Station",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
197 "Type",
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
198 "yyyy-mm-dd hh:mm",
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
199 "Lon (°E)",
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
200 "Lat (°N)",
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
201 "Bot. Depth [m]",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
202 "Depth [m]",
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
203 "QF"
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
204 };
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
205
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
206
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
207 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
208 * Profile for exporting data to odv
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
209 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
210 public static final Profile TIMESERIES_ODV_PROFILE =
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
211 new DefaultProfile(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
212 ODV_COLUMN_HEADER,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
213 '\t',
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
214 CSVWriter.NO_QUOTE_CHARACTER,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
215 CSVWriter.NO_ESCAPE_CHARACTER,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
216 "ODV",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
217 "ISO-8859-1");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
218
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
219 /**
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
220 * Constructor
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
221 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
222 public TimeSeriesOutputState() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
223 super();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
224 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
225
536
f1dc3c2f9be7 Calculate results and put them into cache when reaching the output state - avoids latencies.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 535
diff changeset
226
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
227 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
228 * Calls <code>getChartResult</code> which puts the data used for chart
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
229 * creation into cache. This redruces waiting periods after selecting an
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
230 * output type.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
231 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
232 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
233 * @param context The CallContext object.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
234 * @throws StateException if an error occured while fetching the data used
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
235 * for chart creation.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
236 */
536
f1dc3c2f9be7 Calculate results and put them into cache when reaching the output state - avoids latencies.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 535
diff changeset
237 @Override
f1dc3c2f9be7 Calculate results and put them into cache when reaching the output state - avoids latencies.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 535
diff changeset
238 public void initialize(String uuid, CallContext context)
f1dc3c2f9be7 Calculate results and put them into cache when reaching the output state - avoids latencies.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 535
diff changeset
239 throws StateException
f1dc3c2f9be7 Calculate results and put them into cache when reaching the output state - avoids latencies.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 535
diff changeset
240 {
f1dc3c2f9be7 Calculate results and put them into cache when reaching the output state - avoids latencies.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 535
diff changeset
241 getChartResult(uuid, context);
f1dc3c2f9be7 Calculate results and put them into cache when reaching the output state - avoids latencies.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 535
diff changeset
242 }
f1dc3c2f9be7 Calculate results and put them into cache when reaching the output state - avoids latencies.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 535
diff changeset
243
f1dc3c2f9be7 Calculate results and put them into cache when reaching the output state - avoids latencies.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 535
diff changeset
244
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
245 /**
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
246 * This out target has following modes:<br>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
247 * <ol>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
248 * <li>chart: Creates a chart displaying the data corresponding to the
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
249 * current parameterization. A chart has following export modes:<br>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
250 * <ol>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
251 * <li>img: Image representation of a chart.</li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
252 * <li>pdf: PDF representation of a chart.</li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
253 * <li>svg: SVG representation of a chart.</li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
254 * </ol>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
255 * All selected parameters are drawn into a single chart.<br>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
256 * </li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
257 * <li>histogram: Creates a histogram displaying the data corresponding to
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
258 * the current parameterization. A histogram has following export modes:<br>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
259 * <ol>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
260 * <li>img: Image representation of a histogram.</li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
261 * <li>pdf: PDF representation of a histogram.</li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
262 * <li>svg: SVG representation of a histogram.</li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
263 * </ol>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
264 * A single histogram is created for each selected parameter.<br>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
265 * </li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
266 * <li>statistic: Creates a statistic with important figures.</li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
267 * <li>csv: Creates a csv file.</li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
268 * <li>odv: Creates a odv file.</li>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
269 * </ol>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
270 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
271 * @param format Document which contains some export specific information.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
272 * @param inputData Contains some meta information to adjust the export
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
273 * (e.g. width and height of a chart).
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
274 * @param outputStream The output stream used to return the export.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
275 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
276 * @param callContext The CallContext object.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
277 * @throws StateException if an error occured while creating the export
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
278 * object.
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
279 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
280 public void out(
480
211cad2fb5ba Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 467
diff changeset
281 Document format,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
282 Collection<InputData> inputData,
480
211cad2fb5ba Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 467
diff changeset
283 OutputStream outputStream,
211cad2fb5ba Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 467
diff changeset
284 String uuid,
211cad2fb5ba Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 467
diff changeset
285 CallContext callContext
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
286 ) throws StateException
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
287 {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
288 log.debug("TimeSeriesOutputTransition.out");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
289
467
b2d2b36b20a0 Use XMLUtils to evaluate xpath expressions instead of using Config class. Adapted xpath (namespace and prefix).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 454
diff changeset
290 String outputMode = XMLUtils.xpathString(
b2d2b36b20a0 Use XMLUtils to evaluate xpath expressions instead of using Config class. Adapted xpath (namespace and prefix).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 454
diff changeset
291 format, XPATH_OUTPUT_MODE, ArtifactNamespaceContext.INSTANCE);
b2d2b36b20a0 Use XMLUtils to evaluate xpath expressions instead of using Config class. Adapted xpath (namespace and prefix).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 454
diff changeset
292
639
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
293 String mode = XMLUtils.xpathString(
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
294 format, XPATH_EXPORT_MODE, ArtifactNamespaceContext.INSTANCE);
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
295
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
296 if (mode == null || mode.equals("")) {
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
297 mode = "img";
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
298 }
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
299
467
b2d2b36b20a0 Use XMLUtils to evaluate xpath expressions instead of using Config class. Adapted xpath (namespace and prefix).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 454
diff changeset
300 String mimeType = XMLUtils.xpathString(
b2d2b36b20a0 Use XMLUtils to evaluate xpath expressions instead of using Config class. Adapted xpath (namespace and prefix).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 454
diff changeset
301 format, XPATH_MIME_TYPE, ArtifactNamespaceContext.INSTANCE);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
302
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
303 CallMeta callMeta = callContext.getMeta();
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
304
502
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
305 int chartWidth = 600;
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
306 int chartHeight = 400;
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
307 boolean sVisible = false;
629
d08b9ba148c5 Implemented logic to adjust number of bins corresponding to user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 627
diff changeset
308 int binCount = 0;
d08b9ba148c5 Implemented logic to adjust number of bins corresponding to user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 627
diff changeset
309 int binWidth = 0;
d08b9ba148c5 Implemented logic to adjust number of bins corresponding to user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 627
diff changeset
310
d08b9ba148c5 Implemented logic to adjust number of bins corresponding to user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 627
diff changeset
311 Map requestParameter = new HashMap();
502
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
312
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
313 // lines are always visible. if lines should be configurable we need a
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
314 // parameter in the user interface
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
315 boolean lVisible = true;
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
316
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
317 try {
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
318 if (inputData != null) {
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
319 Iterator<InputData> it = inputData.iterator();
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
320 while (it.hasNext()) {
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
321 InputData ip = it.next();
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
322 String optionName = ip.getName().trim();
629
d08b9ba148c5 Implemented logic to adjust number of bins corresponding to user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 627
diff changeset
323 requestParameter.put(optionName, ip.getValue());
502
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
324
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
325 if (optionName.equals("width")) {
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
326 chartWidth = Integer.parseInt(ip.getValue());
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
327 }
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
328 else if (optionName.equals("height")) {
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
329 chartHeight = Integer.parseInt(ip.getValue());
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
330 }
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
331 else if (optionName.equals("points")) {
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
332 sVisible = Boolean.parseBoolean(ip.getValue());
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
333 }
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
334 }
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
335 }
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
336 } catch (NumberFormatException e) {
725
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
337 log.warn(e, e);
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
338 XMLUtils.toStream(
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
339 feedFailure("not.a.number"),
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
340 outputStream);
dde7f51dbe1e Improved exception handling while feeding an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 652
diff changeset
341 return;
502
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
342 }
fec85cd01497 Fixed issue105. Added option to enable/disable data points in charts. Parse this option while creating charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 498
diff changeset
343
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
344 try {
639
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
345 Collection<KeyValueDescibeData> parameters =
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
346 getParameters(uuid);
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
347 Collection<KeyValueDescibeData> measurements =
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
348 getMeasurements(uuid);
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
349 Collection<KeyValueDescibeData> dates =
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
350 getDates(uuid);
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
351
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
352 Locale[] serverLocales =
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
353 RessourceFactory.getInstance().getLocales();
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
354 Locale locale =
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
355 callMeta.getPreferredLocale(serverLocales);
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
356
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
357 ChartLabels chartLables = createChartLabels(locale, uuid);
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
358
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
359 log.debug(
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
360 "Best locale - regarding intersection of server and " +
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
361 "browser locales - is " + locale.toString()
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
362 );
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
363
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
364 String exportFormat = getExportFormat(mimeType);
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
365
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
366 // CHART
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
367 if (outputMode.equalsIgnoreCase("chart")) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
368 log.debug("Chart will be generated.");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
369
639
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
370 if (mode.equalsIgnoreCase("img")) {
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
371 createChart(
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
372 outputStream,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
373 parameters,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
374 measurements,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
375 dates,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
376 chartLables,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
377 callContext,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
378 uuid,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
379 exportFormat,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
380 locale,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
381 chartWidth,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
382 chartHeight,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
383 lVisible,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
384 sVisible,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
385 callContext
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
386 );
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
387 }
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
388 else if (mode.equalsIgnoreCase("pdf")) {
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
389 createPDF(
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
390 outputStream,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
391 parameters,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
392 measurements,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
393 dates,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
394 chartLables,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
395 uuid,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
396 "A4",
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
397 true,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
398 lVisible,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
399 sVisible,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
400 locale,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
401 callContext
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
402 );
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
403 }
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
404 else if (mode.equalsIgnoreCase("svg")) {
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
405 createSVG(
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
406 outputStream,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
407 getParameters(uuid),
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
408 getMeasurements(uuid),
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
409 getDates(uuid),
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
410 createChartLabels(locale, uuid),
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
411 uuid,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
412 locale,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
413 chartWidth,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
414 chartHeight,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
415 lVisible,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
416 sVisible,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
417 callContext
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
418 );
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
419 }
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
420 }
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
421 // HISTOGRAM
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
422 else if (outputMode.equalsIgnoreCase("histogram")) {
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
423 Collection results = (Collection) getChartResult(uuid, callContext);
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
424 requestParameter.put("locale", locale);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
425
617
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
426 Object[][] data = HistogramHelper.prepareHistogramData(
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
427 results, parameters, measurements, dates);
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
428
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
429 int size = data.length;
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
430 Chart[] histograms = new Chart[size];
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
431
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
432 for (int i = 0; i < size; i++) {
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
433 ChartLabels labels = createHistogramLabels(
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
434 uuid, callContext, data[i]);
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
435
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
436 ChartTheme theme = createStyle(callContext);
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
437
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
438 histograms[i] = new DefaultHistogram(
629
d08b9ba148c5 Implemented logic to adjust number of bins corresponding to user input.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 627
diff changeset
439 labels, data[i], theme, requestParameter);
617
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
440 }
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
441
639
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
442 if (mode.equalsIgnoreCase("img")) {
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
443 ChartExportHelper.exportHistograms(
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
444 outputStream,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
445 histograms,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
446 exportFormat,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
447 chartWidth,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
448 chartHeight
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
449 );
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
450 }
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
451 else if (mode.equalsIgnoreCase("pdf")) {
640
e5f1e868ee3e Implementedr histogram pdf export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 639
diff changeset
452 ChartExportHelper.exportHistogramsAsPDF(
e5f1e868ee3e Implementedr histogram pdf export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 639
diff changeset
453 outputStream,
e5f1e868ee3e Implementedr histogram pdf export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 639
diff changeset
454 histograms,
e5f1e868ee3e Implementedr histogram pdf export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 639
diff changeset
455 "A4",
e5f1e868ee3e Implementedr histogram pdf export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 639
diff changeset
456 PDF_FORMAT_LANDSCAPE,
e5f1e868ee3e Implementedr histogram pdf export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 639
diff changeset
457 50F, 50F, 50F, 50F
e5f1e868ee3e Implementedr histogram pdf export.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 639
diff changeset
458 );
639
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
459 }
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
460 else if (mode.equalsIgnoreCase("svg")) {
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
461 ChartExportHelper.exportHistogramsAsSVG(
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
462 outputStream,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
463 histograms,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
464 null,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
465 chartWidth,
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
466 chartHeight
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
467 );
a94ed2755480 Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 629
diff changeset
468 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
469 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
470 else if (outputMode.equalsIgnoreCase("csv")) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
471 log.debug("CSV-File will be generated.");
452
4cd03910f97e Enable PDF export of vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 446
diff changeset
472 Object result = getChartResult(uuid, callContext);
4cd03910f97e Enable PDF export of vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 446
diff changeset
473 if (result instanceof Collection) {
4cd03910f97e Enable PDF export of vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 446
diff changeset
474 this.createCSV(
4cd03910f97e Enable PDF export of vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 446
diff changeset
475 outputStream,
4cd03910f97e Enable PDF export of vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 446
diff changeset
476 (Collection<Result>)result);
4cd03910f97e Enable PDF export of vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 446
diff changeset
477 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
478 } else if (outputMode.equalsIgnoreCase("statistics")) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
479 log.debug("Statistics will be generated.");
446
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
480
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
481 Collection<StatisticSet> statistics;
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
482
454
04cfb4e3da4f Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 452
diff changeset
483 Statistics s = getStatisticsGenerator();
04cfb4e3da4f Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 452
diff changeset
484 Object result = getChartResult(uuid, callContext);
446
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
485
454
04cfb4e3da4f Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 452
diff changeset
486 if (result != null && s != null) {
446
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
487 statistics = s.calculateStatistics(
454
04cfb4e3da4f Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 452
diff changeset
488 result,
446
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
489 parameters,
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
490 measurements,
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
491 dates);
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
492 }
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
493 else {
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
494 statistics = new ArrayList<StatisticSet>();
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
495 }
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
496
454
04cfb4e3da4f Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 452
diff changeset
497 Document doc = writeStatistics2XML(statistics);
04cfb4e3da4f Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 452
diff changeset
498
481
20dde2b6f1b5 Added end of life support for artifact states. Implemented ZIP download
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 480
diff changeset
499 XMLUtils.toStream(doc, outputStream);
454
04cfb4e3da4f Refactored statistics classes a bit. Added class for vertical cross sections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 452
diff changeset
500
617
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
501 }
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
502 else if (outputMode.equalsIgnoreCase("odv")) {
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
503 Collection<Result> odvResult = this.getODVResult(uuid);
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
504 this.createODV(outputStream, odvResult,uuid);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
505 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
506 } catch (IOException e) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
507 log.error(e, e);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
508 throw new StateException(e);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
509 } catch (TechnicalChartException e) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
510 log.error(e, e);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
511 throw new StateException(e);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
512 } catch (StatisticsException e) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
513 log.error(e, e);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
514 throw new StateException(e);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
515 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
516 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
517
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
518
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
519 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
520 * Retrieves the export format (e.g. png, gif, jpeg).
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
521 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
522 * @param mime Export format specified by the incoming request.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
523 * @return <i>mime</i> if it is supported - otherwise the first format in
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
524 * {@link #IMG_EXPORT_FORMAT}.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
525 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
526 protected String getExportFormat(String mime) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
527 for(int i = 0; i < IMG_EXPORT_FORMAT.length; i++) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
528 if (mime.trim().toUpperCase().indexOf(IMG_EXPORT_FORMAT[i]) > 0)
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
529 return IMG_EXPORT_FORMAT[i];
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
530 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
531
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
532 // no format found relating to mimeType, default export as PNG
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
533 return IMG_EXPORT_FORMAT[0];
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
534 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
535
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
536
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
537 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
538 * Returns a collection containing all selected KeyValueDescibeData objects
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
539 * of <i>parameters</i>.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
540 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
541 * @param parameters A collection with KeyValueDescibeData objects.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
542 * @return a collection cleaned from unselected objects.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
543 * @deprecated
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
544 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
545 protected Collection getCleanedParameters(Collection parameters) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
546 Iterator iter = parameters.iterator();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
547 Collection parameter = new Vector(parameters);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
548 while (iter.hasNext()) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
549 KeyValueDescibeData data = (KeyValueDescibeData)iter.next();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
550 if (!data.isSelected())
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
551 parameter.remove(data);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
552 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
553
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
554 return parameter;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
555 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
556
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
557
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
558 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
559 * Calls {@link #getCleanedParameters(java.util.Collection)} with the
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
560 * collection returned by {@link #getParameters(java.lang.String)}.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
561 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
562 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
563 * @return a cleaned collection.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
564 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
565 protected Collection getCleanedParameters(String uuid) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
566 return getCleanedParameters(getParameters(uuid));
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
567 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
568
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
569
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
570 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
571 * Create a csv file representing the data corresponding to the current
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
572 * parameterization.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
573 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
574 * @param out The output stream used to export the csv file.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
575 * @param results The data used for csv file creation.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
576 * @throws UnsupportedEncodingException if the encoding is not supported.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
577 * @throws IOException if an error occured while writing to output stream.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
578 * @throws StateException if an error occured while creating the csv file.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
579 */
368
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
580 protected void createCSV(OutputStream out, Collection<Result> results)
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
581 throws UnsupportedEncodingException, IOException, StateException
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
582 {
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
583 Iterator iter = results.iterator();
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
584 Result res = iter.hasNext() ? (Result) iter.next() : null;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
585
368
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
586 if (res == null)
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
587 return;
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
588
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
589 Profile profile = null;
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
590 int dataid = res.getInteger("DATAID").intValue();
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
591
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
592 // on meshes
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
593 if (dataid == 2) {
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
594 profile = new DefaultProfile(
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
595 TIMESERIES_MESH_CSV_COLUMN_LABEL,
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
596 ',',
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
597 '"',
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
598 '"',
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
599 "CSV",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
600 "ISO-8859-1");
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
601 }
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
602
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
603 // on timeseries
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
604 else {
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
605 profile = new DefaultProfile(
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
606 TIMESERIES_TIMESERIES_CSV_COLUMN_LABEL,
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
607 ',',
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
608 '"',
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
609 '"',
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
610 "CSV",
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
611 "ISO-8859-1");
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
612 }
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
613
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
614 DefaultExport export = new DefaultExport(
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
615 new DefaultDataCollector(TIMESERIES_CSV_PROFILE_COLUMNS));
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
616 export.create(profile, out, results);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
617 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
618
368
6491000407dd Added column labels for csv export of timeseries, vertical and horizontal profiles.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 358
diff changeset
619
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
620 /**
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
621 * Create an odv file representing the data corresponding to the current
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
622 * parameterization.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
623 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
624 * @param outputStream The output stream used to export the odv file.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
625 * @param result The data used for odv file creation.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
626 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
627 * @throws IOException if an error occured while writing to output stream.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
628 * @throws StateException if an error occured while creating the odv file.
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
629 */
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
630 protected void createODV(OutputStream outputStream,
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
631 Collection result,
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
632 String uuid)
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
633 throws IOException, StateException {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
634
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
635 Export export = new ODVExport(new SimpleOdvDataCollector(
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
636 TIMESERIES_ODV_PROFILE_NAMES),
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents: 762
diff changeset
637 this.getParameters(uuid));
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
638
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
639 if (result == null)
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
640 log.error("#################### RESULT == NULL #################");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
641 export.create(TIMESERIES_ODV_PROFILE, outputStream, result);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
642 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
643
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
644 /**
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
645 * Returns the statistic generator.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
646 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
647 * @return the statistic generator.
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
648 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
649 protected Statistics getStatisticsGenerator() {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
650 Statistics s = new TimeseriesStatistics();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
651 return s;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
652 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
653
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
654
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
655 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
656 * Writes the statistic into an xml document.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
657 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
658 * @param statistic Statistic to be written to xml document.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
659 * @return the xml document containing the statistic.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
660 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
661 protected Document writeStatistics2XML( Collection<StatisticSet> statistic) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
662 ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
663 Document doc = XMLUtils.newDocument();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
664 if (statistic != null) {
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
665 @SuppressWarnings("static-access")
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
666 Node statisticResults = ArtifactXMLUtilities.createArtifactElement(doc,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
667 "statistics");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
668 doc.appendChild(statisticResults);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
669 Iterator<StatisticSet> it = statistic.iterator();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
670 while (it.hasNext()) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
671 StatisticSet set = it.next();
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
672 @SuppressWarnings("static-access")
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
673 Element setElement = ArtifactXMLUtilities.createArtifactElement(doc,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
674 "statistic");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
675 setElement.setAttribute("name", set.getName());
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
676
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
677 Iterator<Statistic> sit = set.getStatistics().iterator();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
678 while (sit.hasNext()){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
679 Statistic s = sit.next();
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
680 @SuppressWarnings("static-access")
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
681 Element result = ArtifactXMLUtilities.createArtifactElement(doc,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
682 "statistic-value");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
683 result.setAttribute("name", s.getKey());
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
684 result.setAttribute("value", s.getStringValue());
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
685 setElement.appendChild(result);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
686 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
687 statisticResults.appendChild(setElement);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
688 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
689
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
690 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
691 return doc;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
692 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
693
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
694
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
695 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
696 * Returns the name of the selected feature.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
697 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
698 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
699 * @return the name of the selectef feature.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
700 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
701 protected String getSelectedFeatureName(String uuid) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
702 Collection values = getCollection(featureValuesName, uuid);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
703
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
704 if (values != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
705 Iterator it = values.iterator();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
706
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
707 while (it.hasNext()) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
708 KeyValueDescibeData data = (KeyValueDescibeData) it.next();
610
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
709 return data.getValue();
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
710 }
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
711
610
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
712 return "";
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
713 }
610
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
714 return "";
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
715 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
716
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
717
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
718 /**
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
719 * Creates a chart and writes it to <i>outputStream</i>.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
720 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
721 * @param outputStream The stream used to write the chart to.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
722 * @param parameters A collection with parameters.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
723 * @param measurements A collection with measurements.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
724 * @param dates A collection with dates.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
725 * @param chartLables The labels used to decorate the chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
726 * @param context The CallContext.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
727 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
728 * @param exportFormat The format the chart used to be exported as.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
729 * @param locale The Locale to specify the language.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
730 * @param width The width of the chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
731 * @param height The height of the chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
732 * @param linesVisible A boolean property to determine the visibility of
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
733 * lines connecting two datapoins.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
734 * @param shapesVisible A boolean property to determine the visibility of
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
735 * datapoints.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
736 * @param callContext The CallContext object.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
737 * @throws IOException if an error occured while writing to output stream.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
738 * @throws TechnicalChartException if an error occured while chart creation.
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
739 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
740 protected void createChart(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
741 OutputStream outputStream,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
742 Collection parameters,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
743 Collection measurements,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
744 Collection dates,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
745 ChartLabels chartLables,
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
746 CallContext context,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
747 String uuid,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
748 String exportFormat,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
749 Locale locale,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
750 int width,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
751 int height,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
752 boolean linesVisible,
439
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
753 boolean shapesVisible,
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
754 CallContext callContext
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
755 )
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
756 throws IOException, TechnicalChartException
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
757 {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
758 log.debug("Create chart.");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
759 Chart chart = getChart(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
760 chartLables,
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
761 createStyle(context),
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
762 parameters,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
763 measurements,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
764 dates,
439
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
765 getChartResult(uuid, callContext),
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
766 locale, // Locale
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
767 uuid,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
768 linesVisible,
439
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
769 shapesVisible,
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
770 callContext
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
771 );
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
772
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
773 if (chart == null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
774 log.error("Could not initialize chart.");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
775 return;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
776 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
777
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
778 log.debug(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
779 "export chart as " + exportFormat +
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
780 " in " + width + "x" + height
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
781 );
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
782
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
783 ChartExportHelper.exportImage(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
784 outputStream,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
785 chart.generateChart(),
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
786 exportFormat,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
787 width,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
788 height
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
789 );
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
790 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
791
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
792
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
793 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
794 * Creates a chart and writes it as pdf to <i>outputStream</i>.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
795 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
796 * @param outputStream The stream used to write the chart to.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
797 * @param parameters A collection with parameters.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
798 * @param measurements A collection with measurements.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
799 * @param dates A collection with dates.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
800 * @param chartLables The labels used to decorate the chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
801 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
802 * @param exportFormat The format the chart used to be exported as.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
803 * @param landscape A boolean property to determine the alignment of the
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
804 * chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
805 * @param linesVisible A boolean property to determine the visibility of
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
806 * lines connecting two datapoins.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
807 * @param shapesVisible A boolean property to determine the visibility of
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
808 * datapoints.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
809 * @param locale The Locale to specify the language.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
810 * @param context The CallContext object.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
811 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
812 protected void createPDF(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
813 OutputStream outputStream,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
814 Collection parameters,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
815 Collection measurements,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
816 Collection dates,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
817 ChartLabels chartLables,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
818 String uuid,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
819 String exportFormat,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
820 boolean landscape,
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
821 boolean linesVisible,
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
822 boolean shapesVisible,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
823 Locale locale,
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
824 CallContext context
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
825 ) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
826 Chart chart = getChart(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
827 chartLables,
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
828 createStyle(context),
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
829 parameters,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
830 measurements,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
831 dates,
452
4cd03910f97e Enable PDF export of vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 446
diff changeset
832 getChartResult(uuid, context),
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
833 locale,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
834 uuid,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
835 linesVisible,
439
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
836 shapesVisible,
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
837 context
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
838 );
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
839
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
840 if (chart == null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
841 log.error("Could not initialize chart.");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
842 return;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
843 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
844
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
845 ChartExportHelper.exportPDF(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
846 outputStream,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
847 chart.generateChart(),
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
848 "A4",
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
849 PDF_FORMAT_LANDSCAPE,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
850 50F, 50F, 50F, 50F
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
851 );
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
852 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
853
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
854
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
855 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
856 * Creates a chart and writes it as svg to <i>outputStream</i>.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
857 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
858 * @param outputStream The stream used to write the chart to.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
859 * @param parameters A collection with parameters.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
860 * @param measurements A collection with measurements.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
861 * @param dates A collection with dates.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
862 * @param chartLables The labels used to decorate the chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
863 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
864 * @param locale The Locale to specify the language.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
865 * @param width The width of the chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
866 * @param height The height of the chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
867 * @param linesVisible A boolean property to determine the visibility of
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
868 * lines connecting two datapoins.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
869 * @param shapesVisible A boolean property to determine the visibility of
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
870 * datapoints.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
871 * @param callContext The CallContext object.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
872 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
873 protected void createSVG(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
874 OutputStream outputStream,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
875 Collection parameters,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
876 Collection measurements,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
877 Collection dates,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
878 ChartLabels chartLables,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
879 String uuid,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
880 Locale locale,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
881 int width,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
882 int height,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
883 boolean linesVisible,
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
884 boolean shapesVisible,
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
885 CallContext callContext
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
886 ) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
887 Chart chart = getChart(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
888 chartLables,
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
889 createStyle(callContext),
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
890 parameters,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
891 measurements,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
892 dates,
446
f5a041000357 Connected vertical cross section with chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 443
diff changeset
893 getChartResult(uuid, callContext),
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
894 locale,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
895 uuid,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
896 linesVisible,
439
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
897 shapesVisible,
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
898 callContext
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
899 );
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
900
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
901 if (chart == null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
902 log.error("Could not initialize chart.");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
903 return;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
904 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
905
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
906 ChartExportHelper.exportSVG(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
907 outputStream,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
908 chart.generateChart(),
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
909 null,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
910 600, 400
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
911 );
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
912
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
913 log.debug("svg export finished.");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
914 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
915
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
916
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
917 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
918 * This method creates a chart and returns it. In normal case, this is the
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
919 * only method to be overriden by subclasses to create other types of
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
920 * charts.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
921 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
922 * @param chartLables Labels used to decorate the chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
923 * @param theme The theme used to adjust the look of the chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
924 * @param parameters A collection with parameters this chart contains.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
925 * @param measurements A collection with measurement this chart contains.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
926 * @param dates A collection with dates this chart contains.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
927 * @param result The data collection used to be displayed in this chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
928 * @param locale The Locale used to determine the language.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
929 * @param uuid The uuid of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
930 * @param linesVisible A boolean property to determine the visibility of
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
931 * lines connecting two points in a chart (not used in this chart type).
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
932 * @param shapesVisible A boolean property to determine the visiblity of
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
933 * datapoints in this chart (not used in this chart type).
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
934 * @param callContext The CallContext object.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
935 * @return a timeseries chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
936 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
937 protected Chart getChart(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
938 ChartLabels chartLables,
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
939 ChartTheme theme,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
940 Collection parameters,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
941 Collection measurements,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
942 Collection dates,
429
bed9735adf84 Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 368
diff changeset
943 Object result,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
944 Locale locale,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
945 String uuid,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
946 boolean linesVisible,
439
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
947 boolean shapesVisible,
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
948 CallContext callContext
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
949 ) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
950 Chart chart = null;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
951
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
952 if (CACHE_CHART) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
953 log.info("Try to get timeseries chart from cache.");
439
8975de9d7483 Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 429
diff changeset
954 chart = (Chart) getChartFromCache(uuid, callContext);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
955 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
956
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
957 if (chart != null)
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
958 return chart;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
959
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
960 log.info("Chart not in cache yet.");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
961 chart = new TimeSeriesChart(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
962 chartLables,
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
963 theme,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
964 parameters,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
965 measurements,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
966 dates,
429
bed9735adf84 Finished preprocessing data for interpolation in verticalcrosssection charts.ß
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 368
diff changeset
967 (Collection)result,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
968 timeGapDefinitions,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
969 locale,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
970 linesVisible,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
971 shapesVisible
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
972 );
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
973 chart.generateChart();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
974
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
975 if (CACHE_CHART) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
976 log.info("Put chart into cache.");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
977 purifyChart(chart, uuid);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
978 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
979
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
980 return chart;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
981 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
982
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
983
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
984 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
985 * Fetches the ChartTheme from <i>callContext</i> and returns it.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
986 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
987 * @param callContext CallContext objects storing a chart theme.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
988 * @return a chart theme.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
989 */
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
990 protected ChartTheme createStyle(CallContext callContext) {
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
991 log.debug("Fetch chart theme from global context");
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
992
358
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
993 GNVArtifactContext context =
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
994 (GNVArtifactContext) callContext.globalContext();
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
995
2f7a28f211c7 Fetch ChartTheme from CallContext instead of creating it each time before creating a chart.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 342
diff changeset
996 XMLChartTheme theme = (XMLChartTheme) context.get(
443
da21c256a0ba "horizontale Schnittprofile" are now configured via conf.xml
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 439
diff changeset
997 GNVArtifactContext.CHART_TEMPLATE_KEY);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
998
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
999 return theme;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1000 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1001
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1002 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1003 * Creates a ChartLabels object storing different labels used to decorate a
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1004 * chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1005 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1006 * @param locale The Locale object to adjust the language of labels.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1007 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1008 * @return the chart labels.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1009 */
492
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1010 protected ChartLabels createChartLabels(Locale locale, String uuid) {
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1011 return new ChartLabels(
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1012 createChartTitle(locale, uuid),
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1013 createChartSubtitle(locale, uuid),
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1014 RessourceFactory.getInstance().getRessource(
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1015 locale,
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1016 domainLable,
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1017 domainLable
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1018 )
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1019 );
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1020 }
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1021
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1022
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1023 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1024 * Creates and returns the chart title.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1025 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1026 * @param locale The Locale used to adjust the language of the title.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1027 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1028 * @return the name of the selected fis.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1029 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1030 protected String createChartTitle(Locale locale, String uuid) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1031 return getFisName(locale);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1032
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1033 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1034
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1035
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1036 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1037 * Creates and returns the subtitle of a chart.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1038 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1039 * @param locale The Locale used to adjust the language of the subtitle.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1040 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1041 * @return the selected feature.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1042 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1043 protected String createChartSubtitle(Locale locale, String uuid) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1044 return getSelectedFeatureName(uuid);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1045 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1046
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1047
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1048 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1049 * Creates and returns labels to decorate histograms.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1050 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1051 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1052 * @param context The CallContext object.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1053 * @param data An array storing strings.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1054 * @return A ChartLabels object with the 1st string in <i>data</i> as title.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1055 */
617
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
1056 protected ChartLabels createHistogramLabels(
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
1057 String uuid, CallContext context, Object[] data)
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
1058 {
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
1059 return new ChartLabels((String) data[0], "", "");
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
1060 }
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
1061
3d13fa281a7e Added new ouput mode: histogram.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 615
diff changeset
1062
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1063 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1064 * Returns the selected fis name.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1065 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1066 * @param locale The Locale object used to adjust the language.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1067 * @return the name of the fis.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1068 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1069 protected String getFisName(Locale locale) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1070 String returnValue = "";
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1071 InputData input = inputData.get("fisname");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1072
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1073 if (input != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1074 String value = input.getValue();
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1075
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1076 returnValue = RessourceFactory.getInstance().getRessource(
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1077 locale,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1078 value,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1079 value
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1080 );
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1081 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1082 return returnValue;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1083 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1084
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1085
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1086 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1087 * Returns the name of the selected object in the collection specified by
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1088 * <i>key</i>.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1089 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1090 * @param uuid The UUID of the current artifat.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1091 * @param key A key to specify a collection.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1092 * @return the name of the selected item.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1093 */
492
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1094 protected String getSelectedInputDataName(String uuid, String key) {
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1095 Collection values = getCollection(key, uuid);
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1096
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1097 if (values != null) {
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1098 Iterator it = values.iterator();
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1099
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1100 while (it.hasNext()) {
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1101 KeyValueDescibeData data = (KeyValueDescibeData) it.next();
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1102
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1103 if (data.isSelected()) {
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1104 return data.getValue();
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1105 }
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1106 }
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1107 }
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1108 return null;
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1109 }
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1110
79e80c289018 Added labels and titles to 'Profilschnitt' charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 481
diff changeset
1111
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1112 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1113 * Returns a collection of selected parameters.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1114 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1115 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1116 * @return selected parameters.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1117 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1118 protected Collection<KeyValueDescibeData> getParameters(String uuid) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1119 return this.getCollection(parameterValuesName, uuid);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1120 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1121
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1122 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1123 * Returns a collection of selected measurements.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1124 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1125 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1126 * @return selected measurements.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1127 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1128 protected Collection<KeyValueDescibeData> getMeasurements(String uuid) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1129 return this.getCollection(measuremenValueName, uuid);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1130 }
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1131
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1132 /**
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1133 * Returns a collection of selected dates.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1134 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1135 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1136 * @return selected dates.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1137 */
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1138 protected Collection<KeyValueDescibeData> getDates(String uuid) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1139 return this.getCollection(dateValueName,uuid);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1140 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1141
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1142 @Override
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1143 public void setup(Node configuration) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1144 super.setup(configuration);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1145 String featureNameValue = Config.getStringXPath(configuration,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1146 "value-names/value-name[@name='feature']/@value");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1147 if (featureNameValue != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1148 this.featureValuesName = featureNameValue;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1149 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1150 String parameterNameValue = Config.getStringXPath(configuration,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1151 "value-names/value-name[@name='parameter']/@value");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1152 if (parameterNameValue != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1153 this.parameterValuesName = parameterNameValue;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1154 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1155 String measurementNameValue = Config.getStringXPath(configuration,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1156 "value-names/value-name[@name='measurement']/@value");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1157 if (measurementNameValue != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1158 this.measuremenValueName = measurementNameValue;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1159 }
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
1160
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1161 String dateNameValue = Config.getStringXPath(configuration,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1162 "value-names/value-name[@name='date']/@value");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1163 if (dateNameValue != null) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1164 this.dateValueName = dateNameValue;
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1165 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1166 if (timeGapDefinitions == null){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1167 Element gapDefinition = (Element)Config.getNodeXPath(configuration,
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1168 "time-gap-definition");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1169 synchronized (this.getClass()) {
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1170 if (gapDefinition != null){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1171 String link = gapDefinition.getAttribute("xlink:href");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1172 if (link != null ){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1173 String absolutFileName = Config.replaceConfigDir(link);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1174 gapDefinition = (Element)new ArtifactXMLUtilities().
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1175 readConfiguration(absolutFileName);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1176 }
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
1177
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
1178 NodeList gapDefinitions = Config.getNodeSetXPath(gapDefinition,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1179 "/time-gaps/time-gap");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1180 if (gapDefinition != null){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1181 timeGapDefinitions = new ArrayList<TimeGap>(gapDefinitions.
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1182 getLength());
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1183 for (int i = 0; i < gapDefinitions.getLength(); i++){
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1184 Element gapNode = (Element)gapDefinitions.item(i);
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1185 String unit = gapNode.getAttribute("unit");
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1186 int key = Integer.parseInt(gapNode.getAttribute("key"));
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1187 int value = Integer.parseInt(gapNode.getAttribute("gap"));
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1188 log.info("Add new Timegap: "+key+" "+value+" "+ unit);
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
1189 timeGapDefinitions.add(new DefaultTimeGap(unit,
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 765
diff changeset
1190 key,
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1191 value));
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1192 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1193 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1194 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1195 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1196 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1197 }
610
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1198
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1199
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1200 /**
804
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1201 * Creates a <code>NamedArrayList</code> storing some <code>
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1202 * KeyValueDescibeData</code> objects found in the input data with the key
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1203 * <i>collectionName</i>.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1204 *
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1205 * @param collectionName String to specify the input data.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1206 * @param uuid The UUID of the current artifact.
9058c08eac3a Added more Javadoc in some classes of state.profile.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 781
diff changeset
1207 * @return a collection with values from input data.
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1208 */
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1209 protected Collection<KeyValueDescibeData> getCollection(
610
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1210 String collectionName,
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1211 String uuid)
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1212 {
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1213 NamedCollection<KeyValueDescibeData> c = new NamedArrayList<KeyValueDescibeData>(collectionName);
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1214
610
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1215 InputData data = inputData.get(collectionName);
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1216 if (data == null) {
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1217 log.warn("No collection found with name: " + collectionName);
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1218 return c;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1219 }
610
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1220
615
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
1221 String[] descs = data.getDescription();
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
1222 String[] values = data.splitValue();
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
1223 int size = values.length;
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
1224
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
1225 for (int i = 0; i < size; i++){
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
1226 c.add(new DefaultKeyValueDescribeData(
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
1227 values[i], descs[i], getID()));
01054ddccb0f Repaired multi parameter selection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
1228 }
610
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1229
6484464d2059 Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 536
diff changeset
1230 return c;
335
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1231 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1232 }
e964a3d8f7bc Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1233 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org