[Dive4elements-commits] [PATCH 4 of 6] meta-data.xml: Replace wst_columns queries by macro call

Wald Commits scm-commit at wald.intevation.org
Tue Jan 29 10:47:05 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1359389760 -3600
# Node ID 5741970e2c586d13224b569b4ff6f5b5bedfc78d
# Parent  54762b8ef016b786734e1d848672637ae43709ea
meta-data.xml: Replace wst_columns queries by macro call.

diff -r 54762b8ef016 -r 5741970e2c58 flys-artifacts/doc/conf/meta-data.xml
--- a/flys-artifacts/doc/conf/meta-data.xml	Mon Jan 28 14:43:53 2013 +0100
+++ b/flys-artifacts/doc/conf/meta-data.xml	Mon Jan 28 17:16:00 2013 +0100
@@ -1,6 +1,16 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage">
 <datacage>
+<dc:macro name="SQL-wst_columns_statement">
+    <dc:statement>
+        SELECT wst_columns.id          AS prot_column_id,
+               wst_columns.name        AS prot_column_name,
+               wst_columns.position    AS prot_rel_pos,
+               wst_columns.description AS info
+        FROM wst_columns WHERE wst_columns.wst_id = ${prot_id}
+        ORDER by wst_columns.position
+    </dc:statement>
+</dc:macro>
   <dc:macro name="load-system">
     <dc:context connection="system">
       <dc:statement>
@@ -24,14 +34,7 @@
                   <basedata>
                     <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,
-                               description AS info
-                        FROM wst_columns WHERE wst_id = ${prot_id}
-                        ORDER by position
-                      </dc:statement>
+                      <dc:call-macro name="SQL-wst_columns_statement"/>
                       <dc:elements>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
@@ -59,14 +62,7 @@
                   <basedata>
                     <dc:attribute name="name" value="${prot_description}"/>
                     <dc:context>
-                      <dc:statement>
-                        SELECT wst_columns.id       AS prot_column_id,
-                               wst_columns.name     AS prot_column_name,
-                               wst_columns.position AS prot_rel_pos,
-                               wst_columns.description AS info
-                        FROM wst_columns WHERE wst_columns.wst_id = ${prot_id}
-                        ORDER by wst_columns.position
-                      </dc:statement>
+                      <dc:call-macro name="SQL-wst_columns_statement"/>
                       <dc:elements>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
@@ -95,14 +91,7 @@
                   <additional>
                     <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,
-                               description AS info
-                        FROM wst_columns WHERE wst_id = ${prot_id}
-                        ORDER by position
-                      </dc:statement>
+                      <dc:call-macro name="SQL-wst_columns_statement"/>
                       <dc:elements>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
@@ -131,14 +120,7 @@
                   <additional>
                     <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,
-                               description AS info
-                        FROM wst_columns WHERE wst_id = ${prot_id}
-                        ORDER by position
-                      </dc:statement>
+                      <dc:call-macro name="SQL-wst_columns_statement"/>
                       <dc:elements>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
@@ -167,14 +149,7 @@
                   <relativepoint>
                     <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,
-                               description AS info
-                        FROM wst_columns WHERE wst_id = ${prot_id}
-                        ORDER by position
-                      </dc:statement>
+                      <dc:call-macro name="SQL-wst_columns_statement"/>
                       <dc:elements>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
@@ -203,14 +178,7 @@
                   <dc:attribute name="name" value="${prot_description}"/>
                   <!--dc:attribute name="ids" value="fixations-wstv-A-${prot_id}"/-->
                   <dc:context>
-                    <dc:statement>
-                      SELECT id       AS prot_column_id,
-                             name     AS prot_column_name,
-                             position AS prot_rel_pos,
-                             description AS info
-                      FROM wst_columns WHERE wst_id = ${prot_id}
-                      ORDER by position
-                    </dc:statement>
+                    <dc:call-macro name="SQL-wst_columns_statement"/>
                     <dc:elements>
                       <column>
                         <dc:attribute name="name" value="${prot_column_name}"/>
@@ -238,14 +206,7 @@
                 <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,
-                             description AS info
-                      FROM wst_columns WHERE wst_id = ${prot_id}
-                      ORDER by position
-                    </dc:statement>
+                    <dc:call-macro name="SQL-wst_columns_statement"/>
                     <dc:elements>
                       <column>
                         <dc:attribute name="name" value="${prot_column_name}"/>
@@ -273,14 +234,7 @@
                 <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,
-                             description AS info
-                      FROM wst_columns WHERE wst_id = ${prot_id}
-                      ORDER by position
-                    </dc:statement>
+                    <dc:call-macro name="SQL-wst_columns_statement"/>
                     <dc:elements>
                       <column>
                         <dc:attribute name="name" value="${prot_column_name}"/>
@@ -308,14 +262,7 @@
                 <relativepoint>
                   <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,
-                             description AS info
-                      FROM wst_columns WHERE wst_id = ${prot_id}
-                      ORDER by position
-                    </dc:statement>
+                    <dc:call-macro name="SQL-wst_columns_statement"/>
                     <dc:elements>
                       <column>
                         <dc:attribute name="name" value="${prot_column_name}"/>
@@ -344,14 +291,7 @@
                   <official>
                     <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,
-                               description AS info
-                        FROM wst_columns WHERE wst_id = ${prot_id}
-                        ORDER by position
-                      </dc:statement>
+                      <dc:call-macro name="SQL-wst_columns_statement"/>
                       <dc:elements>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
@@ -379,14 +319,7 @@
                 <relativepoint>
                   <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,
-                             description AS info
-                      FROM wst_columns WHERE wst_id = ${prot_id}
-                      ORDER by position
-                    </dc:statement>
+                    <dc:call-macro name="SQL-wst_columns_statement"/>
                     <dc:elements>
                       <column>
                         <dc:attribute name="name" value="${prot_column_name}"/>
@@ -414,14 +347,7 @@
                 <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,
-                             description AS info
-                      FROM wst_columns WHERE wst_id = ${prot_id}
-                      ORDER by position
-                    </dc:statement>
+                    <dc:call-macro name="SQL-wst_columns_statement"/>
                     <dc:elements>
                       <column>
                         <dc:attribute name="name" value="${prot_column_name}"/>
@@ -449,14 +375,7 @@
                 <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,
-                             description AS info
-                      FROM wst_columns WHERE wst_id = ${prot_id}
-                      ORDER by position
-                    </dc:statement>
+                    <dc:call-macro name="SQL-wst_columns_statement"/>
                     <dc:elements>
                       <column>
                         <dc:attribute name="name" value="${prot_column_name}"/>
@@ -488,14 +407,7 @@
                   <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,
-                               description AS info
-                        FROM wst_columns WHERE wst_id = ${prot_id}
-                        ORDER by position
-                      </dc:statement>
+                      <dc:call-macro name="SQL-wst_columns_statement"/>
                       <dc:elements>
                         <column>
                           <dc:attribute name="name" value="${prot_column_name}"/>
@@ -527,18 +439,13 @@
                   <dc:attribute name="db-id" value="${prot_id}"/>
                   <dc:attribute name="factory" value="staticwkms"/>
                   <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:call-macro name="SQL-wst_columns_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"/>
+                        <dc:attribute name="info" value="${info}"/>
                       </column>
                     </dc:elements>
                   </dc:context>


More information about the Dive4elements-commits mailing list