changeset 8289:f12a5c55864d

Consider new SQ-diagrams in datacage config.
author "Tom Gottfried <tom@intevation.de>"
date Wed, 17 Sep 2014 13:24:13 +0200
parents 2f7f9ced46a5
children 9b295cc828c5
files artifacts/contrib/list-non-existant-outs.sh artifacts/doc/conf/meta-data.xml
diffstat 2 files changed, 36 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/contrib/list-non-existant-outs.sh	Wed Sep 17 13:12:12 2014 +0200
+++ b/artifacts/contrib/list-non-existant-outs.sh	Wed Sep 17 13:24:13 2014 +0200
@@ -9,6 +9,9 @@
     sed "s/ *<dc:when test=\"\$out = '\(.*\)'\">/\1/" | \
     sort -u > /tmp/$tmpfile
 
+echo "WARNING:"
+echo "Only tests having exactly the pattern \"\$out = 'outname'\" will be recognised!"
+echo
 echo "outs not used in any artifact-configuration:"
 for out in `cat /tmp/$tmpfile`
 do
--- a/artifacts/doc/conf/meta-data.xml	Wed Sep 17 13:12:12 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Sep 17 13:24:13 2014 +0200
@@ -278,7 +278,8 @@
                     <dc:call-macro name="basedata_4_heightmarks-points"/>
                     <dc:call-macro name="basedata_5_flood-protections"/>
                   </dc:when>
-                  <dc:when test="starts-with($out, 'sq_relation')">
+                  <dc:when test="starts-with($out, 'sq_relation') or
+                                 $out = 'sq_overview'">
                     <dc:call-macro name="sqrelations"/>
                   </dc:when>
                 </dc:choose>
@@ -396,7 +397,8 @@
                     <dc:when test="$out = 'historical_discharge_wq'">
                       <dc:call-macro name="historical-discharge-wq-user"/>
                     </dc:when>
-                    <dc:when test="starts-with($out, 'sq_relation')">
+                    <dc:when test="starts-with($out, 'sq_relation') or
+                                 $out = 'sq_overview'">
                       <dc:call-macro name="sqrelations_user"/>
                     </dc:when>
                   </dc:choose>
@@ -1071,13 +1073,15 @@
     </dc:macro>
 
     <dc:macro name="sqrelations_user">
-      <dc:filter expr="
+      <dc:filter expr="not(dc:contains($facet_name, 'overview')) and (
         ($out = 'sq_relation_a' and starts-with($facet_name, 'sq_a_')) or
         ($out = 'sq_relation_b' and starts-with($facet_name, 'sq_b_')) or
         ($out = 'sq_relation_c' and starts-with($facet_name, 'sq_c_')) or
         ($out = 'sq_relation_d' and starts-with($facet_name, 'sq_d_')) or
         ($out = 'sq_relation_e' and starts-with($facet_name, 'sq_e_')) or
-        ($out = 'sq_relation_f' and starts-with($facet_name, 'sq_f_'))">
+        ($out = 'sq_relation_f' and starts-with($facet_name, 'sq_f_')) or
+        ($out = 'sq_relation_g' and starts-with($facet_name, 'sq_g_'))) or
+        $out = 'sq_overview' and dc:contains($facet_name, 'overview')">
         <dc:if test="dc:has-result()">
           <sq_relations>
             <dc:call-macro name="collection-group">
@@ -2106,17 +2110,31 @@
         </dc:statement>
         <dc:if test="dc:has-result()">
           <sq_relations>
-            <dc:filter expr="$out = concat('sq_relation_', $parameter)">
-              <dc:group expr="$station_km" type="number">
-                <dc:group expr="concat('km ', $station_km, ': ', $station_name)">
-                  <station description="{dc:group-key()}">
-                    <dc:for-each>
-                      <dc:variable name="combined_desc" expr="concat(dc:date-format('yyyy', $start_time), ' bis ', dc:date-format('yyyy', $stop_time))"/>
-                      <sqvalue factory="staticsqrelation" target_out="{$out}"
-                        ids="{$sqvid};{$station_name}: {$combined_desc}" description="{$combined_desc}"/>
-                    </dc:for-each>
-                  </station>
-                </dc:group>
+            <dc:filter expr="$out = concat('sq_relation_', $parameter) or
+                             $out = 'sq_overview'">
+              <dc:group expr="concat('Parameter ', dc:uppercase($parameter))">
+                <parameter description="{dc:group-key()}">
+                  <dc:for-each>
+                    <dc:group expr="$station_km" type="number">
+                      <dc:group expr="concat('km ', $station_km, ': ',
+                                      $station_name)">
+                        <station description="{dc:group-key()}">
+                          <dc:for-each>
+                            <dc:variable name="combined_desc"
+                                         expr="concat(dc:date-format('yyyy',
+                                               $start_time), ' bis ',
+                                               dc:date-format('yyyy',
+                                               $stop_time))"/>
+                            <sqvalue factory="staticsqrelation"
+                                     target_out="{$out}"
+                                     ids="{$sqvid};{dc:uppercase($parameter)} - {$station_name}: {$combined_desc}"
+                                     description="{$combined_desc}"/>
+                          </dc:for-each>
+                        </station>
+                      </dc:group>
+                    </dc:group>
+                  </dc:for-each>
+                </parameter>
               </dc:group>
             </dc:filter>
           </sq_relations>

http://dive4elements.wald.intevation.org