annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java @ 327:22a6493e8460

New options in chart template: visibility of lines and points in charts and point's size. gnv-artifacts/trunk@393 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 02 Dec 2009 10:50:12 +0000
parents 3eff9241ea1e
children 1c427acb6c76
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.io.IOException;
304
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
7 import java.io.File;
73
504570de21fd Refactoring Work depending on Infrastructurchanges in the Artifact-Module
Tim Englich <tim.englich@intevation.de>
parents: 68
diff changeset
8 import java.io.OutputStream;
321
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
9 import java.io.FileOutputStream;
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;
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
15 import java.util.Locale;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
16
95
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.Transformer;
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.TransformerConfigurationException;
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.TransformerException;
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.TransformerFactory;
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.TransformerFactoryConfigurationError;
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.dom.DOMSource;
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
23 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
24
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
25 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
26 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
27 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
28 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
29 import org.w3c.dom.NodeList;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
30
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
31 import org.jfree.chart.ChartTheme;
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
32
90
6bdef6e590d6 Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents: 86
diff changeset
33 import au.com.bytecode.opencsv.CSVWriter;
119
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
34 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
35 import de.intevation.artifactdatabase.XMLUtils;
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
36 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
37 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
38 import de.intevation.gnv.artifacts.ressource.RessourceFactory;
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
39 import de.intevation.gnv.chart.Chart;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
40 import de.intevation.gnv.chart.ChartLabels;
299
d6c75171f1e9 Pass the xml document of the request to OutputTransition for more information about output formats of charts (png,jpeg).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 253
diff changeset
41 import de.intevation.gnv.chart.TimeSeriesChart;
304
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
42 import de.intevation.gnv.chart.XMLChartTheme;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
43 import de.intevation.gnv.chart.exception.TechnicalChartException;
318
5f2820e821e0 Implemented a helper class for exporting charts. Adapted code.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 315
diff changeset
44 import de.intevation.gnv.exports.ChartExportHelper;
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
45 import de.intevation.gnv.exports.DefaultExport;
301
3ea030aafe65 Removed duplicated and needless imports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
46 import de.intevation.gnv.exports.DefaultDataCollector;
3ea030aafe65 Removed duplicated and needless imports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 300
diff changeset
47 import de.intevation.gnv.exports.SimpleOdvDataCollector;
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
48 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
49 import de.intevation.gnv.exports.Export.Profile;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
50 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
51 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
52 import de.intevation.gnv.statistics.StatisticSet;
98
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
53 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
54 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
55 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
56 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
57 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
58 import de.intevation.gnv.transition.InputData;
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
59 import de.intevation.gnv.transition.OutputTransitionBase;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
60 import de.intevation.gnv.transition.describedata.KeyValueDescibeData;
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 73
diff changeset
61 import de.intevation.gnv.transition.describedata.NamedCollection;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
62 import de.intevation.gnv.transition.exception.TransitionException;
95
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
63 import de.intevation.gnv.utils.ArtifactXMLUtilities;
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
64
230
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
65
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66 /**
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
67 * @author Tim Englich <tim.englich@intevation.de>
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
68 *
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
69 */
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
70 public class TimeSeriesOutputTransition extends OutputTransitionBase {
86
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
71
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
72 protected static final boolean CACHE_CHART =
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
73 Boolean.parseBoolean(System.getProperty("cache.chart", "false"));
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
74
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
75 protected static final boolean PDF_FORMAT_LANDSCAPE =
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
76 Boolean.parseBoolean(System.getProperty("export.pdf.landscape","true"));
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
77
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
78 protected static final String[] IMG_EXPORT_FORMAT = {
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
79 "PNG", "JPEG", "GIF"
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
80 };
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
81
86
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
82 /**
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
83 * The UID of this Class
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
84 */
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
85 private static final long serialVersionUID = 4178407570503098858L;
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
86
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
87 /**
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
88 * 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
89 */
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
90 private static Logger log = Logger
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
91 .getLogger(TimeSeriesOutputTransition.class);
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
92
217
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
93 private static List<TimeGap> timeGapDefinitions = null;
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
94
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
95 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
96
119
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
97 protected String featureValuesName = "featureid";
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
98 protected String parameterValuesName = "parameterid";
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
99 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
100 protected String dateValueName = "dateid";
230
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
101
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
102 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
103 "XORDINATE",
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
104 "YORDINATE",
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
105 "GROUP1",
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
106 "GROUP2",
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
107 "GROUP3"
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
108 };
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
109
3d6d89bcbf42 Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents: 230
diff changeset
110 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
111 "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
112 "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
113 "TYPE",
238
a157c6042cb4 ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
114 "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
115 "BOTDEPTH",
247
af474a541f74 Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents: 241
diff changeset
116 "DEPTH",
af474a541f74 Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents: 241
diff changeset
117 "TIMEVALUE",
af474a541f74 Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents: 241
diff changeset
118 "DATAVALUE",
af474a541f74 Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents: 241
diff changeset
119 "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
120 };
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
121
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
122
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 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
124 "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
125 "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
126 "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
127 "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
128 "Latitude [deegrees_north]",
241
8500529d82af Added ODV-Export to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 239
diff changeset
129 "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
130 "Depth [m]",
af474a541f74 Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents: 241
diff changeset
131 "Date/Time",
af474a541f74 Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents: 241
diff changeset
132 "Value",
af474a541f74 Sort Columns to the given order of the ODV-Specification
Tim Englich <tim.englich@intevation.de>
parents: 241
diff changeset
133 "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
134 };
230
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
135
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 * 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
138 */
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
139 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
140 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
141 null,
230
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
142 ',',
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
143 '"',
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
144 '"',
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
145 "CSV",
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
146 "ISO-8859-1");
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
147
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
148 /**
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
149 * 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
150 * 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
151 */
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
152 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
153 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
154 ODV_COLUMN_HEADER,
230
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
155 '\t',
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
156 CSVWriter.NO_QUOTE_CHARACTER,
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
157 CSVWriter.NO_ESCAPE_CHARACTER,
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
158 "ODV",
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
159 "ISO-8859-1");
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
160
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
161 /**
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
162 * Constructor
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
163 */
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
164 public TimeSeriesOutputTransition() {
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
165 super();
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
166 }
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
167
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
168 /**
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
169 * @see de.intevation.gnv.transition.OutputTransition#out(java.lang.String,
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
170 * java.util.Collection, java.io.OutputStream, java.lang.String,
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
171 * de.intevation.artifacts.CallMeta)
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
172 */
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
173 public void out(
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
174 Document format,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
175 Collection<InputData> inputData,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
176 OutputStream outputStream,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
177 String uuid,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
178 CallMeta callMeta
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
179 ) throws TransitionException
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
180 {
90
6bdef6e590d6 Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents: 86
diff changeset
181 log.debug("TimeSeriesOutputTransition.out");
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
182
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
183 String outputMode = Config.getStringXPath(
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
184 format,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
185 "action/out/@name"
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
186 );
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
187 String mimeType = Config.getStringXPath(
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
188 format,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
189 "action/out/mime-type/@value"
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
190 );
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
191
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
192 try {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
193 if (outputMode.equalsIgnoreCase("chart")) {
90
6bdef6e590d6 Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents: 86
diff changeset
194 log.debug("Chart will be generated.");
91
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
195 int chartWidth = 600;
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
196 int chartHeight = 400;
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
197 try {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
198 if (inputData != null) {
91
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
199 Iterator<InputData> it = inputData.iterator();
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
200 while (it.hasNext()) {
91
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
201 InputData ip = it.next();
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
202 if (ip.getName().equalsIgnoreCase("width")) {
91
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
203 chartWidth = Integer.parseInt(ip.getValue());
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
204 } else if (ip.getName().equalsIgnoreCase("height")) {
91
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
205 chartHeight = Integer.parseInt(ip.getValue());
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
206 }
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
207 }
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
208 }
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
209 } catch (NumberFormatException e) {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
210 log.error(e, e);
91
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
211 throw new TransitionException(e);
bd284d8306db Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents: 90
diff changeset
212 }
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
213 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
214 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
215 Collection<KeyValueDescibeData> dates = this.getDates(uuid);
178
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
216 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
217 .getSelectedFeatureName(uuid), this.domainLable);
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
218
315
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
219 String exportFormat = getExportFormat(mimeType);
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
220
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
221 // TODO Remove this and parse input data
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
222 boolean linesVisible = true;
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
223 boolean shapesVisible = true;
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
224
315
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
225 PreferredLocale[] locales = callMeta.getLanguages();
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
226 Locale[] serverLocales =
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
227 RessourceFactory.getInstance().getLocales();
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
228 Locale locale =
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
229 callMeta.getPreferredLocale(serverLocales);
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
230
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
231 log.debug(
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
232 "Best locale - regarding intersection of server and " +
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
233 "browser locales - is " + locale.toString()
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
234 );
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
235
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
236 this.createChart(
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
237 outputStream,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
238 parameters,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
239 measurements,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
240 dates,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
241 chartLables,
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
242 uuid,
304
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
243 exportFormat,
315
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
244 locale,
304
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
245 chartWidth,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
246 chartHeight,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
247 linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
248 shapesVisible
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
249 );
318
5f2820e821e0 Implemented a helper class for exporting charts. Adapted code.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 315
diff changeset
250 }
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
251 else if (outputMode.equalsIgnoreCase("pdf")) {
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
252 log.debug("Output mode == pdf");
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
253
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
254 Locale[] serverLocales =
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
255 RessourceFactory.getInstance().getLocales();
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
256 Locale locale =
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
257 callMeta.getPreferredLocale(serverLocales);
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
258
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
259 // TODO Remove this and parse input data
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
260 boolean linesVisible = true;
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
261 boolean shapesVisible = true;
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
262
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
263 log.debug(
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
264 "Best locale - regarding intersection of server and " +
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
265 "browser locales - is " + locale.toString()
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
266 );
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
267
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
268 createPDF(
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
269 outputStream,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
270 getParameters(uuid),
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
271 getMeasurements(uuid),
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
272 getDates(uuid),
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
273 new ChartLabels(
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
274 this.getFisName(callMeta.getLanguages()) +
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
275 " "+ getSelectedFeatureName(uuid),
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
276 this.domainLable),
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
277 uuid,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
278 "A4",
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
279 true,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
280 locale,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
281 linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
282 shapesVisible
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
283 );
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
284 }
321
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
285 else if (outputMode.equalsIgnoreCase("svg")) {
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
286 log.debug("Output mode == svg");
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
287 int width = 600;
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
288 int height = 400;
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
289
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
290 // TODO Remove this and parse input data
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
291 boolean linesVisible = true;
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
292 boolean shapesVisible = true;
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
293
321
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
294 Locale[] serverLocales =
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
295 RessourceFactory.getInstance().getLocales();
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
296 Locale locale =
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
297 callMeta.getPreferredLocale(serverLocales);
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
298
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
299 log.debug(
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
300 "Best locale - regarding intersection of server and " +
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
301 "browser locales - is " + locale.toString()
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
302 );
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
303
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
304 createSVG(
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
305 outputStream,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
306 getParameters(uuid),
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
307 getMeasurements(uuid),
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
308 getDates(uuid),
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
309 new ChartLabels(
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
310 this.getFisName(callMeta.getLanguages()) +
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
311 " "+ getSelectedFeatureName(uuid),
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
312 this.domainLable),
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
313 uuid,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
314 locale,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
315 width,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
316 height,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
317 linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
318 shapesVisible
321
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
319 );
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
320 }
318
5f2820e821e0 Implemented a helper class for exporting charts. Adapted code.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 315
diff changeset
321 else if (outputMode.equalsIgnoreCase("csv")) {
90
6bdef6e590d6 Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents: 86
diff changeset
322 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
323 Collection<Result> chartResult = this.getChartResult(uuid);
177
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
324 this.createCSV(outputStream, chartResult);
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
325 } 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
326 log.debug("Statistics will be generated.");
98
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
327 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
328 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
329 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
330 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
331 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
332 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
333 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
334 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
335 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
336 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
337 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
338 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
339 dates);
95
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
340 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
341 this.writeDocument2OutputStream(doc, outputStream);
230
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
342 } 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
343
3d6d89bcbf42 Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents: 230
diff changeset
344 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
345 this.createODV(outputStream, odvResult);
90
6bdef6e590d6 Added CSV-Support and do some performanceimprovments
Tim Englich <tim.englich@intevation.de>
parents: 86
diff changeset
346 }
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
347 } catch (IOException e) {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
348 log.error(e, e);
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
349 throw new TransitionException(e);
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
350 } catch (TechnicalChartException e) {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
351 log.error(e, e);
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
352 throw new TransitionException(e);
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
353 } catch (StatisticsException e) {
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
354 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
355 throw new TransitionException(e);
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
356 }
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
357 }
98
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
358
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
359
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
360 protected String getExportFormat(String mime) {
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
361 for(int i = 0; i < IMG_EXPORT_FORMAT.length; i++) {
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
362 if (mime.trim().toUpperCase().indexOf(IMG_EXPORT_FORMAT[i]) > 0)
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
363 return IMG_EXPORT_FORMAT[i];
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
364 }
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
365
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
366 // no format found relating to mimeType, default export as PNG
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
367 return IMG_EXPORT_FORMAT[0];
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
368 }
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
369
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
370
98
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
371 /**
177
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
372 * @param outputStream
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
373 * @param chartResult
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
374 * @throws UnsupportedEncodingException
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
375 * @throws IOException
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
376 * @throws TransitionException
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
377 */
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
378 protected void createCSV(OutputStream outputStream,
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
379 Collection<Result> chartResult)
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
380 throws UnsupportedEncodingException,
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
381 IOException,
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
382 TransitionException {
233
2ceb4bf51cba Added DataCollector which collects data used for exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 232
diff changeset
383 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
384 TIMESERIES_CSV_PROFILE_NAMES));
230
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
385
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
386 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
387 }
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
388
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
389 /**
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
390 * 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
391 */
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
392 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
393 throws IOException, TransitionException {
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
394
238
a157c6042cb4 ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
395 DefaultExport export = new DefaultExport(new SimpleOdvDataCollector(
a157c6042cb4 ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
396 TIMESERIES_ODV_PROFILE_NAMES));
230
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
397
238
a157c6042cb4 ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
398 if (result == null)
a157c6042cb4 ODV-export for timeseries completed.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 233
diff changeset
399 log.error("#################### RESULT == NULL #################");
230
f68ffbe974a0 Implemented an exporter for odv and csv exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 220
diff changeset
400 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
401 }
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
402
08b8b79b30ff Integrated special CSV-Export for HorizontalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
403 /**
98
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
404 * @return
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
405 */
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
406 protected Statistics getStatisticsGenerator() {
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
407 Statistics s = new TimeseriesStatistics();
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
408 return s;
156db25ad4b4 Add Statisticssupport also to VerticalProfiles
Tim Englich <tim.englich@intevation.de>
parents: 95
diff changeset
409 }
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
410
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
411 protected void writeDocument2OutputStream(Document document, OutputStream os) {
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
412
95
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
413 try {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
414 TransformerFactory transformerFactory = TransformerFactory
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
415 .newInstance();
95
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
416 Transformer transformer = transformerFactory.newTransformer();
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
417 DOMSource source = new DOMSource(document);
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
418 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
419 transformer.transform(source, result);
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
420 } catch (TransformerConfigurationException e) {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
421 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
422 } catch (TransformerFactoryConfigurationError e) {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
423 log.error(e, e);
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
424 } catch (TransformerException e) {
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
425 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
426 }
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
427 }
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
428
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
429 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
430 ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities();
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
431 Document doc = XMLUtils.newDocument();
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
432 if (statistic != null) {
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
433 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
434 "statistics");
95
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
435 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
436 Iterator<StatisticSet> it = statistic.iterator();
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
437 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
438 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
439 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
440 "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
441 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
442
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
443 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
444 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
445 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
446 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
447 "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
448 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
449 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
450 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
451 }
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
452 statisticResults.appendChild(setElement);
95
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
453 }
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
454
95
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
455 }
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
456 return doc;
13402ac8d8fe Put the Statisticscalulation to the Outmethod of the OutputTransition.
Tim Englich <tim.englich@intevation.de>
parents: 91
diff changeset
457 }
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
458
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 protected String getSelectedFeatureName(String uuid) {
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
460 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
461 .getCollection(featureValuesName, uuid);
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
462 if (values != null) {
86
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
463 Iterator<KeyValueDescibeData> it = values.iterator();
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
464 while (it.hasNext()) {
86
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
465 KeyValueDescibeData data = it.next();
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
466 if (data.isSelected()) {
86
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
467 return data.getValue();
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
468 }
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
469 }
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
470 }
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
471 return null;
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
472 }
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
473
86
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
474 /**
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
475 * @param outputStream
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
476 * @param parameters
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
477 * @param measurements
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
478 * @param timeSeriesName
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
479 * @param chartStyle
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
480 * @param chartLables
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
481 * @throws IOException
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
482 * @throws TechnicalChartException
5d4f5d26bb7a Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
483 */
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
484 protected void createChart(
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
485 OutputStream outputStream,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
486 Collection parameters,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
487 Collection measurements,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
488 Collection dates,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
489 ChartLabels chartLables,
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
490 String uuid,
304
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
491 String exportFormat,
315
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
492 Locale locale,
304
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
493 int width,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
494 int height,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
495 boolean linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
496 boolean shapesVisible
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
497 )
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
498 throws IOException, TechnicalChartException
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
499 {
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
500 log.debug("Create chart.");
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
501 Chart chart = getChart(
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
502 chartLables,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
503 parameters,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
504 measurements,
310
45625b5cd6d4 Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 304
diff changeset
505 dates,
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
506 getChartResult(uuid),
315
63f8b3fb7d9a Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 310
diff changeset
507 locale, // Locale
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
508 uuid,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
509 linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
510 shapesVisible
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
511 );
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
512
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
513 if (chart == null) {
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
514 log.error("Could not initialize chart.");
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
515 return;
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
516 }
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
517
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
518 log.debug(
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
519 "export chart as " + exportFormat +
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
520 " in " + width + "x" + height
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
521 );
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
522
318
5f2820e821e0 Implemented a helper class for exporting charts. Adapted code.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 315
diff changeset
523 ChartExportHelper.exportImage(
5f2820e821e0 Implemented a helper class for exporting charts. Adapted code.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 315
diff changeset
524 outputStream,
5f2820e821e0 Implemented a helper class for exporting charts. Adapted code.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 315
diff changeset
525 chart.generateChart(),
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
526 exportFormat,
318
5f2820e821e0 Implemented a helper class for exporting charts. Adapted code.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 315
diff changeset
527 width,
5f2820e821e0 Implemented a helper class for exporting charts. Adapted code.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 315
diff changeset
528 height
303
9ba2cf8cad8d Export format of charts is related to mime-type.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 301
diff changeset
529 );
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
530 }
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
531
310
45625b5cd6d4 Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 304
diff changeset
532
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
533 protected void createPDF(
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
534 OutputStream outputStream,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
535 Collection parameters,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
536 Collection measurements,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
537 Collection dates,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
538 ChartLabels chartLables,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
539 String uuid,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
540 String exportFormat,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
541 boolean landscape,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
542 Locale locale,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
543 boolean linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
544 boolean shapesVisible
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
545 ) {
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
546 Chart chart = getChart(
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
547 chartLables,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
548 parameters,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
549 measurements,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
550 dates,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
551 getChartResult(uuid),
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
552 locale,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
553 uuid,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
554 linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
555 shapesVisible
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
556 );
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
557
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
558 if (chart == null) {
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
559 log.error("Could not initialize chart.");
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
560 return;
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
561 }
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
562
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
563 ChartExportHelper.exportPDF(
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
564 outputStream,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
565 chart.generateChart(),
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
566 "A4",
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
567 PDF_FORMAT_LANDSCAPE,
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
568 50F, 50F, 50F, 50F
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
569 );
321
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
570
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
571 try {
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
572 OutputStream toFile = new FileOutputStream("/vol1/home/iweinzierl/tmp/test.svg");
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
573 ChartExportHelper.exportSVG(
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
574 toFile,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
575 chart.generateChart(),
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
576 null,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
577 600, 400
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
578 );
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
579 toFile.flush();
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
580 toFile.close();
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
581 }
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
582 catch(Exception e) { log.debug("ERROR WHLILE TEST."); }
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
583 }
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
584
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
585
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
586 protected void createSVG(
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
587 OutputStream outputStream,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
588 Collection parameters,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
589 Collection measurements,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
590 Collection dates,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
591 ChartLabels chartLables,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
592 String uuid,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
593 Locale locale,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
594 int width,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
595 int height,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
596 boolean linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
597 boolean shapesVisible
321
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
598 ) {
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
599 Chart chart = getChart(
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
600 chartLables,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
601 parameters,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
602 measurements,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
603 dates,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
604 getChartResult(uuid),
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
605 locale,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
606 uuid,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
607 linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
608 shapesVisible
321
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
609 );
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
610
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
611 if (chart == null) {
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
612 log.error("Could not initialize chart.");
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
613 return;
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
614 }
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
615
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
616 ChartExportHelper.exportSVG(
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
617 outputStream,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
618 chart.generateChart(),
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
619 null,
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
620 600, 400
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
621 );
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
622
a4376fd23f99 Implemented svg export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 320
diff changeset
623 log.debug("svg export finished.");
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
624 }
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
625
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
626
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
627 protected Chart getChart(
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
628 ChartLabels chartLables,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
629 Collection parameters,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
630 Collection measurements,
310
45625b5cd6d4 Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 304
diff changeset
631 Collection dates,
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
632 Collection result,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
633 Locale locale,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
634 String uuid,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
635 boolean linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
636 boolean shapesVisible
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
637 ) {
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
638 Chart chart = null;
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
639
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
640 if (CACHE_CHART) {
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
641 log.info("Try to get timeseries chart from cache.");
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
642 chart = (Chart) getChartFromCache(uuid);
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
643 }
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
644
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
645 if (chart != null)
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
646 return chart;
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
647
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
648 log.info("Chart not in cache yet.");
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
649 chart = new TimeSeriesChart(
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
650 chartLables,
304
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
651 createStyle(),
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
652 parameters,
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
653 measurements,
310
45625b5cd6d4 Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 304
diff changeset
654 dates,
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
655 result,
310
45625b5cd6d4 Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 304
diff changeset
656 timeGapDefinitions,
327
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
657 locale,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
658 linesVisible,
22a6493e8460 New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 325
diff changeset
659 shapesVisible
300
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
660 );
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
661 chart.generateChart();
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
662
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
663 if (CACHE_CHART) {
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
664 log.info("Put chart into cache.");
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
665 purifyChart(chart, uuid);
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
666 }
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
667
6a3a02e004d9 Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 299
diff changeset
668 return chart;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
669 }
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
670
304
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
671 protected ChartTheme createStyle() {
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
672 XMLChartTheme theme = null;
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
673
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
674 Document template = Config.getChartTemplate();
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
675 String name = Config.getStringXPath(
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
676 template,
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
677 "theme/name/@value"
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
678 );
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
679
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
680 theme = new XMLChartTheme(name);
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
681 theme.applyXMLConfiguration(template);
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
682
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
683 return theme;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
684 }
304
a16d337c5678 The style of charts can be configured with ChartThemes using XML configuration files.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 303
diff changeset
685
178
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
686 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
687 String returnValue = "";
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
688 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
689 if (inputData != null){
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
690 returnValue = RessourceFactory.getInstance()
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
691 .getRessource(preferredLocales,
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
692 inputData.getValue(),
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
693 inputData.getValue());
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
694 }
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
695 return returnValue;
9bcf315f57e4 Added Name of FIS to the Title of Charts
Tim Englich <tim.englich@intevation.de>
parents: 177
diff changeset
696 }
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
697
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
698 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
699 return this.getCollection(parameterValuesName, uuid);
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
700 }
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
701
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
702 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
703 return this.getCollection(measuremenValueName, uuid);
119
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
704 }
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
705 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
706 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
707 }
119
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
708
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
709 @Override
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
710 public void setup(Node configuration) {
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
711 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
712 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
713 "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
714 if (featureNameValue != null) {
119
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
715 this.featureValuesName = featureNameValue;
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
716 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 119
diff changeset
717 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
718 "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
719 if (parameterNameValue != null) {
119
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
720 this.parameterValuesName = parameterNameValue;
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
721 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 119
diff changeset
722 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
723 "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
724 if (measurementNameValue != null) {
119
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
725 this.measuremenValueName = measurementNameValue;
4841808819d9 Added the new FIS
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
726 }
179
f2c76f35da5a Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents: 178
diff changeset
727
f2c76f35da5a Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents: 178
diff changeset
728 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
729 "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
730 if (dateNameValue != null) {
f2c76f35da5a Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents: 178
diff changeset
731 this.dateValueName = dateNameValue;
f2c76f35da5a Added missing Class Description Values to the Horizontal Profile Charts
Tim Englich <tim.englich@intevation.de>
parents: 178
diff changeset
732 }
217
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
733 if (timeGapDefinitions == null){
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
734 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
735 "time-gap-definition");
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
736 synchronized (this.getClass()) {
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
737 if (gapDefinition != null){
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
738 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
739 if (link != null ){
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
740 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
741 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
742 readConfiguration(absolutFileName);
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
743 }
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
744
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
745 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
746 "/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
747 if (gapDefinition != null){
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
748 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
749 getLength());
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
750 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
751 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
752 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
753 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
754 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
755 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
756 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
757 key,
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
758 value));
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
759 }
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
760 }
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
761
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
762 }
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
763 }
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
764 }
82
5eb62df21f9a Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
765 }
217
3dcd2b0b456e Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issu45
Tim Englich <tim.englich@intevation.de>
parents: 207
diff changeset
766
82
5eb62df21f9a Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
767 /**
5eb62df21f9a Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
768 * @param collectionName
5eb62df21f9a Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
769 * @return
5eb62df21f9a Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
770 */
5eb62df21f9a Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
771 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
772 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
773 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
774 Iterator<Object> it = this.getDescibeData(uuid).iterator();
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
775 while (it.hasNext()) {
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
776
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
777 Object o = it.next();
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
778
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
779 if (o instanceof NamedCollection<?>) {
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
780 NamedCollection<KeyValueDescibeData> nc = (NamedCollection<KeyValueDescibeData>) o;
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
781 if (nc.getName().equals(collectionName)) {
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
782 return nc;
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
783 }
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
784 }
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
785 }
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
786 return null;
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 64
diff changeset
787 }
64
5db77e0a8594 Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
788 }
320
18302372703f Implemented pdf export of charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 318
diff changeset
789 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org