[PATCH 3 of 3] (issue1474) Add sqrelation user data and disable filtering for it

Wald Commits scm-commit at wald.intevation.org
Wed Oct 16 11:46:31 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1381916723 -7200
# Node ID 59bfda45262b4184a824af426fb52db114b9fed9
# Parent  93a1e63f56447df3fd73fcae9ccc81ea612e7838
(issue1474) Add sqrelation user data and disable filtering for it

diff -r 93a1e63f5644 -r 59bfda45262b artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Wed Oct 16 11:42:53 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Oct 16 11:45:23 2013 +0200
@@ -407,6 +407,9 @@
                       <dc:call-macro name="waterlevels-fix"/>
                       <dc:call-macro name="delta-wt-ls"/>
                     </dc:when>
+                    <dc:when test="starts-with($out, 'sq_relation')">
+                      <dc:call-macro name="sqrelations_user"/>
+                    </dc:when>
                   </dc:choose>
                 </dc:iterate>
               </dc:otherwise>
@@ -1063,6 +1066,35 @@
       </dc:filter>
     </dc:macro>
 
+    <dc:macro name="sqrelations_user">
+      <dc:filter expr="
+        ($out = 'sq_relation_a' and starts-with($facet_name, 'sq_a')) or
+        ($out = 'sq_relation_b' and starts-with($facet_name, 'sq_b')) or
+        ($out = 'sq_relation_c' and starts-with($facet_name, 'sq_c')) or
+        ($out = 'sq_relation_d' and starts-with($facet_name, 'sq_d')) or
+        ($out = 'sq_relation_e' and starts-with($facet_name, 'sq_e')) or
+        ($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)">
+              <sqrel description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="minfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}"/>
+                    <dc:attribute name="artifact-id" value="${a_gid}"/>
+                    <dc:attribute name="out" value="${out_name}"/>
+                  </dc:element>
+                </dc:for-each>
+              </sqrel>
+            </dc:group>
+          </sq_relations>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
     <dc:macro name="waterlevels-discharge">
       <dc:filter expr="$out_name = 'discharge_longitudinal_section' and $facet_name = 'discharge_longitudinal_section.w'">
         <dc:if test="dc:has-result()">
@@ -2854,7 +2886,12 @@
     </dc:macro>
 
     <dc:macro name="km-filtered-user-artifacts">
-      <dc:filter expr="not($deffrom > $tokm or $defto < $fromkm)">
+      <dc:comment>
+        Apply KM Filtering but pass
+        sq_ facets with no regard about their location.
+      </dc:comment>
+      <dc:filter expr="not($deffrom > $tokm or $defto < $fromkm) or
+        starts-with($facet_name, 'sq_')">
         <dc:macro-body/>
       </dc:filter>
     </dc:macro>


More information about the Dive4elements-commits mailing list