[Dive4elements-commits] [PATCH 2 of 2] merged

Wald Commits scm-commit at wald.intevation.org
Mon May 13 11:15:18 CEST 2013


# HG changeset patch
# User Tom Gottfried <tom.gottfried at intevation.de>
# Date 1368436514 -7200
# Node ID d7eb007a57cc387dbb37e132105dc5af5e00e2f3
# Parent  ec54bb4fe407b28902cb46734d60db67b5584eb0
# Parent  f049f9521a5104d50c06fbb2bfdb6b9e9378ecd6
merged

diff -r ec54bb4fe407 -r d7eb007a57cc artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Mon May 13 11:14:38 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Mon May 13 11:15:14 2013 +0200
@@ -164,7 +164,7 @@
                       <dc:for-each>
                         <column name="{$prot_column_name}"
                                 ids="additionals-wstv-{$prot_rel_pos}-{$prot_id}:OUT={$OUT}"
-                                factory="staticwkms"
+                                factory="staticwqkms"
                                 info="{$info} [km {$deffrom} - {$defto}]"/>
                       </dc:for-each>
                     </dc:context>
diff -r ec54bb4fe407 -r d7eb007a57cc artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java	Mon May 13 11:14:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java	Mon May 13 11:15:14 2013 +0200
@@ -61,8 +61,18 @@
 
     static {
         // TODO: Move to configuration.
-        FacetActivity.Registry.getInstance()
-            .register(NAME, FacetActivity.INACTIVE);
+        FacetActivity.Registry.getInstance().register(
+            NAME,
+            new FacetActivity() {
+                @Override
+                public Boolean isInitialActive(
+                    Artifact artifact,
+                    Facet    facet,
+                    String   outputName
+                ) {
+                    String fname = facet.getName();
+                    return (fname.equals(STATIC_WQKMS) || fname.equals(STATIC_WQKMS_W));
+                }});
     }
 
     /**
diff -r ec54bb4fe407 -r d7eb007a57cc artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFactory.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFactory.java	Mon May 13 11:14:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFactory.java	Mon May 13 11:15:14 2013 +0200
@@ -147,6 +147,10 @@
         for (int i = 0, N = results.size(); i < N; i++) {
             Object[] row = results.get(i);
             // add(w, q, km)
+            if (row == null || row[0] == null || row[1] == null || row[2] == null) {
+                log.warn("A value in result for WQKms is null.");
+                continue;
+            }
             wqkms.add((Double) row[1], (Double) row[2], (Double) row[0]);
         }
 


More information about the Dive4elements-commits mailing list