diff artifacts/doc/conf/meta-data.xml @ 7418:6665d0e3d795

meta-data.xml: Create and use collection-group macro.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 23 Oct 2013 11:04:06 +0200
parents 79da07ca2afc
children cae7c0625436
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Wed Oct 23 09:59:46 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Oct 23 11:04:06 2013 +0200
@@ -422,7 +422,7 @@
       <dc:filter expr="$facet_name = 'w_differences'">
         <dc:if test="dc:has-result()">
           <differences>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <differences description="{dc:group-key()}">
                 <dc:for-each>
                     <w_differences
@@ -434,7 +434,7 @@
                       out="w_differences"/>
                 </dc:for-each>
               </differences>
-            </dc:group>
+            </dc:call-macro>
           </differences>
         </dc:if>
       </dc:filter>
@@ -540,11 +540,17 @@
       </dc:filter>
     </dc:macro>
 
+    <dc:macro name="collection-group">
+      <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+        <dc:macro-body/>
+      </dc:group>
+    </dc:macro>
+
     <dc:macro name="longitudinal">
       <dc:filter expr="$out_name = 'longitudinal_section'">
         <dc:if test="dc:has-result()">
           <waterlevels_ls>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <dc:comment>Aheinecke: Why is this grouping different from the rest?</dc:comment>
               <longitudinal_section_columns description="{dc:group-key()}">
                 <dc:for-each>
@@ -558,7 +564,7 @@
                   </dc:element>
                 </dc:for-each>
               </longitudinal_section_columns>
-            </dc:group>
+            </dc:call-macro>
           </waterlevels_ls>
         </dc:if>
       </dc:filter>
@@ -576,7 +582,7 @@
         ">
         <dc:if test="dc:has-result()">
           <waterlevels_fix>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <waterlevels description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -596,7 +602,7 @@
                   </dc:element>
                 </dc:for-each>
               </waterlevels>
-            </dc:group>
+            </dc:call-macro>
           </waterlevels_fix>
         </dc:if>
       </dc:filter>
@@ -611,7 +617,7 @@
         starts-with($facet_name, 'fix_sector_average_dwt'))">
         <dc:if test="dc:has-result()">
           <waterlevels>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <waterlevels description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -624,7 +630,7 @@
                   </dc:element>
                 </dc:for-each>
               </waterlevels>
-            </dc:group>
+            </dc:call-macro>
           </waterlevels>
         </dc:if>
       </dc:filter>
@@ -636,7 +642,7 @@
         starts-with($facet_name, 'fix_deviation_dwt'))">
         <dc:if test="dc:has-result()">
           <waterlevels>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <waterlevels description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -649,7 +655,7 @@
                   </dc:element>
                 </dc:for-each>
               </waterlevels>
-            </dc:group>
+            </dc:call-macro>
           </waterlevels>
         </dc:if>
       </dc:filter>
@@ -659,7 +665,7 @@
       <dc:filter expr="$out_name = 'fix_derivate_curve' and $facet_name = 'fix_derivate_curve'">
         <dc:if test="dc:has-result()">
           <waterlevels>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <waterlevels description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -672,7 +678,7 @@
                   </dc:element>
                 </dc:for-each>
               </waterlevels>
-            </dc:group>
+            </dc:call-macro>
           </waterlevels>
         </dc:if>
       </dc:filter>
@@ -686,7 +692,7 @@
         $facet_name = 'fix_wq_curve')">
         <dc:if test="dc:has-result()">
           <waterlevels>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <waterlevels description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -699,7 +705,7 @@
                   </dc:element>
                 </dc:for-each>
               </waterlevels>
-            </dc:group>
+            </dc:call-macro>
           </waterlevels>
         </dc:if>
       </dc:filter>
@@ -935,7 +941,7 @@
         $facet_name = 'bed_longitudinal_section.bedload_diameter'">
         <dc:if test="dc:has-result()">
           <bed_quality_load>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <quality-load description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -948,7 +954,7 @@
                   </dc:element>
                 </dc:for-each>
               </quality-load>
-            </dc:group>
+            </dc:call-macro>
           </bed_quality_load>
         </dc:if>
       </dc:filter>
@@ -960,7 +966,7 @@
          $facet_name = 'bed_longitudinal_section.sediment_density_sublayer')">
         <dc:if test="dc:has-result()">
           <bed_quality_density>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <density description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -973,7 +979,7 @@
                   </dc:element>
                 </dc:for-each>
               </density>
-            </dc:group>
+            </dc:call-macro>
           </bed_quality_density>
         </dc:if>
       </dc:filter>
@@ -985,7 +991,7 @@
         $facet_name = 'bed_longitudinal_section.porosity_sublayer')">
         <dc:if test="dc:has-result()">
           <bed_quality_porosity>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <porosity description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -998,7 +1004,7 @@
                   </dc:element>
                 </dc:for-each>
               </porosity>
-            </dc:group>
+            </dc:call-macro>
           </bed_quality_porosity>
         </dc:if>
       </dc:filter>
@@ -1012,7 +1018,7 @@
          $facet_name = 'flow_velocity.mainchannel.filtered')">
         <dc:if test="dc:has-result()">
           <flow-velocity>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <flow description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -1025,7 +1031,7 @@
                   </dc:element>
                 </dc:for-each>
               </flow>
-            </dc:group>
+            </dc:call-macro>
           </flow-velocity>
         </dc:if>
       </dc:filter>
@@ -1035,7 +1041,7 @@
       <dc:filter expr="$out_name = 'sedimentload_ls' and starts-with($facet_name, 'sedimentload')">
         <dc:if test="dc:has-result()">
           <sediment-load>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <load description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -1048,7 +1054,7 @@
                   </dc:element>
                 </dc:for-each>
               </load>
-            </dc:group>
+            </dc:call-macro>
           </sediment-load>
         </dc:if>
       </dc:filter>
@@ -1059,7 +1065,7 @@
         (starts-with($facet_name, 'bedheight_difference.year') or starts-with($facet_name, 'bedheight_difference.epoch'))">
         <dc:if test="dc:has-result()">
           <bedheight_differences>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <difference description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -1072,7 +1078,7 @@
                   </dc:element>
                 </dc:for-each>
               </difference>
-            </dc:group>
+            </dc:call-macro>
           </bedheight_differences>
         </dc:if>
       </dc:filter>
@@ -1088,7 +1094,7 @@
         ($out = 'sq_relation_f' and starts-with($facet_name, 'sq_f_'))">
         <dc:if test="dc:has-result()">
           <sq_relations>
-            <dc:group expr="concat($river, ' ', dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <sqrel description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -1101,7 +1107,7 @@
                   </dc:element>
                 </dc:for-each>
               </sqrel>
-            </dc:group>
+            </dc:call-macro>
           </sq_relations>
         </dc:if>
       </dc:filter>
@@ -1111,7 +1117,7 @@
       <dc:filter expr="$out_name = 'discharge_longitudinal_section' and $facet_name = 'discharge_longitudinal_section.w'">
         <dc:if test="dc:has-result()">
           <waterlevels_discharge>
-            <dc:group expr="concat($river, ' ',  dc:date-format('dd.MM.yyyy - H:mm:ss', $a_creation), ' ', $collection_name)">
+            <dc:call-macro name="collection-group">
               <discharge description="{dc:group-key()}">
                 <dc:for-each>
                   <dc:element name="${facet_name}">
@@ -1124,7 +1130,7 @@
                   </dc:element>
                 </dc:for-each>
               </discharge>
-            </dc:group>
+            </dc:call-macro>
           </waterlevels_discharge>
         </dc:if>
       </dc:filter>

http://dive4elements.wald.intevation.org