Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java @ 7937:a310b1f85ce0
issue1633: Add info lines in SQ-relation CSV export.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 17 Jun 2014 17:57:25 +0200 |
parents | 5ef60ed15c25 |
children | 705f8b92fd66 |
comparison
equal
deleted
inserted
replaced
7936:5ef60ed15c25 | 7937:a310b1f85ce0 |
---|---|
60 public static final String DEFAULT_CSV_CHARSET = "UTF-8"; | 60 public static final String DEFAULT_CSV_CHARSET = "UTF-8"; |
61 | 61 |
62 /** The default separator for the CSV export. */ | 62 /** The default separator for the CSV export. */ |
63 public static final char DEFAULT_CSV_SEPARATOR = ';'; | 63 public static final char DEFAULT_CSV_SEPARATOR = ';'; |
64 | 64 |
65 public static final String START_META_CHAR = "#"; | |
66 | |
65 /** XPath that points to the desired export facet. */ | 67 /** XPath that points to the desired export facet. */ |
66 public static final String XPATH_FACET = "/art:action/@art:type"; | 68 public static final String XPATH_FACET = "/art:action/@art:type"; |
67 | 69 |
68 /** The out name to serve. */ | 70 /** The out name to serve. */ |
69 protected String outName; | 71 protected String outName; |
99 * | 101 * |
100 * @param writer The CSVWriter. | 102 * @param writer The CSVWriter. |
101 */ | 103 */ |
102 protected abstract void writeCSVData(CSVWriter writer) throws IOException; | 104 protected abstract void writeCSVData(CSVWriter writer) throws IOException; |
103 | 105 |
106 | |
107 /** | |
108 * Write lines of informative content to CSV file. | |
109 * Usually this will be done above the column headers from within | |
110 * the implementation of writeCSVData in concret subclasses. | |
111 * | |
112 * @param writer The CSVWriter | |
113 * @param infolines Array of Strings with informative content. | |
114 * Each will be written to a separate line prefixed with START_META_CHAR. | |
115 */ | |
116 protected void writeCSVInfo(CSVWriter writer, String[] infolines) { | |
117 String[] metaline = new String[1]; | |
118 | |
119 for (String infoline: infolines) { | |
120 metaline[0] = START_META_CHAR + " " + infoline; | |
121 writer.writeNext(metaline); | |
122 } | |
123 | |
124 } | |
104 | 125 |
105 /** | 126 /** |
106 * Concrete subclasses need to use this method to write their special data | 127 * Concrete subclasses need to use this method to write their special data |
107 * objects into the PDF document. | 128 * objects into the PDF document. |
108 */ | 129 */ |