changeset 5164:8c65acf01adc 2.9.10

Fixed datacage to be oracle compatible.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 04 Mar 2013 11:44:11 +0100
parents 9474e27e319a
children aa5b1e3c5af2
files flys-artifacts/doc/conf/meta-data.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java
diffstat 2 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/meta-data.xml	Mon Mar 04 11:21:50 2013 +0100
+++ b/flys-artifacts/doc/conf/meta-data.xml	Mon Mar 04 11:44:11 2013 +0100
@@ -591,7 +591,7 @@
               <dc:attribute name="id" value="flood-protections-${river_id}"/>
               <dc:context connection="system">
                 <dc:statement>
-                  SELECT DISTINCT ON (cs.id)
+                  SELECT DISTINCT
                          cs.id          AS prot_id,
                          cs.description AS prot_description
                   FROM cross_sections cs
@@ -617,7 +617,7 @@
               <dc:attribute name="id" value="hyk-${river_id}"/>
               <dc:context connection="system">
                 <dc:statement>
-                  SELECT DISTINCT ON (h.id)
+                  SELECT DISTINCT
                          h.id          AS hyk_id,
                          h.description AS hyk_description
                   FROM hyks h
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java	Mon Mar 04 11:21:50 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java	Mon Mar 04 11:44:11 2013 +0100
@@ -93,17 +93,17 @@
                 Object from      = args.get(2);
 
                 if (!(mode instanceof String)){
-                    return -Double.MAX_VALUE;
+                    return -99999d;
                 }
 
                 if (mode.equals("locations")) {
                     if (!(locations instanceof String)) {
-                        return -Double.MAX_VALUE;
+                        return -99999d;
                     }
                     String loc = ((String)locations).replace(" ", "");
                     String[] split = loc.split(",");
                     if (split.length < 1) {
-                        return -Double.MAX_VALUE;
+                        return -99999d;
                     }
                     try {
                         double min = Double.parseDouble(split[0]);
@@ -116,23 +116,23 @@
                         return min;
                     }
                     catch (NumberFormatException nfe) {
-                        return -Double.MAX_VALUE;
+                        return -99999d;
                     }
                 }
                 else if (mode.equals("distance")) {
                     if (!(from instanceof String)) {
-                        return -Double.MAX_VALUE;
+                        return -99999d;
                     }
                     String f = (String)from;
                     try {
                         return Double.parseDouble(f);
                     }
                     catch(NumberFormatException nfe) {
-                        return -Double.MAX_VALUE;
+                        return -99999d;
                     }
                 }
                 else {
-                    return -Double.MAX_VALUE;
+                    return -99999d;
                 }
             }
         });
@@ -149,18 +149,18 @@
                 Object to        = args.get(2);
 
                 if (!(mode instanceof String)){
-                    return Double.MAX_VALUE;
+                    return 99999d;
                 }
 
                 if (mode.equals("locations")) {
                     if (!(locations instanceof String)) {
-                        return Double.MAX_VALUE;
+                        return 99999d;
                     }
                     try {
                         String loc = ((String)locations).replace(" ", "");
                         String[] split = loc.split(",");
                         if (split.length < 1) {
-                            return Double.MAX_VALUE;
+                            return 99999d;
                         }
                         double max = Double.parseDouble(split[0]);
                         for (int i = 1; i < split.length; ++i) {
@@ -172,12 +172,12 @@
                         return max;
                     }
                     catch (NumberFormatException nfe) {
-                        return Double.MAX_VALUE;
+                        return 99999d;
                     }
                 }
                 else if (mode.equals("distance")) {
                     if (!(to instanceof String)) {
-                        return Double.MAX_VALUE;
+                        return 99999d;
                     }
                     else {
                         String t = (String)to;
@@ -185,12 +185,12 @@
                             return Double.parseDouble(t);
                         }
                         catch(NumberFormatException nfe) {
-                            return Double.MAX_VALUE;
+                            return 99999d;
                         }
                     }
                 }
                 else {
-                    return Double.MAX_VALUE;
+                    return 99999d;
                 }
             }
         });

http://dive4elements.wald.intevation.org