# HG changeset patch # User Ingo Weinzierl # Date 1301568847 0 # Node ID e5e7af20885773ad23e1b4bdc918b4c32ca14184 # Parent 3419b1c8ca28e98055f03e485d8b8504efc7032f Added an OutGenerator interface that might be used to generator collected outputs of a set of artifacts. flys-artifacts/trunk@1632 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 3419b1c8ca28 -r e5e7af208857 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Wed Mar 30 16:00:51 2011 +0000 +++ b/flys-artifacts/ChangeLog Thu Mar 31 10:54:07 2011 +0000 @@ -1,3 +1,10 @@ +2011-03-31 Ingo Weinzierl + + * src/main/java/de/intevation/flys/exports/OutGenerator.java: + New. This interface is used to generator different types of output. + ArtifactCollections will make use of this interface to create a + collected output of all its artifacts. + 2011-03-30 Ingo Weinzierl * src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java: diff -r 3419b1c8ca28 -r e5e7af208857 flys-artifacts/src/main/java/de/intevation/flys/exports/OutGenerator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/OutGenerator.java Thu Mar 31 10:54:07 2011 +0000 @@ -0,0 +1,47 @@ +package de.intevation.flys.exports; + +import java.io.OutputStream; + +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.CallContext; + + +/** + * An OutGenerator is used to create a collected outputs of a list of Artifacts. + * + * @author Ingo Weinzierl + */ +public interface OutGenerator { + + /** + * Initializes the OutGenerator with meta information which are necessary + * for the output generation. + * + * @param request The incomding request document. + * @param out The output stream. + * @param context The CallContext that provides further information and + * objects used for the output generation. + */ + void init(Document request, OutputStream out, CallContext context); + + /** + * Creates the output of an Artifact and appends that single output to the + * total output. + * + * @param artifact The artifact that provides information and data for the + * single output. + * @param attr A document that might contain some attributes used while + * producing the output. + */ + void doOut(Artifact artifact, Document attr); + + /** + * Writes the collected output of all artifacts specified in the + * request (see init()) document to the OutputStream out (see + * init()). + */ + void generate(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :