org.kuali.kfs.module.bc.document.service.impl
Class BudgetRequestImportServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.bc.document.service.impl.BudgetRequestImportServiceImpl
All Implemented Interfaces:
BudgetRequestImportService

public class BudgetRequestImportServiceImpl
extends Object
implements BudgetRequestImportService

Contains services relevent to the budget construction import request process


Constructor Summary
BudgetRequestImportServiceImpl()
           
 
Method Summary
protected  void deleteBudgetConstructionMoveRecords(String principalId)
          Clears BudgetConstructionRequestMove
protected  List<BudgetConstructionFundingLock> findBudgetLocks(BudgetConstructionRequestMove record, Integer budgetYear)
           
 void generatePdf(List<String> errorMessages, ByteArrayOutputStream baos)
          Generates the log file
 BudgetParameterService getBudgetParameterService()
           
 org.kuali.rice.kns.service.DocumentHelperService getDocumentHelperService()
           
protected  org.kuali.rice.kns.service.DocumentService getDocumentService()
           
 ImportRequestDao getImportRequestDao()
           
 LaborModuleService getLaborModuleService()
           
protected  ObjectCode getObjectCode(BudgetConstructionRequestMove record, Integer budgetYear)
           
 OptionsService getOptionsService()
           
protected  SubObjectCode getSubObjectCode(BudgetConstructionRequestMove record, Integer budgetYear)
           
 List<String> loadBudget(org.kuali.rice.kim.bo.Person user, String fileType, Integer budgetYear)
          Loads all budget request records that do not have error codes
 List processImportFile(InputStream fileImportStream, String principalId, String fieldSeperator, String textDelimiter, String fileType, Integer budgetYear)
          Takes an import request file (either monthly or annual) and creates the BudgetConstructionMove objects for each line of the file.
 void setBudgetDocumentService(BudgetDocumentService budgetDocumentService)
          Sets BudgetDocumentService
 void setBudgetParameterService(BudgetParameterService budgetParameterService)
           
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          Sets the business object service
 void setDictionaryValidationService(org.kuali.rice.kns.service.DictionaryValidationService dictionaryValidationService)
           
 void setDocumentHelperService(org.kuali.rice.kns.service.DocumentHelperService documentHelperService)
           
 void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
           
 void setImportRequestDao(ImportRequestDao dao)
           
 void setLaborModuleService(LaborModuleService laborModuleService)
           
 void setLockService(LockService lockService)
           
 void setOptionsService(OptionsService optionsService)
           
protected  void udpateBenefits(String fileType, BudgetConstructionHeader header)
          Updates benefits
protected  String updateBudgetAmounts(String fileType, BudgetConstructionRequestMove importLine, BudgetConstructionHeader header, Integer budgetYear)
          updates budget amounts
 List<String> validateData(Integer budgetYear, String principalId)
          Checks the imported request records for valid data.
protected  String validateLine(BudgetConstructionRequestMove budgetConstructionRequestMove, int lineNumber, boolean isAnnual)
          Checks line validations and returns error messages for line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BudgetRequestImportServiceImpl

public BudgetRequestImportServiceImpl()
Method Detail

generatePdf

public void generatePdf(List<String> errorMessages,
                        ByteArrayOutputStream baos)
                 throws com.lowagie.text.DocumentException
Description copied from interface: BudgetRequestImportService
Generates the log file

Specified by:
generatePdf in interface BudgetRequestImportService
Throws:
com.lowagie.text.DocumentException
See Also:
BudgetRequestImportService.generatePdf(java.util.List, java.io.ByteArrayOutputStream)

processImportFile

@Transactional
public List processImportFile(InputStream fileImportStream,
                                            String principalId,
                                            String fieldSeperator,
                                            String textDelimiter,
                                            String fileType,
                                            Integer budgetYear)
                       throws IOException
Description copied from interface: BudgetRequestImportService
Takes an import request file (either monthly or annual) and creates the BudgetConstructionMove objects for each line of the file. If any errors are encounterd, file processing stops. If no errors are encountered an empty list is returned.

Specified by:
processImportFile in interface BudgetRequestImportService
Returns:
list of errors encountered during file processing
Throws:
IOException
See Also:
org.kuali.kfs.module.bc.document.service.BudgetRequestImportService#processImportFile(java.io.InputStream, java.lang.String, java.lang.String, java.lang.String)

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
Sets the business object service

Parameters:
businessObjectService -

validateData

@Transactional
public List<String> validateData(Integer budgetYear,
                                               String principalId)
Description copied from interface: BudgetRequestImportService
Checks the imported request records for valid data. Sets error codes on invalid records.

Specified by:
validateData in interface BudgetRequestImportService
Returns:
true if no data validation errors were found. false otherwise
See Also:
org.kuali.kfs.module.bc.document.service.BudgetRequestImportService#validateData()

loadBudget

@Transactional
public List<String> loadBudget(org.kuali.rice.kim.bo.Person user,
                                             String fileType,
                                             Integer budgetYear)
                        throws Exception
Description copied from interface: BudgetRequestImportService
Loads all budget request records that do not have error codes

Specified by:
loadBudget in interface BudgetRequestImportService
Returns:
Throws:
Exception
See Also:
org.kuali.kfs.module.bc.document.service.BudgetRequestImportService#loadBudget()

getImportRequestDao

public ImportRequestDao getImportRequestDao()
See Also:
org.kuali.kfs.module.bc.document.service.BudgetRequestImportService#getImportRequestDao()

setImportRequestDao

public void setImportRequestDao(ImportRequestDao dao)
See Also:
org.kuali.kfs.module.bc.document.service.BudgetRequestImportService#setImportRequestDao(org.kuali.kfs.module.bc.document.dataaccess.ImportRequestDao)

updateBudgetAmounts

protected String updateBudgetAmounts(String fileType,
                                     BudgetConstructionRequestMove importLine,
                                     BudgetConstructionHeader header,
                                     Integer budgetYear)
updates budget amounts

Parameters:
fileType -
importLine -
Returns:
error message

udpateBenefits

protected void udpateBenefits(String fileType,
                              BudgetConstructionHeader header)
Updates benefits

Parameters:
fileType -
importLine -

validateLine

protected String validateLine(BudgetConstructionRequestMove budgetConstructionRequestMove,
                              int lineNumber,
                              boolean isAnnual)
Checks line validations and returns error messages for line

Parameters:
budgetConstructionRequestMove -
lineNumber -
isAnnual -
Returns:

getObjectCode

protected ObjectCode getObjectCode(BudgetConstructionRequestMove record,
                                   Integer budgetYear)

getSubObjectCode

protected SubObjectCode getSubObjectCode(BudgetConstructionRequestMove record,
                                         Integer budgetYear)

findBudgetLocks

protected List<BudgetConstructionFundingLock> findBudgetLocks(BudgetConstructionRequestMove record,
                                                              Integer budgetYear)

deleteBudgetConstructionMoveRecords

protected void deleteBudgetConstructionMoveRecords(String principalId)
Clears BudgetConstructionRequestMove

Parameters:
principalId -

setDictionaryValidationService

public void setDictionaryValidationService(org.kuali.rice.kns.service.DictionaryValidationService dictionaryValidationService)
See Also:
org.kuali.kfs.module.bc.document.service.BudgetRequestImportService#setDictionaryValidationService(org.kuali.rice.kns.service.DictionaryValidationService)

setLockService

public void setLockService(LockService lockService)
See Also:
org.kuali.kfs.module.bc.document.service.BudgetRequestImportService#setLockService(org.kuali.kfs.module.bc.document.service.LockService)

setBudgetDocumentService

public void setBudgetDocumentService(BudgetDocumentService budgetDocumentService)
Sets BudgetDocumentService

Parameters:
budgetDocumentService -

setLaborModuleService

public void setLaborModuleService(LaborModuleService laborModuleService)

getLaborModuleService

public LaborModuleService getLaborModuleService()

getBudgetParameterService

public BudgetParameterService getBudgetParameterService()

setBudgetParameterService

public void setBudgetParameterService(BudgetParameterService budgetParameterService)

getOptionsService

public OptionsService getOptionsService()

setOptionsService

public void setOptionsService(OptionsService optionsService)

getDocumentHelperService

public org.kuali.rice.kns.service.DocumentHelperService getDocumentHelperService()

setDocumentHelperService

public void setDocumentHelperService(org.kuali.rice.kns.service.DocumentHelperService documentHelperService)

getDocumentService

protected org.kuali.rice.kns.service.DocumentService getDocumentService()

setDocumentService

public void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)


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