# HG changeset patch # User Sascha L. Teichmann # Date 1347533614 0 # Node ID 0f99e9f1a2ca0ad0580e455b74e027c115f5959f # Parent 61195d14b844c7cb962ba529b0b862115a361ebc Importer: Added flag to invert skipping behaviour by default. Makes importing single features much easier. flys-backend/trunk@5452 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 61195d14b844 -r 0f99e9f1a2ca flys-backend/ChangeLog --- a/flys-backend/ChangeLog Wed Sep 12 16:51:38 2012 +0000 +++ b/flys-backend/ChangeLog Thu Sep 13 10:53:34 2012 +0000 @@ -1,3 +1,11 @@ +2012-09-12 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/importer/Config.java: + Add system property 'flys.backend.importer.skip.default' + which enables the switching of the skipping default. + Very useful if you want only some sub systems by + setting this to 'true' and the sub systems to 'false'. + 2012-09-12 Sascha L. Teichmann * doc/schema/postgresql.sql: Indices on cross sections diff -r 61195d14b844 -r 0f99e9f1a2ca flys-backend/src/main/java/de/intevation/flys/importer/Config.java --- a/flys-backend/src/main/java/de/intevation/flys/importer/Config.java Wed Sep 12 16:51:38 2012 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/importer/Config.java Thu Sep 13 10:53:34 2012 +0000 @@ -2,6 +2,9 @@ public class Config { + public static final String SKIP_DEFAULT = + "flys.backend.importer.skip.default"; + public static final String DRY_RUN = "flys.backend.importer.dry.run"; @@ -74,8 +77,15 @@ private Config () { } + public static final boolean getFlag(String key) { + String flag = System.getProperty(key); + return flag != null + ? Boolean.valueOf(flag) + : Boolean.getBoolean(SKIP_DEFAULT); + } + public boolean dryRun() { - return Boolean.getBoolean(DRY_RUN); + return getFlag(DRY_RUN); } public String getInfoGewFile() { @@ -87,79 +97,79 @@ } public boolean skipGauges() { - return Boolean.getBoolean(SKIP_GAUGES); + return getFlag(SKIP_GAUGES); } public boolean skipAnnotations() { - return Boolean.getBoolean(SKIP_ANNOTATIONS); + return getFlag(SKIP_ANNOTATIONS); } public boolean skipPRFs() { - return Boolean.getBoolean(SKIP_PRFS); + return getFlag(SKIP_PRFS); } public boolean skipHYKs() { - return Boolean.getBoolean(SKIP_HYKS); + return getFlag(SKIP_HYKS); } public boolean skipWst() { - return Boolean.getBoolean(SKIP_WST); + return getFlag(SKIP_WST); } public boolean skipExtraWsts() { - return Boolean.getBoolean(SKIP_EXTRA_WSTS); + return getFlag(SKIP_EXTRA_WSTS); } public boolean skipFixations() { - return Boolean.getBoolean(SKIP_FIXATIONS); + return getFlag(SKIP_FIXATIONS); } public boolean skipOfficialLines() { - return Boolean.getBoolean(SKIP_OFFICIAL_LINES); + return getFlag(SKIP_OFFICIAL_LINES); } public boolean skipFloodWater() { - return Boolean.getBoolean(SKIP_FLOOD_WATER); + return getFlag(SKIP_FLOOD_WATER); } public boolean skipFloodProtection() { - return Boolean.getBoolean(SKIP_FLOOD_PROTECTION); + return getFlag(SKIP_FLOOD_PROTECTION); } public boolean skipBedHeightSingle() { - return Boolean.getBoolean(SKIP_BED_HEIGHT_SINGLE); + return getFlag(SKIP_BED_HEIGHT_SINGLE); } public boolean skipBedHeightEpoch() { - return Boolean.getBoolean(SKIP_BED_HEIGHT_EPOCH); + return getFlag(SKIP_BED_HEIGHT_EPOCH); } public boolean skipSedimentDensity() { - return Boolean.getBoolean(SKIP_SEDIMENT_DENSITY); + return getFlag(SKIP_SEDIMENT_DENSITY); } public boolean skipMorphologicalWidth() { - return Boolean.getBoolean(SKIP_MORPHOLOGICAL_WIDTH); + return getFlag(SKIP_MORPHOLOGICAL_WIDTH); } public boolean skipFlowVelocity() { - return Boolean.getBoolean(SKIP_FLOW_VELOCITY); + return getFlag(SKIP_FLOW_VELOCITY); } public boolean skipSedimentYield() { - return Boolean.getBoolean(SKIP_SEDIMENT_YIELD); + return getFlag(SKIP_SEDIMENT_YIELD); } public boolean skipWaterlevels() { - return Boolean.getBoolean(SKIP_WATERLEVELS); + return getFlag(SKIP_WATERLEVELS); } public boolean skipWaterlevelDifferences() { - return Boolean.getBoolean(SKIP_WATERLEVEL_DIFFERENCES); + return getFlag(SKIP_WATERLEVEL_DIFFERENCES); } public boolean skipSQRelation() { - return Boolean.getBoolean(SKIP_SQ_RELATION); + return getFlag(SKIP_SQ_RELATION); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :