changeset 7427:2ee825c87f57

(issue965) Handle the case that diffids are not available
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 23 Oct 2013 12:43:26 +0200
parents f4623fe18868
children 76015ac8c5f1
files artifacts/doc/conf/meta-data.xml
diffstat 1 files changed, 23 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Wed Oct 23 12:09:36 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Oct 23 12:43:26 2013 +0200
@@ -1688,20 +1688,29 @@
         On this list of numbers we use the dc:min/max-number functions to
         get the extreme values and interpret the result as a number.
       </dc:comment>
-      <dc:variable name="year_from" expr="
-        dc:min-number(
-          dc:find-all(
-            '\d{4}',
-              dc:replace-all(
-                $diffids, '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}', '')))"
-        type="number"/>
-      <dc:variable name="year_to" expr="
-        dc:max-number(
-          dc:find-all(
-            '\d{4}',
-            dc:replace-all(
-              $diffids, '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}', '')))"
-        type="number"/>
+      <dc:choose>
+        <dc:when test="dc:contains($parameters, 'diffids')">
+          <dc:variable name="year_from" expr="
+            dc:min-number(
+              dc:find-all(
+                '\d{4}',
+                dc:replace-all(
+                  $diffids, '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}', '')))"
+            type="number"/>
+          <dc:variable name="year_to" expr="
+            dc:max-number(
+              dc:find-all(
+                '\d{4}',
+                dc:replace-all(
+                  $diffids, '[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}', '')))"
+            type="number"/>
+        </dc:when>
+        <dc:otherwise>
+          <dc:comment>Just show everything</dc:comment>
+          <dc:variable name="year_to" expr="9999" type="number"/>
+          <dc:variable name="year_from" expr="0" type="number"/>
+        </dc:otherwise>
+      </dc:choose>
       <bedheights>
         <dc:call-macro name="bed-heights-single"/>
         <dc:call-macro name="bed-heights-epoch"/>

http://dive4elements.wald.intevation.org