changeset 5264:731030b69c7e

Fix Waterlevel*-Parser to correctly register the wst-columns.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 13 Mar 2013 10:06:26 +0100
parents db341e37d194
children 19f6022276fa db196abd16ca
files flys-backend/src/main/java/de/intevation/flys/importer/parsers/WaterlevelDifferencesParser.java flys-backend/src/main/java/de/intevation/flys/importer/parsers/WaterlevelParser.java
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/WaterlevelDifferencesParser.java	Wed Mar 13 10:05:47 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/WaterlevelDifferencesParser.java	Wed Mar 13 10:06:26 2013 +0100
@@ -145,13 +145,15 @@
 
 
     private void initColumns(String[] cols) {
-        columns = new ImportWstColumn[cols.length];
+        current.setNumberColumns(cols.length);
+        columns = current.getColumns().toArray(new ImportWstColumn[cols.length]);
 
         for (int i = 0; i < cols.length; i++) {
             String name = cols[i].replace("\"", "");
 
             log.debug("Create new column '" + name + "'");
-            columns[i] = new ImportWstColumn(current, name, name, i);
+            current.getColumn(i).setName(name);
+            current.getColumn(i).setDescription(name);
         }
     }
 
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/WaterlevelParser.java	Wed Mar 13 10:05:47 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/WaterlevelParser.java	Wed Mar 13 10:06:26 2013 +0100
@@ -79,10 +79,10 @@
     protected void reset() {
         currentQRange = null;
         current       = new ImportWst(currentDescription);
-        column        = new ImportWstColumn(current,
-            currentDescription,
-            currentDescription,
-            0);
+        current.setNumberColumns(1);
+        column        = current.getColumn(0);
+        column.setName(currentDescription);
+        column.setDescription(currentDescription);
         current.setKind(6);
     }
 

http://dive4elements.wald.intevation.org