org.kuali.kfs.gl.document.service.impl
Class CorrectionDocumentServiceImpl

java.lang.Object
  extended by org.kuali.kfs.gl.document.service.impl.CorrectionDocumentServiceImpl
All Implemented Interfaces:
CorrectionDocumentService
Direct Known Subclasses:
LaborCorrectionDocumentServiceImpl

@Transactional
public class CorrectionDocumentServiceImpl
extends Object
implements CorrectionDocumentService

The base implementaiton of CorrectionDocumentService


Nested Class Summary
protected  class CorrectionDocumentServiceImpl.CorrectionFileFilter
           
protected static class CorrectionDocumentServiceImpl.GlcpFilenameFilter
           
 
Field Summary
protected static String CORRECTION_FILE_FILTER
           
protected  CorrectionChangeDao correctionChangeDao
           
protected  CorrectionChangeGroupDao correctionChangeGroupDao
           
protected  CorrectionCriteriaDao correctionCriteriaDao
           
protected  CorrectionDocumentDao correctionDocumentDao
           
protected  org.kuali.rice.kns.service.DateTimeService dateTimeService
           
protected  org.kuali.rice.kns.dao.DocumentDao documentDao
           
protected static String GLCP_OUTPUT_PREFIX
           
protected static String INPUT_ORIGIN_ENTRIES_FILE_SUFFIX
           
protected  org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService
           
protected static org.apache.log4j.Logger LOG
           
protected  OriginEntryGroupService originEntryGroupService
           
protected static String OUTPUT_ORIGIN_ENTRIES_FILE_SUFFIX
           
protected  ReportAggregatorService reportAggregatorService
           
protected  String reportFilenamePrefix
           
protected  String reportFilenameSuffix
           
protected  String reportsDirectory
           
protected  String temporaryReportFilenameComponent
           
protected  String temporaryReportFilenameSuffix
           
protected  String temporaryReportsDirectory
           
 
Fields inherited from interface org.kuali.kfs.gl.document.service.CorrectionDocumentService
CORRECTION_TYPE_CRITERIA, CORRECTION_TYPE_MANUAL, CORRECTION_TYPE_REMOVE_GROUP_FROM_PROCESSING, SYSTEM_DATABASE, SYSTEM_UPLOAD, UNLIMITED_ABORT_THRESHOLD
 
Constructor Summary
CorrectionDocumentServiceImpl()
           
 
Method Summary
 void aggregateCorrectionDocumentReports(GeneralLedgerCorrectionProcessDocument document)
           
 boolean areInputOriginEntriesPersisted(GeneralLedgerCorrectionProcessDocument document)
          Returns true if and only if the file corresponding to this document's input origin entries are on the file system.
 boolean areOutputOriginEntriesPersisted(GeneralLedgerCorrectionProcessDocument document)
          Returns true if and only if the file corresponding to this document's output origin entries are on the file system.
protected  String buildFileExtensionWithDate(Date date)
           
 String createOutputFileForProcessing(String docId, Date today)
           
 GeneralLedgerCorrectionProcessDocument findByCorrectionDocumentHeaderId(String docId)
          Retrieves a correction document by the document id
 List findByDocumentHeaderIdAndCorrectionGroupNumber(String docId, int i)
          Finds CollectionChange records associated with a given document id and correction change group.
 CorrectionChangeGroup findByDocumentNumberAndCorrectionChangeGroupNumber(String docId, int i)
          Returns a specific correction change group for a GLCP document.
 List findByDocumentNumberAndCorrectionGroupNumber(String docId, int i)
          Finds Collection Criteria associated with the given GLCP document and group.
 String[] findExistingCorrectionOutputFilesForDocument(String documentNumber)
          Finds any existing output files for the given document.
 void generateCorrectionReport(GeneralLedgerCorrectionProcessDocument document)
          Generate a text report for the given correction document
protected  String generateInputOriginEntryFileName(GeneralLedgerCorrectionProcessDocument document)
          Generates the file name that input origin entries should be retrieved from
protected  String generateInputOriginEntryFileName(String docId)
          Generates the file name that input origin entries should be retrieved from
protected  String generateOutputOriginEntryFileName(GeneralLedgerCorrectionProcessDocument document)
          Generates the file name that output origin entries should be written to
 String generateOutputOriginEntryFileName(String docId)
          Generates the file name that output origin entries should be written to
protected  File getAggregatedReportFile(String documentNumber)
           
 String getBatchFileDirectoryName()
           
 Collection<GeneralLedgerCorrectionProcessDocument> getCorrectionDocumentsFinalizedOn(Date date)
          Retrieves all of the documents that were finalized on a certain date
protected  DocumentNumberAwareReportWriterService getGlCorrectionDocumentReportWriterService()
           
 String getGlcpDirectoryName()
          Gets the glcpDirectoryName attribute.
 org.kuali.rice.kns.service.KualiConfigurationService getKualiConfigurationService()
          Gets the kualiConfigurationService attribute.
 OriginEntryGroupService getOriginEntryGroupService()
          Gets the originEntryGroupService attribute.
 OriginEntryService getOriginEntryService()
          Gets the originEntryService attribute.
protected  String getOriginEntryStagingDirectoryPath()
          Gets the name of the directory to save all these temporary files in
protected  List<File> getReportsToAggregateIntoReport(String documentNumber)
           
 List<org.kuali.rice.kns.web.ui.Column> getTableRenderColumnMetadata(String docId)
          Returns metadata to help render columns in the GLCP.
protected  BufferedOutputStream openEntryOutputStreamForOutputGroup(GeneralLedgerCorrectionProcessDocument document)
          Opens an Output Stream to write Origin Entries to
 void persistInputOriginEntriesForInitiatedOrSavedDocument(GeneralLedgerCorrectionProcessDocument document, Iterator<OriginEntryFull> entries)
          This method persists an Iterator of input origin entries for a document that is in the initiated or saved state
protected  void persistOriginEntries(String fullPathUniqueFileName, Iterator<OriginEntryFull> entries)
          Saves an interator of Origin Entry records to the given file name
 void persistOriginEntryGroupsForDocumentSave(GeneralLedgerCorrectionProcessDocument document, CorrectionDocumentEntryMetadata correctionDocumentEntryMetadata)
          Saves the input and output origin entry groups for a document prior to saving the document
 void persistOutputOriginEntriesForInitiatedOrSavedDocument(GeneralLedgerCorrectionProcessDocument document, Iterator<OriginEntryFull> entries)
          This method persists an Iterator of output origin entries for a document that is in the initiated or saved state
 void removePersistedInputOriginEntries(GeneralLedgerCorrectionProcessDocument document)
          Removes input origin entries that were saved to the database associated with the given document
 void removePersistedInputOriginEntries(String docId)
          Removes input origin entries that were saved to the database associated with the given document
protected  void removePersistedOriginEntries(String fullPathUniqueFileName)
          Removes a file of origin entries.
 void removePersistedOutputOriginEntries(GeneralLedgerCorrectionProcessDocument document)
          Removes all output origin entries persisted in the database created by the given document
 void removePersistedOutputOriginEntries(String docId)
          Removes all output origin entries persisted in the database created by the given document
 List<OriginEntryFull> retrievePersistedInputOriginEntries(GeneralLedgerCorrectionProcessDocument document, int abortThreshold)
          retrieves input origin entries that have been persisted for this document
 Iterator<OriginEntryFull> retrievePersistedInputOriginEntriesAsIterator(GeneralLedgerCorrectionProcessDocument document)
          Retrieves input origin entries that have been persisted for this document in an iterator.
protected  List<OriginEntryFull> retrievePersistedOriginEntries(String fullPathUniqueFileName, int abortThreshold)
          Reads a file of origin entries and returns a List of those entry records
protected  Iterator<OriginEntryFull> retrievePersistedOriginEntriesAsIterator(String fullPathUniqueFileName)
          Reads origin entries from a file to an iterator
 List<OriginEntryFull> retrievePersistedOutputOriginEntries(GeneralLedgerCorrectionProcessDocument document, int abortThreshold)
          retrieves output origin entries that have been persisted for this document
 Iterator<OriginEntryFull> retrievePersistedOutputOriginEntriesAsIterator(GeneralLedgerCorrectionProcessDocument document)
          Retrieves output origin entries that have been persisted for this document in an iterator.
 void setBatchFileDirectoryName(String batchFileDirectoryName)
           
 void setCorrectionChangeDao(CorrectionChangeDao correctionChangeDao)
           
 void setCorrectionChangeGroupDao(CorrectionChangeGroupDao correctionChangeGroupDao)
           
 void setCorrectionCriteriaDao(CorrectionCriteriaDao correctionCriteriaDao)
           
 void setCorrectionDocumentDao(CorrectionDocumentDao correctionDocumentDao)
           
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
          Sets the dateTimeService attribute value.
 void setDocumentDao(org.kuali.rice.kns.dao.DocumentDao documentDao)
           
 void setGlCorrectionDocumentReportWriterService(DocumentNumberAwareReportWriterService glCorrectionDocumentReportWriterService)
           
 void setGlcpDirectoryName(String glcpDirectoryName)
          Sets the glcpDirectoryName attribute value.
 void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)
          Sets the kualiConfigurationService attribute value.
 void setOriginEntryGroupService(OriginEntryGroupService originEntryGroupService)
          Sets the originEntryGroupService attribute value.
 void setOriginEntryService(OriginEntryService originEntryService)
          Sets the originEntryService attribute value.
 void setReportAggregatorService(ReportAggregatorService reportAggregatorService)
          Sets the reportAggregatorService attribute value.
 void setReportFilenamePrefix(String reportFilenamePrefix)
          Sets the reportFilenamePrefix attribute value.
 void setReportFilenameSuffix(String reportFilenameSuffix)
          Sets the reportFilenameSuffix attribute value.
 void setReportsDirectory(String reportsDirectory)
          Sets the reportsDirectory attribute value.
 void setTemporaryReportFilenameComponent(String temporaryReportFilenameComponent)
          Sets the temporaryReportFilenameComponent attribute value.
 void setTemporaryReportFilenameSuffix(String temporaryReportFilenameSuffix)
          Sets the temporaryReportFilenameSuffix attribute value.
 void setTemporaryReportsDirectory(String temporaryReportsDirectory)
          Sets the temporaryReportsDirectory attribute value.
 void writePersistedInputOriginEntriesToStream(GeneralLedgerCorrectionProcessDocument document, OutputStream out)
          Writes out the persisted input origin entries in an OutputStream in a flat file format\
protected  void writePersistedOriginEntriesToStream(String fullPathUniqueFileName, OutputStream out)
          Writes origin entries to an output stream
 void writePersistedOutputOriginEntriesToStream(GeneralLedgerCorrectionProcessDocument document, OutputStream out)
          Writes out the persisted output origin entries in an OutputStream in a flat file format\
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG

correctionChangeGroupDao

protected CorrectionChangeGroupDao correctionChangeGroupDao

correctionChangeDao

protected CorrectionChangeDao correctionChangeDao

correctionCriteriaDao

protected CorrectionCriteriaDao correctionCriteriaDao

documentDao

protected org.kuali.rice.kns.dao.DocumentDao documentDao

kualiConfigurationService

protected org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService

originEntryGroupService

protected OriginEntryGroupService originEntryGroupService

dateTimeService

protected org.kuali.rice.kns.service.DateTimeService dateTimeService

reportAggregatorService

protected ReportAggregatorService reportAggregatorService

temporaryReportsDirectory

protected String temporaryReportsDirectory

temporaryReportFilenameComponent

protected String temporaryReportFilenameComponent

temporaryReportFilenameSuffix

protected String temporaryReportFilenameSuffix

reportsDirectory

protected String reportsDirectory

reportFilenamePrefix

protected String reportFilenamePrefix

reportFilenameSuffix

protected String reportFilenameSuffix

INPUT_ORIGIN_ENTRIES_FILE_SUFFIX

protected static final String INPUT_ORIGIN_ENTRIES_FILE_SUFFIX
See Also:
Constant Field Values

OUTPUT_ORIGIN_ENTRIES_FILE_SUFFIX

protected static final String OUTPUT_ORIGIN_ENTRIES_FILE_SUFFIX
See Also:
Constant Field Values

GLCP_OUTPUT_PREFIX

protected static final String GLCP_OUTPUT_PREFIX
See Also:
Constant Field Values

CORRECTION_FILE_FILTER

protected static final String CORRECTION_FILE_FILTER
See Also:
Constant Field Values

correctionDocumentDao

protected CorrectionDocumentDao correctionDocumentDao
Constructor Detail

CorrectionDocumentServiceImpl

public CorrectionDocumentServiceImpl()
Method Detail

findByDocumentNumberAndCorrectionChangeGroupNumber

public CorrectionChangeGroup findByDocumentNumberAndCorrectionChangeGroupNumber(String docId,
                                                                                int i)
Returns a specific correction change group for a GLCP document. Defers to DAO.

Specified by:
findByDocumentNumberAndCorrectionChangeGroupNumber in interface CorrectionDocumentService
Parameters:
docId - the document id of a GLCP document
i - the number of the correction group within the document
Returns:
a CorrectionChangeGroup
See Also:
CorrectionDocumentService.findByDocumentNumberAndCorrectionChangeGroupNumber(java.lang.String, int)

findByDocumentHeaderIdAndCorrectionGroupNumber

public List findByDocumentHeaderIdAndCorrectionGroupNumber(String docId,
                                                           int i)
Finds CollectionChange records associated with a given document id and correction change group. Defers to DAO

Specified by:
findByDocumentHeaderIdAndCorrectionGroupNumber in interface CorrectionDocumentService
Parameters:
docId - the document id of a GLCP document
i - the number of the correction group within the document
Returns:
a List of qualifying CorrectionChange records
See Also:
CorrectionDocumentService.findByDocumentHeaderIdAndCorrectionGroupNumber(java.lang.String, int)

findByDocumentNumberAndCorrectionGroupNumber

public List findByDocumentNumberAndCorrectionGroupNumber(String docId,
                                                         int i)
Finds Collection Criteria associated with the given GLCP document and group. Defers to DAO.

Specified by:
findByDocumentNumberAndCorrectionGroupNumber in interface CorrectionDocumentService
Parameters:
docId - the document id of a GLCP document
i - the number of the correction group within the document
Returns:
a List of qualifying CorrectionCriteria
See Also:
CorrectionDocumentService.findByDocumentNumberAndCorrectionGroupNumber(java.lang.String, int)

findByCorrectionDocumentHeaderId

public GeneralLedgerCorrectionProcessDocument findByCorrectionDocumentHeaderId(String docId)
Retrieves a correction document by the document id

Specified by:
findByCorrectionDocumentHeaderId in interface CorrectionDocumentService
Parameters:
docId - the document id of the GLCP to find
Returns:
a CorrectionDocument if found
See Also:
CorrectionDocumentService.findByCorrectionDocumentHeaderId(java.lang.String)

setCorrectionChangeDao

public void setCorrectionChangeDao(CorrectionChangeDao correctionChangeDao)

setCorrectionChangeGroupDao

public void setCorrectionChangeGroupDao(CorrectionChangeGroupDao correctionChangeGroupDao)

setCorrectionCriteriaDao

public void setCorrectionCriteriaDao(CorrectionCriteriaDao correctionCriteriaDao)

setDocumentDao

public void setDocumentDao(org.kuali.rice.kns.dao.DocumentDao documentDao)

getTableRenderColumnMetadata

public List<org.kuali.rice.kns.web.ui.Column> getTableRenderColumnMetadata(String docId)
Returns metadata to help render columns in the GLCP. Do not modify this list or the contents in this list.

Specified by:
getTableRenderColumnMetadata in interface CorrectionDocumentService
Parameters:
docId - the document id of a GLCP document
Returns:
a List of Columns to render
See Also:
CorrectionDocumentService.getTableRenderColumnMetadata(java.lang.String)

generateInputOriginEntryFileName

protected String generateInputOriginEntryFileName(GeneralLedgerCorrectionProcessDocument document)
Generates the file name that input origin entries should be retrieved from

Parameters:
document - a GLCP document
Returns:
the name of the file to read

generateOutputOriginEntryFileName

protected String generateOutputOriginEntryFileName(GeneralLedgerCorrectionProcessDocument document)
Generates the file name that output origin entries should be written to

Parameters:
document - a GLCP document
Returns:
the name of the file to write to

generateInputOriginEntryFileName

protected String generateInputOriginEntryFileName(String docId)
Generates the file name that input origin entries should be retrieved from

Parameters:
docId - the document id of a GLCP document
Returns:
the name of the file to read input origin entries in from

generateOutputOriginEntryFileName

public String generateOutputOriginEntryFileName(String docId)
Generates the file name that output origin entries should be written to

Specified by:
generateOutputOriginEntryFileName in interface CorrectionDocumentService
Parameters:
docId - the document id of a GLCP document
Returns:
the name of the file to write output origin entries to

persistInputOriginEntriesForInitiatedOrSavedDocument

public void persistInputOriginEntriesForInitiatedOrSavedDocument(GeneralLedgerCorrectionProcessDocument document,
                                                                 Iterator<OriginEntryFull> entries)
This method persists an Iterator of input origin entries for a document that is in the initiated or saved state

Specified by:
persistInputOriginEntriesForInitiatedOrSavedDocument in interface CorrectionDocumentService
Parameters:
document - an initiated or saved document
entries - an Iterator of origin entries
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#persistOriginEntriesToFile(java.lang.String, java.util.Iterator)

persistOutputOriginEntriesForInitiatedOrSavedDocument

public void persistOutputOriginEntriesForInitiatedOrSavedDocument(GeneralLedgerCorrectionProcessDocument document,
                                                                  Iterator<OriginEntryFull> entries)
This method persists an Iterator of output origin entries for a document that is in the initiated or saved state

Specified by:
persistOutputOriginEntriesForInitiatedOrSavedDocument in interface CorrectionDocumentService
Parameters:
document - an initiated or saved document
entries - an Iterator of origin entries
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#persistOutputOriginEntriesForInitiatedOrSavedDocument(org.kuali.kfs.gl.document.CorrectionDocument, java.util.Iterator)

persistOriginEntries

protected void persistOriginEntries(String fullPathUniqueFileName,
                                    Iterator<OriginEntryFull> entries)
Saves an interator of Origin Entry records to the given file name

Parameters:
fullPathUniqueFileName - the name of the file to write entries to
entries - entries to write

openEntryOutputStreamForOutputGroup

protected BufferedOutputStream openEntryOutputStreamForOutputGroup(GeneralLedgerCorrectionProcessDocument document)
                                                            throws IOException
Opens an Output Stream to write Origin Entries to

Parameters:
document - the GLCP document which has the origin entries to write
Returns:
an OutputStream to write to
Throws:
IOException - if the file cannot be successfully opened

removePersistedInputOriginEntries

public void removePersistedInputOriginEntries(GeneralLedgerCorrectionProcessDocument document)
Removes input origin entries that were saved to the database associated with the given document

Specified by:
removePersistedInputOriginEntries in interface CorrectionDocumentService
Parameters:
document - a GLCP document
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#removePersistedInputOriginEntriesForInitiatedOrSavedDocument(org.kuali.kfs.gl.document.CorrectionDocument)

removePersistedOutputOriginEntries

public void removePersistedOutputOriginEntries(GeneralLedgerCorrectionProcessDocument document)
Removes all output origin entries persisted in the database created by the given document

Specified by:
removePersistedOutputOriginEntries in interface CorrectionDocumentService
Parameters:
document - a GLCP document
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#removePersistedOutputOriginEntriesForInitiatedOrSavedDocument(org.kuali.kfs.gl.document.CorrectionDocument)

removePersistedInputOriginEntries

public void removePersistedInputOriginEntries(String docId)
Removes input origin entries that were saved to the database associated with the given document

Specified by:
removePersistedInputOriginEntries in interface CorrectionDocumentService
Parameters:
docId - the document id of a GLCP document
See Also:
CorrectionDocumentService.removePersistedInputOriginEntries(java.lang.String)

removePersistedOutputOriginEntries

public void removePersistedOutputOriginEntries(String docId)
Removes all output origin entries persisted in the database created by the given document

Specified by:
removePersistedOutputOriginEntries in interface CorrectionDocumentService
Parameters:
docId - the document id of a GLCP document
See Also:
CorrectionDocumentService.removePersistedOutputOriginEntries(java.lang.String)

removePersistedOriginEntries

protected void removePersistedOriginEntries(String fullPathUniqueFileName)
Removes a file of origin entries. Just deletes the whole thing!

Parameters:
fullPathUniqueFileName - the file name of the file holding origin entries

retrievePersistedInputOriginEntries

public List<OriginEntryFull> retrievePersistedInputOriginEntries(GeneralLedgerCorrectionProcessDocument document,
                                                                 int abortThreshold)
retrieves input origin entries that have been persisted for this document

Specified by:
retrievePersistedInputOriginEntries in interface CorrectionDocumentService
Parameters:
document - the document
abortThreshold - if the file exceeds this number of rows, then null is returned. UNLIMITED_ABORT_THRESHOLD signifies that there is no limit
Returns:
the list, or null if there are too many origin entries
Throws:
RuntimeException - several reasons, primarily relating to underlying persistence layer problems
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#retrievePersistedInputOriginEntries(org.kuali.kfs.gl.document.CorrectionDocument, int)

retrievePersistedOutputOriginEntries

public List<OriginEntryFull> retrievePersistedOutputOriginEntries(GeneralLedgerCorrectionProcessDocument document,
                                                                  int abortThreshold)
retrieves output origin entries that have been persisted for this document

Specified by:
retrievePersistedOutputOriginEntries in interface CorrectionDocumentService
Parameters:
document - the document
abortThreshold - if the file exceeds this number of rows, then null is returned. UNLIMITED_ABORT_THRESHOLD signifies that there is no limit
Returns:
the list, or null if there are too many origin entries
Throws:
RuntimeException - several reasons, primarily relating to underlying persistence layer problems
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#retrievePersistedOutputOriginEntries(org.kuali.kfs.gl.document.CorrectionDocument, int)

retrievePersistedOriginEntries

protected List<OriginEntryFull> retrievePersistedOriginEntries(String fullPathUniqueFileName,
                                                               int abortThreshold)
Reads a file of origin entries and returns a List of those entry records

Parameters:
fullPathUniqueFileName - the file name of the file to read
abortThreshold - if more entries than this need to be read...well, they just won't get read
Returns:
a List of OriginEntryFulls

retrievePersistedInputOriginEntriesAsIterator

public Iterator<OriginEntryFull> retrievePersistedInputOriginEntriesAsIterator(GeneralLedgerCorrectionProcessDocument document)
Retrieves input origin entries that have been persisted for this document in an iterator. Implementations of this method may choose to implement this method in a way that consumes very little memory.

Specified by:
retrievePersistedInputOriginEntriesAsIterator in interface CorrectionDocumentService
Parameters:
document - the document
Returns:
the iterator
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#retrievePersistedInputOriginEntriesAsIterator(org.kuali.kfs.gl.document.CorrectionDocument)

retrievePersistedOutputOriginEntriesAsIterator

public Iterator<OriginEntryFull> retrievePersistedOutputOriginEntriesAsIterator(GeneralLedgerCorrectionProcessDocument document)
Retrieves output origin entries that have been persisted for this document in an iterator. Implementations of this method may choose to implement this method in a way that consumes very little memory.

Specified by:
retrievePersistedOutputOriginEntriesAsIterator in interface CorrectionDocumentService
Parameters:
document - the document
Returns:
the iterator
Throws:
RuntimeException - several reasons, primarily relating to underlying persistence layer problems
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#retrievePersistedOutputOriginEntriesAsIterator(org.kuali.kfs.gl.document.CorrectionDocument)

retrievePersistedOriginEntriesAsIterator

protected Iterator<OriginEntryFull> retrievePersistedOriginEntriesAsIterator(String fullPathUniqueFileName)
Reads origin entries from a file to an iterator

Parameters:
fullPathUniqueFileName - the file name to read from
Returns:
an Iterator of OriginEntries

areInputOriginEntriesPersisted

public boolean areInputOriginEntriesPersisted(GeneralLedgerCorrectionProcessDocument document)
Returns true if and only if the file corresponding to this document's input origin entries are on the file system.

Specified by:
areInputOriginEntriesPersisted in interface CorrectionDocumentService
Parameters:
document - a GLCP document
Returns:
Returns true if system should store origin entries, false otherwise
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#areInputOriginEntriesPersisted(org.kuali.kfs.gl.document.CorrectionDocument)

areOutputOriginEntriesPersisted

public boolean areOutputOriginEntriesPersisted(GeneralLedgerCorrectionProcessDocument document)
Returns true if and only if the file corresponding to this document's output origin entries are on the file system.

Specified by:
areOutputOriginEntriesPersisted in interface CorrectionDocumentService
Parameters:
document - a GLCP document to query
Returns:
true if origin entries are stored to the system, false otherwise
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#areOutputOriginEntriesPersisted(org.kuali.kfs.gl.document.CorrectionDocument)

writePersistedInputOriginEntriesToStream

public void writePersistedInputOriginEntriesToStream(GeneralLedgerCorrectionProcessDocument document,
                                                     OutputStream out)
                                              throws IOException
Writes out the persisted input origin entries in an OutputStream in a flat file format\

Specified by:
writePersistedInputOriginEntriesToStream in interface CorrectionDocumentService
Parameters:
document - a GLCP document
out - axn open and ready output stream
Throws:
IOException - thrown if IOExceptions occurred in writing the persisted origin entries
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#writePersistedInputOriginEntriesToStream(java.io.OutputStream)

writePersistedOutputOriginEntriesToStream

public void writePersistedOutputOriginEntriesToStream(GeneralLedgerCorrectionProcessDocument document,
                                                      OutputStream out)
                                               throws IOException
Writes out the persisted output origin entries in an OutputStream in a flat file format\

Specified by:
writePersistedOutputOriginEntriesToStream in interface CorrectionDocumentService
Parameters:
document - a GLCP document
out - axn open and ready output stream
Throws:
IOException - thrown if IOExceptions occurred in writing the persisted origin entries
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#writePersistedOutputOriginEntriesToStream(java.io.OutputStream)

writePersistedOriginEntriesToStream

protected void writePersistedOriginEntriesToStream(String fullPathUniqueFileName,
                                                   OutputStream out)
                                            throws IOException
Writes origin entries to an output stream

Parameters:
fullPathUniqueFileName - the name of the file to write to
out - an output stream to write to
Throws:
IOException - thrown if problems occur during writing

createOutputFileForProcessing

public String createOutputFileForProcessing(String docId,
                                            Date today)
Specified by:
createOutputFileForProcessing in interface CorrectionDocumentService

buildFileExtensionWithDate

protected String buildFileExtensionWithDate(Date date)

persistOriginEntryGroupsForDocumentSave

public void persistOriginEntryGroupsForDocumentSave(GeneralLedgerCorrectionProcessDocument document,
                                                    CorrectionDocumentEntryMetadata correctionDocumentEntryMetadata)
Saves the input and output origin entry groups for a document prior to saving the document

Specified by:
persistOriginEntryGroupsForDocumentSave in interface CorrectionDocumentService
Parameters:
document - a GLCP document
correctionDocumentEntryMetadata - metadata about this GLCP document
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#persistOriginEntryGroupsForDocumentSave(org.kuali.kfs.gl.document.CorrectionDocument, org.kuali.kfs.gl.document.web.CorrectionDocumentEntryMetadata)

generateCorrectionReport

public void generateCorrectionReport(GeneralLedgerCorrectionProcessDocument document)
Description copied from interface: CorrectionDocumentService
Generate a text report for the given correction document

Specified by:
generateCorrectionReport in interface CorrectionDocumentService
Parameters:
document - GLCP document to report on
See Also:
CorrectionDocumentService.generateCorrectionReport(org.kuali.kfs.gl.document.GeneralLedgerCorrectionProcessDocument)

getOriginEntryStagingDirectoryPath

protected String getOriginEntryStagingDirectoryPath()
Gets the name of the directory to save all these temporary files in

Returns:
the name of a directory path

getKualiConfigurationService

public org.kuali.rice.kns.service.KualiConfigurationService getKualiConfigurationService()
Gets the kualiConfigurationService attribute.

Returns:
Returns the kualiConfigurationService.

setKualiConfigurationService

public void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)
Sets the kualiConfigurationService attribute value.

Parameters:
kualiConfigurationService - The kualiConfigurationService to set.

getOriginEntryService

public OriginEntryService getOriginEntryService()
Gets the originEntryService attribute.

Returns:
Returns the originEntryService.

setOriginEntryService

public void setOriginEntryService(OriginEntryService originEntryService)
Sets the originEntryService attribute value.

Parameters:
originEntryService - The originEntryService to set.

getGlcpDirectoryName

public String getGlcpDirectoryName()
Gets the glcpDirectoryName attribute.

Specified by:
getGlcpDirectoryName in interface CorrectionDocumentService
Returns:
Returns the glcpDirectoryName.

setGlcpDirectoryName

public void setGlcpDirectoryName(String glcpDirectoryName)
Sets the glcpDirectoryName attribute value.

Parameters:
glcpDirectoryName - The glcpDirectoryName to set.

getOriginEntryGroupService

public OriginEntryGroupService getOriginEntryGroupService()
Gets the originEntryGroupService attribute.

Returns:
Returns the originEntryGroupService.

setOriginEntryGroupService

public void setOriginEntryGroupService(OriginEntryGroupService originEntryGroupService)
Sets the originEntryGroupService attribute value.

Parameters:
originEntryGroupService - The originEntryGroupService to set.

getCorrectionDocumentsFinalizedOn

public Collection<GeneralLedgerCorrectionProcessDocument> getCorrectionDocumentsFinalizedOn(Date date)
Description copied from interface: CorrectionDocumentService
Retrieves all of the documents that were finalized on a certain date

Specified by:
getCorrectionDocumentsFinalizedOn in interface CorrectionDocumentService
Parameters:
date - the date to find GLCP documents finalized on
Returns:
a collection of documents
See Also:
CorrectionDocumentService.getCorrectionDocumentsFinalizedOn(java.sql.Date)

setCorrectionDocumentDao

public void setCorrectionDocumentDao(CorrectionDocumentDao correctionDocumentDao)

setBatchFileDirectoryName

public void setBatchFileDirectoryName(String batchFileDirectoryName)

getBatchFileDirectoryName

public String getBatchFileDirectoryName()
Specified by:
getBatchFileDirectoryName in interface CorrectionDocumentService

getGlCorrectionDocumentReportWriterService

protected DocumentNumberAwareReportWriterService getGlCorrectionDocumentReportWriterService()
Returns:
Returns the glCorrectionDocumentReportWriterService.

setGlCorrectionDocumentReportWriterService

public void setGlCorrectionDocumentReportWriterService(DocumentNumberAwareReportWriterService glCorrectionDocumentReportWriterService)
Parameters:
glCorrectionDocumentReportWriterService - The glCorrectionDocumentReportWriterService to set.

aggregateCorrectionDocumentReports

public void aggregateCorrectionDocumentReports(GeneralLedgerCorrectionProcessDocument document)
Specified by:
aggregateCorrectionDocumentReports in interface CorrectionDocumentService
See Also:
org.kuali.kfs.gl.document.service.CorrectionDocumentService#aggregateCorrectionDocumentReports()

getAggregatedReportFile

protected File getAggregatedReportFile(String documentNumber)

getReportsToAggregateIntoReport

protected List<File> getReportsToAggregateIntoReport(String documentNumber)

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
Sets the dateTimeService attribute value.

Parameters:
dateTimeService - The dateTimeService to set.

setReportAggregatorService

public void setReportAggregatorService(ReportAggregatorService reportAggregatorService)
Sets the reportAggregatorService attribute value.

Parameters:
reportAggregatorService - The reportAggregatorService to set.

setTemporaryReportsDirectory

public void setTemporaryReportsDirectory(String temporaryReportsDirectory)
Sets the temporaryReportsDirectory attribute value.

Parameters:
temporaryReportsDirectory - The temporaryReportsDirectory to set.

setTemporaryReportFilenameComponent

public void setTemporaryReportFilenameComponent(String temporaryReportFilenameComponent)
Sets the temporaryReportFilenameComponent attribute value.

Parameters:
temporaryReportFilenameComponent - The temporaryReportFilenameComponent to set.

setTemporaryReportFilenameSuffix

public void setTemporaryReportFilenameSuffix(String temporaryReportFilenameSuffix)
Sets the temporaryReportFilenameSuffix attribute value.

Parameters:
temporaryReportFilenameSuffix - The temporaryReportFilenameSuffix to set.

setReportsDirectory

public void setReportsDirectory(String reportsDirectory)
Sets the reportsDirectory attribute value.

Parameters:
reportsDirectory - The reportsDirectory to set.

setReportFilenamePrefix

public void setReportFilenamePrefix(String reportFilenamePrefix)
Sets the reportFilenamePrefix attribute value.

Parameters:
reportFilenamePrefix - The reportFilenamePrefix to set.

setReportFilenameSuffix

public void setReportFilenameSuffix(String reportFilenameSuffix)
Sets the reportFilenameSuffix attribute value.

Parameters:
reportFilenameSuffix - The reportFilenameSuffix to set.

findExistingCorrectionOutputFilesForDocument

public String[] findExistingCorrectionOutputFilesForDocument(String documentNumber)
Description copied from interface: CorrectionDocumentService
Finds any existing output files for the given document. Used to prevent double-processing.

Specified by:
findExistingCorrectionOutputFilesForDocument in interface CorrectionDocumentService
Returns:


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