changeset 6005:d7eb007a57cc

merged
author Tom Gottfried <tom.gottfried@intevation.de>
date Mon, 13 May 2013 11:15:14 +0200
parents ec54bb4fe407 (current diff) f049f9521a51 (diff)
children 2c4be2375f63
files
diffstat 3 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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>
--- 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));
+                }});
     }
 
     /**
--- 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]);
         }
 

http://dive4elements.wald.intevation.org