changeset 7851:b566cd0c025a

New macro for porosities in datacage config.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 30 Apr 2014 15:26:44 +0200
parents 63959d4f3c03
children 6e346ef4446f
files artifacts/doc/conf/meta-data.xml
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Wed Apr 30 15:25:50 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Apr 30 15:26:44 2014 +0200
@@ -1303,6 +1303,7 @@
           <dc:call-macro name="minfo-heights"/>
           <dc:call-macro name="sounding-width"/>
           <dc:call-macro name="morph_width"/>
+          <dc:call-macro name="porosities"/>
           <flow_velocities>
             <dc:call-macro name="flow_velocity_measurements"/>
             <dc:call-macro name="flow_velocity_models"/>
@@ -1324,6 +1325,34 @@
       <dc:call-macro name="sediment-load"/>
     </dc:macro>
 
+    <dc:macro name="porosities">
+      <porosities>
+      <dc:context>
+        <dc:statement>
+            SELECT DISTINCT
+                p.id          AS pid,
+                p.description AS description,
+                d.lower        AS depth_lower,
+                d.upper        AS depth_upper
+            FROM     porosity p
+                JOIN depths d ON p.depth_id = d.id
+                JOIN porosity_values pv on pv.porosity_id = p.id
+            WHERE   p.river_id = ${river_id}
+            GROUP BY p.id, p.description, d.upper, d.lower
+            ORDER BY depth_lower, depth_upper
+        </dc:statement>
+        <dc:if test="dc:has-result()">
+          <dc:for-each>
+                  <porosity description="{$depth_lower}-{$depth_upper} cm"
+                   factory="porosity"
+                   target_out="{$out}"
+                   info="{$description}"
+                   ids="{$pid}" />
+          </dc:for-each>
+        </dc:if>
+      </dc:context>
+      </porosities>
+    </dc:macro>
 
     <dc:macro name="densities">
       <densities>

http://dive4elements.wald.intevation.org