# HG changeset patch # User Ingo Weinzierl # Date 1333005855 0 # Node ID 68d1661a57cfe5506e38d5c3d5538354faaed5f0 # Parent cdc084071c14c70c027d990bbc8671c1b76219ad Added a new config option to specify a INFO.gew file by system property. flys-backend/trunk@4182 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r cdc084071c14 -r 68d1661a57cf flys-backend/ChangeLog --- a/flys-backend/ChangeLog Mon Mar 19 06:11:38 2012 +0000 +++ b/flys-backend/ChangeLog Thu Mar 29 07:24:15 2012 +0000 @@ -1,3 +1,12 @@ +2012-03-29 Ingo Weinzierl + + * src/main/java/de/intevation/flys/importer/Config.java: Added a config + option "flys.backend.importer.infogew.file" to set the path of an + INFO.gew file. + + * src/main/java/de/intevation/flys/importer/Importer.java: Read the path + to the INFO.gew from the new config option and try to parse it. + 2012-03-19 Ingo Weinzierl * doc/schema/oracle-spatial.sql: Set the type of 'lower' and 'upper' column diff -r cdc084071c14 -r 68d1661a57cf flys-backend/src/main/java/de/intevation/flys/importer/Config.java --- a/flys-backend/src/main/java/de/intevation/flys/importer/Config.java Mon Mar 19 06:11:38 2012 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/importer/Config.java Thu Mar 29 07:24:15 2012 +0000 @@ -5,6 +5,9 @@ public static final String DRY_RUN = "flys.backend.importer.dry.run"; + public static final String INFO_GEW_FILE = + "flys.backend.importer.infogew.file"; + public static final String ANNOTATION_TYPES = "flys.backend.importer.annotation.types"; @@ -47,6 +50,10 @@ return Boolean.getBoolean(DRY_RUN); } + public String getInfoGewFile() { + return System.getProperty(INFO_GEW_FILE); + } + public String getAnnotationTypes() { return System.getProperty(ANNOTATION_TYPES); } diff -r cdc084071c14 -r 68d1661a57cf flys-backend/src/main/java/de/intevation/flys/importer/Importer.java --- a/flys-backend/src/main/java/de/intevation/flys/importer/Importer.java Mon Mar 19 06:11:38 2012 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/importer/Importer.java Thu Mar 29 07:24:15 2012 +0000 @@ -125,6 +125,17 @@ } } + String gew = Config.INSTANCE.getInfoGewFile(); + if (gew != null && gew.length() > 0) { + log.info("parsing info gew file: " + gew); + try { + infoGewParser.parse(new File(gew)); + } + catch (IOException ioe) { + log.error("cannot parse file: " + gew); + } + } + if (!Config.INSTANCE.dryRun()) { new Importer(infoGewParser.getRivers()).writeToDatabase(); }