[PATCH 1 of 2] (issue965) Use new datacage magic to have year filtering for bedheights

Wald Commits scm-commit at wald.intevation.org
Tue Oct 22 10:13:34 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1382374650 -7200
# Node ID 350057df635b6e72926bde9beda642250454e6c9
# Parent  6599ee317069e44c20356fb9843e2abb19fda3b3
(issue965) Use new datacage magic to have year filtering for bedheights

diff -r 6599ee317069 -r 350057df635b artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Mon Oct 21 17:54:34 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Mon Oct 21 18:57:30 2013 +0200
@@ -1668,6 +1668,20 @@
     </dc:macro>
 
     <dc:macro name="minfo-heights">
+      <dc:variable name="year_from" expr="
+        dc:min-number(
+        dc:find-all(
+          '\d{4}',
+            dc:replace-all(
+              $diffids, '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}', '')))"
+        type="number"/>
+      <dc:variable name="year_to" expr="
+        dc:max-number(
+          dc:find-all(
+            '\d{4}',
+            dc:replace-all(
+              $diffids, '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}', '')))"
+        type="number"/>
       <bedheights>
         <dc:call-macro name="bed-heights-single"/>
         <dc:call-macro name="bed-heights-epoch"/>
@@ -1685,7 +1699,8 @@
             FROM bed_height_single bhs
                JOIN bed_height_type bht ON bht.id = bhs.type_id
             WHERE bhs.river_id = ${river_id}
-              AND lower(bhs.description) NOT LIKE '%epoch%'
+            AND lower(bhs.description) NOT LIKE '%epoch%'
+            AND bhs.year BETWEEN ${year_from} AND ${year_to}
           </dc:statement>
           <dc:if test="dc:has-result()">
             <dc:group expr="$bedh_year">
@@ -1714,6 +1729,7 @@
             FROM bed_height_single
             WHERE river_id = ${river_id}
               AND lower(description) LIKE '%epoch%'
+              AND year BETWEEN ${year_from} AND ${year_to}
           </dc:statement>
           <dc:for-each>
             <height factory="bedheight" target_out="{$out}"


More information about the Dive4elements-commits mailing list