diff artifacts/src/main/java/org/dive4elements/river/artifacts/model/QSectorFacet.java @ 8369:a5bd0a5b8efd

Use the CURRENT_KM constant from injectors.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 02 Oct 2014 13:57:50 +0200
parents e4606eae8ea5
children 0a5239a1e46e
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/QSectorFacet.java	Thu Oct 02 09:42:12 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/QSectorFacet.java	Thu Oct 02 13:57:50 2014 +0200
@@ -18,6 +18,8 @@
 import org.dive4elements.artifactdatabase.state.DefaultFacet;
 import org.dive4elements.artifactdatabase.state.Facet;
 
+import static org.dive4elements.river.exports.injector.InjectorConstants.CURRENT_KM;
+
 
 /**
  * Facet to access QSector that where added by user.
@@ -58,12 +60,12 @@
     public Object getData(Artifact artifact, CallContext context) {
         QSectorArtifact qsectorArtifact = (QSectorArtifact) artifact;
         if (qsectorArtifact == null || context == null ||
-            context.getContextValue("currentKm") == null) {
+            context.getContextValue(CURRENT_KM) == null) {
             log.error("No artifact, context or currentKm in QSectorFacet");
             return null;
         }
         double currentKm =
-            ((Double)context.getContextValue("currentKm")).doubleValue();
+            ((Double)context.getContextValue(CURRENT_KM)).doubleValue();
         return qsectorArtifact.getQSectors(currentKm, context);
     }
 

http://dive4elements.wald.intevation.org