diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java @ 1129:da3c3e286c88

Introduced a MapfileGenerator that creates Mapserver specific mapfiles based on WSPLGEN results read from filesystem. flys-artifacts/trunk@2644 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 05 Sep 2011 14:04:03 +0000
parents 727c53fd0dc7
children effe8f945c93
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Mon Sep 05 07:17:52 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Mon Sep 05 14:04:03 2011 +0000
@@ -62,9 +62,6 @@
         System.getProperty("flys.uesk.keep.artifactsdir", "false");
 
 
-    public static final String XPATH_SHAPEFILE_DIR =
-        "/artifact-database/floodmap/shapefile-path/@value";
-
     public static final String WSP_ARTIFACT_UUID = "uesk.wsp.artifact";
 
     public static final String WINFO_WSP_STATE_ID = "state.winfo.waterlevel";
@@ -123,20 +120,6 @@
 
 
     /**
-     * Returns the shapefile path defined in the configuration.
-     *
-     * @return the shapefile path.
-     */
-    protected String getShapefilePath() {
-        String shapePath = (String) Config.getXPath(
-            XPATH_SHAPEFILE_DIR, XPathConstants.STRING);
-        shapePath = Config.replaceConfigDir(shapePath);
-
-        return shapePath;
-    }
-
-
-    /**
      * Returns (and creates if not existing) the directory for storing WSPLEN
      * data for the owner artifact.
      *
@@ -145,7 +128,8 @@
      * @return the directory for WSPLEN data.
      */
     protected File getDirectory(FLYSArtifact artifact) {
-        String shapePath = getShapefilePath();
+        String shapePath = FLYSUtils.getXPathString(
+            FLYSUtils.XPATH_SHAPEFILE_DIR);
 
         File artifactDir = FileTools.getDirectory(
             shapePath, artifact.identifier());
@@ -159,8 +143,10 @@
      * results of WSPLGEN are stored. Should be called in endOfLife().
      */
     protected void removeDirectory(FLYSArtifact artifact) {
-        String shapePath    = getShapefilePath();
-        File   artifactDir = new File(shapePath, artifact.identifier());
+        String shapePath = FLYSUtils.getXPathString(
+            FLYSUtils.XPATH_SHAPEFILE_DIR);
+
+        File artifactDir = new File(shapePath, artifact.identifier());
 
         if (artifactDir.exists()) {
             logger.info("Delete directory: " + artifactDir.getAbsolutePath());

http://dive4elements.wald.intevation.org