org.kuali.kfs.module.purap.document.web.struts
Class PurchasingAccountsPayableActionBase

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.apache.struts.actions.DispatchAction
          extended by org.kuali.rice.kns.web.struts.action.KualiAction
              extended by org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
                  extended by org.kuali.rice.kns.web.struts.action.KualiTransactionalDocumentActionBase
                      extended by org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentActionBase
                          extended by org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase
                              extended by org.kuali.kfs.module.purap.document.web.struts.PurchasingAccountsPayableActionBase
Direct Known Subclasses:
AccountsPayableActionBase, PurchasingActionBase

public class PurchasingAccountsPayableActionBase
extends KualiAccountingDocumentActionBase

Struts Action for Purchasing and Accounts Payable documents


Field Summary
 
Fields inherited from class org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase
LOG, UPDATE_EVENT_ACTIONS
 
Fields inherited from class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
DOCUMENT_LOAD_COMMANDS
 
Fields inherited from class org.kuali.rice.kns.web.struts.action.KualiAction
FORM_ACTION, FORWARD_NEXT, FORWARD_TEXT_AREA_UPDATE, METHOD_TO_CALL, POST_TEXT_AREA_TO_PARENT, TEXT_AREA_FIELD_ANCHOR, TEXT_AREA_FIELD_LABEL, TEXT_AREA_FIELD_NAME, TEXT_AREA_MAX_LENGTH, TEXT_AREA_READ_ONLY
 
Fields inherited from class org.apache.struts.actions.DispatchAction
clazz, log, messages, methods, types
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
PurchasingAccountsPayableActionBase()
           
 
Method Summary
 org.apache.struts.action.ActionForward calculate(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Perform calculation on item line.
 org.apache.struts.action.ActionForward clearAllTaxes(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  SourceAccountingLine customAccountRetrieval(int accountIndex, PurchasingAccountsPayableFormBase purchasingAccountsPayableForm)
          Perform custom processing on accounting lines.
protected  void customCalculate(PurchasingAccountsPayableDocument purapDoc)
           
 org.apache.struts.action.ActionForward deleteSourceLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method will remove a SourceAccountingLine from a FinancialDocument.
 org.apache.struts.action.ActionForward downloadBOAttachment(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  String[] getSelectedLineForAccounts(javax.servlet.http.HttpServletRequest request)
          Will return an array of Strings containing 2 indexes, the first String is the item index and the second String is the account index.
 SourceAccountingLine getSourceAccountingLine(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request)
          This method is a helper method that will return a source accounting line.
 org.apache.struts.action.ActionForward hideAllAccounts(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Toggles all specific tabs to closed
protected  void insertAccountingLine(KualiAccountingDocumentFormBase financialDocumentForm, PurApItem item, PurApAccountingLine line)
          Insert the given Accounting Line in several appropriate places in the given item and given form.
protected  void insertAccountingLine(PurchasingAccountsPayableFormBase financialDocumentForm, PurApItem item, PurApAccountingLine line)
          Insert the given Accounting Line in several appropriate places in the given item and given form.
 org.apache.struts.action.ActionForward insertBONote(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Override to verify the document has been saved before the note is inserted.
 org.apache.struts.action.ActionForward insertSourceLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This action executes an insert of a SourceAccountingLine into a document only after validating the accounting line and checking any appropriate business rules.
protected  void loadDocument(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase)
          All document-load operations get routed through here
protected  void processAccountingLineOverrides(List accountingLines)
           
 boolean processCustomInsertAccountingLine(PurchasingAccountsPayableFormBase purapForm, javax.servlet.http.HttpServletRequest request)
          Allows the custom processing of an accounting line during a call to insert source line.
 org.apache.struts.action.ActionForward refreshAccountSummary(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Invokes a service method to refresh the account summary.
 org.apache.struts.action.ActionForward showAllAccounts(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Toggles all specific tabs to open
protected
<T extends PurchasingAccountsPayableDocument,V extends KualiAccountingDocumentFormBase>
void
updateBaseline(T document, V form)
          Updates the baseline accounts on form and doc.
protected  void uploadAccountingLines(boolean isSource, org.apache.struts.action.ActionForm form)
          This method determines whether we are uploading source or target lines, and then calls uploadAccountingLines directly on the document object.
 
Methods inherited from class org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase
addCapitalAssetInfo, addCapitalAssetInfoDetailLines, applyCapitalAssetInformation, approve, blanketApprove, checkSalesTax, checkSalesTaxRequiredAllLines, checkUploadFile, clearCapitalAssetInfo, clearOverridesThatBecameUnneeded, copy, deepCopyAccountingLinesList, deleteAccountingLine, deleteCapitalAssetInfoDetailLine, deleteTargetLine, execute, getCurrentCapitalAssetInformationObject, getMaxItemLineNumber, getNextItemLineNumberAndIncremented, getObjectTypeCodeFromLine, getTargetAccountingLine, handleSalesTaxRequired, handleSalesTaxRequiredAllLines, hasSalesTaxBeenEntered, hideDetails, insertAccountingLine, insertTargetLine, isSalesTaxRequired, isValidSalesTaxEntered, performBalanceInquiryForAccountingLine, performBalanceInquiryForSourceLine, performBalanceInquiryForTargetLine, performLookup, populateSalesTax, processAccountingLineOverrides, processAccountingLineOverrides, processAccountingLines, refresh, refreshSalesTaxInfo, removeSalesTax, resetCapitalAssetInfo, route, save, showDetails, toggleTab, uploadSourceLines, uploadTargetLines
 
Methods inherited from class org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentActionBase
correct
 
Methods inherited from class org.kuali.rice.kns.web.struts.action.KualiTransactionalDocumentActionBase
populateAuthorizationFields
 
Methods inherited from class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
acknowledge, attemptLockRelease, buildAuthorizationException, cancel, cancelBOAttachment, canSave, checkAndWarnAboutSensitiveData, checkAuthorization, close, combineAdHocRecipients, convertSetToMap, createDocument, delete, deleteAdHocRoutePerson, deleteAdHocRouteWorkgroup, deleteBONote, determineNoteWorkflowNotificationAction, disapprove, docHandler, doProcessingAfterPost, exitingDocument, fyi, generatePessimisticLockMessage, getAttachmentService, getBusinessObjectAuthorizationService, getBusinessObjectMetaDataService, getBusinessObjectService, getDataDictionaryService, getDocumentHelperService, getDocumentService, getEntityManagerFactory, getIdentityManagementService, getKualiConfigurationService, getKualiRuleService, getNoteService, getParameterService, getPessimisticLockService, getQuestion, hideAllTabs, insertAdHocRoutePerson, insertAdHocRouteWorkgroup, isFormRepresentingLockObject, performRouteReport, populateAdHocActionRequestCodes, promptBeforeValidation, promptBeforeValidation, refreshAdHocRoutingWorkgroupLookups, releaseLocks, reload, returnToSender, selectedAttachmentIndex, sendAdHocRequests, sendNoteWorkflowNotification, setupDocumentExit, setupPessimisticLockMessages, showAllTabs, streamToResponse, supervisorFunctions
 
Methods inherited from class org.kuali.rice.kns.web.struts.action.KualiAction
addMethodToCallToUncheckedList, defaultDispatch, dispatchMethod, findMethodToCall, getApplicationBaseUrl, getBasePath, getEncryptionService, getHeaderTabDispatch, getHeaderTabNavigateTo, getImageContext, getKualiModuleService, getLineToDelete, getReturnLocation, getRoleQualification, getSelectedLine, getTabToToggle, headerTab, performInquiry, performQuestionWithInput, performQuestionWithInputAgainBecauseOfErrors, performQuestionWithoutInput, performWorkgroupLookup, postTextAreaToParent, retrieveLookupParameterValue, updateTextArea, validateLookupInquiryFullParameter
 
Methods inherited from class org.apache.struts.actions.DispatchAction
cancelled, getMethod, getMethodName, getParameter, unspecified
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PurchasingAccountsPayableActionBase

public PurchasingAccountsPayableActionBase()
Method Detail

loadDocument

protected void loadDocument(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase kualiDocumentFormBase)
                     throws org.kuali.rice.kew.exception.WorkflowException
Description copied from class: KualiAccountingDocumentActionBase
All document-load operations get routed through here

Overrides:
loadDocument in class KualiAccountingDocumentActionBase
Throws:
org.kuali.rice.kew.exception.WorkflowException
See Also:
KualiDocumentActionBase.loadDocument(org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase)

updateBaseline

protected <T extends PurchasingAccountsPayableDocument,V extends KualiAccountingDocumentFormBase> void updateBaseline(T document,
                                                                                                                      V form)
Updates the baseline accounts on form and doc.

Parameters:
document - A descendant of PurchasingAccountsPayableDocument

refreshAccountSummary

public org.apache.struts.action.ActionForward refreshAccountSummary(org.apache.struts.action.ActionMapping mapping,
                                                                    org.apache.struts.action.ActionForm form,
                                                                    javax.servlet.http.HttpServletRequest request,
                                                                    javax.servlet.http.HttpServletResponse response)
                                                             throws Exception
Invokes a service method to refresh the account summary.

Parameters:
mapping - An ActionMapping
form - An ActionForm
request - The HttpServletRequest
response - The HttpServletResponse
Returns:
An ActionForward
Throws:
Exception

uploadAccountingLines

protected void uploadAccountingLines(boolean isSource,
                                     org.apache.struts.action.ActionForm form)
                              throws FileNotFoundException,
                                     IOException
Description copied from class: KualiAccountingDocumentActionBase
This method determines whether we are uploading source or target lines, and then calls uploadAccountingLines directly on the document object. This method handles retrieving the actual upload file as an input stream into the document.

Overrides:
uploadAccountingLines in class KualiAccountingDocumentActionBase
Throws:
FileNotFoundException
IOException
See Also:
KualiAccountingDocumentActionBase.uploadAccountingLines(boolean,org.apache.struts.action.ActionForm)

insertSourceLine

public org.apache.struts.action.ActionForward insertSourceLine(org.apache.struts.action.ActionMapping mapping,
                                                               org.apache.struts.action.ActionForm form,
                                                               javax.servlet.http.HttpServletRequest request,
                                                               javax.servlet.http.HttpServletResponse response)
                                                        throws Exception
Description copied from class: KualiAccountingDocumentActionBase
This action executes an insert of a SourceAccountingLine into a document only after validating the accounting line and checking any appropriate business rules.

Overrides:
insertSourceLine in class KualiAccountingDocumentActionBase
Returns:
ActionForward
Throws:
Exception
See Also:
KualiAccountingDocumentActionBase.insertSourceLine(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

insertAccountingLine

protected void insertAccountingLine(PurchasingAccountsPayableFormBase financialDocumentForm,
                                    PurApItem item,
                                    PurApAccountingLine line)
Insert the given Accounting Line in several appropriate places in the given item and given form.

Parameters:
financialDocumentForm - A form that inherits from PurchasingAccountsPaybleFormBase
item - A PurApItem
line - A PurApAccountingLine

processCustomInsertAccountingLine

public boolean processCustomInsertAccountingLine(PurchasingAccountsPayableFormBase purapForm,
                                                 javax.servlet.http.HttpServletRequest request)
Allows the custom processing of an accounting line during a call to insert source line. If a custom method for inserting an accounting line was performed, then a value of true must be returned.

Parameters:
purapForm -
request -
Returns:
boolean indicating if validation succeeded

insertAccountingLine

protected void insertAccountingLine(KualiAccountingDocumentFormBase financialDocumentForm,
                                    PurApItem item,
                                    PurApAccountingLine line)
Insert the given Accounting Line in several appropriate places in the given item and given form.

Parameters:
financialDocumentForm - A form that inherits from KualiAccountingDocumentFormBase
item - A PurApItem
line - A PurApAccountingLine

deleteSourceLine

public org.apache.struts.action.ActionForward deleteSourceLine(org.apache.struts.action.ActionMapping mapping,
                                                               org.apache.struts.action.ActionForm form,
                                                               javax.servlet.http.HttpServletRequest request,
                                                               javax.servlet.http.HttpServletResponse response)
                                                        throws Exception
Description copied from class: KualiAccountingDocumentActionBase
This method will remove a SourceAccountingLine from a FinancialDocument. This assumes that the user presses the delete button for a specific accounting line on the document and that the document is represented by a FinancialDocumentFormBase.

Overrides:
deleteSourceLine in class KualiAccountingDocumentActionBase
Returns:
ActionForward
Throws:
Exception
See Also:
KualiAccountingDocumentActionBase.deleteSourceLine(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

getSourceAccountingLine

public SourceAccountingLine getSourceAccountingLine(org.apache.struts.action.ActionForm form,
                                                    javax.servlet.http.HttpServletRequest request)
Description copied from class: KualiAccountingDocumentActionBase
This method is a helper method that will return a source accounting line. The reason we're making it protected in here is so that we can override this method in some of the modules. PurchasingActionBase is one of the subclasses that will be overriding this, because in PurchasingActionBase, we'll need to get the source accounting line using both an item index and an account index.

Overrides:
getSourceAccountingLine in class KualiAccountingDocumentActionBase
Returns:
See Also:
KualiAccountingDocumentActionBase.getSourceAccountingLine(org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest)

customAccountRetrieval

protected SourceAccountingLine customAccountRetrieval(int accountIndex,
                                                      PurchasingAccountsPayableFormBase purchasingAccountsPayableForm)
Perform custom processing on accounting lines. See getSelectedLineForAccounts.

Parameters:
accountIndex - The index of the account into the request parameter
purchasingAccountsPayableForm - A form which inherits from PurchasingAccountsPayableFormBase
Returns:
A SourceAccountingLine

getSelectedLineForAccounts

protected String[] getSelectedLineForAccounts(javax.servlet.http.HttpServletRequest request)
Will return an array of Strings containing 2 indexes, the first String is the item index and the second String is the account index. These are obtained by parsing the method to call parameter from the request, between the word ".line" and "." The indexes are separated by a semicolon (:)

Parameters:
request - The HttpServletRequest
Returns:
An array of Strings containing pairs of two indices, an item index and a account index

downloadBOAttachment

public org.apache.struts.action.ActionForward downloadBOAttachment(org.apache.struts.action.ActionMapping mapping,
                                                                   org.apache.struts.action.ActionForm form,
                                                                   javax.servlet.http.HttpServletRequest request,
                                                                   javax.servlet.http.HttpServletResponse response)
                                                            throws Exception
Overrides:
downloadBOAttachment in class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
Throws:
Exception
See Also:
KualiDocumentActionBase.downloadBOAttachment(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

processAccountingLineOverrides

protected void processAccountingLineOverrides(List accountingLines)
Overrides:
processAccountingLineOverrides in class KualiAccountingDocumentActionBase

calculate

public org.apache.struts.action.ActionForward calculate(org.apache.struts.action.ActionMapping mapping,
                                                        org.apache.struts.action.ActionForm form,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        javax.servlet.http.HttpServletResponse response)
                                                 throws Exception
Perform calculation on item line.

Parameters:
mapping - An ActionMapping
form - An ActionForm
request - The HttpServletRequest
response - The HttpServletResponse
Returns:
An ActionForward
Throws:
Exception

clearAllTaxes

public org.apache.struts.action.ActionForward clearAllTaxes(org.apache.struts.action.ActionMapping mapping,
                                                            org.apache.struts.action.ActionForm form,
                                                            javax.servlet.http.HttpServletRequest request,
                                                            javax.servlet.http.HttpServletResponse response)
                                                     throws Exception
Throws:
Exception

customCalculate

protected void customCalculate(PurchasingAccountsPayableDocument purapDoc)

showAllAccounts

public org.apache.struts.action.ActionForward showAllAccounts(org.apache.struts.action.ActionMapping mapping,
                                                              org.apache.struts.action.ActionForm form,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
                                                       throws Exception
Toggles all specific tabs to open

Parameters:
mapping -
form -
request -
response -
Returns:
Throws:
Exception

hideAllAccounts

public org.apache.struts.action.ActionForward hideAllAccounts(org.apache.struts.action.ActionMapping mapping,
                                                              org.apache.struts.action.ActionForm form,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
                                                       throws Exception
Toggles all specific tabs to closed

Parameters:
mapping -
form -
request -
response -
Returns:
Throws:
Exception

insertBONote

public org.apache.struts.action.ActionForward insertBONote(org.apache.struts.action.ActionMapping mapping,
                                                           org.apache.struts.action.ActionForm form,
                                                           javax.servlet.http.HttpServletRequest request,
                                                           javax.servlet.http.HttpServletResponse response)
                                                    throws Exception
Override to verify the document has been saved before the note is inserted. This will assure the correct parent object id is associated with the note.

Overrides:
insertBONote in class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
Throws:
Exception
See Also:
KualiDocumentActionBase.insertBONote(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)


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