ingo@294: package de.intevation.flys.exports;
ingo@294:
ingo@299: import java.io.IOException;
ingo@294: import java.io.OutputStream;
ingo@294:
ingo@294: import org.w3c.dom.Document;
ingo@294:
ingo@294: import de.intevation.artifacts.Artifact;
ingo@294: import de.intevation.artifacts.CallContext;
ingo@294:
ingo@294:
ingo@294: /**
ingo@294: * An OutGenerator is used to create a collected outputs of a list of Artifacts.
ingo@294: *
ingo@294: * @author Ingo Weinzierl
ingo@294: */
ingo@294: public interface OutGenerator {
ingo@294:
ingo@294: /**
ingo@294: * Initializes the OutGenerator with meta information which are necessary
ingo@294: * for the output generation.
ingo@294: *
ingo@294: * @param request The incomding request document.
ingo@294: * @param out The output stream.
ingo@294: * @param context The CallContext that provides further information and
ingo@294: * objects used for the output generation.
ingo@294: */
ingo@294: void init(Document request, OutputStream out, CallContext context);
ingo@294:
ingo@294: /**
ingo@294: * Creates the output of an Artifact and appends that single output to the
ingo@294: * total output.
ingo@294: *
ingo@294: * @param artifact The artifact that provides information and data for the
ingo@294: * single output.
ingo@294: * @param attr A document that might contain some attributes used while
ingo@294: * producing the output.
ingo@294: */
ingo@294: void doOut(Artifact artifact, Document attr);
ingo@294:
ingo@294: /**
ingo@294: * Writes the collected output of all artifacts specified in the
ingo@294: * request (see init()) document to the OutputStream out (see
ingo@294: * init()).
ingo@294: */
ingo@299: void generate() throws IOException;
ingo@294: }
ingo@294: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :