com.lowagie.servlets
Class ITextOutputFilter

java.lang.Object
  extended bycom.lowagie.servlets.OutputFilterBase
      extended bycom.lowagie.servlets.ITextOutputFilter

public class ITextOutputFilter
extends OutputFilterBase

Extends OutputfilterBase to pass the output from the filter chain through the iText library.

Author:
Marcelo Vanzin

Field Summary
private  HashMap construtores
           
private static String CONTENT_TYPE
           
static String CONTENT_TYPE_KEY
          Request key where to store the desired Content Type to send for the custom DocWriter.
private static String[] CONTENT_TYPES
           
private  String contentType
           
static Integer CUSTOM_OUTPUT
          Constant for custom writer output.
static int CUSTOM_OUTPUT_INT
           
private static String CUSTOM_WRITER
           
private  String docWriter
           
static String DOCWRITER_KEY
          Request key where to store the desired DocWriter class name.
static String FILENAME_KEY
          Request key where to store the desired filename to be sent to the browser.
static Integer HTML_OUTPUT
          Constant for HTML output.
static int HTML_OUTPUT_INT
           
private static Class[] INIT_PARAMS
           
private static String OUTPUT_TYPE
           
static String OUTPUT_TYPE_KEY
          Request key where to store the desired output type.
private  int outputType
           
private static String PAGE_SIZE
           
static String PAGE_SIZE_KEY
          Request key where to store the desired page size.
private  Rectangle pageSize
           
static Integer PDF_OUTPUT
          Constant for PDF output.
static int PDF_OUTPUT_INT
           
static Integer RTF_OUTPUT
          Constant for RTF output.
static int RTF_OUTPUT_INT
           
static String TAGMAP_KEY
          Request key where to store the desired tagmap to use in iText.
static Integer XML_OUTPUT
          Constant for XML output.
static int XML_OUTPUT_INT
           
 
Fields inherited from class com.lowagie.servlets.OutputFilterBase
EXCEPTION_KEY, fConfig, PREVENT_FILTER
 
Constructor Summary
ITextOutputFilter()
           
 
Method Summary
 void init(FilterConfig filterConfig)
          Initializes the filter.
 void perform(ServletRequest request, ServletResponse response, InputStream data)
          Calls iText to turn the passed input stream into a document in the desired format (either the default, or a format passed as a request attribute).
 
Methods inherited from class com.lowagie.servlets.OutputFilterBase
destroy, doFilter, dump, dump, getFilterConfig, prepareRequest, prepareResponse, sendError, setFilterConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PDF_OUTPUT_INT

public static final int PDF_OUTPUT_INT
See Also:
Constant Field Values

RTF_OUTPUT_INT

public static final int RTF_OUTPUT_INT
See Also:
Constant Field Values

XML_OUTPUT_INT

public static final int XML_OUTPUT_INT
See Also:
Constant Field Values

HTML_OUTPUT_INT

public static final int HTML_OUTPUT_INT
See Also:
Constant Field Values

CUSTOM_OUTPUT_INT

public static final int CUSTOM_OUTPUT_INT
See Also:
Constant Field Values

PDF_OUTPUT

public static final Integer PDF_OUTPUT
Constant for PDF output.


RTF_OUTPUT

public static final Integer RTF_OUTPUT
Constant for RTF output.


XML_OUTPUT

public static final Integer XML_OUTPUT
Constant for XML output.


HTML_OUTPUT

public static final Integer HTML_OUTPUT
Constant for HTML output.


CUSTOM_OUTPUT

public static final Integer CUSTOM_OUTPUT
Constant for custom writer output.


CONTENT_TYPES

private static final String[] CONTENT_TYPES

PAGE_SIZE_KEY

public static final String PAGE_SIZE_KEY
Request key where to store the desired page size.

See Also:
Constant Field Values

OUTPUT_TYPE_KEY

public static final String OUTPUT_TYPE_KEY
Request key where to store the desired output type.

See Also:
Constant Field Values

FILENAME_KEY

public static final String FILENAME_KEY
Request key where to store the desired filename to be sent to the browser.

See Also:
Constant Field Values

TAGMAP_KEY

public static final String TAGMAP_KEY
Request key where to store the desired tagmap to use in iText.

See Also:
Constant Field Values

DOCWRITER_KEY

public static final String DOCWRITER_KEY
Request key where to store the desired DocWriter class name.

See Also:
Constant Field Values

CONTENT_TYPE_KEY

public static final String CONTENT_TYPE_KEY
Request key where to store the desired Content Type to send for the custom DocWriter.

See Also:
Constant Field Values

pageSize

private Rectangle pageSize

outputType

private int outputType

docWriter

private String docWriter

contentType

private String contentType

PAGE_SIZE

private static final String PAGE_SIZE
See Also:
Constant Field Values

OUTPUT_TYPE

private static final String OUTPUT_TYPE
See Also:
Constant Field Values

CUSTOM_WRITER

private static final String CUSTOM_WRITER
See Also:
Constant Field Values

CONTENT_TYPE

private static final String CONTENT_TYPE
See Also:
Constant Field Values

INIT_PARAMS

private static final Class[] INIT_PARAMS

construtores

private final HashMap construtores
Constructor Detail

ITextOutputFilter

public ITextOutputFilter()
Method Detail

init

public void init(FilterConfig filterConfig)
          throws ServletException

Initializes the filter. Possible configuration parameters are:

Overrides:
init in class OutputFilterBase
Throws:
ServletException
See Also:
PageSize

perform

public void perform(ServletRequest request,
                    ServletResponse response,
                    InputStream data)
             throws Exception

Calls iText to turn the passed input stream into a document in the desired format (either the default, or a format passed as a request attribute). The input stream must contain a XML document in the format understood by iText. Currently, tag maps are not supported.

The following atributes may be provided in the request to modify the target document:

Specified by:
perform in class OutputFilterBase
Parameters:
request - The original request from the filter chain.
response - The original response from the filter chain.
data - The data collected from the called resources.
Throws:
Exception