com.secondmove.wopdfreports
Class PDFPage

java.lang.Object
  extended bycom.webobjects.appserver.WOElement
      extended bycom.webobjects.appserver.WOComponent
          extended bycom.secondmove.wopdfreports.PDFPage
All Implemented Interfaces:
java.lang.Cloneable, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation.NSValidation, java.io.Serializable, com.webobjects.appserver.WOActionResults

public class PDFPage
extends com.webobjects.appserver.WOComponent

Version:
1.0a

The PDFPage component serves as a wrapper for the HTML2PDFConvertor class and simplifies the use of HTML2PDFConvertor from within WebObjects. You'll find an example application at /Developer/Examples/HTML2PDFConvertor/HTML2PDFConvertorMoviesExample

Author:
Jan Willem Luiten, Second Move the Netherlands
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.webobjects.appserver.WOComponent
com.webobjects.appserver.WOComponent._EventLoggingEnabler, com.webobjects.appserver.WOComponent.Event
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.DefaultImplementation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.Utility, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
 
Nested classes inherited from class com.webobjects.foundation.NSValidation
com.webobjects.foundation.NSValidation._MethodBinding, com.webobjects.foundation.NSValidation._ValidationBinding, com.webobjects.foundation.NSValidation.DefaultImplementation, com.webobjects.foundation.NSValidation.Utility, com.webobjects.foundation.NSValidation.ValidationException
 
Field Summary
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
_CLASS, NullValue
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSValidation
_CLASS
 
Constructor Summary
PDFPage(com.webobjects.appserver.WOContext context)
          Basic constructor
 
Method Summary
 void appendComponent(com.webobjects.appserver.WOComponent component)
          Has the component generate HTML, converts it to PDF and appends it to the document.
 void appendComponentWithDisplayGroupNamed(com.webobjects.appserver.WOComponent component, java.lang.String displayGroupName)
          Appends the HTML generated by the component for each of the batches in a displaygroup.
 void appendToResponse(com.webobjects.appserver.WOResponse aResponse, com.webobjects.appserver.WOContext aContext)
          Invokes the convertors' closeDocument method, retrieves the generated PDF document and presents it to the client (browser) by setting the necessary headers.
 HTML2PDFConvertor convertor()
           
 java.lang.String reportName()
          Returns the name of the report.
 void setConvertor(HTML2PDFConvertor convertor)
          Sets the HTML2PDFConvertor used for converting HTML to PDF
 void setReportName(java.lang.String newReportName)
          Sets the name of the report.
 
Methods inherited from class com.webobjects.appserver.WOComponent
_associationWithName, _awakeInContext, _childTemplate, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, invokeAction, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, reset, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, synchronizesVariablesWithBindings, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, template, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDFPage

public PDFPage(com.webobjects.appserver.WOContext context)
Basic constructor

Method Detail

appendToResponse

public void appendToResponse(com.webobjects.appserver.WOResponse aResponse,
                             com.webobjects.appserver.WOContext aContext)
Invokes the convertors' closeDocument method, retrieves the generated PDF document and presents it to the client (browser) by setting the necessary headers.


setConvertor

public void setConvertor(HTML2PDFConvertor convertor)
Sets the HTML2PDFConvertor used for converting HTML to PDF

Parameters:
convertor - The HTML2PDFConvertor used by the PDFPage instance to convert the HTML generated by other components to PDF format.
See Also:
appendComponent(WOComponent), HTML2PDFConvertor.createDocument()

convertor

public HTML2PDFConvertor convertor()
Returns:
the HTML2PDFConvertor.
See Also:
setConvertor(HTML2PDFConvertor)

reportName

public java.lang.String reportName()
Returns the name of the report.

Returns:
the name of the report. If no name was specified using setReportName "report.pdf" will be returned. This name is used in the attachment-header for the filename.

setReportName

public void setReportName(java.lang.String newReportName)
Sets the name of the report.

Parameters:
newReportName - the name for the report as used in the attachment-header for the filename

appendComponent

public void appendComponent(com.webobjects.appserver.WOComponent component)
Has the component generate HTML, converts it to PDF and appends it to the document.

Parameters:
component - The component used to generate HTML

appendComponentWithDisplayGroupNamed

public void appendComponentWithDisplayGroupNamed(com.webobjects.appserver.WOComponent component,
                                                 java.lang.String displayGroupName)
Appends the HTML generated by the component for each of the batches in a displaygroup. PDFPage uses the KeyValueCoding protocol to retrieve the actual WODisplayGroup instance from component by calling component.valueForKey(displayGroupName).

Parameters:
component - The component used to generate the HTML.
displayGroupName - The name of the WODisplayGroup instance in component.