org.apache.turbine.modules.screens
Class RawScreen

java.lang.Object
  extended by org.apache.turbine.modules.Assembler
      extended by org.apache.turbine.modules.Screen
          extended by org.apache.turbine.modules.screens.RawScreen
Direct Known Subclasses:
JSONScreen

public abstract class RawScreen
extends 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(RunData data) and doOutput(RunData data) (see below).

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

Version:
$Id: RawScreen.java 938645 2010-04-27 20:57:51Z tv $
Author:
Regis Koenig, Peter Courcoux

Field Summary
 
Fields inherited from class org.apache.turbine.modules.Screen
CACHE_SIZE_DEFAULT, CACHE_SIZE_KEY, NAME, PREFIX
 
Constructor Summary
RawScreen()
           
 
Method Summary
protected  org.apache.ecs.ConcreteElement doBuild(PipelineData pipelineData)
          Build the Screen.
protected  org.apache.ecs.ConcreteElement doBuild(RunData data)
          Deprecated. Use PipelineData version instead.
protected  void doOutput(PipelineData pipelineData)
          Actually output the dynamic content.
protected abstract  void doOutput(RunData data)
          Deprecated. Use PipelineData version instead.
protected  String getContentType(PipelineData pipelineData)
          Set the content type.
protected abstract  String getContentType(RunData data)
          Deprecated. Use PipelineData version instead.
 String getLayout(PipelineData pipelineData)
          The layout must be set to null.
 String getLayout(RunData data)
          Deprecated. Use PipelineData version instead.
 
Methods inherited from class org.apache.turbine.modules.Screen
build, build, getPrefix, prepareText, prepareTextMinimum, setLayout, setLayout
 
Methods inherited from class org.apache.turbine.modules.Assembler
getRunData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawScreen

public RawScreen()
Method Detail

doBuild

protected final org.apache.ecs.ConcreteElement doBuild(RunData data)
                                                throws Exception
Deprecated. Use PipelineData version instead.

Build the Screen. This method actually makes a call to the doOutput() method in order to generate the Screen content.

Specified by:
doBuild in class Screen
Parameters:
data - Turbine information.
Returns:
A ConcreteElement.
Throws:
Exception, - a generic exception.
Exception - a generic exception.

doBuild

protected final org.apache.ecs.ConcreteElement 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.

Overrides:
doBuild in class Screen
Parameters:
data - Turbine information.
Returns:
A ConcreteElement.
Throws:
Exception, - a generic exception.
Exception - a generic exception.

getContentType

protected abstract String getContentType(RunData data)
Deprecated. Use PipelineData version instead.

Set the content type. This method should be overidden to actually set the real content-type header of the output.

Parameters:
data - Turbine information.
Returns:
A String with the content type.

getContentType

protected String getContentType(PipelineData pipelineData)
Set the content type. This method should be overidden to actually set the real content-type header of the output.

Parameters:
data - Turbine information.
Returns:
A String with the content type.

doOutput

protected abstract void doOutput(RunData data)
                          throws Exception
Deprecated. Use PipelineData version instead.

Actually output the dynamic content. The OutputStream can be accessed like this:
OutputStream out =
 data.getResponse().getOutputStream();
.

Parameters:
data - Turbine information.
Throws:
Exception, - a generic exception.
Exception

doOutput

protected void doOutput(PipelineData pipelineData)
                 throws Exception
Actually output the dynamic content. The OutputStream can be accessed like this:
OutputStream out =
 data.getResponse().getOutputStream();
.

Parameters:
data - Turbine information.
Throws:
Exception, - a generic exception.
Exception

getLayout

public final String getLayout(RunData data)
Deprecated. Use PipelineData version instead.

The layout must be set to null.

Overrides:
getLayout in class Screen
Parameters:
data - Turbine information.
Returns:
A null String.

getLayout

public final String getLayout(PipelineData pipelineData)
The layout must be set to null.

Overrides:
getLayout in class Screen
Parameters:
data - Turbine information.
Returns:
A null String.


Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.