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@695: import de.intevation.artifactdatabase.state.Facet;
ingo@695:
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@412: * This method is used to tell the OutGenerator which artifact is the master
ingo@412: * artifact which is used for special operations.
ingo@412: *
ingo@412: * @param master The master artifact.
ingo@412: */
ingo@412: void setMasterArtifact(Artifact master);
ingo@412:
ingo@412: /**
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@1684: * @param visible Specifies, if this output should be visible or not.
ingo@294: */
ingo@1684: void doOut(Artifact artifact, Facet facet, Document attr, boolean visible);
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 :