org.kuali.kfs.fp.document.service.impl
Class CashReceiptCoverSheetServiceImpl

java.lang.Object
  extended by org.kuali.kfs.fp.document.service.impl.CashReceiptCoverSheetServiceImpl
All Implemented Interfaces:
CashReceiptCoverSheetService

public class CashReceiptCoverSheetServiceImpl
extends Object
implements CashReceiptCoverSheetService

Implementation of service for handling creation of the cover sheet of the CashReceiptDocument


Field Summary
static String CR_COVERSHEET_TEMPLATE_NM
           
 
Constructor Summary
CashReceiptCoverSheetServiceImpl()
           
 
Method Summary
 void generateCoverSheet(CashReceiptDocument document, String searchPath, OutputStream returnStream)
          Generate a cover sheet for the CashReceiptDocument.
protected  float getCurrentRenderingYPosition()
          Defines a state of Y position for the text.
 org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
          Gets the dataDictionaryService attribute.
 org.kuali.rice.kns.service.DocumentHelperService getDocumentHelperService()
          Gets the documentHelperService attribute.
protected  com.lowagie.text.pdf.BaseFont getTextFont()
          Read-only accessor for BaseFont.
 boolean isCoverSheetPrintingAllowed(CashReceiptDocument crDoc)
          This method determines if cover sheet printing is allowed by reviewing the CashReceiptDocumentRule to see if the cover sheet is printable.
protected  void populateCheckDetail(CashReceiptDocument crDoc, com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.pdf.PdfReader reader)
          Method responsible for producing Check Detail section of the cover sheet.
protected  void setCurrentRenderingYPosition(float y)
          Defines a state of Y position for the text.
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
          Sets the dataDictionaryService attribute value.
 void setDocumentHelperService(org.kuali.rice.kns.service.DocumentHelperService documentHelperService)
          Sets the documentHelperService attribute value.
protected  void stampPdfFormValues(CashReceiptDocument document, String searchPath, OutputStream returnStream)
          Use iText PdfStamper to stamp information from CashReceiptDocument into field values on a PDF Form Template.
protected  com.lowagie.text.pdf.PdfContentByte startNewPage(com.lowagie.text.pdf.PdfWriter writer, com.lowagie.text.pdf.PdfReader reader, org.kuali.kfs.fp.document.service.impl.ModifiableInteger pageNumber)
          Responsible for creating a new PDF page and workspace through PdfContentByte for direct writing to the PDF.
protected  void writeCheckAmount(com.lowagie.text.pdf.PdfContentByte output, Check check)
          This method writes the check amount from the check provided to the PDF template.
protected  void writeCheckDate(com.lowagie.text.pdf.PdfContentByte output, Check check)
          This method writes the check date from the check provided to the PDF template.
protected  void writeCheckDescription(com.lowagie.text.pdf.PdfContentByte output, Check check)
          This method writes the check description from the check provided to the PDF template.
protected  void writeCheckField(com.lowagie.text.pdf.PdfContentByte output, float xPos, String fieldValue)
          This method writes out the value provided to the output provided and aligns the value outputted using the xPos float provided.
protected  void writeCheckNumber(com.lowagie.text.pdf.PdfContentByte output, Check check)
          This method writes the check number from the check provided to the PDF template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CR_COVERSHEET_TEMPLATE_NM

public static final String CR_COVERSHEET_TEMPLATE_NM
See Also:
Constant Field Values
Constructor Detail

CashReceiptCoverSheetServiceImpl

public CashReceiptCoverSheetServiceImpl()
Method Detail

isCoverSheetPrintingAllowed

public boolean isCoverSheetPrintingAllowed(CashReceiptDocument crDoc)
This method determines if cover sheet printing is allowed by reviewing the CashReceiptDocumentRule to see if the cover sheet is printable.

Specified by:
isCoverSheetPrintingAllowed in interface CashReceiptCoverSheetService
Parameters:
crDoc - The document the cover sheet is being printed for.
Returns:
True if the cover sheet is printable, false otherwise.
See Also:
CashReceiptCoverSheetService.isCoverSheetPrintingAllowed(org.kuali.kfs.fp.document.CashReceiptDocument), org.kuali.kfs.fp.document.validation.impl.CashReceiptDocumentRule#isCoverSheetPrintable(org.kuali.kfs.fp.document.CashReceiptFamilyBase)

generateCoverSheet

public void generateCoverSheet(CashReceiptDocument document,
                               String searchPath,
                               OutputStream returnStream)
                        throws Exception
Generate a cover sheet for the CashReceiptDocument. An OutputStream is written to for the cover sheet.

Specified by:
generateCoverSheet in interface CashReceiptCoverSheetService
Parameters:
document - The cash receipt document the cover sheet is for.
searchPath - The directory path to the template to be used to generate the cover sheet.
returnStream - The output stream the cover sheet will be written to.
Throws:
com.lowagie.text.DocumentException - Thrown if the document provided is invalid, including null.
IOException - Thrown if there is a problem writing to the output stream.
Exception - Thrown if there are any problems generating the cover sheet.
See Also:
org.kuali.rice.kns.module.financial.service.CashReceiptCoverSheetServiceImpl#generateCoverSheet( org.kuali.module.financial.documentCashReceiptDocument )

stampPdfFormValues

protected void stampPdfFormValues(CashReceiptDocument document,
                                  String searchPath,
                                  OutputStream returnStream)
                           throws Exception
Use iText PdfStamper to stamp information from CashReceiptDocument into field values on a PDF Form Template.

Parameters:
document - The cash receipt document the values will be pulled from.
searchPath - The directory path of the template to be used to generate the cover sheet.
returnStream - The output stream the cover sheet will be written to.
Throws:
Exception

writeCheckNumber

protected void writeCheckNumber(com.lowagie.text.pdf.PdfContentByte output,
                                Check check)
This method writes the check number from the check provided to the PDF template.

Parameters:
output - The PDF output field the check number will be written to.
check - The check the check number will be retrieved from.

writeCheckDate

protected void writeCheckDate(com.lowagie.text.pdf.PdfContentByte output,
                              Check check)
This method writes the check date from the check provided to the PDF template.

Parameters:
output - The PDF output field the check date will be written to.
check - The check the check date will be retrieved from.

writeCheckDescription

protected void writeCheckDescription(com.lowagie.text.pdf.PdfContentByte output,
                                     Check check)
This method writes the check description from the check provided to the PDF template.

Parameters:
output - The PDF output field the check description will be written to.
check - The check the check description will be retrieved from.

writeCheckAmount

protected void writeCheckAmount(com.lowagie.text.pdf.PdfContentByte output,
                                Check check)
This method writes the check amount from the check provided to the PDF template.

Parameters:
output - The PDF output field the check amount will be written to.
check - The check the check amount will be retrieved from.

writeCheckField

protected void writeCheckField(com.lowagie.text.pdf.PdfContentByte output,
                               float xPos,
                               String fieldValue)
This method writes out the value provided to the output provided and aligns the value outputted using the xPos float provided.

Parameters:
output - The content byte used to write out the field to the PDF template.
xPos - The x coordinate of the starting point on the document where the value will be written to.
fieldValue - The value to be written to the PDF cover sheet.

getTextFont

protected com.lowagie.text.pdf.BaseFont getTextFont()
                                             throws com.lowagie.text.DocumentException,
                                                    IOException
Read-only accessor for BaseFont. Used for creating the check detail information. The font being used is Helvetica.

Returns:
A BaseFont object used to identify what type of font is used on the cover sheet.
Throws:
com.lowagie.text.DocumentException
IOException

setCurrentRenderingYPosition

protected void setCurrentRenderingYPosition(float y)
Defines a state of Y position for the text.

Parameters:
y - The y coordinate to be set.

getCurrentRenderingYPosition

protected float getCurrentRenderingYPosition()
Defines a state of Y position for the text.

Returns:
The current y coordinate.

populateCheckDetail

protected void populateCheckDetail(CashReceiptDocument crDoc,
                                   com.lowagie.text.pdf.PdfWriter writer,
                                   com.lowagie.text.pdf.PdfReader reader)
                            throws Exception
Method responsible for producing Check Detail section of the cover sheet. Not all Cash Receipt documents have checks.

Parameters:
crDoc - The CashReceipt document the cover sheet is being created for.
writer - The output writer used to write the check data to the PDF file.
reader - The input reader used to read data from the PDF file.
Throws:
Exception

startNewPage

protected com.lowagie.text.pdf.PdfContentByte startNewPage(com.lowagie.text.pdf.PdfWriter writer,
                                                           com.lowagie.text.pdf.PdfReader reader,
                                                           org.kuali.kfs.fp.document.service.impl.ModifiableInteger pageNumber)
                                                    throws com.lowagie.text.DocumentException,
                                                           IOException
Responsible for creating a new PDF page and workspace through PdfContentByte for direct writing to the PDF.

Parameters:
writer - The PDF writer used to write to the new page with.
reader - The PDF reader used to read information from the PDF file.
pageNumber - The current number of pages in the PDF file, which will be incremented by one inside this method.
Returns:
The PDFContentByte used to access the new PDF page.
Throws:
com.lowagie.text.DocumentException
IOException

getDataDictionaryService

public org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
Gets the dataDictionaryService attribute.

Returns:
Returns the dataDictionaryService.

setDataDictionaryService

public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
Sets the dataDictionaryService attribute value.

Parameters:
dataDictionaryService - The dataDictionaryService to set.

getDocumentHelperService

public org.kuali.rice.kns.service.DocumentHelperService getDocumentHelperService()
Gets the documentHelperService attribute.

Returns:
Returns the documentHelperService.

setDocumentHelperService

public void setDocumentHelperService(org.kuali.rice.kns.service.DocumentHelperService documentHelperService)
Sets the documentHelperService attribute value.

Parameters:
documentHelperService - The documentHelperService to set.


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.