diff gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java @ 792:9b9bf42b7928

Added and repaired JavaDoc in artifacts package. gnv-artifacts/trunk@874 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 31 Mar 2010 10:52:34 +0000
parents c4156275c1e1
children feae2f9d6c6f
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java	Wed Mar 31 09:30:34 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java	Wed Mar 31 10:52:34 2010 +0000
@@ -39,6 +39,11 @@
 import org.w3c.dom.NodeList;
 
 /**
+ * This artifact is used to handle to input/output at the beginning of a
+ * parameterization when no product has been selected so far. After the user
+ * having selected a product, this artifact is replaced by a concrete product
+ * artifact.
+ * 
  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
  */
 public class SelectProductArtifact extends GNVDefaultArtifact {
@@ -48,17 +53,37 @@
      */
     private static final long serialVersionUID = -7952357683127758677L;
 
+    /**
+     * Path to uuid.
+     */
     public static final String XPATH_UUID = "art:action/art:uuid/@value";
 
+    /**
+     * Path to hash.
+     */
     public static final String XPATH_HASH = "art:action/art:hash/@value";
 
+    /**
+     * Path to selected product.
+     */
     public static final String XPATH_INPUT_DATA_VALUE =
         "art:action/art:data/art:input[@name='product']/@value";
 
+    /**
+     * Path to parameters required by the factory.
+     */
     public static final String XPATH_SETUP_PARAMETER_NODES =
         "/art:action/art:factory/art:parameter";
 
+    /**
+     *
+     */
     public static final String XFORM_URL    = "http://www.w3.org/2002/xforms";
+
+    /**
+     * Prefix used in the user interface description part of the describe
+     * document.
+     */
     public static final String XFORM_PREFIX = "xform";
 
     private static Logger log = Logger.getLogger(SelectProductArtifact.class);
@@ -70,11 +95,23 @@
 
     private Map<String, InputData> preSettings = null;
 
+    /**
+     * Constructor.
+     */
     public SelectProductArtifact() {
         super();
     }
 
 
+    /**
+     * Initialize this artifact and parse all required information from <code>
+     * data</code> document.
+     *
+     * @param identifier
+     * @param factory
+     * @param context
+     * @param data
+     */
     @Override
     public void setup(
         String          identifier,
@@ -112,11 +149,23 @@
     }
 
 
+    /**
+     *
+     * @param products
+     */
     public void setProducts(Map products) {
         this.products = products;
     }
 
 
+    /**
+     * Search for a selected product and create a new concrecte product artifact
+     * with this information.
+     *
+     * @param target Document which contains the selected product.
+     * @param context CallContext.
+     * @return Error or success message.
+     */
     @Override
     public Document feed(Document target, CallContext context) {
         log.debug("SelectProductArtifact.feed()");
@@ -166,6 +215,15 @@
     }
 
 
+    /**
+     * If {@link #feed(org.w3c.dom.Document, de.intevation.artifacts.CallContext)}
+     * was sucessfully called before, this artifact is replaced with a concrete
+     * product artifact.
+     * 
+     * @param target
+     * @param context
+     * @return
+     */
     @Override
     public Document advance(Document target, CallContext context) {
         log.debug("SelectProductArtifact.advance()");
@@ -228,6 +286,14 @@
     }
 
 
+    /**
+     * Create a describe document including the user interface description. The
+     * user gets the choice to select a product supported by the current fis.
+     * 
+     * @param data
+     * @param context
+     * @return
+     */
     @Override
     public Document describe(Document data, CallContext context) {
         log.debug("SelectProductArtifact.describe()");
@@ -293,6 +359,13 @@
     }
 
 
+    /**
+     *
+     * @param document
+     * @param out
+     * @param context
+     * @throws IOException
+     */
     @Override
     public void out(Document document, OutputStream out, CallContext context)
     throws IOException
@@ -304,6 +377,13 @@
     }
 
 
+    /**
+     * Append products to the describe document.
+     *
+     * @param document
+     * @param parent
+     * @param context
+     */
     protected void appendProducts(
         Document document,
         Node     parent,
@@ -329,6 +409,14 @@
     }
 
 
+    /**
+     * Append the product select box to the user interface description of the
+     * describe document.
+     *
+     * @param document
+     * @param node
+     * @param callMeta
+     */
     protected void appendSelectProducts(
         Document document,
         Node     node,
@@ -379,6 +467,13 @@
     }
 
 
+    /**
+     * Create a feed document.
+     * 
+     * @param uuid
+     * @param hash
+     * @return
+     */
     protected Document feedDocument(String uuid, String hash) {
         Document document = XMLUtils.newDocument();
 
@@ -421,4 +516,4 @@
         return document;
     }
 }
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org