annotate flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionExporter.java @ 716:733d6db30722

Fix for flys/issue158 flys-artifacts/trunk@2186 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 21 Jun 2011 17:03:46 +0000
parents dad1a2c88f9f
children c09c9e05ecfa
rev   line source
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.exports;
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
418
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
3 import java.text.NumberFormat;
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
4
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 import org.apache.log4j.Logger;
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import au.com.bytecode.opencsv.CSVWriter;
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import de.intevation.flys.artifacts.model.WQCKms;
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import de.intevation.flys.artifacts.model.WQKms;
716
733d6db30722 Fix for flys/issue158
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 701
diff changeset
11 import de.intevation.flys.artifacts.model.CalculationResult;
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 /**
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 */
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 public class DischargeLongitudinalSectionExporter extends WaterlevelExporter {
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 /** The logger used in this exporter.*/
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 private static Logger logger =
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 Logger.getLogger(DischargeLongitudinalSectionExporter.class);
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22
416
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
23 public static final String CSV_KM_HEADER =
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
24 "export.discharge.longitudinal.section.csv.header.km";
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
25
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
26 public static final String CSV_W_HEADER =
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
27 "export.discharge.longitudinal.section.csv.header.w";
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
28
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
29 public static final String CSV_CW_HEADER =
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
30 "export.discharge.longitudinal.section.csv.header.cw";
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
31
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
32 public static final String CSV_Q_HEADER =
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
33 "export.discharge.longitudinal.section.csv.header.q";
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
34
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
35 public static final String DEFAULT_CSV_KM_HEADER = "Fluss-Km";
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
36 public static final String DEFAULT_CSV_W_HEADER = "W [NN + m]";
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
37 public static final String DEFAULT_CSV_CW_HEADER = "W korr.";
664
e006da5679d2 s@m³/s@m\u00b3/s@
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 450
diff changeset
38 public static final String DEFAULT_CSV_Q_HEADER = "Q [m\u00b3/s]";
416
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
39
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
40
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 @Override
701
dad1a2c88f9f Base WST/CSV exports on facets. TODO: generate the facets.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 664
diff changeset
42 protected void addData(Object d) {
716
733d6db30722 Fix for flys/issue158
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 701
diff changeset
43 if (d instanceof CalculationResult) {
733d6db30722 Fix for flys/issue158
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 701
diff changeset
44 d = ((CalculationResult)d).getData();
733d6db30722 Fix for flys/issue158
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 701
diff changeset
45 if (d instanceof WQKms []) {
733d6db30722 Fix for flys/issue158
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 701
diff changeset
46 data.add((WQKms [])d);
733d6db30722 Fix for flys/issue158
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 701
diff changeset
47 }
733d6db30722 Fix for flys/issue158
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 701
diff changeset
48 }
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 }
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 @Override
416
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
53 protected void writeCSVHeader(CSVWriter writer) {
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
54 logger.info("WaterlevelExporter.writeCSVHeader");
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
55
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
56 writer.writeNext(new String[] {
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
57 msg(CSV_KM_HEADER, DEFAULT_CSV_KM_HEADER),
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
58 msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER),
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
59 msg(CSV_CW_HEADER, DEFAULT_CSV_CW_HEADER),
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
60 msg(CSV_Q_HEADER, DEFAULT_CSV_Q_HEADER)
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
61 });
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
62 }
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
63
340dc41a7ea3 The CSV exports will now have headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 407
diff changeset
64 @Override
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 protected void wQKms2CSV(CSVWriter writer, WQKms wqkms) {
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 logger.debug("WaterlevelExporter.wQKms2CSV");
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 int size = wqkms.size();
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 double[] result = new double[4];
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70
418
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
71 NumberFormat kmf = getKmFormatter();
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
72 NumberFormat wf = getWFormatter();
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
73 NumberFormat qf = getQFormatter();
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
74
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 for (int i = 0; i < size; i ++) {
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 result = wqkms.get(i, result);
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 String wc = "";
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 if (wqkms instanceof WQCKms) {
418
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
80 wc = wf.format(result[3]);
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 }
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 writer.writeNext(new String[] {
418
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
84 kmf.format(result[2]),
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
85 wf.format(result[0]),
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 wc,
418
e0fec407a280 ISSUE-53 Formatted number values of CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 416
diff changeset
87 qf.format(result[1])
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 });
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 }
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 }
450
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
91
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
92
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
93 @Override
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
94 protected void addWSTColumn(WstWriter writer, WQKms wqkms) {
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
95 String name = wqkms.getName();
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
96
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
97 // is it a W or a Q mode?
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
98 int wIdx = name.indexOf("W");
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
99 int qIdx = name.indexOf("Q");
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
100
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
101 String wq = null;
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
102 if (wIdx >= 0) {
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
103 wq = "W";
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
104 }
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
105 else if (qIdx >= 0) {
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
106 wq = "Q";
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
107 }
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
108
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
109 // we just want to display the first W or Q value in the WST
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
110 int start = name.indexOf("(");
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
111 int end = name.indexOf(")");
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
112
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
113 String tmp = name.substring(start+1, end);
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
114 String[] values = tmp.split(";");
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
115
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
116 String column = wq + "=" + values[0];
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
117
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
118 writer.addColumn(column);
c8bb38115290 Enabled the discharge longitudinal section to be exported as WST.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 418
diff changeset
119 }
407
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 }
9eb5f0c8fe7f Added a CSV exporter for the discharge longitudinal section computation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org