public class ReportWriterTextServiceImpl extends Object implements ReportWriterService, WrappingBatchService
ReportWriterService
interface. If you are a developer attempting to add a new business
object for error report writing, take a look at the Spring definitions for BusinessObjectReportHelper.BusinessObjectReportHelper
Modifier and Type | Field and Description |
---|---|
protected boolean |
aggregationModeOn |
protected Class<? extends org.kuali.rice.krad.bo.BusinessObject> |
businessObjectClass |
protected Map<Class<? extends org.kuali.rice.krad.bo.BusinessObject>,BusinessObjectReportHelper> |
businessObjectReportHelpers |
protected Map<Class<? extends org.kuali.rice.krad.bo.BusinessObject>,String> |
classToBusinessObjectReportHelperBeanNames
A map of BO classes to
BusinessObjectReportHelper bean names, to configure which BO's will be rendered by which
BusinessObjectReportHelper. |
protected org.kuali.rice.core.api.datetime.DateTimeService |
dateTimeService |
protected String |
errorFormat |
protected String |
errorSubTitle |
protected String |
fileNamePrefix |
protected String |
fileNameSuffix |
protected String |
filePath |
protected static int |
INITIAL_LINE_NUMBER |
protected int |
initialPageNumber |
protected int |
line |
protected boolean |
modeParameters |
protected boolean |
modeStatistics |
protected String |
newLineCharacter |
protected boolean |
newPage |
protected int |
page |
protected String |
pageLabel |
protected int |
pageLength |
protected int |
pageWidth |
protected PrintStream |
printStream |
protected String |
statisticsLabel |
protected String |
statisticsLeftPadding |
protected String |
title |
Constructor and Description |
---|
ReportWriterTextServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allFormattingEscaped(String format)
Determines if all formatting on the given String is escaped - ie, that it has no formatting
|
void |
destroy() |
protected Object[] |
escapeArguments(Object... args)
Iterates through array and escapes special formatting characters
|
protected String |
escapeFormatCharacters(String replacementString)
Escapes characters in a string that have special meaning for formatting
|
protected String |
generateFullFilePath() |
BusinessObjectReportHelper |
getBusinessObjectReportHelper(org.kuali.rice.krad.bo.BusinessObject businessObject)
get the business report helper for the given business object
|
BusinessObjectReportHelper |
getBusinessObjectReportHelper(Class<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjectClass)
get the business report helper for the given business object
|
String[] |
getMultipleFormattedMessageLines(String format,
Object... args)
This method...
|
String |
getParametersLabel()
Gets the parametersLabel attribute.
|
String |
getParametersLeftPadding()
Gets the parametersLeftPadding attribute.
|
void |
initialize() |
protected void |
initializeBusinessObjectReportHelpers() |
boolean |
isAggregationModeOn()
Gets the aggregationModeOn attribute.
|
void |
pageBreak()
Breaking the page and write a new header
|
void |
setAggregationModeOn(boolean aggregationModeOn)
Sets the aggregationModeOn attribute value.
|
void |
setClassToBusinessObjectReportHelperBeanNames(Map<Class<? extends org.kuali.rice.krad.bo.BusinessObject>,String> classToBusinessObjectReportHelperBeanNames)
Sets a map of BO classes to
BusinessObjectReportHelper bean names, to configure which BO's will be rendered by which
BusinessObjectReportHelper. |
void |
setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService)
Sets the DateTimeService
|
void |
setErrorSubTitle(String errorSubTitle)
Sets the errorSubTitle
|
void |
setFileNamePrefix(String fileNamePrefix)
Sets the fileNamePrefix
|
void |
setFileNameSuffix(String fileNameSuffix)
Sets the fileNameSuffix
|
void |
setFilePath(String filePath)
Sets the filePath
|
void |
setInitialPageNumber(int initialPageNumber)
Sets the initialPageNumber
|
void |
setNewLineCharacter(String newLineCharacter)
Sets the newLineCharacter
|
void |
setPageLabel(String pageLabel)
Sets the pageLabel
|
void |
setPageLength(int pageLength)
Sets the pageLength
|
void |
setPageWidth(int pageWidth)
Sets the pageWidth
|
void |
setParametersLabel(String parametersLabel)
Sets the parametersLabel attribute value.
|
void |
setParametersLeftPadding(String parametersLeftPadding)
Sets the parametersLeftPadding attribute value.
|
void |
setStatisticsLabel(String statisticsLabel)
Sets the statisticsLabel
|
void |
setStatisticsLeftPadding(String statisticsLeftPadding)
Sets the statisticsLeftPadding
|
void |
setTitle(String title)
Sets the title
|
void |
writeError(org.kuali.rice.krad.bo.BusinessObject businessObject,
List<Message> messages)
Same as writeError except that it provides for multiple messages for the BO.
|
void |
writeError(org.kuali.rice.krad.bo.BusinessObject businessObject,
Message message)
Writes an error message for the passed in business object.
|
void |
writeError(org.kuali.rice.krad.bo.BusinessObject businessObject,
Message message,
boolean printBusinessObjectValues) |
protected void |
writeErrorHeader(org.kuali.rice.krad.bo.BusinessObject businessObject)
Helper method to write the error header
|
void |
writeFormattedMessageLine(String format)
Pass through to PrintStream.printf except that it also handles pagination.
|
void |
writeFormattedMessageLine(String format,
Object... args)
Pass through to PrintStream.printf except that it also handles pagination.
|
protected void |
writeHeader(String title)
Helper method to write a header for placement at top of new page
|
void |
writeMultipleFormattedMessageLines(String[] messageLines)
write the given information as multiple lines if it contains more than one line breaks
|
protected void |
writeMultipleFormattedMessageLines(String[] messageLines,
String[] headerLinesInNewPage,
boolean isRowBreakAcrossPageAllowed)
write the given information as multiple lines if it contains more than one line breaks
|
void |
writeMultipleFormattedMessageLines(String format,
Object... args) |
void |
writeNewLines(int lines)
Writes "lines" number of newlines to the report
|
void |
writeParameterLine(String message,
Object... args)
Writes parameter usually placed at the end of the report.
|
void |
writeStatisticLine(String message,
Object... args)
Writes statistics usually placed at the end of the report.
|
void |
writeSubTitle(String message)
Writes a centered message.
|
void |
writeTable(List<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjects,
boolean isHeaderRepeatedInNewPage,
boolean isRowBreakAcrossPageAllowed)
Write table into a report for the given list of business objects
|
void |
writeTableHeader(org.kuali.rice.krad.bo.BusinessObject businessObject)
Write table header into a report for the given business object
|
void |
writeTableHeader(Class<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjectClass)
Writes out the table header, based on a business object class
|
void |
writeTableRow(org.kuali.rice.krad.bo.BusinessObject businessObject)
Write table row into a report for the given business object
|
void |
writeTableRowSeparationLine(org.kuali.rice.krad.bo.BusinessObject businessObject)
write a separation line in a table
|
void |
writeTableRowWithColspan(org.kuali.rice.krad.bo.BusinessObject businessObject)
Write table row into a report for the given business object and also take the colspan in account
|
protected static final int INITIAL_LINE_NUMBER
protected String fileNamePrefix
protected String fileNameSuffix
protected int pageWidth
protected int pageLength
protected int initialPageNumber
protected String errorSubTitle
protected String statisticsLabel
protected String statisticsLeftPadding
protected String newLineCharacter
protected org.kuali.rice.core.api.datetime.DateTimeService dateTimeService
protected boolean aggregationModeOn
protected Map<Class<? extends org.kuali.rice.krad.bo.BusinessObject>,String> classToBusinessObjectReportHelperBeanNames
BusinessObjectReportHelper
bean names, to configure which BO's will be rendered by which
BusinessObjectReportHelper. This property should be configured via the spring bean definitionprotected Map<Class<? extends org.kuali.rice.krad.bo.BusinessObject>,BusinessObjectReportHelper> businessObjectReportHelpers
protected PrintStream printStream
protected int page
protected int line
protected String errorFormat
protected boolean modeStatistics
protected boolean modeParameters
protected boolean newPage
protected Class<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjectClass
public ReportWriterTextServiceImpl()
public void initialize()
initialize
in interface WrappingBatchService
WrappingBatchService.initialize()
protected void initializeBusinessObjectReportHelpers()
protected String generateFullFilePath()
public void destroy()
destroy
in interface WrappingBatchService
WrappingBatchService.destroy()
public void writeSubTitle(String message)
ReportWriterService
writeSubTitle
in interface ReportWriterService
message
- to be written centeredReportWriterService.writeSubTitle(java.lang.String)
public void writeError(org.kuali.rice.krad.bo.BusinessObject businessObject, Message message)
ReportWriterService
writeError
in interface ReportWriterService
businessObject
- controlling the table header and values to be printedmessage
- associated with the businessObjectorg.kuali.ole.sys.service.ReportWriterService#writeError(java.lang.Class, org.kuali.ole.sys.Message)
public void writeError(org.kuali.rice.krad.bo.BusinessObject businessObject, Message message, boolean printBusinessObjectValues)
printBusinessObjectValues
- indicates whether the bo values should be printed before the messageorg.kuali.ole.sys.service.ReportWriterService#writeError(java.lang.Class, org.kuali.ole.sys.Message)
public void writeError(org.kuali.rice.krad.bo.BusinessObject businessObject, List<Message> messages)
ReportWriterService
writeError
in interface ReportWriterService
businessObject
- controlling the table header and values to be printedmessages
- associated with the businessObjectorg.kuali.ole.sys.service.ReportWriterService#writeError(java.lang.Class, java.util.List)
public void writeNewLines(int lines)
ReportWriterService
writeNewLines
in interface ReportWriterService
lines
- number of newlines to write to the reportReportWriterService.writeNewLines(int)
public void writeStatisticLine(String message, Object... args)
ReportWriterService
writeStatisticLine
in interface ReportWriterService
message
- to writeargs
- for the message per standard String.formatReportWriterService.writeStatisticLine(java.lang.String, java.lang.Object[])
public void writeParameterLine(String message, Object... args)
ReportWriterService
writeParameterLine
in interface ReportWriterService
message
- to writeargs
- for the message per standard String.formatReportWriterService.writeParameterLine(java.lang.String, java.lang.Object[])
public void writeFormattedMessageLine(String format)
ReportWriterService
writeFormattedMessageLine
in interface ReportWriterService
ReportWriterService.writeFormattedMessageLine(java.lang.String)
public void writeFormattedMessageLine(String format, Object... args)
ReportWriterService
writeFormattedMessageLine
in interface ReportWriterService
ReportWriterService.writeFormattedMessageLine(java.lang.String, java.lang.Object[])
protected boolean allFormattingEscaped(String format)
format
- the format to testpublic void pageBreak()
ReportWriterService
pageBreak
in interface ReportWriterService
ReportWriterService.pageBreak()
protected void writeHeader(String title)
title
- that should be printed on this headerprotected void writeErrorHeader(org.kuali.rice.krad.bo.BusinessObject businessObject)
businessObject
- to print header forpublic void writeTableHeader(org.kuali.rice.krad.bo.BusinessObject businessObject)
ReportWriterService
writeTableHeader
in interface ReportWriterService
businessObject
- the given business objectReportWriterService.writeTableHeader(org.kuali.rice.krad.bo.BusinessObject)
public void writeTableHeader(Class<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjectClass)
writeTableHeader
in interface ReportWriterService
businessObjectClass
- the class to write the header out forpublic void writeTableRowSeparationLine(org.kuali.rice.krad.bo.BusinessObject businessObject)
ReportWriterService
writeTableRowSeparationLine
in interface ReportWriterService
businessObject
- the given business objectReportWriterService.writeTableRow(org.kuali.rice.krad.bo.BusinessObject)
public void writeTableRow(org.kuali.rice.krad.bo.BusinessObject businessObject)
ReportWriterService
writeTableRow
in interface ReportWriterService
businessObject
- the given business objectReportWriterService.writeTableRow(org.kuali.rice.krad.bo.BusinessObject)
public void writeTableRowWithColspan(org.kuali.rice.krad.bo.BusinessObject businessObject)
ReportWriterService
writeTableRowWithColspan
in interface ReportWriterService
businessObject
- the given business objectReportWriterService.writeTableRowWithColspan(org.kuali.rice.krad.bo.BusinessObject)
public void writeTable(List<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjects, boolean isHeaderRepeatedInNewPage, boolean isRowBreakAcrossPageAllowed)
ReportWriterService
writeTable
in interface ReportWriterService
businessObjects
- the given business objectsisHeaderRepeatedInNewPage
- instruct if the header row needs to be repeated in a new pageisRowBreakAcrossPageAllowed
- determine whether a row can be broken across pagesReportWriterService.writeTable(java.util.List, boolean, boolean)
public BusinessObjectReportHelper getBusinessObjectReportHelper(org.kuali.rice.krad.bo.BusinessObject businessObject)
businessObject
- the given business objectpublic BusinessObjectReportHelper getBusinessObjectReportHelper(Class<? extends org.kuali.rice.krad.bo.BusinessObject> businessObjectClass)
businessObject
- the given business objectprotected void writeMultipleFormattedMessageLines(String[] messageLines, String[] headerLinesInNewPage, boolean isRowBreakAcrossPageAllowed)
format
- the given text format definitionmessageLines
- the given information being written outheaderLinesInNewPage
- the given header lines being written in the begin of a new pagepublic void writeMultipleFormattedMessageLines(String[] messageLines)
format
- the given text format definitionargs
- the given information being written outpublic void writeMultipleFormattedMessageLines(String format, Object... args)
writeMultipleFormattedMessageLines
in interface ReportWriterService
public String[] getMultipleFormattedMessageLines(String format, Object... args)
format
- args
- protected Object[] escapeArguments(Object... args)
args
- Object array to processprotected String escapeFormatCharacters(String replacementString)
replacementString
- string to escapeOLEConstants.ReportConstants.FORMAT_ESCAPE_CHARACTERS
public void setFilePath(String filePath)
filePath
- The filePath to set.public void setFileNamePrefix(String fileNamePrefix)
fileNamePrefix
- The fileNamePrefix to set.public void setFileNameSuffix(String fileNameSuffix)
fileNameSuffix
- The fileNameSuffix to set.public void setPageWidth(int pageWidth)
pageWidth
- The pageWidth to set.public void setPageLength(int pageLength)
pageLength
- The pageLength to set.public void setInitialPageNumber(int initialPageNumber)
initialPageNumber
- The initialPageNumber to set.public void setErrorSubTitle(String errorSubTitle)
errorSubTitle
- The errorSubTitle to set.public void setStatisticsLabel(String statisticsLabel)
statisticsLabel
- The statisticsLabel to set.public void setStatisticsLeftPadding(String statisticsLeftPadding)
statisticsLeftPadding
- The statisticsLeftPadding to set.public void setPageLabel(String pageLabel)
pageLabel
- The pageLabel to set.public void setNewLineCharacter(String newLineCharacter)
newLineCharacter
- The newLineCharacter to set.public void setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService)
dateTimeService
- The DateTimeService to set.public void setClassToBusinessObjectReportHelperBeanNames(Map<Class<? extends org.kuali.rice.krad.bo.BusinessObject>,String> classToBusinessObjectReportHelperBeanNames)
BusinessObjectReportHelper
bean names, to configure which BO's will be rendered by which
BusinessObjectReportHelper. This property should be configured via the spring bean definitionclassToBusinessObjectReportHelperBeanNames
- The classToBusinessObjectReportHelperBeanNames to set.public String getParametersLabel()
public void setParametersLabel(String parametersLabel)
parametersLabel
- The parametersLabel to set.public String getParametersLeftPadding()
public void setParametersLeftPadding(String parametersLeftPadding)
parametersLeftPadding
- The parametersLeftPadding to set.public boolean isAggregationModeOn()
public void setAggregationModeOn(boolean aggregationModeOn)
aggregationModeOn
- The aggregationModeOn to set.Copyright © 2004–2015 The Kuali Foundation. All rights reserved.