# HG changeset patch # User Tim Englich # Date 1271146620 0 # Node ID ac1b9f00603f59a3a95e3793d0702743cb4ea818 # Parent 9b41dbe92d9d540ae27a7c1bb55953e11d592b12 Added more Javadoc. Removed obsolet TODO-Flags. Added missing Files to Revision 907 gnv-artifacts/trunk@909 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 9b41dbe92d9d -r ac1b9f00603f gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java Mon Apr 12 14:16:04 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java Tue Apr 13 08:17:00 2010 +0000 @@ -34,6 +34,7 @@ import de.intevation.gnv.utils.ShapeFileWriter; /** + * This OutputState is used for Layer-Products. * @author Tim Englich * */ @@ -49,8 +50,15 @@ */ private static final long serialVersionUID = 9180957321704424049L; - // TODO: Replace + /** + * The Basename of the Templates for the WMS-Exports + */ public static final String LAYER_MODEL = "layer"; + + /** + * The Name of the Shapefile which will be generated. + */ + public static final String SHAPEFILE_NAME = "data.shp"; /** * The ID for the Query fetching the Layer from the DB @@ -63,25 +71,44 @@ */ private String geometryQueryID = null; + /** + * The ID of the Query for fetching the Columnnames of the Table which + * should put into the Shapefile. + */ private String columnQueryID = null; + /** + * The ID of the Query for fetching the Information which kind of Geometry + * should be put into the Shapefile. + */ private String geometryTypeQueryID = null; /** - * The ID for the Value which will hold the Geometrie-Value + * The ID for the Value which will hold the Geometry-Value */ private String geometryID = null; + /** + * Flag for synchronized Access of the Shapefile. + */ private Boolean shapeFileLock = new Boolean(true); + /** + * The Path where the Shapefile is stored. + */ private String shapeFilePath; + /** + * The ID of the Template which should be used to generate the Layerentry + * in the Mapfile. + */ private String templateID = null; + /** + * The Kind of Geometry which should be used to generate the Shapefile. + */ private String geometryType = null; - public static final String SHAPEFILE_NAME = "data.shp"; - /** * Constructor */ @@ -89,7 +116,6 @@ super(); } - public void out(Document format, Collection inputData, OutputStream outputStream, String uuid, CallContext callContext) throws StateException { @@ -123,7 +149,6 @@ * * @param outputStream The output stream used to write the exception to. */ - @SuppressWarnings("static-access") private void writeExceptionReport2Stream(OutputStream outputStream) { Document document = XMLUtils.newDocument(); ArtifactXMLUtilities. @@ -135,11 +160,10 @@ /** * Fetches the Data from the Databasebackend. * - * @return the resulting data. + * @return the resultdata. */ protected Collection fetchData(){ log.debug("LayerOutputState.fetchData"); - // TODO PUT ALL in CACHE Collection result = this.getData(this.queryID); Collection data = null; String geometryWKT = null; @@ -174,7 +198,6 @@ } } catch (QueryException e) { log.error(e,e); - // TODO: what should happen?? } queryValues = new String[]{columns, table, @@ -354,7 +377,7 @@ /** - * Write the resulting data to shapefiles. + * Write the resultdata to shapefiles. * * @param uuid The UUID of the current artifact. * @param data The finalized data used for shapefile creation. @@ -484,7 +507,6 @@ new Thread() { @Override public void run() { - // TODO: Do the un-publishing WMS stuff. String path = resetShapeFilePath(); if (path == null) { @@ -511,8 +533,11 @@ }.start(); } - - public String resetShapeFilePath() { + /** + * Resets the Settings e.g shapeFilePath and templateID + * @return + */ + private String resetShapeFilePath() { synchronized (shapeFileLock) { String path = shapeFilePath; shapeFilePath = null; @@ -541,7 +566,6 @@ String geometryType) throws StateException { - // TODO: Do the real WMS publishing here! Document document = XMLUtils.newDocument(); Element pathElement = document.createElement("path"); diff -r 9b41dbe92d9d -r ac1b9f00603f gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/package.html --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/package.html Mon Apr 12 14:16:04 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/package.html Tue Apr 13 08:17:00 2010 +0000 @@ -3,6 +3,7 @@ -DOCUMENT ME! +State classes used by artifacts representing Layer to handle input and +output.