Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java @ 724:9ba6bb85d6dd
Integrate lookup for MapFileTemplate for the different Layer.
gnv-artifacts/trunk@754 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 09 Mar 2010 12:54:05 +0000 |
parents | 199982e8866e |
children | f6630d0203da |
comparison
equal
deleted
inserted
replaced
723:199982e8866e | 724:9ba6bb85d6dd |
---|---|
78 | 78 |
79 private String shapeFilePath; | 79 private String shapeFilePath; |
80 | 80 |
81 private String geometryType = null; | 81 private String geometryType = null; |
82 | 82 |
83 private String templateID = null; | |
84 | |
83 public static final String SHAPEFILE_NAME = "data.shp"; | 85 public static final String SHAPEFILE_NAME = "data.shp"; |
84 | 86 |
85 /** | 87 /** |
86 * Constructor | 88 * Constructor |
87 */ | 89 */ |
148 String[] queryValues = null; | 150 String[] queryValues = null; |
149 if (it.hasNext()){ | 151 if (it.hasNext()){ |
150 Result resultValue = it.next(); | 152 Result resultValue = it.next(); |
151 String table = resultValue.getString(0); | 153 String table = resultValue.getString(0); |
152 String where = resultValue.getString(1); | 154 String where = resultValue.getString(1); |
155 templateID = resultValue.getString(2); | |
153 if (this.geometryID != null){ | 156 if (this.geometryID != null){ |
154 InputData geometryInputData = | 157 InputData geometryInputData = |
155 this.inputData.get(this.geometryID); | 158 this.inputData.get(this.geometryID); |
156 if (geometryInputData != null){ | 159 if (geometryInputData != null){ |
157 | 160 |
363 public String resetShapeFilePath() { | 366 public String resetShapeFilePath() { |
364 synchronized (shapeFileLock) { | 367 synchronized (shapeFileLock) { |
365 String path = shapeFilePath; | 368 String path = shapeFilePath; |
366 shapeFilePath = null; | 369 shapeFilePath = null; |
367 geometryType = null; | 370 geometryType = null; |
371 templateID = null; | |
368 return path; | 372 return path; |
369 } | 373 } |
370 } | 374 } |
371 protected Document getWMS(String uuid, | 375 protected Document getWMS(String uuid, |
372 CallContext callContext, | 376 CallContext callContext, |
387 else { | 391 else { |
388 | 392 |
389 if (data != null && | 393 if (data != null && |
390 (path = writeToShapeFile(uuid, data, callContext)) != null) { | 394 (path = writeToShapeFile(uuid, data, callContext)) != null) { |
391 | 395 |
392 String paramType = LAYER_MODEL+"_"+this.geometryType.toLowerCase(); | 396 String paramType = LAYER_MODEL+"_"+templateID; |
393 | 397 |
398 if (!MapfileGenerator.getInstance().templateExists(paramType)){ | |
399 // If the template doesn't exist the Defaulttemplates will be used. | |
400 paramType = LAYER_MODEL+"_"+this.geometryType.toLowerCase(); | |
401 } | |
394 Document meta = MetaWriter.writeLayerMeta(callContext, uuid, | 402 Document meta = MetaWriter.writeLayerMeta(callContext, uuid, |
395 path, paramType, | 403 path, paramType, |
396 this.determineGeometryType()); | 404 this.determineGeometryType()); |
397 if (meta != null) { | 405 if (meta != null) { |
398 MapfileGenerator.getInstance().update(); | 406 MapfileGenerator.getInstance().update(); |