pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.service.event
Class PDFOutputEvent

java.lang.Object
  extended by org.torweg.pulse.service.event.PDFOutputEvent
All Implemented Interfaces:
Event, ResultAwareEvent

public class PDFOutputEvent
extends java.lang.Object
implements ResultAwareEvent

Outputs a PDF via Fop.

Version:
$Revision: 2026 $
Author:
Thomas Weber, Daniel Dietz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.torweg.pulse.service.event.Event
Event.Disposition
 
Constructor Summary
PDFOutputEvent(XSLHandle xsl)
          creates a new PDFOutputEvent with the given XSL.
PDFOutputEvent(XSLHandle xsl, java.lang.String name, Event.Disposition contentDisposition)
          creates a new PDFOutputEvent as download with the given XSL.
 
Method Summary
 void addTemoraryResource(java.io.File file)
          adds a temporary resource.
 CacheMode getCacheMode()
          returns the CacheMode.
 Event.Disposition getDisposition()
          returns the Content-Dispostion.
 boolean isOutputEvent()
          returns true.
 boolean isSingularEvent()
          Indicates that the Event will only be added once to the EventManager and block all other Events.
 boolean isStopEvent()
          returns true.
 void run(ServiceRequest req)
          starts the PDF output base on the given XSL.
 void setCacheMode(CacheMode c)
          sets the CacheMode.
 void setDisposition(Event.Disposition disp)
          sets the Content-Disposition.
 void setResultSet(ResultSet rs)
          sets the ResultSet to be used for output generation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFOutputEvent

public PDFOutputEvent(XSLHandle xsl)
creates a new PDFOutputEvent with the given XSL.

Parameters:
xsl - the XSLT document to be used for generating the XSL-FO document

PDFOutputEvent

public PDFOutputEvent(XSLHandle xsl,
                      java.lang.String name, Event.Disposition contentDisposition)
creates a new PDFOutputEvent as download with the given XSL.

Parameters:
xsl - the XSLT document to be used for generating the XSL-FO document
name - the name for the PDF
contentDisposition - the content-disposition
Method Detail

isOutputEvent

public final boolean isOutputEvent()
returns true.

Specified by:
isOutputEvent in interface Event
Returns:
true
See Also:
Event.isOutputEvent()

isStopEvent

public final boolean isStopEvent()
returns true.

Specified by:
isStopEvent in interface Event
Returns:
true
See Also:
Event.isStopEvent()

isSingularEvent

public final boolean isSingularEvent()
Description copied from interface: Event
Indicates that the Event will only be added once to the EventManager and block all other Events.

If an Event of the same type has already been added to the EventManager, subsequent calls to EventManager.addEvent(Event) will return without adding the given Event.

Specified by:
isSingularEvent in interface Event
Returns:
true
See Also:
Event.isSingularEvent()

getCacheMode

public final CacheMode getCacheMode()
returns the CacheMode.

Specified by:
getCacheMode in interface Event
Returns:
the cache mode
See Also:
Event.getCacheMode()

setCacheMode

public final void setCacheMode(CacheMode c)
sets the CacheMode.

Specified by:
setCacheMode in interface Event
Parameters:
c - the cache mode to set
See Also:
Event.setCacheMode(org.torweg.pulse.service.request.CacheMode)

getDisposition

public final Event.Disposition getDisposition()
returns the Content-Dispostion.

Returns:
the disposition

setDisposition

public final void setDisposition(Event.Disposition disp)
sets the Content-Disposition.

Parameters:
disp - the disposition to set

run

public final void run(ServiceRequest req)
starts the PDF output base on the given XSL.

Specified by:
run in interface Event
Parameters:
req - the current request

setResultSet

public final void setResultSet(ResultSet rs)
sets the ResultSet to be used for output generation.

Specified by:
setResultSet in interface ResultAwareEvent
Parameters:
rs - the ResultSet to be used for output generation

addTemoraryResource

public final void addTemoraryResource(java.io.File file)
adds a temporary resource.

Parameters:
file - the resource