Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java @ 2015:61667c3a0003
Disabled default values in Artifact's DESCRIBE document - added a system property to re-enable those default values.
flys-artifacts/trunk@3468 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 19 Dec 2011 16:11:13 +0000 |
parents | 41ba2276d785 |
children | 19518116a49a |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java Mon Dec 19 15:47:34 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java Mon Dec 19 16:11:13 2011 +0000 @@ -41,6 +41,12 @@ /** The logger that is used in this class. */ private static Logger logger = Logger.getLogger(DefaultState.class); + + /** Determines, if the DESCRIBE document should contain default values or + * not. */ + public static final boolean USE_DEFAULTS = + Boolean.getBoolean("flys.use.default.values"); + /** The three possible compute types. */ public static enum ComputeType { FEED, ADVANCE, INIT @@ -205,19 +211,21 @@ Element select = createData(creator, artifact, data, context); - String defValue = (String) data.getValue(); - String defDesc = null; + if (USE_DEFAULTS) { + String defValue = (String) data.getValue(); + String defDesc = null; - if (defValue != null && defValue.length() > 0) { - defDesc = Resources.getMsg( - context.getMeta(), - defValue, - defValue); - } + if (defValue != null && defValue.length() > 0) { + defDesc = Resources.getMsg( + context.getMeta(), + defValue, + defValue); + } - if (defValue != null && defDesc != null) { - creator.addAttr(select, "defaultValue", defValue, true); - creator.addAttr(select, "defaultLabel", defDesc, true); + if (defValue != null && defDesc != null) { + creator.addAttr(select, "defaultValue", defValue, true); + creator.addAttr(select, "defaultLabel", defDesc, true); + } } Element choices = ProtocolUtils.createArtNode(