diff artifacts/doc/conf/meta-data.xml @ 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 1431d1af84d7
children 57bd0a586a9b
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