[Dive4elements-commits] [PATCH 3 of 9] ThemeUtil: Method to parse/access showextramark theme prop

Wald Commits scm-commit at wald.intevation.org
Mon Nov 5 09:16:50 CET 2012


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1351865439 -3600
# Node ID ecd237428af62f0aa544d34f545bc153af797466
# Parent  7fc4855ecd2699b0d3564f9c762de5a29e54b716
ThemeUtil: Method to parse/access showextramark theme prop.

diff -r 7fc4855ecd26 -r ecd237428af6 flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Fri Nov 02 15:09:53 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/ThemeUtil.java	Fri Nov 02 15:10:39 2012 +0100
@@ -121,6 +121,9 @@
     public final static String XPATH_BANDWIDTH =
             "/theme/field[@name='bandwidth']/@default";
 
+    /** XPATH to find showextramark field. */
+    public final static String XPATH_SHOWEXTRAMARK =
+            "/theme/field[@name='showextramark']/@default";
 
     /** Parse string to be boolean with default if empty or unrecognized. */
     public static boolean parseBoolean(String value, boolean defaultsTo) {
@@ -286,6 +289,15 @@
 
 
     /**
+     * Parses the attribute 'showextramark', defaults to false.
+     * @param theme The theme.
+     */
+    public static boolean parseShowExtraMark(Document theme) {
+        String show = XMLUtils.xpathString(theme, XPATH_SHOWEXTRAMARK, null);
+        return parseBoolean(show, false);
+    }
+
+    /**
      * Parses the attribute 'showpoints', defaults to false.
      * @param theme The theme.
      */


More information about the Dive4elements-commits mailing list