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:
felix@1944: import de.intevation.artifactdatabase.state.ArtifactAndFacet;
ingo@1979: import de.intevation.artifactdatabase.state.Settings;
ingo@294: import de.intevation.artifacts.Artifact;
ingo@294: import de.intevation.artifacts.CallContext;
ingo@3422: import de.intevation.flys.collections.FLYSArtifactCollection;
ingo@294:
felix@1962:
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@3422: * This method is used to set the Collection of the OutGenerator.
ingo@3422: *
ingo@3422: * @param collection A reference to the collection.
ingo@3422: */
ingo@3422: void setCollection(FLYSArtifactCollection collection);
ingo@3422:
ingo@3422: /**
ingo@294: * Creates the output of an Artifact and appends that single output to the
ingo@294: * total output.
ingo@294: *
felix@3270: * @param bundle The Facet and 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: */
felix@1944: void doOut(ArtifactAndFacet bundle, 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@1979:
ingo@1979: /**
ingo@2047: * This method is used to set a Settings object for the Output
ingo@2047: * that is produced by this OutGenerator.
ingo@2047: *
ingo@2047: * @param settings The Settings that might be used while
ingo@2047: * Output creation.
ingo@2047: */
ingo@2047: void setSettings(Settings settings);
ingo@2047:
ingo@2047: /**
ingo@1979: * Returns the Settings for the Output produced by this OutGenerator.
ingo@1979: *
ingo@1979: * @return the Settings for the Output produced by this OutGenerator.
ingo@1979: */
ingo@1979: Settings getSettings();
ingo@294: }
ingo@294: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :