# HG changeset patch # User Ingo Weinzierl # Date 1297432097 0 # Node ID 9cb3ee7ed8ba865186f1c9e330b666552b38799b # Parent a65793e0824504e926b214655ce4f990850dee7a Added interfaces for Artifacts, its ArtifactDescription and Data. flys-client/trunk@1316 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r a65793e08245 -r 9cb3ee7ed8ba flys-client/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties, diff -r a65793e08245 -r 9cb3ee7ed8ba flys-client/src/main/java/de/intevation/flys/client/shared/model/Artifact.java --- /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 Ingo Weinzierl + */ +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 : diff -r a65793e08245 -r 9cb3ee7ed8ba flys-client/src/main/java/de/intevation/flys/client/shared/model/ArtifactDescription.java --- /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 Ingo Weinzierl + */ +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 : diff -r a65793e08245 -r 9cb3ee7ed8ba flys-client/src/main/java/de/intevation/flys/client/shared/model/Data.java --- /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 + * type makes it possible to validate the input in the client. + * + * @author Ingo Weinzierl + */ +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 : diff -r a65793e08245 -r 9cb3ee7ed8ba flys-client/src/main/java/de/intevation/flys/client/shared/model/DataItem.java --- /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 Ingo Weinzierl + */ +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 :