Mercurial > dive4elements > river
changeset 3797:0f99e9f1a2ca
Importer: Added flag to invert skipping behaviour by default. Makes importing single features much easier.
flys-backend/trunk@5452 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 13 Sep 2012 10:53:34 +0000 |
parents | 61195d14b844 |
children | 90f91ba077a8 |
files | flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/importer/Config.java |
diffstat | 2 files changed, 38 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- 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 <sascha.teichmann@intevation.de> + + * 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 <sascha.teichmann@intevation.de> * doc/schema/postgresql.sql: Indices on cross sections
--- 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 :