changeset 8335:9d62a8b4bf15

Throw non-lethal XPathException if not at gauge instead of lethal PSQLException if at gauge.
author "Tom Gottfried <tom@intevation.de>"
date Fri, 26 Sep 2014 14:18:27 +0200
parents 38f57e854977
children b9fa8124583c
files artifacts/doc/conf/meta-data.xml
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Fri Sep 26 10:53:26 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Fri Sep 26 14:18:27 2014 +0200
@@ -466,6 +466,8 @@
 
 
     <dc:macro name="historical_discharge_curve">
+      <dc:variable name="refgauge" type="number"
+                   expr="dc:get('reference_gauge')"/>
       <dc:context>
         <dc:statement>
           SELECT g.id   AS gauge_id,
@@ -480,7 +482,7 @@
           WHERE g.river_id = ${river_id}
             AND dt.kind &lt;&gt; 0
             AND ((g.station = ${fromkm} AND g.station = ${tokm})
-              OR g.official_number = ${reference_gauge})
+              OR g.official_number = ${refgauge})
           ORDER BY start_time
         </dc:statement>
         <dc:if test="dc:has-result()">
@@ -1783,6 +1785,8 @@
     </dc:macro>
 
     <dc:macro name="discharge_table_gauge">
+      <dc:variable name="refgauge" type="number"
+                   expr="dc:get('reference_gauge')"/>
       <dc:context>
         <dc:statement>
           SELECT g.id   AS gauge_id,
@@ -1795,7 +1799,7 @@
           WHERE g.river_id = ${river_id}
           AND dt.kind = 0
           AND ((g.station = ${fromkm} AND g.station = ${tokm})
-          OR g.official_number = ${reference_gauge})
+          OR g.official_number = ${refgauge})
         </dc:statement>
         <dc:if test="dc:has-result()">
           <dc:for-each>

http://dive4elements.wald.intevation.org