org.kuali.kfs.sys.web.struts
Class KualiAccountingDocumentFormBase

java.lang.Object
  extended by org.apache.struts.action.ActionForm
      extended by org.kuali.rice.kns.web.struts.pojo.PojoFormBase
          extended by org.kuali.rice.kns.web.struts.form.KualiForm
              extended by org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase
                  extended by org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase
                      extended by org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentFormBase
                          extended by org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase
All Implemented Interfaces:
Serializable, org.kuali.rice.kns.web.struts.pojo.PojoForm
Direct Known Subclasses:
AdvanceDepositForm, AssetPaymentForm, BudgetAdjustmentForm, CashReceiptForm, CreditCardReceiptForm, CustomerInvoiceDocumentForm, DisbursementVoucherForm, DistributionOfIncomeAndExpenseForm, GeneralErrorCorrectionForm, IndirectCostAdjustmentForm, InternalBillingForm, LaborDocumentFormBase, NonCheckDisbursementForm, PreEncumbranceForm, ProcurementCardForm, PurchasingAccountsPayableFormBase, TransferOfFundsForm, VoucherForm

public class KualiAccountingDocumentFormBase
extends FinancialSystemTransactionalDocumentFormBase

This class is the base action form for all financial documents.

See Also:
Serialized Form

Field Summary
protected  Map editableAccounts
           
protected  Map forcedLookupOptionalFields
           
protected  boolean hideDetails
           
protected static org.apache.log4j.Logger LOG
           
protected  SourceAccountingLine newSourceLine
           
protected  TargetAccountingLine newTargetLine
           
protected  org.apache.struts.upload.FormFile sourceFile
           
protected  org.apache.struts.upload.FormFile targetFile
           
 
Fields inherited from class org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase
forcedReadOnlyFields
 
Fields inherited from class org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase
adHocActionRequestCodes, attachmentFile, documentActions, editingMode, suppressAllButtons
 
Fields inherited from class org.kuali.rice.kns.web.struts.form.KualiForm
extraButtons
 
Fields inherited from class org.kuali.rice.kns.web.struts.pojo.PojoFormBase
requiredNonEditableProperties
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
KualiAccountingDocumentFormBase()
          This constructor sets up empty instances for the dependent objects...
 
Method Summary
protected  SourceAccountingLine createNewSourceAccountingLine(AccountingDocument financialDocument)
           
protected  TargetAccountingLine createNewTargetAccountingLine(AccountingDocument financialDocument)
           
protected  void customInitMaxUploadSizes()
          Adds the accounting line file size to the list of max file sizes.
 String getAccountingLineImportInstructionsUrl()
           
 String getCurrencyFormattedSourceTotal()
          Retrieves the source accounting lines total in a currency format with commas.
 String getCurrencyFormattedTargetTotal()
          Retrieves the source accounting lines total in a currency format with commas.
 Map getEditableAccounts()
           
protected  List<String> getExcludedmethodToCall()
          get the names of the methods to call that can be excluded from the "be used" check.
 AccountingDocument getFinancialDocument()
          This method retrieves an instance of the form.
 Map getForcedLookupOptionalFields()
          A Map of names of optional accounting line fields that require a quickfinder.
 boolean getHideDetails()
           
 SourceAccountingLine getNewSourceLine()
           
 TargetAccountingLine getNewTargetLine()
           
 org.apache.struts.upload.FormFile getSourceFile()
           
 org.apache.struts.upload.FormFile getTargetFile()
           
protected  List<AccountingLine> harvestAccountingLines(List lines)
          This method takes a generic list, hopefully with some AccountingLine objects in it, and returns a list of AccountingLine objects, because Java generics are just so wonderful.
 boolean isHideDetails()
           
 void populate(javax.servlet.http.HttpServletRequest request)
          Overrides the parent to call super.populate and then to call the accounting lines populate method that is specific to loading the two select lists on the page.
protected  void populateAccountingLine(AccountingLine line, String accountingLinePropertyName, Map parameterMap)
          Populates the dependent fields of objects contained within the given accountingLine
protected  void populateAccountingLines(Map parameterMap)
          This method iterates over all of the source lines and all of the target lines in a transactional document, and calls prepareAccountingLineForValidationAndPersistence on each one.
protected  void populateAccountingLinesForResponse(String methodToCall, Map parameterMap)
          Populates the accounting lines which need to be updated to successfully complete a response to the request
 void populateSourceAccountingLine(SourceAccountingLine sourceLine, String accountingLinePropertyName, Map parameterMap)
          Populates a source accounting line bo using values from the struts form.
 void populateTargetAccountingLine(TargetAccountingLine targetLine, String accountingLinePropertyName, Map parameterMap)
          Populates a target accounting line bo using values from the struts form.
protected  void repopulateOverrides(AccountingLine line, String accountingLinePropertyName, Map parameterMap)
          This repopulates the override values from the request
 void setEditableAccounts(Map editableAccounts)
           
 void setForcedLookupOptionalFields(Map fieldMap)
          A Map of names of optional accounting line fields that require a quickfinder.
 void setHideDetails(boolean hideDetails)
           
 void setNewSourceLine(SourceAccountingLine newIncomeLine)
           
 void setNewTargetLine(TargetAccountingLine newExpenseLine)
           
 void setSourceFile(org.apache.struts.upload.FormFile sourceFile)
           
 void setTargetFile(org.apache.struts.upload.FormFile targetFile)
           
 boolean shouldMethodToCallParameterBeUsed(String methodToCallParameterName, String methodToCallParameterValue, javax.servlet.http.HttpServletRequest request)
           
 
Methods inherited from class org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentFormBase
extendDocInfoToThreeColumns, generateErrorCorrectionButton, getExtraButtons, populateHeaderFields
 
Methods inherited from class org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase
discoverDocumentTypeName, formatReversalDate, getForcedReadOnlyFields, getTransactionalDocument, instantiateTransactionalDocumentByDocumentTypeName, populateEmptyMultiSelect, populateFalseCheckboxes, populationSpecialEmptyFields, setForcedReadOnlyFields
 
Methods inherited from class org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase
addRequiredNonEditableProperties, buildHtmlLink, getAdditionalScriptFile, getAdditionalScriptFiles, getAdHocActionRequestCodes, getAdHocRoutePerson, getAdHocRoutePersons, getAdHocRouteWorkgroup, getAdHocRouteWorkgroups, getAnnotation, getAttachmentFile, getBoNotes, getCommand, getDefaultDocumentTypeName, getDocId, getDocNum, getDocTypeName, getDocument, getDocumentActions, getDocumentHandlerUrl, getEditingMode, getErrorMapFromPreviousRequest, getFormKey, getInitiator, getInitiatorNetworkId, getMessageMapFromPreviousRequest, getNewAdHocRoutePerson, getNewAdHocRouteWorkgroup, getNewNote, getPersonInquiryUrlLink, getStandardHeaderFields, getWorkflowDocument, hasDocumentId, initializeHeaderNavigationTabs, instantiateDocument, isDocumentEnRoute, isFormDocumentInitialized, isHasWorkflowDocument, isReturnToActionList, isSuppressAllButtons, isUserDocumentInitiator, reset, setAdditionalScriptFile, setAdditionalScriptFiles, setAdHocActionRequestCodes, setAdHocRoutePersons, setAdHocRouteWorkgroups, setAnnotation, setAttachmentFile, setBoNotes, setCommand, setDerivedValuesOnForm, setDocId, setDocNum, setDocTypeName, setDocument, setDocumentActions, setEditingMode, setErrorMapFromPreviousRequest, setFormKey, setMessageMapFromPreviousRequest, setNewAdHocRoutePerson, setNewAdHocRouteWorkgroup, setNewNote, setReturnToActionList, setSuppressAllButtons, shouldPropertyBePopulatedInForm, validate
 
Methods inherited from class org.kuali.rice.kns.web.struts.form.KualiForm
clearEditablePropertyInformation, getActionFormUtilMap, getAnchor, getBackLocation, getCurrentTabIndex, getDisplayedErrors, getDisplayedInfo, getDisplayedWarnings, getDocInfo, getExtraButton, getFieldNameToFocusOnAfterSubmit, getHeaderNavigationTabs, getMethodToCall, getNavigationCss, getNextArbitrarilyHighIndex, getNumColumns, getRefreshCaller, getTabState, getTabStates, incrementTabIndex, isFieldLevelHelpEnabled, populateBackLocation, populateFieldLevelHelpEnabled, reset, retrieveFormValueForLookupInquiryParameters, setActionFormUtilMap, setAnchor, setBackLocation, setCurrentTabIndex, setDocInfo, setExtraButton, setExtraButtons, setFieldLevelHelpEnabled, setFieldNameToFocusOnAfterSubmit, setHeaderNavigationTabs, setMethodToCall, setNavigationCss, setNumColumns, setRefreshCaller, setTabStates
 
Methods inherited from class org.kuali.rice.kns.web.struts.pojo.PojoFormBase
addMaxUploadSize, cacheUnconvertedValue, copyPopulateEditablePropertiesToActionEditableProperties, formatterClassForKeypath, formatValue, getActionEditablePropertiesGuid, getEditableProperties, getFormatter, getFormatterTypes, getIsNewForm, getMaxUploadSizes, getMethodToCallsToBypassSessionRetrievalForGETRequests, getParameter, getParameterValues, getPopulateEditableProperties, getPopulateEditablePropertiesGuid, getPropertyType, getRequiredNonEditableProperties, getStrutsActionMappingScope, getUnconvertedValues, getUnknownKeys, initMaxUploadSizes, isPropertyEditable, isPropertyNonEditableButRequired, populateForProperty, postprocessRequestParameters, processValidationFail, registerEditableProperty, registerIsNewForm, registerRequiredNonEditableProperty, registerStrutsActionMappingScope, setActionEditablePropertiesGuid, setFormatterType, setFormatterTypes, setPopulateEditablePropertiesGuid, setUnconvertedValues
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, setMultipartRequestHandler, setServlet, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG

newSourceLine

protected SourceAccountingLine newSourceLine

newTargetLine

protected TargetAccountingLine newTargetLine

editableAccounts

protected Map editableAccounts

forcedLookupOptionalFields

protected Map forcedLookupOptionalFields

sourceFile

protected org.apache.struts.upload.FormFile sourceFile

targetFile

protected org.apache.struts.upload.FormFile targetFile

hideDetails

protected boolean hideDetails
Constructor Detail

KualiAccountingDocumentFormBase

public KualiAccountingDocumentFormBase()
This constructor sets up empty instances for the dependent objects...

Method Detail

populate

public void populate(javax.servlet.http.HttpServletRequest request)
Overrides the parent to call super.populate and then to call the accounting lines populate method that is specific to loading the two select lists on the page.

Specified by:
populate in interface org.kuali.rice.kns.web.struts.pojo.PojoForm
Overrides:
populate in class org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase
See Also:
PojoForm.populate(javax.servlet.http.HttpServletRequest)

populateAccountingLinesForResponse

protected void populateAccountingLinesForResponse(String methodToCall,
                                                  Map parameterMap)
Populates the accounting lines which need to be updated to successfully complete a response to the request

Parameters:
methodToCall - the method to call in the action to complete this request transaction
parameterMap - the map of parameters which came in with the transaction

populateAccountingLines

protected void populateAccountingLines(Map parameterMap)
This method iterates over all of the source lines and all of the target lines in a transactional document, and calls prepareAccountingLineForValidationAndPersistence on each one. This is called because a user could have updated already existing accounting lines that had blank values in composite key fields.

Parameters:
parameterMap - the map of parameters that were sent in with the request

populateSourceAccountingLine

public void populateSourceAccountingLine(SourceAccountingLine sourceLine,
                                         String accountingLinePropertyName,
                                         Map parameterMap)
Populates a source accounting line bo using values from the struts form. This is in place to make sure that all of the composite key objects have the correct values in them. This should be overridden by children forms in the situation where document level attributes need to be pushed down into the accounting lines.

Parameters:
sourceLine -
accountingLinePropertyName - the property path from the form to the accounting line
parameterMap - the map of parameters that were sent in with the request

populateTargetAccountingLine

public void populateTargetAccountingLine(TargetAccountingLine targetLine,
                                         String accountingLinePropertyName,
                                         Map parameterMap)
Populates a target accounting line bo using values from the struts form. This is in place to make sure that all of the composite key objects have the correct values in them. This should be overridden by children forms in the situation where document level attributes need to be pushed down into the accounting lines.

Parameters:
targetLine -
accountingLinePropertyName - the property path from the form to the accounting line
parameterMap - the map of parameters that were sent in with the request

populateAccountingLine

protected void populateAccountingLine(AccountingLine line,
                                      String accountingLinePropertyName,
                                      Map parameterMap)
Populates the dependent fields of objects contained within the given accountingLine

Parameters:
line -
accountingLinePropertyName - the property path from the form to the accounting line
parameterMap - the map of parameters that were sent in with the request

repopulateOverrides

protected void repopulateOverrides(AccountingLine line,
                                   String accountingLinePropertyName,
                                   Map parameterMap)
This repopulates the override values from the request

Parameters:
line - the line to repopulate override values for
accountingLinePropertyName - the property path from the form to the accounting line
parameterMap - the map of parameters that were sent in with the request

getFinancialDocument

public AccountingDocument getFinancialDocument()
This method retrieves an instance of the form.

Returns:

getNewTargetLine

public TargetAccountingLine getNewTargetLine()
Returns:
Returns the newTargetLine.

setNewTargetLine

public void setNewTargetLine(TargetAccountingLine newExpenseLine)
Parameters:
newExpenseLine - The newTargetLine to set.

getNewSourceLine

public SourceAccountingLine getNewSourceLine()
Returns:
Returns the newSourceLine.

setNewSourceLine

public void setNewSourceLine(SourceAccountingLine newIncomeLine)
Parameters:
newIncomeLine - The newSourceLine to set.

getSourceFile

public org.apache.struts.upload.FormFile getSourceFile()
Returns:
Returns the sourceFile.

setSourceFile

public void setSourceFile(org.apache.struts.upload.FormFile sourceFile)
Parameters:
sourceFile - The sourceFile to set.

getTargetFile

public org.apache.struts.upload.FormFile getTargetFile()
Returns:
Returns the targetFile.

setTargetFile

public void setTargetFile(org.apache.struts.upload.FormFile targetFile)
Parameters:
targetFile - The targetFile to set.

getEditableAccounts

public Map getEditableAccounts()
Returns:
current Map of editableAccounts

setEditableAccounts

public void setEditableAccounts(Map editableAccounts)
Parameters:
editableAccounts - the account Map to set

isHideDetails

public boolean isHideDetails()
Returns:
hideDetails attribute

getHideDetails

public boolean getHideDetails()
Returns:
hideDetails attribute
See Also:
isHideDetails()

setHideDetails

public void setHideDetails(boolean hideDetails)
Parameters:
hideDetails -

getCurrencyFormattedSourceTotal

public String getCurrencyFormattedSourceTotal()
Retrieves the source accounting lines total in a currency format with commas.

Returns:
String

getCurrencyFormattedTargetTotal

public String getCurrencyFormattedTargetTotal()
Retrieves the source accounting lines total in a currency format with commas.

Returns:
String

getAccountingLineImportInstructionsUrl

public String getAccountingLineImportInstructionsUrl()
Returns:
the URL to the accounting line import instructions

createNewSourceAccountingLine

protected SourceAccountingLine createNewSourceAccountingLine(AccountingDocument financialDocument)
Parameters:
financialDocument -
Returns:
a new source accounting line for the document

createNewTargetAccountingLine

protected TargetAccountingLine createNewTargetAccountingLine(AccountingDocument financialDocument)
Parameters:
financialDocument -
Returns:
a new target accounting line for the documet

harvestAccountingLines

protected List<AccountingLine> harvestAccountingLines(List lines)
This method takes a generic list, hopefully with some AccountingLine objects in it, and returns a list of AccountingLine objects, because Java generics are just so wonderful.

Parameters:
lines - a list of objects
Returns:
a list of the accounting lines that were in the lines parameter

setForcedLookupOptionalFields

public void setForcedLookupOptionalFields(Map fieldMap)
A Map of names of optional accounting line fields that require a quickfinder.


getForcedLookupOptionalFields

public Map getForcedLookupOptionalFields()
A Map of names of optional accounting line fields that require a quickfinder.

Returns:
a Map of fields

customInitMaxUploadSizes

protected void customInitMaxUploadSizes()
Adds the accounting line file size to the list of max file sizes.

Overrides:
customInitMaxUploadSizes in class org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase
See Also:
PojoFormBase.customInitMaxUploadSizes()

shouldMethodToCallParameterBeUsed

public boolean shouldMethodToCallParameterBeUsed(String methodToCallParameterName,
                                                 String methodToCallParameterValue,
                                                 javax.servlet.http.HttpServletRequest request)
Overrides:
shouldMethodToCallParameterBeUsed in class org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase
See Also:
KualiDocumentFormBase.shouldMethodToCallParameterBeUsed(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest)

getExcludedmethodToCall

protected List<String> getExcludedmethodToCall()
get the names of the methods to call that can be excluded from the "be used" check.

Returns:
the names of the methods to call that can be excluded from the "be used" check


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