comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java @ 4586:319565a48182

Add the csv export to the GaugeDischargeCurveArtifact Add the csv export to show the calculation results in the flys client.
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 27 Nov 2012 17:43:19 +0100
parents 8c51c43e59ca
children 526fd442e0e5
comparison
equal deleted inserted replaced
4585:b4a95290ec63 4586:319565a48182
49 "at"; 49 "at";
50 public static final String GAUGE_DISCHARGE_CURVE_OUT = 50 public static final String GAUGE_DISCHARGE_CURVE_OUT =
51 "discharge_curve"; 51 "discharge_curve";
52 public static final String GAUGE_DISCHARGE_CURVE_AT_EXPORT_OUT = 52 public static final String GAUGE_DISCHARGE_CURVE_AT_EXPORT_OUT =
53 "computed_dischargecurve_at_export"; 53 "computed_dischargecurve_at_export";
54 public static final String GAUGE_DISCHARGE_CURVE_CSV_OUT =
55 "computed_dischargecurve_export";
56 public static final String GAUGE_DISCHARGE_CURVE_CSV_FACET =
57 "csv";
54 58
55 private Facet atexportfacet; 59 private Facet atexportfacet;
56 private Facet curvefacet; 60 private Facet curvefacet;
61 private Facet csvfacet;
57 62
58 /** 63 /**
59 * Setup initializes the data by extracting the river and gauge from 64 * Setup initializes the data by extracting the river and gauge from
60 * the XML Document. 65 * the XML Document.
61 */ 66 */
117 "facet.gauge_discharge_curve.description", 122 "facet.gauge_discharge_curve.description",
118 "Discharge curve on gauge", 123 "Discharge curve on gauge",
119 rivername, 124 rivername,
120 gaugename); 125 gaugename);
121 126
122 List<Facet> fs = new ArrayList<Facet>(2); 127 List<Facet> fs = new ArrayList<Facet>(3);
123 curvefacet = new GaugeDischargeCurveFacet( 128 curvefacet = new GaugeDischargeCurveFacet(
124 GAUGE_DISCHARGE_CURVE_FACET, description); 129 GAUGE_DISCHARGE_CURVE_FACET, description);
125 fs.add(curvefacet); 130 fs.add(curvefacet);
126 131
127 description = Resources.format(callmeta, 132 description = Resources.format(callmeta,
130 rivername, 135 rivername,
131 gaugename); 136 gaugename);
132 atexportfacet = new GaugeDischargeCurveFacet( 137 atexportfacet = new GaugeDischargeCurveFacet(
133 GAUGE_DISCHARGE_CURVE_AT_EXPORT_FACET, description); 138 GAUGE_DISCHARGE_CURVE_AT_EXPORT_FACET, description);
134 fs.add(atexportfacet); 139 fs.add(atexportfacet);
140
141 description = Resources.format(callmeta,
142 "facet.computed_dischargecurve_export.csv",
143 "Discharge curve CSV export on gauge",
144 rivername,
145 gaugename);
146 csvfacet = new GaugeDischargeCurveFacet(
147 GAUGE_DISCHARGE_CURVE_CSV_FACET, description);
148 fs.add(csvfacet);
135 149
136 addFacets(STATIC_STATE_NAME, fs); 150 addFacets(STATIC_STATE_NAME, fs);
137 151
138 super.setup(identifier, factory, context, callmeta, data); 152 super.setup(identifier, factory, context, callmeta, data);
139 } 153 }
166 "text/plain", 180 "text/plain",
167 fs, 181 fs,
168 "export"); 182 "export");
169 state.addOutput(output); 183 state.addOutput(output);
170 184
185 fs = new ArrayList<Facet>(1);
186 fs.add(csvfacet);
187 output = new DefaultOutput(
188 GAUGE_DISCHARGE_CURVE_CSV_OUT,
189 "output.computed_dischargecurve_export",
190 "text/plain",
191 fs,
192 "export");
193 state.addOutput(output);
194
171 state.setUIProvider(UIPROVIDER); 195 state.setUIProvider(UIPROVIDER);
172 setStaticState(state); 196 setStaticState(state);
173 } 197 }
174 } 198 }

http://dive4elements.wald.intevation.org