Mercurial > dive4elements > river
changeset 4611:526fd442e0e5
Add pdf export to GaugeDischargeCurveArtifact
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 30 Nov 2012 16:07:27 +0100 |
parents | 497bc73ca64a |
children | 410a9292b71c |
files | flys-artifacts/doc/conf/artifacts/gaugedischargecurve.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java |
diffstat | 2 files changed, 18 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/artifacts/gaugedischargecurve.xml Fri Nov 30 16:06:03 2012 +0100 +++ b/flys-artifacts/doc/conf/artifacts/gaugedischargecurve.xml Fri Nov 30 16:07:27 2012 +0100 @@ -19,6 +19,7 @@ <outputmode name="computed_dischargecurve_export" description="output.computed_dischargecurve_export" mime-type="text/plain" type="export"> <facets> <facet name="csv" description="facet.computed_dischargecurve_export.csv" /> + <facet name="pdf" description="facet.computed_dischargecurve_export.pdf" /> </facets> </outputmode> </outputmodes>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java Fri Nov 30 16:06:03 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/GaugeDischargeCurveArtifact.java Fri Nov 30 16:07:27 2012 +0100 @@ -51,14 +51,17 @@ "discharge_curve"; public static final String GAUGE_DISCHARGE_CURVE_AT_EXPORT_OUT = "computed_dischargecurve_at_export"; - public static final String GAUGE_DISCHARGE_CURVE_CSV_OUT = + public static final String GAUGE_DISCHARGE_CURVE_EXPORT_OUT = "computed_dischargecurve_export"; public static final String GAUGE_DISCHARGE_CURVE_CSV_FACET = "csv"; + public static final String GAUGE_DISCHARGE_CURVE_PDF_FACET = + "pdf"; private Facet atexportfacet; private Facet curvefacet; private Facet csvfacet; + private Facet pdffacet; /** * Setup initializes the data by extracting the river and gauge from @@ -124,7 +127,7 @@ rivername, gaugename); - List<Facet> fs = new ArrayList<Facet>(3); + List<Facet> fs = new ArrayList<Facet>(4); curvefacet = new GaugeDischargeCurveFacet( GAUGE_DISCHARGE_CURVE_FACET, description); fs.add(curvefacet); @@ -147,6 +150,15 @@ GAUGE_DISCHARGE_CURVE_CSV_FACET, description); fs.add(csvfacet); + description = Resources.format(callmeta, + "facet.computed_dischargecurve_export.pdf", + "Discharge curve PDF export on gauge", + rivername, + gaugename); + pdffacet = new GaugeDischargeCurveFacet( + GAUGE_DISCHARGE_CURVE_PDF_FACET, description); + fs.add(pdffacet); + addFacets(STATIC_STATE_NAME, fs); super.setup(identifier, factory, context, callmeta, data); @@ -182,10 +194,11 @@ "export"); state.addOutput(output); - fs = new ArrayList<Facet>(1); + fs = new ArrayList<Facet>(2); fs.add(csvfacet); + fs.add(pdffacet); output = new DefaultOutput( - GAUGE_DISCHARGE_CURVE_CSV_OUT, + GAUGE_DISCHARGE_CURVE_EXPORT_OUT, "output.computed_dischargecurve_export", "text/plain", fs,