Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java @ 1071:9bb1979aabbe
Added a new output state and chart type for vertical profiles using vector data.
gnv-artifacts/trunk@1168 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 07 Jun 2010 15:00:23 +0000 |
parents | cc4ec127d666 |
children | 1728aac87717 |
comparison
equal
deleted
inserted
replaced
1070:7096a2e13676 | 1071:9bb1979aabbe |
---|---|
39 */ | 39 */ |
40 public class TimeSeriesVectorOutputState extends TimeSeriesOutputState { | 40 public class TimeSeriesVectorOutputState extends TimeSeriesOutputState { |
41 | 41 |
42 private static Logger logger = | 42 private static Logger logger = |
43 Logger.getLogger(TimeSeriesVectorOutputState.class); | 43 Logger.getLogger(TimeSeriesVectorOutputState.class); |
44 | |
45 public static final String[] RESULT_COLUMNS = { | |
46 "YORDINATE", "XORDINATE", "GROUP1", "GROUP2", "GROUP3", "GAPID", "SERIES" | |
47 }; | |
44 | 48 |
45 public static final String[] ODV_COLUMN_HEADERS = { | 49 public static final String[] ODV_COLUMN_HEADERS = { |
46 "Cruise", | 50 "Cruise", |
47 "Station", | 51 "Station", |
48 "Type", | 52 "Type", |
105 return value.getObjectValue(); | 109 return value.getObjectValue(); |
106 } | 110 } |
107 else { | 111 else { |
108 logger.debug("Element not in cache, we ask the database"); | 112 logger.debug("Element not in cache, we ask the database"); |
109 Collection<Result> res = (Collection<Result>)getData(queryID); | 113 Collection<Result> res = (Collection<Result>)getData(queryID); |
110 res = VectorDataProcessor.process(res); | 114 res = VectorDataProcessor.process(res, RESULT_COLUMNS); |
111 cache.put(new net.sf.ehcache.Element(key, res)); | 115 cache.put(new net.sf.ehcache.Element(key, res)); |
112 | 116 |
113 return res; | 117 return res; |
114 } | 118 } |
115 } | 119 } |
116 else { | 120 else { |
117 // we don't use a cache, so we have to query the database every | 121 // we don't use a cache, so we have to query the database every |
118 // single time | 122 // single time |
119 logger.info("Not using a cache."); | 123 logger.info("Not using a cache."); |
120 return VectorDataProcessor.process(getData(queryID)); | 124 return VectorDataProcessor.process( |
125 getData(queryID), RESULT_COLUMNS); | |
121 } | 126 } |
122 } | 127 } |
123 | 128 |
124 | 129 |
125 @Override | 130 @Override |