changeset 822:ac1b9f00603f

Added more Javadoc. Removed obsolet TODO-Flags. Added missing Files to Revision 907 gnv-artifacts/trunk@909 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 13 Apr 2010 08:17:00 +0000
parents 9b41dbe92d9d
children 499cfbbb61bc
files gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/package.html
diffstat 2 files changed, 40 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- 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 <code>OutputState</code> is used for Layer-Products.
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
  *
  */
@@ -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> 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<Result> fetchData(){
         log.debug("LayerOutputState.fetchData");
-        // TODO PUT ALL in CACHE
         Collection<Result> result = this.getData(this.queryID);
         Collection<Result> 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");
--- 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 @@
 <head>
 </head>
 <body>
-DOCUMENT ME!
+State classes used by artifacts representing Layer to handle input and
+output.
 </body>
 </html>

http://dive4elements.wald.intevation.org