[PATCH] Set facet activity for middle bed height

Wald Commits scm-commit at wald.intevation.org
Wed Sep 17 17:56:40 CEST 2014


# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1410969397 -7200
# Node ID 86e532106abb15c75886cfdc5d6b7e449641fda6
# Parent  84ac8549e87b2224fcfd3a56c0004344c825d729
Set facet activity for middle bed height.

diff -r 84ac8549e87b -r 86e532106abb artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Wed Sep 17 17:35:36 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Wed Sep 17 17:56:37 2014 +0200
@@ -14,8 +14,10 @@
 import org.apache.log4j.Logger;
 
 import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.artifacts.Artifact;
 
 import org.dive4elements.artifactdatabase.state.Facet;
+import org.dive4elements.artifactdatabase.state.FacetActivity;
 
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.access.BedHeightAccess;
@@ -136,5 +138,24 @@
 
         return res;
     }
+
+    static {
+        // Active/deactivate facets.
+        FacetActivity.Registry.getInstance().register(
+            "minfo",
+            new FacetActivity() {
+                @Override
+                public Boolean isInitialActive(
+                    Artifact artifact,
+                    Facet    facet,
+                    String   output
+                ) {
+                    if (facet.getName().equals(MIDDLE_BED_HEIGHT_SINGLE)) {
+                        return Boolean.TRUE;
+                    }
+                    return null;
+                }
+            });
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4Elements-commits mailing list