changeset 8:9cb3ee7ed8ba

Added interfaces for Artifacts, its ArtifactDescription and Data. flys-client/trunk@1316 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 11 Feb 2011 13:48:17 +0000
parents a65793e08245
children 8facd8545a12
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/shared/model/Artifact.java flys-client/src/main/java/de/intevation/flys/client/shared/model/ArtifactDescription.java flys-client/src/main/java/de/intevation/flys/client/shared/model/Data.java flys-client/src/main/java/de/intevation/flys/client/shared/model/DataItem.java
diffstat 5 files changed, 182 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Feb 11 11:16:55 2011 +0000
+++ b/flys-client/ChangeLog	Fri Feb 11 13:48:17 2011 +0000
@@ -1,3 +1,18 @@
+2011-02-11  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/Artifact.java: New.
+	  The interface description of an artifact used in this client. There are
+	  several methods that provide information about the artifact itself and its
+	  representation.
+
+	* src/main/java/de/intevation/flys/client/shared/model/ArtifactDescription.java:
+	  New. The ArtifactDescription provides information about the current
+	  representation of an artifact.
+
+	* src/main/java/de/intevation/flys/client/shared/model/DataItem.java,
+	  src/main/java/de/intevation/flys/client/shared/model/Data.java: New. The
+	  interfaces are used to handle user input.
+
 2011-02-11  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/Artifact.java	Fri Feb 11 13:48:17 2011 +0000
@@ -0,0 +1,43 @@
+package de.intevation.flys.client.shared.model;
+
+
+/**
+ * This class represents an artifact for the client. It contains the necessary
+ * information for the client and the communication with the artifact server.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public interface Artifact {
+
+    /**
+     * Returns the UUID of the artifact.
+     *
+     * @return the UUID.
+     */
+    public String getUuid();
+
+
+    /**
+     * Returns the hash of the artifact.
+     *
+     * @return the hash.
+     */
+    public String getHash();
+
+
+    /**
+     * Returns the ArtifactDescription.
+     *
+     * @return the artifact description.
+     */
+    public ArtifactDescription getDescription();
+
+
+    /**
+     * Sets a new ArtifactDescription.
+     *
+     * @param artifactDescription The new artifact description.
+     */
+    public void setArtifactDescription(ArtifactDescription artifactDescription);
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/ArtifactDescription.java	Fri Feb 11 13:48:17 2011 +0000
@@ -0,0 +1,45 @@
+package de.intevation.flys.client.shared.model;
+
+/**
+ * The artifact description describes a state of an artifact. There are
+ * operations defined that return former inserted data, possible input values
+ * and output targets that are available in the current state of the artifact.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public interface ArtifactDescription {
+
+    /**
+     * Returns the data that have been inserted in former states of the
+     * artifact.
+     *
+     * @return the old data of former states.
+     */
+    public Data[] getOldData();
+
+
+    /**
+     * Returns the data with all its options that might be inserted in the
+     * current state of the artifact.
+     *
+     * @return the current data.
+     */
+    public Data getCurrentData();
+
+
+    /**
+     * Returns the current state as string.
+     *
+     * @return the current state.
+     */
+    public String getCurrentState();
+
+
+    /**
+     * Returns the reachable states as string.
+     *
+     * @return the reachable states.
+     */
+    public String[] getReachableStates();
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/Data.java	Fri Feb 11 13:48:17 2011 +0000
@@ -0,0 +1,44 @@
+package de.intevation.flys.client.shared.model;
+
+
+/**
+ * A Data object represents the necessary data of a single state of the
+ * artifact. It might provide several DataItems or just a single DataItem. The
+ * <code>type</code> makes it possible to validate the input in the client.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public interface Data {
+
+    /**
+     * Returns the label of the item.
+     *
+     * @return the label.
+     */
+    public String getLabel();
+
+
+    /**
+     * Returns the description of the item.
+     *
+     * @return the description.
+     */
+    public String getDescription();
+
+
+    /**
+     * Returns the type of the item.
+     *
+     * @return the type.
+     */
+    public String getType();
+
+
+    /**
+     * Returns the DataItems provided by this Data object.
+     *
+     * @return the DataItems.
+     */
+    public DataItem[] getItems();
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DataItem.java	Fri Feb 11 13:48:17 2011 +0000
@@ -0,0 +1,35 @@
+package de.intevation.flys.client.shared.model;
+
+
+/**
+ * A DataItem represents a concrete item that might be selected, chosen or
+ * inserted by the user.
+ *
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public interface DataItem {
+
+    /**
+     * Returns the label of the item.
+     *
+     * @return the label.
+     */
+    public String getLabel();
+
+
+    /**
+     * Returns the description of the item.
+     *
+     * @return the description;
+     */
+    public String getDescription();
+
+
+    /**
+     * Returns the value of the item.
+     *
+     * @return the value.
+     */
+    public Object getValue();
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org