Mercurial > dive4elements > gnv-client
changeset 690:254f062e334b
Added JavaDoc.
gnv/trunk@908 c6561f87-3c4e-4783-a992-168aeb5c3f6f
line wrap: on
line diff
--- a/gnv/ChangeLog Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/ChangeLog Mon Apr 12 16:45:16 2010 +0000 @@ -1,3 +1,61 @@ +2010-04-12 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java, + src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java, + src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/CommunicationKeys.java, + src/main/java/de/intevation/gnv/action/DoExportAction.java, + src/main/java/de/intevation/gnv/action/WMSAction.java, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/ShowStatisticAction.java, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/LoadAction.java, + src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/SelectFisAction.java, + src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java, + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/StoreAction.java, + src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java: Added JavaDoc + comments. + 2010-04-12 Ingo Weinzierl <ingo.weinzierl@intevation.de> * src/main/resources/applicationMessages.properties,
--- a/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Mon Apr 12 16:45:16 2010 +0000 @@ -32,12 +32,7 @@ super(); } - /** - * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, - * org.apache.struts.action.ActionForm, - * javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ + @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -48,15 +43,11 @@ return forward; } - /** - * Returns the ExceptionForward for the ArtifactDatabaseActions - * - * @param mapping - * @return - */ + protected ActionForward getExceptionForward(ActionMapping mapping) { log.debug("ArtifactDatabaseActionBase.getExceptionForward"); ActionForward lForward = mapping.findForward(EXCEPTION_FORWARD_ID); return lForward; } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -29,8 +29,10 @@ import org.apache.struts.action.ActionMapping; /** + * This controller is called to change options used in charts and histograms + * (e.g. width, height, etc). + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class ChangeOptionsAction extends DescribeUIAction { /** @@ -181,7 +183,6 @@ } } - protected boolean validDouble(Locale locale, String value) { try { NumberFormat format = NumberFormat.getInstance(locale);
--- a/gnv/src/main/java/de/intevation/gnv/action/CommunicationKeys.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/CommunicationKeys.java Mon Apr 12 16:45:16 2010 +0000 @@ -1,6 +1,9 @@ package de.intevation.gnv.action; /** + * This class defines some keys used to store different exception types in the + * session. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> */ public class CommunicationKeys { @@ -8,8 +11,26 @@ * The Key which should be used for accessing ExceptionMessages */ public final static String REQUEST_EXCEPTION_MESSAGE_ID = "request_exception_message_id"; + + /** + * Key used to store exceptions relating to wrong user input. + */ public final static String REQUEST_EXCEPTION_INPUT_ID = "request_exception_input_id"; + + /** + * Key used to store exceptions relating to more general errors occured in + * the server. + */ public final static String REQUEST_EXCEPTION_MESSAGE = "request_exception_message"; + + /** + * Key used to store exceptions relating to an invalid input format. + */ public final static String REQUEST_EXCEPTION_VALUE = "request_exception_value"; + + /** + * Key used to store exceptions relating to a load/save project error. + */ public final static String REQUEST_EXCEPTION_PROJECT = "request_exception_project"; } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -13,6 +13,10 @@ import org.apache.struts.action.ActionMapping; /** + * This controller is called to display charts.<br> + * An attribute 'chart' on the request object is activated which inserts an + * image calling a chart output of the server. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class CreateChartAction extends DescribeUIAction {
--- a/gnv/src/main/java/de/intevation/gnv/action/CreateHistogramAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/CreateHistogramAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -13,6 +13,10 @@ import org.apache.struts.action.ActionMapping; /** + * This controller is called to display histograms.<br> + * An attribute 'histogram' on the request object is activated which inserts an + * image calling a histogram output of the server. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class CreateHistogramAction extends DescribeUIAction {
--- a/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -28,6 +28,12 @@ import org.w3c.dom.Node; /** + * This controller is called to fetch the current artifact description using the + * describe operation. The describe document is used to feed an XSL transformer + * that parses the xml and creats html output representing the parameter panel. + * The html code is stored as attribute on the request object which is queried + * in a jsp page later. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class DescribeUIAction extends ArtifactDatabaseActionBase {
--- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -28,8 +28,10 @@ import org.apache.struts.action.ActionMapping; /** + * This controller is called to trigger an export (e.g. pdf, svg, image). A + * 'save-file' dialog is opened to save the export. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class DoExportAction extends ArtifactDatabaseActionBase { @@ -45,12 +47,7 @@ super(); } - /** - * @see de.intevation.gnv.action.ArtifactDatabaseActionBase#execute(org.apache.struts.action.ActionMapping, - * org.apache.struts.action.ActionForm, - * javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ + @Override public ActionForward execute( ActionMapping mapping, @@ -212,3 +209,4 @@ } } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -27,6 +27,9 @@ import org.apache.struts.action.ActionMapping; /** + * This controller calls the out operation of the server directly. Html img-tags + * in jsp pages use this action to fetch charts and histograms. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ @@ -44,12 +47,7 @@ super(); } - /** - * @see de.intevation.gnv.action.ArtifactDatabaseActionBase#execute(org.apache.struts.action.ActionMapping, - * org.apache.struts.action.ActionForm, - * javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ + @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
--- a/gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -21,9 +21,11 @@ import org.apache.struts.action.ActionMapping; /** + * This controller fetches artifact factories from artifact server and stores + * them on a <code>SessionModel</code> object. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> - * */ public class FetchArtifactFactoriesAction extends ArtifactDatabaseActionBase { /** @@ -36,12 +38,7 @@ super(); } - /** - * @see de.intevation.gnv.action.ArtifactDatabaseActionBase#execute(org.apache.struts.action.ActionMapping, - * org.apache.struts.action.ActionForm, - * javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ + @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
--- a/gnv/src/main/java/de/intevation/gnv/action/LoadAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/LoadAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -34,6 +34,11 @@ import org.w3c.dom.Document; /** + * This controller is called for reloading projects from xml files. It waits for + * an xml document named 'document' and feeds the artifact server with this + * document. After a successful feed, the artifact description is fetched and + * displayed in the gui. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class LoadAction extends ArtifactDatabaseActionBase {
--- a/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -27,9 +27,12 @@ import org.apache.struts.action.ActionMapping; /** + * This controller feeds the artifact server with the current input data and + * refreshes the gui with the current artifact description after the next state + * is reached. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> - * */ public class NextArtifactStepAction extends DescribeUIAction {
--- a/gnv/src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -19,8 +19,12 @@ import org.apache.struts.action.ActionMapping; /** + * This controller is used to step back to a previous state of the current + * artifact. After calling the advance operation of the artifact server have + * been called successfully, the describe document of the current artifact is + * fetched and a new gui is rendered. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> - * */ public class PreviousArtifactStepAction extends DescribeUIAction { @@ -44,8 +48,6 @@ HttpServletResponse response ) throws Exception { - String id = request.getSession().getId(); - SessionModel session = SessionModelFactory.getInstance().getSessionModel( request);
--- a/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -20,8 +20,9 @@ import org.apache.struts.action.ActionMapping; /** + * This controller is called to select a specific fis. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class SelectArtifactFactoryAction extends DescribeUIAction { /** @@ -30,12 +31,7 @@ private static Logger log = Logger .getLogger(SelectArtifactFactoryAction.class); - /** - * @see de.intevation.gnv.action.ArtifactDatabaseActionBase#execute(org.apache.struts.action.ActionMapping, - * org.apache.struts.action.ActionForm, - * javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ + @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -60,7 +56,7 @@ sm.selectArtifactFactory(selectedArtifactFactoryID); ArtifactObject af = sm.getSelectedArtifactFactory(); - ; + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory .getInstance() .getArtifactDatabaseClient(getLocale(request)); @@ -82,5 +78,5 @@ */ public SelectArtifactFactoryAction() { } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -13,6 +13,9 @@ import org.apache.struts.action.ActionMapping; /** + * This controller is used to step back to the fis selection. It is called when + * pushing the step-back button besides the currently selected fis. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class SelectFisAction extends ArtifactDatabaseActionBase {
--- a/gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -20,6 +20,9 @@ import org.apache.struts.action.ActionMapping; /** + * This controller is used to display to statistic of the current + * parameterization. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class ShowStatisticAction extends DescribeUIAction { @@ -63,3 +66,4 @@ return super.execute(mapping, form, request, response); } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/action/StoreAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/StoreAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -20,6 +20,9 @@ import org.apache.struts.action.ActionMapping; /** + * This controller is used to save the current artifact to an xml file. A file + * dialog is opened to save the file to the local disk. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class StoreAction extends ArtifactDatabaseActionBase {
--- a/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java Mon Apr 12 16:45:16 2010 +0000 @@ -34,6 +34,12 @@ import org.w3c.dom.Document; /** + * This controller is used to publish the results of the current artifact as + * WMS. The wms export mode of the artifact server is triggered which feeds a + * MapServer with the given shapefiles (path to the shapefiles is stored in the + * artifact). After calling this controller, the shapefiles are ready to be + * queried as WMS layers. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class WMSAction extends DescribeUIAction {
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Mon Apr 12 16:45:16 2010 +0000 @@ -11,6 +11,9 @@ import org.apache.log4j.Logger; /** + * The default implementation of <code>SessionModel</code> which stores the + * current artifact object and the digram options selected by the user. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ @@ -43,9 +46,7 @@ super(); } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#selectArtifactFactory(java.lang.String) - */ + public void selectArtifactFactory(String artiFactFactoryId) { Collection<ArtifactObject> artifactObjects = this .getArtifactFactories(); @@ -67,59 +68,43 @@ } } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#setArtifacteFactories(java.util.Collection) - */ + public void setArtifacteFactories( Collection<ArtifactObject> artifactFactories) { this.artifactFactories = artifactFactories; } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#getAttributeFactories() - */ + public Collection<ArtifactObject> getArtifactFactories() { return this.artifactFactories; } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#getSelectedArtifactFactory() - */ + public ArtifactObject getSelectedArtifactFactory() { return this.selectedArtifactFactory; } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#getCurrentArtifact() - */ + public ArtifactObject getCurrentArtifact() { return this.currentArtifact; } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#setCurrentArtifact(de.intevation.gnv.artifactdatabase.objects.ArtifactObject) - */ + public void setCurrentArtifact(ArtifactObject artifact) { this.currentArtifact = artifact; } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#getDiagrammOptions() - */ + public DiagrammOptions getDiagrammOptions() { return this.diagrammOptions; } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#setDiagrammOptions(de.intevation.gnv.action.sessionmodel.DiagrammOptions) - */ + public void setDiagrammOptions(DiagrammOptions diagrammOptions) { this.diagrammOptions = diagrammOptions; } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#getArtifactDescription() - */ + public ArtifactDescription getArtifactDescription() { if (this.currentArtifact != null) { return (ArtifactDescription) this.currentArtifact; @@ -127,9 +112,7 @@ return null; } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#getOutputMode(java.lang.String) - */ + public OutputMode getOutputMode(String name) { ArtifactDescription ad = this.getArtifactDescription(); if (ad != null) { @@ -140,9 +123,7 @@ return null; } - /** - * @see de.intevation.gnv.action.sessionmodel.SessionModel#resetModel() - */ + public void resetModel() { log.debug("DefaultSessionModel.resetModel"); this.selectedArtifactFactory = null; @@ -152,9 +133,7 @@ } - /**b - * @see de.intevation.gnv.action.sessionmodel.SessionModel#getStatistics() - */ + public Collection<ArtifactStatisticsSet> getStatistics() { return this.statistics; } @@ -163,3 +142,4 @@ this.statistics = statistics; } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Mon Apr 12 16:45:16 2010 +0000 @@ -4,8 +4,10 @@ import java.util.Map; /** + * Stores key-value pairs used to save user input for changing diagram + * attributes. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class DiagrammOptions { @@ -19,17 +21,21 @@ } /** - * @return + * @return the value. */ public String getValue(String key) { return this.values.get(key); } + /** - * @param width + * Set a value with the given key. + * + * @param key The given key. + * @param value The value to be stored. */ public void setValue(String key, String value) { this.values.put(key, value); } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Mon Apr 12 16:45:16 2010 +0000 @@ -10,6 +10,9 @@ import java.util.Collection; /** + * This interface describe basic methods to store artifacts and diagram options. + * The SessionModel is saved in the session, which keeps alive during the work. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ @@ -40,5 +43,5 @@ void setStatistics(Collection<ArtifactStatisticsSet> statistics); Collection<ArtifactStatisticsSet> getStatistics(); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java Mon Apr 12 16:45:16 2010 +0000 @@ -5,8 +5,10 @@ import org.apache.log4j.Logger; /** + * Creates and restores <code>SessionModel</code> objects from <code> + * HttpServletRequest</code>. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class SessionModelFactory { @@ -59,5 +61,5 @@ return sm; } } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Mon Apr 12 16:45:16 2010 +0000 @@ -20,6 +20,9 @@ import org.w3c.dom.Document; /** + * This interface describes basic methods for the communication between artifact + * server and this client. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ @@ -33,25 +36,36 @@ * Return the Artifactfactories which can be resolved. * * @return the Artifactfactories which can be resolved. - * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseClientException if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. */ public Collection<ArtifactObject> getArtifactFactories() throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; /** - * + * Call the create operation of the artifact server and returns a new + * artifact with the information returned by the artifact server. + * * @param artifactFactory * @return the new Artifact - * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseClientException if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. */ public ArtifactObject createNewArtifact(ArtifactObject artifactFactory) throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; /** + * Call the describe operation of the artifact server. * + * @param artifactFactory * @param currentArtifact + * @param includeUI * @return the Current Artifact - * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseClientException if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. */ public ArtifactDescription getCurrentStepDescription( ArtifactObject artifactFactory, @@ -65,8 +79,10 @@ * @param currentArtifact * @param target * @param inputParameter - * @return - * @throws ArtifactDatabaseClientException + * @return the artifact description. + * @throws ArtifactDatabaseClientException if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. */ public ArtifactDescription doNextStep( ArtifactObject artifactFactory, @@ -85,8 +101,9 @@ * @param artifactFactory * @param currentArtifact * @param inputParameter - * @return - * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseClientException if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. */ public void doFeed(ArtifactObject artifactFactory, ArtifactObject currentArtifact, @@ -94,12 +111,15 @@ throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; /** + * Call the out operation of the artifact server. * * @param artifactFactory * @param currentArtifact * @param stream * @param targetName + * @param exportMode * @param mimeType + * @param inputParameter * @throws ArtifactDatabaseClientException */ public void doOutput( @@ -113,6 +133,14 @@ throws ArtifactDatabaseClientException; + /** + * Write the current artifact to an xml file. + * + * @param artifactFactory + * @param currentArtifact + * @param out + * @throws ArtifactDatabaseClientException + */ public void doExport( ArtifactObject artifactFactory, ArtifactObject currentArtifact, @@ -120,15 +148,31 @@ throws ArtifactDatabaseClientException; + /** + * Import an artifact from xml file. + * + * @param factory + * @param document + * @return a status message. If the import was successful, it contains + * information about the imported artifact, otherwise a failure is + * contained. + * @throws ArtifactDatabaseClientException + * @throws IOException + */ public Document doImport( ArtifactFactory factory, Document document) throws ArtifactDatabaseClientException, IOException; /** + * Publish shapefiles of an artifact as WMS layer. + * * @param factory * @param artifact + * @param inputParameter * @return URL to wms service as string + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException */ public Document publishWMS( ArtifactObject factory, @@ -138,18 +182,35 @@ /** + * Start statistics calculation. + * * @param artifactFactory * @param currentArtifact - * @return + * @return the calculated statistic. * @throws ArtifactDatabaseClientException */ public Collection<ArtifactStatisticsSet> calculateStatistics( - ArtifactObject artifactFactory, - ArtifactObject currentArtifact) - throws ArtifactDatabaseClientException; + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException; + /** + * Set the current locale. + * @param locale + */ public void setLocale(Locale locale); + /** + * Returns some meta information about the currently selected + * ArtifactFactory. + * + * @param mapServices + * @param geometry + * @param srs + * @return the information. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ public Collection<ArtifactObject> getArtifactFactoryMetaInformation( Collection<MapService> mapServices, String geometry, @@ -157,3 +218,4 @@ throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java Mon Apr 12 16:45:16 2010 +0000 @@ -5,6 +5,9 @@ import org.apache.log4j.Logger; /** + * Used to start a session with a new artifact. A new + * <code>DefaultArtifactDatabaseClient</code> is created. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ @@ -49,7 +52,6 @@ DefaultArtifactDatabaseClient adc = new DefaultArtifactDatabaseClient(); adc.setLocale(locale); return adc; - } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Mon Apr 12 16:45:16 2010 +0000 @@ -63,6 +63,9 @@ import org.w3c.dom.NodeList; /** + * The default implementation of <code>ArtifactDatabaseClient</code> which + * implements methods to communicate via HTTP protocol with the artifact server. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ @@ -119,9 +122,6 @@ } - /** - * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#getArtifactFactories() - */ public Collection<ArtifactObject> getArtifactFactories() throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { Collection<ArtifactObject> resultValues = null; @@ -149,23 +149,31 @@ return resultValues; } + + /** + * Returns a collection of artifact factories retrieved by <i>server</i>. + * + * @param document + * @param server + * @param geometry + * @return a collection of factories. + */ private Collection<ArtifactObject> getArtifactFactories(Document document, String server, String geometry) { - XMLUtils xmlUtils = new XMLUtils(); - NodeList artifactFactories = xmlUtils.getNodeSetXPath(document, + NodeList artifactFactories = XMLUtils.getNodeSetXPath(document, "/art:result/art:factories/art:factory"); Collection<ArtifactObject> resultValues = new ArrayList<ArtifactObject>( artifactFactories.getLength()); if (artifactFactories != null) { for (int i = 0; i < artifactFactories.getLength(); i++) { Node artifactFactoryNode = artifactFactories.item(i); - String name = xmlUtils.getStringXPath(artifactFactoryNode, + String name = XMLUtils.getStringXPath(artifactFactoryNode, "@art:name"); - String description = xmlUtils.getStringXPath( + String description = XMLUtils.getStringXPath( artifactFactoryNode, "@art:description"); - NodeList parameterNodeList = xmlUtils.getNodeSetXPath( + NodeList parameterNodeList = XMLUtils.getNodeSetXPath( artifactFactoryNode, "art:parameter"); @@ -201,22 +209,18 @@ return resultValues; } - /** - * @throws IOException - */ + private Document doGetRequest(String requestUrl) throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { return this.doGetRequest(requestUrl, null); } - /** - * @throws IOException - */ + private Document doGetRequest(String requestUrl, Document requestBody) throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { XMLUtils xmlUtils = new XMLUtils(); Representation output = doGetRequestInternal(requestUrl, requestBody); - Document document = xmlUtils.readDocument(output.getStream()); + Document document = XMLUtils.readDocument(output.getStream()); this.check4ExceptionReport(document); return document; } @@ -225,6 +229,14 @@ return initialize(request, locale); } + /** + * Initialize the <code>ClientInfo</code> object of <i>request</i> with the + * given <i>locale</i>. + * + * @param request The request object. + * @param locale The locale. + * @return the prepared request object. + */ protected Request initialize(Request request, Locale locale) { if (locale != null) { ClientInfo clientInfo = request.getClientInfo(); @@ -239,17 +251,13 @@ return request; } - /** - * @param requestUrl - * @param requestBody - * @return - */ + private Representation doGetRequestInternal(String requestUrl, Document requestBody) throws IOException { Client client = new Client(Protocol.HTTP); Request request = initialize(new Request(Method.GET, requestUrl)); if (requestBody != null) { - String documentBody = new XMLUtils() + String documentBody = XMLUtils .writeDocument2String(requestBody); Representation representation = new StringRepresentation( documentBody); @@ -263,14 +271,12 @@ return output; } - /** - * @throws IOException - */ + private InputStream doPostRequest(String requestUrl, Document requestBody) throws IOException { Client client = new Client(Protocol.HTTP); Request request = initialize(new Request(Method.POST, requestUrl)); - String documentBody = new XMLUtils().writeDocument2String(requestBody); + String documentBody = XMLUtils.writeDocument2String(requestBody); Representation representation = new StringRepresentation(documentBody); request.setEntity(representation); Response response = client.handle(request); @@ -297,8 +303,16 @@ } + /** - * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#createNewArtifact(de.intevation.gnv.artifactdatabase.objects.ArtifactObject) + * Creates a new artifact with the given <i>artifactFactory</i>. A POST call + * is sent to the artifact server which creates a new artifact. + * + * @param artifactFactory The artifact factory used to create a new + * artifact. + * @return the created artifact of the artifact server. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException */ public ArtifactObject createNewArtifact(ArtifactObject artifactFactory) throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { @@ -313,16 +327,24 @@ } } + /** + * Returns a new artifact defined by uuid and hash values of the document + * returned by the artifact server after creating a new artifact. + * + * @param document Contains information about the server-side created + * artifact. + * @return a new artifact object. + */ private ArtifactObject getArtifact(Document document) { XMLUtils xmlUtils = new XMLUtils(); - String uuid = xmlUtils.getStringXPath(document, "/art:result/art:uuid/@value"); - String hash = xmlUtils.getStringXPath(document, "/art:result/art:hash/@value"); + String uuid = XMLUtils.getStringXPath(document, "/art:result/art:uuid/@value"); + String hash = XMLUtils.getStringXPath(document, "/art:result/art:hash/@value"); log.info("NEW Artifact: " + uuid + " / " + hash); return new Artifact(uuid, hash); } private Document createCreateRequestBody(ArtifactObject artifactFactory) { - Document document = new XMLUtils().newDocument(); + Document document = XMLUtils.newDocument(); Node rootNode = this.createRootNode(document); Element typeNode = this.createArtifactElement(document, "type"); typeNode.setAttribute("name", "create"); @@ -360,10 +382,7 @@ return rootNode; } - /** - * @param document - * @return - */ + private Element createArtifactElement(Document document, String name) { XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( document, @@ -374,26 +393,30 @@ return creator.create(name); } - /** - * @param artifactFactory - * @param xmlUtils - * @param request - * @throws IOException - */ + private Document doPostRequest(ArtifactObject artifactFactory, Document request, String suburl) throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { XMLUtils xmlUtils = new XMLUtils(); String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl(); InputStream is = this.doPostRequest(url + "/" + suburl, request); - Document result = xmlUtils.readDocument(is); + Document result = XMLUtils.readDocument(is); this.check4ExceptionReport(result); return result; } + /** - * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#getCurrentStepDescription(de.intevation.gnv.artifactdatabase.objects.ArtifactFactory, - * de.intevation.gnv.artifactdatabase.objects.ArtifactObject) + * Retrieve the current artifact description after calling the describe + * operation of the artifact server. + * + * @param artifactFactory + * @param currentArtifact + * @param includeUI Set this option to true, if the user interface + * description is required. + * @return the artifact description. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException */ public ArtifactDescription getCurrentStepDescription( ArtifactObject artifactFactory, @@ -402,12 +425,11 @@ throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { try { String url = this.getArtifactUrl(artifactFactory, currentArtifact); - log.debug("DESCRIBE URL: " + url); Document request = this.createDescribeRequestBody(currentArtifact, includeUI); InputStream describeResult = this.doPostRequest(url, request); - return this.readDescription(new XMLUtils().readDocument(describeResult), + return this.readDescription(XMLUtils.readDocument(describeResult), currentArtifact); } catch (IOException e) { log.error(e, e); @@ -418,8 +440,7 @@ private Document createDescribeRequestBody(ArtifactObject currentArtifact, boolean includeUI){ - - Document document = new XMLUtils().newDocument(); + Document document = XMLUtils.newDocument(); Node rootNode = this.createRootNode(document); Element typeNode = this.createArtifactElement(document, "type"); @@ -439,11 +460,7 @@ return document; } - /** - * @param artifactFactory - * @param currentArtifact - * @return - */ + private String getArtifactUrl(ArtifactObject artifactFactory, ArtifactObject currentArtifact) { String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl() @@ -457,28 +474,27 @@ // Check if there was an Error or Exception reported from the // ArtifactDatabase this.check4ExceptionReport(document); - XMLUtils xmlUtils = new XMLUtils(); if (artifact instanceof ArtifactDescription) { ArtifactDescription ad = (ArtifactDescription) artifact; - Node uiNode = xmlUtils.getNodeXPath(document, "/art:result/art:ui"); - Node outputNode = xmlUtils + Node uiNode = XMLUtils.getNodeXPath(document, "/art:result/art:ui"); + Node outputNode = XMLUtils .getNodeXPath(document, "/art:result/art:outputs"); Map<String, OutputMode> outputModes = null; if (outputNode != null) { - NodeList outputModesNodes = xmlUtils.getNodeSetXPath( + NodeList outputModesNodes = XMLUtils.getNodeSetXPath( outputNode, "art:output"); if (outputModesNodes != null) { outputModes = new HashMap<String, OutputMode>( outputModesNodes.getLength()); for (int i = 0; i < outputModesNodes.getLength(); i++) { Node outputModeNode = outputModesNodes.item(i); - String name = xmlUtils.getStringXPath(outputModeNode, + String name = XMLUtils.getStringXPath(outputModeNode, "@name"); - String mimeType = xmlUtils.getStringXPath( + String mimeType = XMLUtils.getStringXPath( outputModeNode, "@mime-type"); - NodeList parameterNodes = xmlUtils.getNodeSetXPath( + NodeList parameterNodes = XMLUtils.getNodeSetXPath( outputModeNode, "art:parameter/art:parameter"); Collection<OutputParameter> parameter = null; if (parameterNodes != null) { @@ -488,18 +504,18 @@ Node outputParameterNode = parameterNodes .item(j); parameter.add(new DefaultOutputParameter( - xmlUtils.getStringXPath( + XMLUtils.getStringXPath( outputParameterNode, "@name"), - xmlUtils.getStringXPath( + XMLUtils.getStringXPath( outputParameterNode, "@value"), - xmlUtils.getStringXPath( + XMLUtils.getStringXPath( outputParameterNode, "@name"), - xmlUtils.getStringXPath( + XMLUtils.getStringXPath( outputParameterNode, "@type"))); } } - NodeList exportNodes = xmlUtils.getNodeSetXPath( + NodeList exportNodes = XMLUtils.getNodeSetXPath( outputModeNode, "art:exports/art:export"); Map exports = null; @@ -509,12 +525,12 @@ for (int k = 0; k < size; k++) { Node export = exportNodes.item(k); - String expName = xmlUtils.getStringXPath( + String expName = XMLUtils.getStringXPath( export, "@name"); exports.put(expName, new DefaultExportMode( expName, - xmlUtils.getStringXPath(export, "@description"), - xmlUtils.getStringXPath(export, "@mime-type"))); + XMLUtils.getStringXPath(export, "@description"), + XMLUtils.getStringXPath(export, "@mime-type"))); } } @@ -525,9 +541,9 @@ } } - String currentState = xmlUtils.getStringXPath(document, + String currentState = XMLUtils.getStringXPath(document, "/art:result/art:state/@name"); - NodeList statesList = xmlUtils.getNodeSetXPath(document, + NodeList statesList = XMLUtils.getNodeSetXPath(document, "/art:result/art:reachable-states/art:state/@name"); Collection<String> reachableStates = new ArrayList<String>( statesList.getLength()); @@ -535,14 +551,14 @@ reachableStates.add(statesList.item(i).getNodeValue()); } - NodeList inputNodes = xmlUtils.getNodeSetXPath(document, + NodeList inputNodes = XMLUtils.getNodeSetXPath(document, "/art:result/art:model/art:input"); if (inputNodes != null) { Collection<String> inputParameter = new ArrayList<String>( inputNodes.getLength()); for (int i = 0; i < inputNodes.getLength(); i++) { Node inputNode = inputNodes.item(i); - String name = xmlUtils.getStringXPath(inputNode, "@name"); + String name = XMLUtils.getStringXPath(inputNode, "@name"); inputParameter.add(name); } ad.setInputParameter(inputParameter); @@ -562,10 +578,19 @@ } + /** - * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#doNextStep(de.intevation.gnv.artifactdatabase.objects.ArtifactObject, - * de.intevation.gnv.artifactdatabase.objects.ArtifactObject, - * java.lang.String, java.util.Collection) + * Feed, advance and describe in one single method. + * + * @param artifactFactory The factory which created the current artifact. + * @param currentArtifact The current artifact. + * @param target The target state for advance. + * @param inputParameter Input data for feed. + * @return the artifact description after calling feed and advance. + * @throws ArtifactDatabaseClientException if a general error occured in + * the artifact server. + * @throws ArtifactDatabaseInputException if the input data was invalid used + * for feed. */ public ArtifactDescription doNextStep( ArtifactObject artifactFactory, @@ -601,6 +626,19 @@ } + /** + * Call the advance operation of the artifact server to step to the next + * step of the parameterization. + * + * @param factory The artifact factory which created the current artifact. + * @param artifact The current artifact. + * @param target The target state. + * @throws IOException if an error occured while reading/writing from/to + * stream. + * @throws ArtifactDatabaseClientException if a general error occured in + * the artifact server. + * @throws ArtifactDatabaseInputException if the input data was invalid. + */ public void doAdvance( ArtifactObject factory, ArtifactObject artifact, @@ -609,13 +647,13 @@ String url = getArtifactUrl(factory, artifact); Document advanceDocument = createAdvanceRequestBody(artifact, target); InputStream advanceResult = doPostRequest(url, advanceDocument); - check4ExceptionReport(new XMLUtils().readDocument(advanceResult)); + check4ExceptionReport(XMLUtils.readDocument(advanceResult)); } private Document createFeedRequestBody( ArtifactObject currentArtifact, Collection<InputParameter> inputParameter) { - Document document = new XMLUtils().newDocument(); + Document document = XMLUtils.newDocument(); Node rootNode = this.createRootNode(document); Element typeNode = this.createArtifactElement(document, "type"); @@ -637,11 +675,7 @@ return document; } - /** - * @param inputParameter - * @param document - * @param rootNode - */ + private Node createParameterNodes( Collection<InputParameter> inputParameter, Document document, String nodeName) { @@ -668,9 +702,17 @@ return dataNode; } + + /** + * Creates the xml body for the advance request. + * + * @param currentArtifact + * @param target + * @return the advance xml document. + */ private Document createAdvanceRequestBody(ArtifactObject currentArtifact, String target) { - Document document = new XMLUtils().newDocument(); + Document document = XMLUtils.newDocument(); Node rootNode = this.createRootNode(document); Element typeNode = this.createArtifactElement(document, "type"); @@ -691,10 +733,11 @@ } /** - * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#doOutput(de.intevation.gnv.artifactdatabase.objects.ArtifactObject, - * de.intevation.gnv.artifactdatabase.objects.ArtifactObject, - * java.io.OutputStream, java.lang.String, java.lang.String, - * java.util.Collection) + * Call the out operation of the artifact server and writes the result to + * <i>stream</i>. + * + * @param exportMode + * @param inputParameter */ public void doOutput( ArtifactObject artifactFactory, @@ -731,6 +774,15 @@ } + /** + * Call the out method of the artifact server with a specific export mode. + * + * @param artifactFactory + * @param currentArtifact + * @param out + * @throws ArtifactDatabaseClientException if an error occured while + * reading/writing from/to stream. + */ public void doExport( ArtifactObject artifactFactory, ArtifactObject currentArtifact, @@ -777,6 +829,15 @@ } + /** + * Start to import an artifact from xml document. + * + * @param factory + * @param document The artifact as xml document. + * @return A status description of the operation (success or failure). + * @throws ArtifactDatabaseClientException + * @throws IOException + */ public Document doImport( ArtifactFactory factory, Document document) @@ -789,6 +850,16 @@ } + /** + * Creates the xml request body used for an out-call of the artifact server. + * + * @param currentArtifact + * @param target + * @param exportMode + * @param mimeType + * @param inputParameter + * @return the request body. + */ private Document createOutRequestBody( ArtifactObject currentArtifact, String target, @@ -796,7 +867,7 @@ String mimeType, Collection<InputParameter> inputParameter) { - Document document = new XMLUtils().newDocument(); + Document document = XMLUtils.newDocument(); Node rootNode = this.createRootNode(document); Element typeNode = this.createArtifactElement(document, "type"); @@ -830,10 +901,16 @@ return document; } + /** - * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#doFeed(de.intevation.gnv.artifactdatabase.objects.ArtifactObject, - * de.intevation.gnv.artifactdatabase.objects.ArtifactObject, - * java.util.Collection) + * Calls the feed operation of the artifact server. + * + * @param artifactFactory The artifact factory which created the current + * artifact. + * @param currentArtifact The current artifact. + * @param inputParameter The user input. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException */ public void doFeed( ArtifactObject artifactFactory, @@ -846,7 +923,7 @@ inputParameter); String url = this.getArtifactUrl(artifactFactory, currentArtifact); InputStream feedResult = this.doPostRequest(url, feedDocument); - Document feedResultDocument = new XMLUtils() + Document feedResultDocument = XMLUtils .readDocument(feedResult); this.check4ExceptionReport(feedResultDocument); } catch (IOException e) { @@ -857,7 +934,7 @@ private void check4ExceptionReport(Document document) throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { - String message = new XMLUtils().getStringXPath(document, + String message = XMLUtils.getStringXPath(document, EXCEPTION_GENERAL); if (message != null) { throw new ArtifactDatabaseClientException(message); @@ -869,6 +946,19 @@ } } + + /** + * Call the specific wms export mode of the out operation of the artifact + * server. + * + * @param factory + * @param artifact + * @param inputParameter + * @return a document that contains information about the wms service and + * the created layer. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ public Document publishWMS( ArtifactObject factory, ArtifactObject artifact, @@ -892,6 +982,7 @@ } } + public Collection<ArtifactStatisticsSet> calculateStatistics( ArtifactObject artifactFactory, ArtifactObject currentArtifact) @@ -908,10 +999,10 @@ targetName, "", "text/xml", null); XMLUtils xmlUtils = new XMLUtils(); InputStream is = this.doPostRequest(requestUrl, requestBody); - Document resultDocument = xmlUtils.readDocument(is); + Document resultDocument = XMLUtils.readDocument(is); if (resultDocument != null) { - NodeList statisticSetNodes = xmlUtils.getNodeSetXPath(resultDocument, + NodeList statisticSetNodes = XMLUtils.getNodeSetXPath(resultDocument, "/art:statistics/art:statistic"); resultValues = new ArrayList<ArtifactStatisticsSet> (statisticSetNodes.getLength()); @@ -920,7 +1011,7 @@ String name = statisticSetNode.getAttribute("name"); ArtifactStatisticsSet set = new DefaultArtifactStatisticsSet(name); - NodeList resultNodes = xmlUtils.getNodeSetXPath(statisticSetNode, + NodeList resultNodes = XMLUtils.getNodeSetXPath(statisticSetNode, "art:statistic-value"); if (resultNodes != null) { for (int j = 0; j < resultNodes.getLength(); j++) { @@ -949,9 +1040,7 @@ this.locale = locale; } - /** - * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#getArtifactFactoryMetaInformation(java.util.Collection, java.lang.String, java.lang.String) - */ + public Collection<ArtifactObject> getArtifactFactoryMetaInformation( Collection<MapService> mapServices, String geometry, @@ -985,7 +1074,7 @@ String geometry) throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { XMLUtils xmlUtils = new XMLUtils(); - Document document = xmlUtils.readDocument(inputStream); + Document document = XMLUtils.readDocument(inputStream); this.check4ExceptionReport(document); return this.getArtifactFactories(document, server,geometry); } @@ -994,7 +1083,7 @@ String geometry, String srs){ log.debug("DefaultArtifactDatabaseClient.createMetaDataRequestBody"); - Document document = new XMLUtils().newDocument(); + Document document = XMLUtils.newDocument(); Node rootNode = this.createArtifactElement(document, "GetMetaData"); document.appendChild(rootNode); @@ -1033,3 +1122,4 @@ return document; } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java Mon Apr 12 16:45:16 2010 +0000 @@ -1,6 +1,8 @@ package de.intevation.gnv.artifactdatabase.client.exception; /** + * Exception used for general errors in the artifact server. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ @@ -45,5 +47,5 @@ public ArtifactDatabaseClientException(String arg0, Throwable arg1) { super(arg0, arg1); } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java Mon Apr 12 16:45:16 2010 +0000 @@ -1,6 +1,8 @@ package de.intevation.gnv.artifactdatabase.client.exception; /** + * Exception used if an error occured caused by invalid input. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class ArtifactDatabaseInputException extends Exception {
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Mon Apr 12 16:45:16 2010 +0000 @@ -6,6 +6,8 @@ import org.w3c.dom.Node; /** + * An <code>ArtifactObject</code> representing an artifact. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ @@ -29,58 +31,42 @@ private Map<String, OutputMode> outputModes; private String currentState = null; - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getCurrentUI() - */ + public Node getCurrentUI() { return currentUI; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setCurrentUI(org.w3c.dom.Node) - */ + public void setCurrentUI(Node currentUI) { this.currentUI = currentUI; } - /** - * @return the currentOut - */ + public Node getCurrentOut() { return currentOut; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setCurrentOut(org.w3c.dom.Node) - */ + public void setCurrentOut(Node currentOut) { this.currentOut = currentOut; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getReachableStates() - */ + public Collection<String> getReachableStates() { return reachableStates; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setReachableStates(java.util.Collection) - */ + public void setReachableStates(Collection<String> reachableStates) { this.reachableStates = reachableStates; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getCurrentState() - */ + public String getCurrentState() { return currentState; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setCurrentState(java.lang.String) - */ + public void setCurrentState(String currentState) { this.currentState = currentState; } @@ -94,72 +80,52 @@ this.hash = hash; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getHash() - */ + public String getHash() { return this.hash; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getDescription() - */ + public String getDescription() { return this.id; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getId() - */ + public String getId() { return this.id; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getName() - */ + public String getName() { return this.id; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#isSelected() - */ + public boolean isSelected() { return this.selected; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#setSelected(boolean) - */ + public void setSelected(boolean selected) { this.selected = selected; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getInputParameter() - */ + public Collection<String> getInputParameter() { return this.inputParameter; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setInputParameter(java.util.Collection) - */ + public void setInputParameter(Collection<String> inputParameter) { this.inputParameter = inputParameter; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getOutputModes() - */ + public Map<String, OutputMode> getOutputModes() { return this.outputModes; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getOutputModesAsCollection() - */ + public Collection<OutputMode> getOutputModesAsCollection() { if (this.outputModes != null) { return this.outputModes.values(); @@ -167,10 +133,9 @@ return null; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setOutputModes(java.util.Map) - */ + public void setOutputModes(Map<String, OutputMode> outputModes) { this.outputModes = outputModes; } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java Mon Apr 12 16:45:16 2010 +0000 @@ -8,73 +8,95 @@ import org.w3c.dom.Node; /** + * This interface describes basic methods to describe the user interface of an + * artifact. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public interface ArtifactDescription extends Serializable { /** + * Retrieves the xml node of the current user interface. + * * @return the currentUI */ public Node getCurrentUI(); /** - * @param currentUI - * the currentUI to set + * Set the xml node of the current user interface. + * + * @param currentUI the currentUI to set */ public void setCurrentUI(Node currentUI); /** - * @param currentOut - * the currentOut to set + * Set the xml node of the possible output modes. + * + * @param currentOut the currentOut to set */ public void setCurrentOut(Node currentOut); /** + * Retrieves a collection of reachable states. + * * @return the reachableStates */ public Collection<String> getReachableStates(); /** - * @param reachableStates - * the reachableStates to set + * Set the reachable states. + * + * @param reachableStates the reachableStates to set */ public void setReachableStates(Collection<String> reachableStates); /** + * Retrieves the current state. + * * @return the currentState */ public String getCurrentState(); /** - * @param currentState - * the currentState to set + * Set the current state. + * + * @param currentState the currentState to set */ public void setCurrentState(String currentState); /** + * Get a collection of input parameters. + * * @return the reachableStates */ public Collection<String> getInputParameter(); /** + * Set a collection of input parameters. + * * @param inputParameter */ public void setInputParameter(Collection<String> inputParameter); /** - * @return the reachableStates + * Retrieves a map of available output modes. + * + * @return the available output modes. */ public Map<String, OutputMode> getOutputModes(); /** - * @return the reachableStates + * Retrieves a collection of available output modes. + * + * @return the available output modes. */ public Collection<OutputMode> getOutputModesAsCollection(); /** - * @param outputParameter + * Set the available output modes. + * + * @param outputModes A map that contains output modes. */ public void setOutputModes(Map<String, OutputMode> outputModes); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java Mon Apr 12 16:45:16 2010 +0000 @@ -2,7 +2,6 @@ /** * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class ArtifactFactory implements ArtifactObject { @@ -20,6 +19,8 @@ private String dataBaseUrl = null; /** + * Returns the url of the artifact server. + * * @return the dataBaseUrl */ public String getDataBaseUrl() { @@ -40,49 +41,44 @@ this.dataBaseUrl = dataBaseUrl; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getId() - */ + public String getId() { return this.name; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#isSelected() - */ + public boolean isSelected() { return this.selected; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#setSelected(boolean) - */ + public void setSelected(boolean selected) { this.selected = selected; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getName() - */ + public String getName() { return name; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getDescription() - */ + public String getDescription() { return description; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getHash() - */ + public String getHash() { return null; } + /** + * Two ArtifactFactories are equal, if the name and the url to the artifact + * server are equal. + * + * @param obj + * @return true, if the factories are equal - otherwise false. + */ @Override public boolean equals(Object obj) { boolean returnValue = false; @@ -93,5 +89,5 @@ } return returnValue; } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java Mon Apr 12 16:45:16 2010 +0000 @@ -3,21 +3,52 @@ import java.io.Serializable; /** + * The <code>ArtifactObject</code> provides some information about an artifact. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public interface ArtifactObject extends Serializable { + /** + * Retrieves the id of this object. + * + * @return the id. + */ public String getId(); + /** + * Retrieves information about the selection state of this object. + * + * @return true, if this object is selected - otherwise false. + */ public boolean isSelected(); + /** + * Set the selection of this object. + * + * @param selected the new selection. + */ public void setSelected(boolean selected); + /** + * Retrieves the name of this object. + * + * @return the name. + */ public String getName(); + /** + * Retrieves the description of the object. + * + * @return the description. + */ public String getDescription(); + /** + * Retrieves the hash value of this object. + * + * @return the hash value. + */ public String getHash(); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java Mon Apr 12 16:45:16 2010 +0000 @@ -11,5 +11,5 @@ String getKey(); String getValue(); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java Mon Apr 12 16:45:16 2010 +0000 @@ -5,16 +5,31 @@ import java.util.Collection; /** + * An inteface description for a container storing statistics. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public interface ArtifactStatisticsSet extends Serializable { - + /** + * Retrieves the name of this container. + * + * @return the name. + */ String getName(); + /** + * Retrieves the statistics as collection. + * + * @return the statistics. + */ Collection<ArtifactStatisticValue> getStatisticValues(); + /** + * Add a new statistic to this container. + * + * @param value A statistic. + */ void addStatisticValues(ArtifactStatisticValue value); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java Mon Apr 12 16:45:16 2010 +0000 @@ -4,6 +4,8 @@ import java.util.Collection; /** + * The default implementation of <code>ArtifactStatisticsSet</code>. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ @@ -25,25 +27,19 @@ this.name = name; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet#addStatisticValues(de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticValue) - */ + public void addStatisticValues(ArtifactStatisticValue value) { this.statisticValues.add(value); } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet#getName() - */ + public String getName() { return this.name; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet#getStatisticValues() - */ + public Collection<ArtifactStatisticValue> getStatisticValues() { return this.statisticValues; } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java Mon Apr 12 16:45:16 2010 +0000 @@ -1,6 +1,9 @@ package de.intevation.gnv.artifactdatabase.objects; /** + * This is the default implementation of <code>ExportMode</code> which stores + * information about a specific output target (e.g. pdf, svg, image). + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class DefaultExportMode @@ -10,16 +13,25 @@ protected String description; protected String mimeType; + /** + * Creates a new <code>ExportMode</code>. + * + * @param name The name of the mode. + * @param description A description of this mode. + * @param mimeType The mimetype used for this mode. + */ public DefaultExportMode(String name, String description, String mimeType){ this.name = name; this.description = description; this.mimeType = mimeType; } + public String getName() { return name; } + public String getDescription() { return description; } @@ -28,4 +40,4 @@ return mimeType; } } -// 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 :
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java Mon Apr 12 16:45:16 2010 +0000 @@ -1,14 +1,13 @@ package de.intevation.gnv.artifactdatabase.objects; /** + * The default implementation of <code>InputParameter</code>. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ public class DefaultInputParameter implements InputParameter { - /** - * The UID of this Class. - */ private static final long serialVersionUID = 6597439837482244211L; private String name = null; @@ -18,8 +17,8 @@ /** * Constructor * - * @param name - * @param values + * @param name The name of this parameter. + * @param values The values of this parameter. */ public DefaultInputParameter(String name, String[] values) { super(); @@ -27,18 +26,12 @@ this.values = values; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.InputParameter#getName() - */ public String getName() { return this.name; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.InputParameter#getValues() - */ public String[] getValues() { return this.values; } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java Mon Apr 12 16:45:16 2010 +0000 @@ -4,8 +4,9 @@ import java.util.Map; /** + * The default implementation of an <code>OutputMode</code>. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class DefaultOutputMode implements OutputMode { @@ -35,23 +36,14 @@ this.exports = exports; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.OutputMode#getMimeType() - */ public String getMimeType() { return this.mimeType; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.OutputMode#getName() - */ public String getName() { return this.name; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.OutputMode#getOutputParameters() - */ public Collection<OutputParameter> getOutputParameters() { return this.outputParameter; } @@ -60,3 +52,4 @@ return exports.get(mode); } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java Mon Apr 12 16:45:16 2010 +0000 @@ -1,8 +1,9 @@ package de.intevation.gnv.artifactdatabase.objects; /** + * The default implementation of <code>OutputParameter</code>. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class DefaultOutputParameter implements OutputParameter { @@ -35,16 +36,10 @@ this.type = type; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.OutputParameter#getName() - */ public String getName() { return this.name; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.OutputParameter#getValue() - */ public String getValue() { return this.value; } @@ -56,5 +51,5 @@ public String getType() { return this.type; } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java Mon Apr 12 16:45:16 2010 +0000 @@ -3,13 +3,33 @@ import java.io.Serializable; /** + * An <code>ExportMode</code> describes a specific format of an output mode + * (e.g. pdf, svg, image). + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public interface ExportMode extends Serializable { + /** + * Returns the name of this export mode. + * + * @return the name. + */ public String getName(); + + /** + * Returns the description of this export mode. + * + * @return the description. + */ public String getDescription(); + + /** + * Returns the mimetype used for this export mode. + * + * @return the mimetype. + */ public String getMimeType(); } -// 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 :
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java Mon Apr 12 16:45:16 2010 +0000 @@ -3,13 +3,25 @@ import java.io.Serializable; /** + * <code>InputParameter</code> objects are used to store multiple values for a + * single key. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public interface InputParameter extends Serializable { + /** + * Returns the name of the input parameter. + * + * @return the name. + */ public String getName(); + /** + * Returns the values of this input parameter as array. + * + * @return the values as array. + */ public String[] getValues(); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java Mon Apr 12 16:45:16 2010 +0000 @@ -5,16 +5,42 @@ import java.util.Collection; /** + * <code>OutputMode</code> objects give information possible types of exports + * for an artifact (e.g. chart, histogram, csv, odv, statistic). + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ public interface OutputMode extends Serializable{ + /** + * Retrieve the name of an output mode. + * + * @return the name. + */ public String getName(); + /** + * Retrieve the mimetype of an output mode. + * + * @return the mimetype. + */ public String getMimeType(); + /** + * Retrieve the output parameters available to adjust the output. + * + * @return the output parameters. + */ public Collection<OutputParameter> getOutputParameters(); + /** + * Retrieve possible export modes which describe specific output modes + * (e.g. pdf, svg, image). + * + * @param mode The export mode's name. + * @return the export mode. + */ public ExportMode getExportMode(String mode); } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java Mon Apr 12 16:45:16 2010 +0000 @@ -3,17 +3,39 @@ import java.io.Serializable; /** + * An <code>OutputParameter</code> describes the input for an export mode and + * stores the value inserted by the user. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public interface OutputParameter extends Serializable{ + /** + * Retrieves the name of the parameter. + * + * @return the name. + */ String getName(); + /** + * Retrieves the value of this parameters. + * + * @return the value. + */ String getValue(); + /** + * Retrieves the description of this parameter. + * + * @return the description. + */ String getDescription(); + /** + * Retrieves the type of this parameter (e.g. String, Integer, Double, Date). + * + * @return the type. + */ String getType(); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java Mon Apr 12 16:45:16 2010 +0000 @@ -7,8 +7,8 @@ /** * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> */ -public class ParametrizedArtifactFactory extends ArtifactFactory implements - ParametrizedArtifactObject { +public class ParametrizedArtifactFactory +extends ArtifactFactory implements ParametrizedArtifactObject { /** * The UID of this Class @@ -29,18 +29,12 @@ this.parameters = new HashMap<String, Collection<String>>(); } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ParametrizedArtifactObject#getParameters() - */ public Map<String, Collection<String>> getParameters() { return parameters; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.ParametrizedArtifactObject#addParameters(java.lang.String, java.util.Collection) - */ public void addParameters(String key, Collection<String> values) { this.parameters.put(key, values); } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java Mon Apr 12 16:45:16 2010 +0000 @@ -5,17 +5,22 @@ /** * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public interface ParametrizedArtifactObject extends ArtifactObject { /** * Returns the Parameters which could be used to manage (e.g. create) an * ArtifactObject. - * @return + * @return a map storing parameters. */ Map<String, Collection<String>> getParameters(); + /** + * Add a further parameter to the parameter map. + * + * @param key + * @param values + */ void addParameters(String key, Collection<String> values); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java Mon Apr 12 16:45:16 2010 +0000 @@ -1,6 +1,8 @@ package de.intevation.gnv.artifactdatabase.objects.map; /** + * The default implementation of <code>Layer</code>. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> */ public class DefaultLayer implements Layer { @@ -13,6 +15,7 @@ private boolean groupLayer = false; private String parentId = null; + /** * Constructor */ @@ -25,31 +28,21 @@ } - - /** - * @see de.intevation.gnv.artifactdatabase.objects.map.Layer#getID() - */ public String getID() { return this.id; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.map.Layer#getName() - */ + public String getName() { return this.name; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.map.Layer#isGroupLayer() - */ + public boolean isGroupLayer() { return this.groupLayer; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.map.Layer#parentID() - */ + public String parentID() { return this.parentId; } @@ -60,5 +53,5 @@ " IsGroupLayer: "+this.groupLayer+ " ParentID: "+this.parentId; } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java Mon Apr 12 16:45:16 2010 +0000 @@ -3,20 +3,20 @@ import java.util.Collection; /** + * The default implementation of <code>MapService</code>. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class DefaultMapService implements MapService { private String id = null; - - private Collection<Layer> layer = null; private String type = null; private String url = null; + /** * Constructor */ @@ -29,32 +29,24 @@ this.url = url; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.map.MapService#getID() - */ + public String getID() { return this.id; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.map.MapService#getLayer() - */ + public Collection<Layer> getLayer() { return this.layer; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.map.MapService#getType() - */ + public String getType() { return this.type; } - /** - * @see de.intevation.gnv.artifactdatabase.objects.map.MapService#getURL() - */ + public String getURL() { return this.url; } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java Mon Apr 12 16:45:16 2010 +0000 @@ -1,14 +1,39 @@ package de.intevation.gnv.artifactdatabase.objects.map; /** + * This interface defines some basic methods providing information about a map + * layer. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public interface Layer { + /** + * Retrieves the name of a layer. + * + * @return the name of a layer. + */ String getName(); + + /** + * Retrieves the id of a layer. + * + * @return the id of a layer. + */ String getID(); + + /** + * Retrieves true, if this layer is a group layer - otherwise false. + * + * @return true, if this layer is a group layer - otherwise false. + */ boolean isGroupLayer(); + + /** + * Retrieves the id of the parent layer. + * + * @return the id of the parent layer. + */ String parentID(); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java Mon Apr 12 16:45:16 2010 +0000 @@ -3,18 +3,41 @@ import java.util.Collection; /** + * This interface defines some basic methods to provide information about a map + * service. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public interface MapService { - + /** + * Retrieves the id of a map service. + * + * @return the id of a map service. + */ String getID(); + + /** + * Retrieves the URL of a map service. + * + * @return the URL of a map service. + */ String getURL(); + + /** + * Retrieves the type of a map service. + * + * @return the type of a map service. + */ String getType(); + /** + * Retrieves the layers served by a map service. + * + * @return the layers served by a map service. + */ Collection<Layer> getLayer(); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java Mon Apr 12 16:45:16 2010 +0000 @@ -5,29 +5,25 @@ import org.apache.log4j.Logger; /** + * A <code>PropertiesReader</code> storing properties in a <code>Map</code>. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * */ public class MapPropertiesReader implements PropertiesReader { - /** - * the logger, used to log exceptions and additonaly information - */ + private static Logger log = Logger.getLogger(MapPropertiesReader.class); private Map<String, String> properties = null; /** - * Constructor + * Constructs a new MapPropertiesReader with an initial map. */ public MapPropertiesReader(Map<String, String> properties) { super(); this.properties = properties; } - /** - * @see de.intevation.gnv.propertiesreader.PropertiesReader#getPropertieValue(java.lang.String, - * java.lang.String) - */ public String getPropertieValue(String key, String defaultValue) { String value = this.properties.get(key); if (value == null) { @@ -35,5 +31,5 @@ } return value; } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java Mon Apr 12 16:45:16 2010 +0000 @@ -1,11 +1,21 @@ package de.intevation.gnv.propertiesreader; /** + * An interface that defines a single method to retrieve properties specified by + * a key. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public interface PropertiesReader { + /** + * Retrieves a property by the given <i>ke<</i>. + * + * @param key The key of a property. + * @param defaultValue The default value which is returned if no property + * is found by <i>key</i>. + * @return the value of a property. + */ public String getPropertieValue(String key, String defaultValue); - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Mon Apr 12 16:45:16 2010 +0000 @@ -58,8 +58,7 @@ /** * Getting the ConnectionPool * - * @param config - * The Config that should be read + * @param config The Config that should be read */ public void initPropertiesReader(Object config) { if (config instanceof ServletConfig) { @@ -74,5 +73,5 @@ } } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java Mon Apr 12 16:45:16 2010 +0000 @@ -7,6 +7,7 @@ import javax.servlet.ServletConfig; import org.apache.log4j.Logger; + /** * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> * @@ -39,10 +40,7 @@ } } - /** - * @see de.intevation.gnv.propertiesreader.PropertiesReader#getPropertieValue(java.lang.String, - * java.lang.String) - */ + public String getPropertieValue(String key, String defaultValue) { String value = this.properties.get(key); if (value == null) { @@ -50,5 +48,5 @@ } return value; } - } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Mon Apr 12 16:45:16 2010 +0000 @@ -11,11 +11,12 @@ import org.apache.struts.action.ActionServlet; /** + * The GNV ActionServlet. * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class GNVActionServlet extends ActionServlet { + /** * the logger, used to log exceptions and additonaly information */ @@ -23,19 +24,13 @@ static { // BasicConfigurator.configure(); - } static String LOGGINIG_CONFIG_FILE_ID = "de.intevation.gnv.servlet.log4j.configuration"; - /** - * The UID of this Class - */ private static final long serialVersionUID = 3597396283436383943L; - /** - * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig) - */ + @Override public void init(ServletConfig config) throws ServletException { super.init(config); @@ -51,3 +46,4 @@ PropertiesReaderFactory.getInstance().initPropertiesReader(config); } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file
--- a/gnv/src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java Mon Apr 12 16:45:16 2010 +0000 @@ -7,6 +7,9 @@ import javax.xml.namespace.NamespaceContext; /** + * The namespacecontext object used in xml documents retrieved by the artifact + * server. + * * @author <a href="mailto:sascha.teichmann@intevation">Sascha L. Teichmann</a> */ public class ArtifactNamespaceContext @@ -53,4 +56,4 @@ throw new UnsupportedOperationException(); } } -// 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 :
--- a/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java Mon Apr 12 10:56:55 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java Mon Apr 12 16:45:16 2010 +0000 @@ -24,8 +24,10 @@ import org.w3c.dom.Node; /** + * This xsl transformer is used to transform incoming xml documents with the + * help of templates into a html representation. + * * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> - * */ public class XSLTransformer { /** @@ -43,6 +45,17 @@ super(); } + /** + * Turns <i>toTransform</i> into another format using the template <i> + * templateFileName</i> with the <i>encoding</i>. The parameters added in + * {@link #addParameter(java.lang.String, java.lang.String)} are available + * in the transformer. + * + * @param toTransform The node to be transformed. + * @param encoding The encoding to be used. + * @param templateFileName The template used for transformation. + * @return the transformed document as string. + */ public String transform(Node toTransform, String encoding, String templateFileName) { String resultValue = null; @@ -79,6 +92,12 @@ } + /** + * Add a parameter that is required in the XSL sheet. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + */ public void addParameter(String name, String value) { if (params == null) { params = new HashMap<String, String>(3); @@ -87,3 +106,4 @@ params.put(name, value); } } +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : \ No newline at end of file