changeset 1872:2e810c50e685

Refactored datacage conf to (re)use macros. flys-artifacts/trunk@3226 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 10 Nov 2011 14:06:49 +0000
parents 257f7b54a943
children 841af55d5e53
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/meta-data.xml
diffstat 2 files changed, 49 insertions(+), 167 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Nov 10 13:54:24 2011 +0000
+++ b/flys-artifacts/ChangeLog	Thu Nov 10 14:06:49 2011 +0000
@@ -1,3 +1,7 @@
+2011-11-10  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	* doc/conf/meta-data.xml: Refactored and (re)use macros.
+
 2011-11-10  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/WMSBuildingsArtifact.java: New
--- a/flys-artifacts/doc/conf/meta-data.xml	Thu Nov 10 13:54:24 2011 +0000
+++ b/flys-artifacts/doc/conf/meta-data.xml	Thu Nov 10 14:06:49 2011 +0000
@@ -78,6 +78,40 @@
             </addtionals>
         </dc:macro>
 
+        <dc:macro name="basedata_2_fixations">
+          <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="staticwkms"/>
+                      </column>
+                    </dc:elements>
+                  </dc:context>
+                </fixation>
+              </dc:elements>
+            </dc:context>
+          </fixations>
+        </dc:macro>
+
+
         <dc:macro name="basedata_4_heightmarks-points">
           <heightmarks>
             <dc:context>
@@ -167,78 +201,7 @@
              <dc:comment comment="--- non-recommendations---"/>
             </dc:otherwise>
           </dc:choose>
-          <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences'))">
-            <dc:choose>
-              <dc:when test="dc:contains($parameters, 'recommended')">
-              </dc:when>
-              <dc:otherwise>
-                <dc:call-macro name="basedata_0"/>
-                <dc:call-macro name="basedata_1_additionals"/>
-                <dc:comment comment=" FIXATIONS ---------------------------"/>
-                <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="staticwkms"/>
-                            </column>
-                          </dc:elements>
-                        </dc:context>
-                      </fixation>
-                    </dc:elements>
-                  </dc:context>
-                </fixations>
-                <dc:comment comment=" HOEHENMARKEN ---------------------------"/>
-                <heightmarks>
-                  <dc:context>
-                    <dc:statement>
-                      SELECT id          AS prot_id,
-                             description AS prot_description
-                      FROM wsts WHERE kind = 4 AND river_id = ${river_id}
-                    </dc:statement>
-                    <dc:elements>
-                      <heightmark>
-                        <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="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/>
-                              <dc:attribute name="factory" value="staticwkms"/>
-                            </column>
-                          </dc:elements>
-                        </dc:context>
-                      </heightmark>
-                    </dc:elements>
-                  </dc:context>
-                </heightmarks>
-               </dc:otherwise>
-            </dc:choose>
-          </dc:if>
+
 
           <dc:if test="dc:contains($artifact-outs, 'waterlevels')">
             <flood-protections>
@@ -411,101 +374,15 @@
                     </dc:elements>
                   </dc:context>
                 </flood-protections>
-                <flood-water-marks>
-                  <dc:attribute name="id" value="flood-water-marks-${river_id}"/>
-                  <dc:context>
-                    <dc:statement>
-                      SELECT id          AS fw_id,
-                             description AS fw_description
-                      FROM wsts WHERE kind = 4 AND river_id = ${river_id}
-                    </dc:statement>
-                    <dc:elements>
-                      <flood-water-mark>
-                        <dc:attribute name="name" value="${fw_description}"/>
-                        <dc:attribute name="db-id" value="${fw_id}"/>
-                        <columns>
-                          <dc:context>
-                            <dc:statement>
-                              SELECT id   AS fw_column_id,
-                                     name AS fw_column_name
-                              FROM wst_columns WHERE wst_id = ${fw_id}
-                              ORDER by position
-                            </dc:statement>
-                            <dc:elements>
-                              <column>
-                                <dc:attribute name="name" value="${fw_column_name}"/>
-                                <dc:attribute name="db-id" value="${fw_column_id}"/></column>
-                            </dc:elements>
-                          </dc:context>
-                        </columns>
-                      </flood-water-mark>
-                    </dc:elements>
-                  </dc:context>
-                </flood-water-marks>
-                <water-levels>
-                  <dc:attribute name="id" value="water-levels-${river_id}"/>
-                  <dc:context>
-                    <dc:statement>
-                      SELECT id          AS wl_id,
-                             description AS wl_description
-                      FROM wsts WHERE kind = 0 AND river_id = ${river_id}
-                    </dc:statement>
-                    <dc:elements>
-                      <water-level>
-                        <dc:attribute name="name" value="${wl_description}"/>
-                        <dc:attribute name="db-id" value="${wl_id}"/>
-                        <columns>
-                          <dc:context>
-                            <dc:statement>
-                              SELECT id   AS wl_column_id,
-                                     name AS wl_column_name
-                              FROM wst_columns WHERE wst_id = ${wl_id}
-                              ORDER by position
-                            </dc:statement>
-                            <dc:elements>
-                              <column>
-                                <dc:attribute name="name" value="${wl_column_name}"/>
-                                <dc:attribute name="db-id" value="${wl_column_id}"/>
-                              </column>
-                            </dc:elements>
-                          </dc:context>
-                        </columns>
-                      </water-level>
-                    </dc:elements>
-                  </dc:context>
-                </water-levels>
-                <extra-longitudinal-sections>
-                  <dc:attribute name="id" value="extra-longitudinal-sections-${river_id}"/>
-                  <dc:context>
-                    <dc:statement>
-                      SELECT id          AS els_id,
-                             description AS els_description
-                      FROM wsts WHERE kind = 1 AND river_id = ${river_id}
-                    </dc:statement>
-                    <dc:elements>
-                      <extra-longitudinal-section>
-                        <dc:attribute name="name"  value="${els_description}"/>
-                        <dc:attribute name="db-id" value="${els_id}"/>
-                        <columns>
-                          <dc:context>
-                            <dc:statement>
-                              SELECT id   AS els_column_id,
-                                     name AS els_column_name
-                              FROM wst_columns WHERE wst_id = ${els_id}
-                              ORDER by position
-                            </dc:statement>
-                            <dc:elements>
-                              <column>
-                                <dc:attribute name="name"  value="${els_column_name}"/>
-                                <dc:attribute name="db-id" value="${els_column_id}"/>
-                              </column>
-                            </dc:elements>
-                          </dc:context>
-                        </columns>
-                      </extra-longitudinal-section>
-                    </dc:elements>
-                  </dc:context>
-                </extra-longitudinal-sections>
+
+                <!-- 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:if>
           <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')">
@@ -516,6 +393,7 @@
           <dc:if test="dc:contains($artifact-outs, 'duration_curve')">
             <dc:call-macro name="mainvalues"/>
           </dc:if>
+
           <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')">
               <longitudinal-section>
                 <dc:call-macro name="annotations"/>

http://dive4elements.wald.intevation.org