diff flys-artifacts/doc/conf/meta-data.xml @ 1657:91d038c7aae5

Bugfix: #328 Improved datacage configuration and labels for selected waterlevels. flys-artifacts/trunk@2854 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 28 Sep 2011 14:01:00 +0000
parents be8b5c06a1f8
children 3ca999f507b7
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/meta-data.xml	Wed Sep 28 09:17:20 2011 +0000
+++ b/flys-artifacts/doc/conf/meta-data.xml	Wed Sep 28 14:01:00 2011 +0000
@@ -306,7 +306,7 @@
     <dc:when test="dc:contains($parameters, 'user-id')">
       <old_calculations>
         <dc:context connection="user">
-          <dc:statement>SELECT u.id AS user_id, c.id AS collection_id
+          <dc:statement>SELECT u.id AS user_id, c.id AS collection_id, c.name as collection_name
                         FROM collections c JOIN users u ON c.user_id = u.id
                         WHERE u.gid = CAST(${user-id} AS uuid)
                         ORDER BY c.creation DESC
@@ -321,6 +321,12 @@
               </dc:statement>
               <dc:elements>
                 <dc:choose>
+
+
+                  <dc:comment>
+                    Import longitudinal sections only if the ${artifact-out} is defined as 'longitudinal_section'
+                    ---------------------------------------------------------------------------------------------
+                  </dc:comment>
                   <dc:when test="dc:contains($artifact-outs, 'longitudinal_section')">
                     <dc:context>
                       <dc:statement>SELECT id AS out_id FROM outs WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
@@ -346,21 +352,67 @@
                       </dc:elements>
                     </dc:context>
                   </dc:when>
+                  <dc:comment>
+                    Import of longitudinal sections finished
+                  </dc:comment>
+
+
+                  <dc:comment>
+                    Import Waterlevels only if the ${artifact-out} is defined as 'waterlevels'
+                    --------------------------------------------------------------------------
+                  </dc:comment>
+                  <dc:when test="dc:contains($artifact-outs, 'waterlevels')">
+                    <dc:context>
+                      <dc:statement>SELECT id AS out_id FROM outs WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
+                      </dc:statement>
+                      <dc:elements>
+                        <dc:context>
+                          <dc:statement>SELECT name AS facet_name, num as facet_num, description AS facet_description
+                                        FROM facets WHERE out_id = ${out_id} and name = 'longitudinal_section.w' ORDER BY num ASC, name DESC
+                          </dc:statement>
+                          <waterlevels>
+                            <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
+                            <dc:elements>
+                              <dc:element name="${facet_name}">
+                                <dc:attribute name="description" value="${facet_description}"/>
+                                <dc:attribute name="ids" value="${facet_num}"/>
+                                <dc:attribute name="factory" value="winfo"/>
+                                <dc:attribute name="artifact-id" value="${a_gid}"/>
+                                <dc:attribute name="out" value="longitudinal_section"/>
+                              </dc:element>
+                            </dc:elements>
+                          </waterlevels>
+                        </dc:context>
+                      </dc:elements>
+                    </dc:context>
+                  </dc:when>
+                  <dc:comment>
+                    Import of waterlevels finished
+                  </dc:comment>
+
                 </dc:choose>
               </dc:elements>
             </dc:context>
           </dc:elements>
         </dc:context>
       </old_calculations>
+
+
       <dc:comment>
-        System specific part
-        --------------------
+        Include System specific part when 'load-system' is in parameters.
+        -----------------------------------------------------------------
       </dc:comment>
-      <dc:call-macro name="load-system"/>
+      <dc:choose>
+        <dc:when test="dc:contains($parameters,'load-system')">
+          <dc:call-macro name="load-system"/>
+        </dc:when>
+      </dc:choose>
     </dc:when>
+
+
     <dc:comment>
-      System specific part only
-      -------------------------
+      Include System specific part only if no user ID is given.
+      ---------------------------------------------------------
     </dc:comment>
     <dc:otherwise>
         <dc:call-macro name="load-system"/>

http://dive4elements.wald.intevation.org