# HG changeset patch # User Ingo Weinzierl # Date 1296658582 0 # Node ID beb991dc48279bd583016e0bece1f67add5a6e8a # Parent b3792346cb107e5d515943fadacf402d366f78ab Added a first stub of an WINFO artifact. flys-artifacts/trunk@1287 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r b3792346cb10 -r beb991dc4827 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Feb 01 17:56:29 2011 +0000 +++ b/flys-artifacts/ChangeLog Wed Feb 02 14:56:22 2011 +0000 @@ -1,3 +1,16 @@ +2011-02-02 Ingo Weinzierl + + * doc/conf/conf.xml: An initial configuration file for the FLYS artifact + server. + + * doc/conf/artifacts/winfo.xml: An initial transition configuration of an + WINFO artifact. + + * src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java: A stub of + an artifact for a WINFO parameterization. + + * pom.xml: Set the source code version to 1.5. + 2011-02-01 Sascha L. Teichmann * src/**, pom.xml: Added initial maven project. diff -r b3792346cb10 -r beb991dc4827 flys-artifacts/doc/conf/artifacts/winfo.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/doc/conf/artifacts/winfo.xml Wed Feb 02 14:56:22 2011 +0000 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r b3792346cb10 -r beb991dc4827 flys-artifacts/doc/conf/conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/doc/conf/conf.xml Wed Feb 02 14:56:22 2011 +0000 @@ -0,0 +1,34 @@ + + YOUR_SECRET + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + 8181 + localhost + + + + 60000 + + + + SA + + jdbc:h2:${artifacts.config.dir}/../artifactdb/artifacts.db + + + diff -r b3792346cb10 -r beb991dc4827 flys-artifacts/pom.xml --- a/flys-artifacts/pom.xml Tue Feb 01 17:56:29 2011 +0000 +++ b/flys-artifacts/pom.xml Wed Feb 02 14:56:22 2011 +0000 @@ -14,6 +14,20 @@ UTF-8 + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.0.2 + + 1.5 + 1.5 + + + + + junit @@ -21,5 +35,10 @@ 3.8.1 test + + de.intevation.bsh.artifact-database + artifact-database + 1.0-SNAPSHOT + diff -r b3792346cb10 -r beb991dc4827 flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java Wed Feb 02 14:56:22 2011 +0000 @@ -0,0 +1,123 @@ +package de.intevation.flys.artifacts; + +import java.io.IOException; +import java.io.OutputStream; + +import org.w3c.dom.Document; + +import org.apache.log4j.Logger; + +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +import de.intevation.artifactdatabase.DefaultArtifact; + + +/** + * The default WINFO artifact. + * + * @author Ingo Weinzierl + */ +public class WINFOArtifact extends DefaultArtifact { + + /** The logger for this class */ + private static Logger logger = Logger.getLogger(WINFOArtifact.class); + + + /** + * The default constructor. + */ + public WINFOArtifact() { + super(); + } + + + /** + * Initialize the artifact and insert new data if data contains + * information necessary for this artifact. + * + * @param identifier The UUID. + * @param factory The factory that is used to create this artifact. + * @param context The CallContext. + * @param data Some optional data. + */ + @Override + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + Document data) + { + logger.debug("Setup this artifact with the uuid: " + identifier); + + super.setup(identifier, factory, context, data); + } + + + /** + * This method handles requests for changing the current state of an + * artifact. + * + * @param target The target of the advance action. + * @param context The CallContext. + * + * @return the result of the advance action. + */ + @Override + public Document advance(Document target, CallContext context) { + logger.debug("Advance to another state."); + + return super.advance(target, context); + } + + + /** + * This methods introduces new data to the current artifact. + * + * @param data A document containing the new data. + * @param context The CallContext. + * + * @return the result of the feed action. + */ + @Override + public Document feed(Document data, CallContext context) { + logger.debug("Feed the artifact with new data."); + + return super.feed(data, context); + } + + + /** + * This method returns a description of this artifact. + * + * @param data Some data. + * @param CallContext The CallContext. + * + * @return the description of this artifact. + */ + public Document describe(Document data, CallContext context) { + logger.debug("Describe the artifact."); + + return super.describe(data, context); + } + + + /** + * Call an output target. + * + * @param format The format for the output. + * @param outStream The output stream. + * @param context The CallContext. + * @throws IOException if an error occured while writing the result to the + * output stream. + */ + public void out( + Document format, OutputStream outStream, CallContext context) + throws IOException + { + logger.debug("Call an out target."); + + super.out(format, outStream, context); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :