Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java @ 261:874644bf1da8
Added start-script to version control.
gnv-artifacts/trunk@343 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 16 Nov 2009 08:19:04 +0000 |
parents | 07650fc6014c |
children | d6c75171f1e9 |
rev | line source |
---|---|
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 package de.intevation.gnv.transition.timeseries; |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
6 import java.awt.Color; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
7 import java.awt.Dimension; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
8 import java.io.IOException; |
73
504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents:
68
diff
changeset
|
9 import java.io.OutputStream; |
177
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
10 import java.io.UnsupportedEncodingException; |
217
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
11 import java.util.ArrayList; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
12 import java.util.Collection; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
13 import java.util.Iterator; |
217
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
14 import java.util.List; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
15 |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
16 import javax.xml.transform.Transformer; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
17 import javax.xml.transform.TransformerConfigurationException; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
18 import javax.xml.transform.TransformerException; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
19 import javax.xml.transform.TransformerFactory; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
20 import javax.xml.transform.TransformerFactoryConfigurationError; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
21 import javax.xml.transform.dom.DOMSource; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
22 import javax.xml.transform.stream.StreamResult; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
23 |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
24 import org.apache.log4j.Logger; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
25 import org.w3c.dom.Document; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
26 import org.w3c.dom.Element; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
27 import org.w3c.dom.Node; |
217
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
28 import org.w3c.dom.NodeList; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
29 |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
30 import au.com.bytecode.opencsv.CSVWriter; |
119 | 31 import de.intevation.artifactdatabase.Config; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
32 import de.intevation.artifactdatabase.XMLUtils; |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
33 import de.intevation.artifacts.CallMeta; |
178
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
34 import de.intevation.artifacts.PreferredLocale; |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
35 import de.intevation.gnv.artifacts.ressource.RessourceFactory; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
36 import de.intevation.gnv.chart.ChartFactory; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
37 import de.intevation.gnv.chart.ChartLabels; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
38 import de.intevation.gnv.chart.ChartStyle; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
39 import de.intevation.gnv.chart.exception.TechnicalChartException; |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
40 import de.intevation.gnv.exports.DefaultExport; |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
41 import de.intevation.gnv.exports.DefaultProfile; |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
42 import de.intevation.gnv.exports.Export.Profile; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
43 import de.intevation.gnv.geobackend.base.Result; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
44 import de.intevation.gnv.statistics.Statistic; |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
45 import de.intevation.gnv.statistics.StatisticSet; |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
46 import de.intevation.gnv.statistics.Statistics; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
47 import de.intevation.gnv.statistics.TimeseriesStatistics; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
48 import de.intevation.gnv.statistics.exception.StatisticsException; |
217
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
49 import de.intevation.gnv.timeseries.gap.DefaultTimeGap; |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
50 import de.intevation.gnv.timeseries.gap.TimeGap; |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
51 import de.intevation.gnv.transition.InputData; |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
52 import de.intevation.gnv.transition.OutputTransitionBase; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
53 import de.intevation.gnv.transition.describedata.KeyValueDescibeData; |
81
9b41f3688610
Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
73
diff
changeset
|
54 import de.intevation.gnv.transition.describedata.NamedCollection; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
55 import de.intevation.gnv.transition.exception.TransitionException; |
233
2ceb4bf51cba
Added DataCollector which collects data used for exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
232
diff
changeset
|
56 import de.intevation.gnv.exports.DefaultExport; |
2ceb4bf51cba
Added DataCollector which collects data used for exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
232
diff
changeset
|
57 import de.intevation.gnv.exports.DefaultDataCollector; |
238
a157c6042cb4
ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
58 import de.intevation.gnv.exports.SimpleOdvDataCollector; |
233
2ceb4bf51cba
Added DataCollector which collects data used for exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
232
diff
changeset
|
59 import de.intevation.gnv.exports.DefaultProfile; |
2ceb4bf51cba
Added DataCollector which collects data used for exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
232
diff
changeset
|
60 import de.intevation.gnv.exports.Export.Profile; |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
61 import de.intevation.gnv.utils.ArtifactXMLUtilities; |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
63 |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 * @author Tim Englich <tim.englich@intevation.de> |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
66 * |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
67 */ |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
68 public class TimeSeriesOutputTransition extends OutputTransitionBase { |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
69 |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
70 /** |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
71 * The UID of this Class |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
72 */ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
73 private static final long serialVersionUID = 4178407570503098858L; |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
74 |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
75 /** |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
76 * the logger, used to log exceptions and additonaly information |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
77 */ |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
78 private static Logger log = Logger |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
79 .getLogger(TimeSeriesOutputTransition.class); |
217
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
80 |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
81 |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
82 private static List<TimeGap> timeGapDefinitions = null; |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
83 |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
84 protected String domainLable = "Zeit [UTC]"; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
85 |
119 | 86 protected String featureValuesName = "featureid"; |
87 protected String parameterValuesName = "parameterid"; | |
88 protected String measuremenValueName = "measurementid"; | |
179
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
89 protected String dateValueName = "dateid"; |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
90 |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
91 public static final String [] TIMESERIES_CSV_PROFILE_NAMES = { |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
92 "XORDINATE", |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
93 "YORDINATE", |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
94 "GROUP1", |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
95 "GROUP2", |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
96 "GROUP3" |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
97 }; |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
98 |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
99 public static final String [] TIMESERIES_ODV_PROFILE_NAMES = { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
100 "CRUISE", |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
101 "STATION", |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
102 "TYPE", |
238
a157c6042cb4
ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
103 "SHAPE", |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
104 "BOTDEPTH", |
247
af474a541f74
Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents:
241
diff
changeset
|
105 "DEPTH", |
af474a541f74
Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents:
241
diff
changeset
|
106 "TIMEVALUE", |
af474a541f74
Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents:
241
diff
changeset
|
107 "DATAVALUE", |
af474a541f74
Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents:
241
diff
changeset
|
108 "PARAMETER" |
239
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
109 }; |
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
110 |
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
111 |
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
112 public static final String [] ODV_COLUMN_HEADER = { |
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
113 "Cruise", |
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
114 "Station", |
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
115 "Type", |
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
116 "Longitude [deegrees_east]", |
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
117 "Latitude [deegrees_north]", |
241
8500529d82af
Added ODV-Export to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
239
diff
changeset
|
118 "Bot. Depth [m]", |
247
af474a541f74
Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents:
241
diff
changeset
|
119 "Depth [m]", |
af474a541f74
Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents:
241
diff
changeset
|
120 "Date/Time", |
af474a541f74
Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents:
241
diff
changeset
|
121 "Value", |
af474a541f74
Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents:
241
diff
changeset
|
122 "Parameterid" |
239
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
123 }; |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
124 |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
125 /** |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
126 * Profile for exporting data to cvs |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
127 */ |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
128 public static final Profile TIMESERIES_CSV_PROFILE = |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
129 new DefaultProfile( |
239
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
130 null, |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
131 ',', |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
132 '"', |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
133 '"', |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
134 "CSV", |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
135 "ISO-8859-1"); |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
136 |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
137 /** |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
138 * Profile for exporting data to odv |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
139 * TODO Change TIMESERIES_PROFILE_NAMES, which belong to CSV exports |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
140 */ |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
141 public static final Profile TIMESERIES_ODV_PROFILE = |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
142 new DefaultProfile( |
239
75da91eca29f
Added possibility to print column labels in the first line of an export. Added labels for odv export as well.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
238
diff
changeset
|
143 ODV_COLUMN_HEADER, |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
144 '\t', |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
145 CSVWriter.NO_QUOTE_CHARACTER, |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
146 CSVWriter.NO_ESCAPE_CHARACTER, |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
147 "ODV", |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
148 "ISO-8859-1"); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
149 |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
150 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
151 * Constructor |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
152 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
153 public TimeSeriesOutputTransition() { |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
154 super(); |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
155 } |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
156 |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
157 /** |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
158 * @see de.intevation.gnv.transition.OutputTransition#out(java.lang.String, |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
159 * java.util.Collection, java.io.OutputStream, java.lang.String, |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
160 * de.intevation.artifacts.CallMeta) |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
161 */ |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
162 public void out(String outputMode, Collection<InputData> inputData, |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
163 OutputStream outputStream, String uuid, CallMeta callMeta) |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
164 throws TransitionException { |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
165 log.debug("TimeSeriesOutputTransition.out"); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
166 try { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
167 |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
168 this.advance(uuid, callMeta); // TODO This hsould only be done if it is nessessary |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
169 |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
170 if (outputMode.equalsIgnoreCase("chart")) { |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
171 log.debug("Chart will be generated."); |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
172 int chartWidth = 600; |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
173 int chartHeight = 400; |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
174 try { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
175 if (inputData != null) { |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
176 Iterator<InputData> it = inputData.iterator(); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
177 while (it.hasNext()) { |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
178 InputData ip = it.next(); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
179 if (ip.getName().equalsIgnoreCase("width")) { |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
180 chartWidth = Integer.parseInt(ip.getValue()); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
181 } else if (ip.getName().equalsIgnoreCase("height")) { |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
182 chartHeight = Integer.parseInt(ip.getValue()); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
183 } |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
184 } |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
185 } |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
186 } catch (NumberFormatException e) { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
187 log.error(e, e); |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
188 throw new TransitionException(e); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
90
diff
changeset
|
189 } |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
190 Collection<KeyValueDescibeData> parameters = this.getParameters(uuid); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
191 Collection<KeyValueDescibeData> measurements = this.getMeasurements(uuid); |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
192 Collection<KeyValueDescibeData> dates = this.getDates(uuid); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
193 ChartStyle chartStyle = this |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
194 .creatStyle(chartWidth, chartHeight); |
178
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
195 ChartLabels chartLables = new ChartLabels(this.getFisName(callMeta.getLanguages())+" "+this |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
196 .getSelectedFeatureName(uuid), this.domainLable); |
179
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
197 this.createChart(outputStream, parameters, measurements,dates, |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
198 chartStyle, chartLables, uuid); |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
199 } else if (outputMode.equalsIgnoreCase("csv")) { |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
200 log.debug("CSV-File will be generated."); |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
201 Collection<Result> chartResult = this.getChartResult(uuid); |
177
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
202 this.createCSV(outputStream, chartResult); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
203 } else if (outputMode.equalsIgnoreCase("statistics")) { |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
204 log.debug("Statistics will be generated."); |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
205 Statistics s = getStatisticsGenerator(); |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
206 Collection<Result> chartResult = this.getChartResult(uuid); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
207 Collection<KeyValueDescibeData> parameters = |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
208 this.getParameters(uuid); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
209 Collection<KeyValueDescibeData> measurements = |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
210 this.getMeasurements(uuid); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
211 Collection<KeyValueDescibeData> dates = |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
212 this.getDates(uuid); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
213 Collection<StatisticSet> statistics = |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
214 s.calculateStatistics(chartResult, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
215 parameters, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
216 measurements, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
217 dates); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
218 Document doc = this.writeStatistics2XML(statistics); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
219 this.writeDocument2OutputStream(doc, outputStream); |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
220 } else if (outputMode.equalsIgnoreCase("odv")) { |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
221 |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
222 Collection<Result> odvResult = this.getODVResult(uuid); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
230
diff
changeset
|
223 this.createODV(outputStream, odvResult); |
90
6bdef6e590d6
Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
224 } |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
225 } catch (IOException e) { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
226 log.error(e, e); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
227 throw new TransitionException(e); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
228 } catch (TechnicalChartException e) { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
229 log.error(e, e); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
230 throw new TransitionException(e); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
231 } catch (StatisticsException e) { |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
232 log.error(e, e); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
233 throw new TransitionException(e); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
234 } |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
235 } |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
236 |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
237 |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
238 /** |
177
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
239 * @param outputStream |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
240 * @param chartResult |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
241 * @throws UnsupportedEncodingException |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
242 * @throws IOException |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
243 * @throws TransitionException |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
244 */ |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
245 protected void createCSV(OutputStream outputStream, |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
246 Collection<Result> chartResult) |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
247 throws UnsupportedEncodingException, |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
248 IOException, |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
249 TransitionException { |
233
2ceb4bf51cba
Added DataCollector which collects data used for exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
232
diff
changeset
|
250 DefaultExport export = new DefaultExport(new DefaultDataCollector( |
2ceb4bf51cba
Added DataCollector which collects data used for exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
232
diff
changeset
|
251 TIMESERIES_CSV_PROFILE_NAMES)); |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
252 |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
253 export.create(TIMESERIES_CSV_PROFILE, outputStream, chartResult); |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
254 } |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
255 |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
256 /** |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
257 * TODO Result is not used at the moment. Change result with correct data. |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
258 */ |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
259 protected void createODV(OutputStream outputStream, Collection result) |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
260 throws IOException, TransitionException { |
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
261 |
238
a157c6042cb4
ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
262 DefaultExport export = new DefaultExport(new SimpleOdvDataCollector( |
a157c6042cb4
ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
263 TIMESERIES_ODV_PROFILE_NAMES)); |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
264 |
238
a157c6042cb4
ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
265 if (result == null) |
a157c6042cb4
ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
233
diff
changeset
|
266 log.error("#################### RESULT == NULL #################"); |
230
f68ffbe974a0
Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
267 export.create(TIMESERIES_ODV_PROFILE, outputStream, result); |
177
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
268 } |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
269 |
08b8b79b30ff
Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
270 /** |
98
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
271 * @return |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
272 */ |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
273 protected Statistics getStatisticsGenerator() { |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
274 Statistics s = new TimeseriesStatistics(); |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
275 return s; |
156db25ad4b4
Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents:
95
diff
changeset
|
276 } |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
277 |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
278 protected void writeDocument2OutputStream(Document document, OutputStream os) { |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
279 |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
280 try { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
281 TransformerFactory transformerFactory = TransformerFactory |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
282 .newInstance(); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
283 Transformer transformer = transformerFactory.newTransformer(); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
284 DOMSource source = new DOMSource(document); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
285 StreamResult result = new StreamResult(os); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
286 transformer.transform(source, result); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
287 } catch (TransformerConfigurationException e) { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
288 log.error(e, e); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
289 } catch (TransformerFactoryConfigurationError e) { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
290 log.error(e, e); |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
291 } catch (TransformerException e) { |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
292 log.error(e, e); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
293 } |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
294 } |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
295 |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
296 protected Document writeStatistics2XML( Collection<StatisticSet> statistic) { |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
297 ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities(); |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
298 Document doc = XMLUtils.newDocument(); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
299 if (statistic != null) { |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
300 Node statisticResults = xmlUtilities.createArtifactElement(doc, |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
301 "statistics"); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
302 doc.appendChild(statisticResults); |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
303 Iterator<StatisticSet> it = statistic.iterator(); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
304 while (it.hasNext()) { |
253
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
305 StatisticSet set = it.next(); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
306 Element setElement = xmlUtilities.createArtifactElement(doc, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
307 "statistic"); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
308 setElement.setAttribute("name", set.getName()); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
309 |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
310 Iterator<Statistic> sit = set.getStatistics().iterator(); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
311 while (sit.hasNext()){ |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
312 Statistic s = sit.next(); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
313 Element result = xmlUtilities.createArtifactElement(doc, |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
314 "statistic-value"); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
315 result.setAttribute("name", s.getKey()); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
316 result.setAttribute("value", s.getStringValue()); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
317 setElement.appendChild(result); |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
318 } |
07650fc6014c
Put a name to each Statistic group which is similar to the name of the
Tim Englich <tim.englich@intevation.de>
parents:
247
diff
changeset
|
319 statisticResults.appendChild(setElement); |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
320 } |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
321 |
95
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
322 } |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
323 return doc; |
13402ac8d8fe
Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
324 } |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
325 |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
326 protected String getSelectedFeatureName(String uuid) { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
327 Collection<KeyValueDescibeData> values = this |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
328 .getCollection(featureValuesName, uuid); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
329 if (values != null) { |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
330 Iterator<KeyValueDescibeData> it = values.iterator(); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
331 while (it.hasNext()) { |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
332 KeyValueDescibeData data = it.next(); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
333 if (data.isSelected()) { |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
334 return data.getValue(); |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
335 } |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
336 } |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
337 } |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
338 return null; |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
339 } |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
340 |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
341 /** |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
342 * @param outputStream |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
343 * @param parameters |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
344 * @param measurements |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
345 * @param timeSeriesName |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
346 * @param chartStyle |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
347 * @param chartLables |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
348 * @throws IOException |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
349 * @throws TechnicalChartException |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
350 */ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
351 protected void createChart(OutputStream outputStream, |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
352 Collection<KeyValueDescibeData> parameters, |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
353 Collection<KeyValueDescibeData> measurements, |
179
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
354 Collection<KeyValueDescibeData> dates, |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
355 ChartStyle chartStyle, ChartLabels chartLables, |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
356 String uuid) throws IOException, |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
357 TechnicalChartException { |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
358 ChartFactory chartFactory = new ChartFactory(); |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
82
diff
changeset
|
359 chartFactory.createSimpleTimeSeriesChart(chartLables, chartStyle, |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
360 parameters, measurements, outputStream, this |
217
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
361 .getChartResult(uuid),timeGapDefinitions); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
362 } |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
363 |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
364 protected ChartStyle creatStyle(int witdh, int height) { |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
365 // TODO Konfigurierbar machen |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
366 de.intevation.gnv.chart.Insets lInsets = new de.intevation.gnv.chart.Insets( |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
367 5d, 5d, 5d, 5d); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
368 Dimension lChartSize = new Dimension(witdh, height); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
369 return new ChartStyle(Color.white, new Color(230, 230, 230), |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
370 Color.white, Color.white, true, true, lInsets, lChartSize); |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
371 } |
178
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
372 |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
373 protected String getFisName(PreferredLocale[] preferredLocales){ |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
374 String returnValue = ""; |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
375 InputData inputData = this.inputData.get("fisname"); |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
376 if (inputData != null){ |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
377 returnValue = RessourceFactory.getInstance() |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
378 .getRessource(preferredLocales, |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
379 inputData.getValue(), |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
380 inputData.getValue()); |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
381 } |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
382 return returnValue; |
9bcf315f57e4
Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents:
177
diff
changeset
|
383 } |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
384 |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
385 protected Collection<KeyValueDescibeData> getParameters(String uuid) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
386 return this.getCollection(parameterValuesName, uuid); |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
387 } |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
388 |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
389 protected Collection<KeyValueDescibeData> getMeasurements(String uuid) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
390 return this.getCollection(measuremenValueName, uuid); |
119 | 391 } |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
392 protected Collection<KeyValueDescibeData> getDates(String uuid) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
393 return this.getCollection(dateValueName,uuid); |
179
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
394 } |
119 | 395 |
396 @Override | |
397 public void setup(Node configuration) { | |
398 super.setup(configuration); | |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
399 String featureNameValue = Config.getStringXPath(configuration, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
400 "value-names/value-name[@name='feature']/@value"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
401 if (featureNameValue != null) { |
119 | 402 this.featureValuesName = featureNameValue; |
403 } | |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
404 String parameterNameValue = Config.getStringXPath(configuration, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
405 "value-names/value-name[@name='parameter']/@value"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
406 if (parameterNameValue != null) { |
119 | 407 this.parameterValuesName = parameterNameValue; |
408 } | |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
409 String measurementNameValue = Config.getStringXPath(configuration, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
410 "value-names/value-name[@name='measurement']/@value"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
119
diff
changeset
|
411 if (measurementNameValue != null) { |
119 | 412 this.measuremenValueName = measurementNameValue; |
413 } | |
179
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
414 |
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
415 String dateNameValue = Config.getStringXPath(configuration, |
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
416 "value-names/value-name[@name='date']/@value"); |
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
417 if (dateNameValue != null) { |
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
418 this.dateValueName = dateNameValue; |
f2c76f35da5a
Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents:
178
diff
changeset
|
419 } |
217
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
420 if (timeGapDefinitions == null){ |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
421 Element gapDefinition = (Element)Config.getNodeXPath(configuration, |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
422 "time-gap-definition"); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
423 synchronized (this.getClass()) { |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
424 if (gapDefinition != null){ |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
425 String link = gapDefinition.getAttribute("xlink:href"); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
426 if (link != null ){ |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
427 String absolutFileName = Config.replaceConfigDir(link); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
428 gapDefinition = (Element)new ArtifactXMLUtilities(). |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
429 readConfiguration(absolutFileName); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
430 } |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
431 |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
432 NodeList gapDefinitions = Config.getNodeSetXPath(gapDefinition, |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
433 "/time-gaps/time-gap"); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
434 if (gapDefinition != null){ |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
435 timeGapDefinitions = new ArrayList<TimeGap>(gapDefinitions. |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
436 getLength()); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
437 for (int i = 0; i < gapDefinitions.getLength(); i++){ |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
438 Element gapNode = (Element)gapDefinitions.item(i); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
439 String unit = gapNode.getAttribute("unit"); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
440 int key = Integer.parseInt(gapNode.getAttribute("key")); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
441 int value = Integer.parseInt(gapNode.getAttribute("gap")); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
442 log.info("Add new Timegap: "+key+" "+value+" "+ unit); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
443 timeGapDefinitions.add(new DefaultTimeGap(unit, |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
444 key, |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
445 value)); |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
446 } |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
447 } |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
448 |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
449 } |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
450 } |
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
451 } |
82
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
452 } |
217
3dcd2b0b456e
Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents:
207
diff
changeset
|
453 |
82
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
454 /** |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
455 * @param collectionName |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
456 * @return |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
457 */ |
5eb62df21f9a
Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents:
81
diff
changeset
|
458 protected Collection<KeyValueDescibeData> getCollection( |
207
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
459 String collectionName, |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
460 String uuid) { |
d87347142702
Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents:
179
diff
changeset
|
461 Iterator<Object> it = this.getDescibeData(uuid).iterator(); |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
462 while (it.hasNext()) { |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
463 |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
464 Object o = it.next(); |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
465 |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
466 if (o instanceof NamedCollection<?>) { |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
467 NamedCollection<KeyValueDescibeData> nc = (NamedCollection<KeyValueDescibeData>) o; |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
468 if (nc.getName().equals(collectionName)) { |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
469 return nc; |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
470 } |
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
471 } |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
472 } |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
473 return null; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
474 } |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
475 } |