diff flys-artifacts/doc/conf/meta-data.xml @ 1905:d025009fec73

Recommend fixations for computed discharge curves. flys-artifacts/trunk@3265 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 16 Nov 2011 09:43:58 +0000
parents ebd16028efa3
children efff4305dc05
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/meta-data.xml	Wed Nov 16 09:42:35 2011 +0000
+++ b/flys-artifacts/doc/conf/meta-data.xml	Wed Nov 16 09:43:58 2011 +0000
@@ -78,6 +78,58 @@
             </addtionals>
         </dc:macro>
 
+        <dc:macro name="basedata_2_fixations_wst">
+          <fixations>
+            <dc:context>
+              <dc:statement>
+                SELECT id          AS prot_id,
+                       description AS prot_description
+                FROM wsts WHERE kind = 2 AND river_id = ${river_id}
+              </dc:statement>
+              <dc:elements>
+                <fixation>
+                    <dc:attribute name="name" value="${prot_description}"/>
+                    <dc:attribute name="ids" value="fixations-wstv-A-${prot_id}"/>
+                    <dc:attribute name="factory" value="wqinterpol"/>
+                </fixation>
+              </dc:elements>
+            </dc:context>
+          </fixations>
+        </dc:macro>
+
+        <dc:macro name="basedata_2_fixations_wqkms">
+          <fixations>
+            <dc:context>
+              <dc:statement>
+                SELECT id          AS prot_id,
+                       description AS prot_description
+                FROM wsts WHERE kind = 2 AND river_id = ${river_id}
+              </dc:statement>
+              <dc:elements>
+                <fixation>
+                  <dc:attribute name="name" value="${prot_description}"/>
+                  <dc:context>
+                    <dc:statement>
+                      SELECT id       AS prot_column_id,
+                             name     AS prot_column_name,
+                             position AS prot_rel_pos
+                      FROM wst_columns WHERE wst_id = ${prot_id}
+                      ORDER by position
+                    </dc:statement>
+                    <dc:elements>
+                      <column>
+                        <dc:attribute name="name" value="${prot_column_name}"/>
+                        <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/>
+                        <dc:attribute name="factory" value="wqinterpol"/>
+                      </column>
+                    </dc:elements>
+                  </dc:context>
+                </fixation>
+              </dc:elements>
+            </dc:context>
+          </fixations>
+        </dc:macro>
+
         <dc:macro name="basedata_2_fixations">
           <fixations>
             <dc:context>
@@ -111,7 +163,6 @@
           </fixations>
         </dc:macro>
 
-
         <dc:macro name="basedata_4_heightmarks-points">
           <heightmarks>
             <dc:context>
@@ -145,6 +196,44 @@
           </heightmarks>
         </dc:macro>
 
+        <dc:macro name="basedata_5_flood-protections">
+          <flood-protections>
+            <dc:attribute name="id" value="flood-protections-${river_id}"/>
+            <dc:context>
+              <dc:statement>
+                SELECT id          AS prot_id,
+                       description AS prot_description
+                FROM wsts WHERE kind = 5 AND river_id = ${river_id}
+              </dc:statement>
+              <dc:elements>
+                <flood-protection>
+                  <dc:attribute name="name" value="${prot_description}"/>
+                  <dc:attribute name="db-id" value="${prot_id}"/>
+                  <dc:attribute name="factory" value="staticwkms"/>
+                  <columns>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT id       AS prot_column_id,
+                               name     AS prot_column_name,
+                               position AS prot_rel_pos
+                        FROM wst_columns WHERE wst_id = ${prot_id}
+                        ORDER by position
+                      </dc:statement>
+                      <dc:elements>
+                        <column>
+                          <dc:attribute name="name" value="${prot_column_name}"/>
+                          <dc:attribute name="ids" value="flood_protection-wstv-${prot_rel_pos}-${prot_id}"/>
+                          <dc:attribute name="factory" value="staticwkms"/>
+                        </column>
+                      </dc:elements>
+                    </dc:context>
+                  </columns>
+                </flood-protection>
+              </dc:elements>
+            </dc:context>
+          </flood-protections>
+        </dc:macro>
+
         <dc:macro name="mainvalues">
           <mainvalue>
             <dc:attribute name="factory" value="mainvalue"/>
@@ -190,6 +279,10 @@
                  <dc:call-macro name="basedata_0"/>
                  <dc:call-macro name="basedata_4_heightmarks-points"/>
               </dc:if>
+              <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')">
+                 <dc:call-macro name="basedata_0"/>
+                 <dc:call-macro name="basedata_4_heightmarks-points"/>
+              </dc:if>
               <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences'))">
                  <dc:call-macro name="basedata_0"/>
                  <dc:call-macro name="basedata_1_additionals"/>
@@ -204,44 +297,11 @@
 
 
           <dc:if test="dc:contains($artifact-outs, 'waterlevels')">
-            <flood-protections>
-              <dc:attribute name="id" value="flood-protections-${river_id}"/>
-              <dc:context>
-                <dc:statement>
-                  SELECT id          AS prot_id,
-                         description AS prot_description
-                  FROM wsts WHERE kind = 5 AND river_id = ${river_id}
-                </dc:statement>
-                <dc:elements>
-                  <flood-protection>
-                    <dc:attribute name="name" value="${prot_description}"/>
-                    <dc:attribute name="db-id" value="${prot_id}"/>
-                    <dc:attribute name="factory" value="staticwkms"/>
-                    <columns>
-                      <dc:context>
-                        <dc:statement>
-                          SELECT id       AS prot_column_id,
-                                 name     AS prot_column_name,
-                                 position AS prot_rel_pos
-                          FROM wst_columns WHERE wst_id = ${prot_id}
-                          ORDER by position
-                        </dc:statement>
-                        <dc:elements>
-                          <column>
-                            <dc:attribute name="name" value="${prot_column_name}"/>
-                            <dc:attribute name="ids" value="flood_protection-wstv-${prot_rel_pos}-${prot_id}"/>
-                            <dc:attribute name="factory" value="staticwkms"/>
-                          </column>
-                        </dc:elements>
-                      </dc:context>
-                    </columns>
-                  </flood-protection>
-                </dc:elements>
-              </dc:context>
-            </flood-protections>
+
             <!-- base data -->
             <dc:call-macro name="basedata_0"/>
-            <!--extra-longitudinal-sections-->
+
+            <!-- extra-longitudinal-sections -->
             <dc:call-macro name="basedata_1_additionals"/>
 
             <!-- fixations -->
@@ -249,7 +309,15 @@
 
             <!-- flood water marks-->
             <dc:call-macro name="basedata_4_heightmarks-points"/>
+
+            <!-- flood protection -->
+            <dc:call-macro name="basedata_5_flood-protections"/>
+
           </dc:if>
+          <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and (dc:contains($parameters, 'recommended'))">
+                <!--dc:call-macro name="basedata_2_fixations_wst"/-->
+          </dc:if>
+
           <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and not (dc:contains($parameters, 'recommended'))">
               <discharge-table-nn>
                 <discharge-table-gauge>
@@ -285,87 +353,29 @@
                     </dc:elements>
                   </dc:context>
                 </discharge-table-gauge>
-                <fixations>
-                  <dc:attribute name="id" value="fixations-${river_id}"/>
-                  <dc:context>
-                    <dc:statement>
-                      SELECT id          AS fix_id,
-                             description AS fix_description
-                      FROM wsts WHERE kind = 2 AND river_id = ${river_id}
-                    </dc:statement>
-                    <dc:elements>
-                      <fixation>
-                        <dc:attribute name="name" value="${fix_description}"/>
-                        <dc:attribute name="db-id" value="${fix_id}"/>
-                        <columns>
-                          <dc:context>
-                            <dc:statement>
-                              SELECT id   AS fix_column_id,
-                                     name AS fix_column_name
-                              FROM wst_columns WHERE wst_id = ${fix_id}
-                              ORDER by position
-                            </dc:statement>
-                            <dc:elements>
-                              <column>
-                                <dc:attribute name="name" value="${fix_column_name}"/>
-                                <dc:attribute name="db-id" value="${fix_column_id}"/>
-                              </column>
-                            </dc:elements>
-                          </dc:context>
-                        </columns>
-                      </fixation>
-                    </dc:elements>
-                  </dc:context>
-                </fixations>
-                <flood-protections>
-                  <dc:attribute name="id" value="flood-protections-${river_id}"/>
-                  <dc:context>
-                    <dc:statement>
-                      SELECT id          AS prot_id,
-                             description AS prot_description
-                      FROM wsts WHERE kind = 5 AND river_id = ${river_id}
-                    </dc:statement>
-                    <dc:elements>
-                      <flood-protection>
-                        <dc:attribute name="name" value="${prot_description}"/>
-                        <dc:attribute name="db-id" value="${prot_id}"/>
-                        <columns>
-                          <dc:context>
-                            <dc:statement>
-                              SELECT id   AS prot_column_id,
-                                     name AS prot_column_name
-                              FROM wst_columns WHERE wst_id = ${prot_id}
-                              ORDER by position
-                            </dc:statement>
-                            <dc:elements>
-                              <column>
-                                <dc:attribute name="name" value="${prot_column_name}"/>
-                                <dc:attribute name="db-id" value="${prot_column_id}"/>
-                                <dc:attribute name="factory" value="staticwkms"/>
-                              </column>
-                            </dc:elements>
-                          </dc:context>
-                        </columns>
-                      </flood-protection>
-                    </dc:elements>
-                  </dc:context>
-                </flood-protections>
-
-                <!-- ex. waterlevels -->
-                <dc:call-macro name="basedata_0"/>
-
-                <dc:call-macro name="basedata_1_additionals"/>
-
-                <!-- ex. flood-water-marks -->
-                <dc:call-macro name="basedata_4_heightmarks-points"/>
 
               </discharge-table-nn>
+
+            <dc:call-macro name="basedata_2_fixations_wst"/>
+
+            <dc:call-macro name="basedata_5_flood-protections"/>
+
+            <!-- former waterlevels -->
+            <dc:call-macro name="basedata_0"/>
+
+            <dc:call-macro name="basedata_1_additionals"/>
+
+            <!-- former flood-water-marks -->
+            <dc:call-macro name="basedata_4_heightmarks-points"/>
           </dc:if>
-          <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')">
+          <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')"><!-- or (dc:contains($artifact-outs, 'discharge_curve'))"-->
+              <!-- && parameter contains recommended/ation -->
               <computed-discharge-curve>
                 <dc:call-macro name="mainvalues"/>
               </computed-discharge-curve>
+              <dc:call-macro name="basedata_2_fixations_wst"/>
           </dc:if>
+
           <dc:if test="dc:contains($artifact-outs, 'duration_curve')">
             <dc:call-macro name="mainvalues"/>
           </dc:if>
@@ -588,6 +598,7 @@
     </dc:comment>
     <dc:when test="dc:contains($parameters, 'user-id')">
 
+
      <old_calculations>
       <dc:context connection="user">
         <dc:comment>

http://dive4elements.wald.intevation.org