Class RawScreen

  • All Implemented Interfaces:
    Assembler, Screen
    Direct Known Subclasses:
    JSONScreen, PlainJSONScreen

    public abstract class RawScreen
    extends Object
    implements Screen
    Base class for writing Screens that output binary data. This class is provided as a helper class for those who want to write Screens that output raw binary data. For example, it may be extended into a Screen that outputs a SVG file or a SWF (Flash Player format) movie. The only thing one has to do is to implement the two methods getContentType(PipelineData data) and doOutput(PipelineData data) (see below).

    You might want to take a look at the ImageServer screen class contained in the TDK.

    Version:
    $Id$
    Author:
    Regis Koenig, Peter Courcoux
    • Method Detail

      • doBuild

        public final String doBuild​(PipelineData pipelineData)
                             throws Exception
        Build the Screen. This method actually makes a call to the doOutput() method in order to generate the Screen content.
        Specified by:
        doBuild in interface Screen
        Parameters:
        pipelineData - Turbine information.
        Returns:
        A ConcreteElement.
        Throws:
        Exception - a generic exception.
      • getContentType

        protected abstract String getContentType​(PipelineData pipelineData)
        Set the content type. This method should be overridden to actually set the real content-type header of the output.
        Parameters:
        pipelineData - Turbine information.
        Returns:
        A String with the content type.
      • doOutput

        protected abstract void doOutput​(PipelineData pipelineData)
                                  throws Exception
        Actually output the dynamic content. The OutputStream can be accessed like this:
        OutputStream out =
         data.getResponse().getOutputStream();
        .
        Parameters:
        pipelineData - Turbine information.
        Throws:
        Exception - a generic exception.
      • getLayout

        public final String getLayout​(PipelineData pipelineData)
        The layout must be set to null.
        Specified by:
        getLayout in interface Screen
        Parameters:
        pipelineData - Turbine information.
        Returns:
        A null String.