# HG changeset patch # User Sascha L. Teichmann # Date 1341223980 0 # Node ID 282c9da923ab470c220c7ff0add2627fe121f55c # Parent 116b342893e3a77cd64c8ad08532d92ff7ff09f7 FixA: flys/issue689: Export CSV for facet 'fix_parameters' flys-artifacts/trunk@4849 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 116b342893e3 -r 282c9da923ab flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Sun Jul 01 18:00:04 2012 +0000 +++ b/flys-artifacts/ChangeLog Mon Jul 02 10:13:00 2012 +0000 @@ -1,3 +1,12 @@ +2012-07-02 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/exports/fixings/ParametersExporter.java: + Generate CSV for facet 'fix_parameters'. + + * src/main/java/de/intevation/flys/exports/AbstractExporter.java: + Be more eloquent on which kind of facet the exporter does not + like. + 2012-07-02 Sascha L. Teichmann * src/main/java/de/intevation/flys/artifacts/states/SQRelation.java: diff -r 116b342893e3 -r 282c9da923ab flys-artifacts/src/main/java/de/intevation/flys/exports/AbstractExporter.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/AbstractExporter.java Sun Jul 01 18:00:04 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/AbstractExporter.java Mon Jul 02 10:13:00 2012 +0000 @@ -37,6 +37,8 @@ /** The logger used in this exporter.*/ private static Logger logger = Logger.getLogger(AbstractExporter.class); + /* XXX: Why does AbstractExporter do not implement FacetTypes? */ + public static String FIX_PARAMETERS = "fix_parameters"; /** The name of the CSV facet which triggers the CSV creation. */ public static final String FACET_CSV = "csv"; @@ -162,7 +164,8 @@ generatePDF(); } else { - throw new IOException("invalid facet for exporter."); + throw new IOException( + "invalid facet for exporter: '" + facet + "'"); } } diff -r 116b342893e3 -r 282c9da923ab flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/ParametersExporter.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/ParametersExporter.java Sun Jul 01 18:00:04 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/ParametersExporter.java Mon Jul 02 10:13:00 2012 +0000 @@ -56,6 +56,25 @@ } @Override + public void generate() + throws IOException + { + log.debug("ParametersExporter.generate"); + + if (facet == null) { + throw new IOException("invalid (null) facet for exporter"); + } + + if (facet.equals(FIX_PARAMETERS)) { + generateCSV(); + } + else { + throw new IOException( + "invalid facet for exporter: '" + facet + "'"); + } + } + + @Override protected void writeCSVData(final CSVWriter writer) throws IOException { if (parametersList.isEmpty()) {