org.kuali.rice.kns.web.struts.action
Class KualiMaintenanceDocumentAction

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.KualiMaintenanceDocumentAction

public class KualiMaintenanceDocumentAction
extends KualiDocumentActionBase

This class handles actions for maintenance documents. These include creating new edit, and copying of maintenance records.


Field Summary
protected  EncryptionService encryptionService
           
protected static org.apache.log4j.Logger LOG
           
protected  LookupResultsService lookupResultsService
           
protected  LookupService lookupService
           
protected  MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService
           
 
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
KualiMaintenanceDocumentAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward addLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Adds a line to a collection being maintained in a many section.
protected  Map buildKeyMapFromRequest(Maintainable maintainable, javax.servlet.http.HttpServletRequest request)
          Gets keys for the maintainable business object from the persistence metadata explorer.
protected  void clearPrimaryKeyFields(MaintenanceDocument document)
          This method clears the value of the primary key fields on a Business Object.
protected  void clearUnauthorizedNewFields(MaintenanceDocument document)
          This method is used as part of the Copy functionality, to clear any field values that the user making the copy does not have permissions to modify.
 org.apache.struts.action.ActionForward copy(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Calls setupMaintenance for copy action.
protected  void copyParametersToBO(Map<String,String> parameters, PersistableBusinessObject newBO)
           
 org.apache.struts.action.ActionForward delete(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          KUALRice 3070 Calls setupMaintenance for delete action.
 org.apache.struts.action.ActionForward deleteLine(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Deletes a collection line that is pending by this document.
 org.apache.struts.action.ActionForward docHandler(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles creating and loading of documents.
protected  void doProcessingAfterPost(KualiForm form, javax.servlet.http.HttpServletRequest request)
          This method does all special processing on a document that should happen on each HTTP post (ie, save, route, approve, etc).
protected  void doProcessingAfterPost(KualiForm form, Map<String,String[]> parameters)
           
 org.apache.struts.action.ActionForward downloadAttachment(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Downloads the attachment to the user's browser
 org.apache.struts.action.ActionForward edit(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Calls setupMaintenance for edit action.
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Entry point to all actions.
 LookupResultsService getLookupResultsService()
           
 LookupService getLookupService()
           
protected  Map<String,String> getRequestParameters(List keyFieldNames, Maintainable maintainable, javax.servlet.http.HttpServletRequest request)
           
protected  int getSubCollectionIndex(Object object, String documentTypeName)
           
 org.apache.struts.action.ActionForward newWithExisting(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Calls setupMaintenance for new object that have existing objects attributes.
protected  void populateAuthorizationFields(KualiDocumentFormBase formBase)
           
protected  void populateBOWithCopyKeyValues(javax.servlet.http.HttpServletRequest request, PersistableBusinessObject oldBusinessObject, Maintainable oldMaintainableObject)
           
 org.apache.struts.action.ActionForward refresh(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called on return from a lookup.
 org.apache.struts.action.ActionForward replaceAttachment(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method used to replace the attachment
 org.apache.struts.action.ActionForward route(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          route the document using the document service
protected  org.apache.struts.action.ActionForward setupMaintenance(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String maintenanceAction)
          Gets a new document for a maintenance record.
 org.apache.struts.action.ActionForward start(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Calls setup Maintenance for new action.
 org.apache.struts.action.ActionForward toggleInactiveRecordDisplay(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Turns on (or off) the inactive record display for a maintenance collection.
 
Methods inherited from class org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase
acknowledge, approve, attemptLockRelease, blanketApprove, buildAuthorizationException, cancel, cancelBOAttachment, canSave, checkAndWarnAboutSensitiveData, checkAuthorization, close, combineAdHocRecipients, convertSetToMap, createDocument, deleteAdHocRoutePerson, deleteAdHocRouteWorkgroup, deleteBONote, determineNoteWorkflowNotificationAction, disapprove, downloadBOAttachment, exitingDocument, fyi, generatePessimisticLockMessage, getAttachmentService, getBusinessObjectAuthorizationService, getBusinessObjectMetaDataService, getBusinessObjectService, getDataDictionaryService, getDocumentHelperService, getDocumentService, getEntityManagerFactory, getIdentityManagementService, getKualiConfigurationService, getKualiRuleService, getNoteService, getParameterService, getPessimisticLockService, getQuestion, hideAllTabs, insertAdHocRoutePerson, insertAdHocRouteWorkgroup, insertBONote, isFormRepresentingLockObject, loadDocument, performRouteReport, populateAdHocActionRequestCodes, promptBeforeValidation, promptBeforeValidation, refreshAdHocRoutingWorkgroupLookups, releaseLocks, reload, returnToSender, save, selectedAttachmentIndex, sendAdHocRequests, sendNoteWorkflowNotification, setupDocumentExit, setupPessimisticLockMessages, showAllTabs, streamToResponse, supervisorFunctions, toggleTab
 
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, performLookup, 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
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG

maintenanceDocumentDictionaryService

protected MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService

encryptionService

protected EncryptionService encryptionService

lookupService

protected LookupService lookupService

lookupResultsService

protected LookupResultsService lookupResultsService
Constructor Detail

KualiMaintenanceDocumentAction

public KualiMaintenanceDocumentAction()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(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: KualiDocumentActionBase
Entry point to all actions. NOTE: No need to hook into execute for handling framwork setup anymore. Just implement the methodToCall for the framework setup, Constants.METHOD_REQUEST_PARAMETER will contain the full parameter, which can be sub stringed for getting framework parameters.

Overrides:
execute in class KualiDocumentActionBase
Throws:
Exception
See Also:
Action.execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

start

public org.apache.struts.action.ActionForward start(org.apache.struts.action.ActionMapping mapping,
                                                    org.apache.struts.action.ActionForm form,
                                                    javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
                                             throws Exception
Calls setup Maintenance for new action.

Throws:
Exception

copy

public org.apache.struts.action.ActionForward copy(org.apache.struts.action.ActionMapping mapping,
                                                   org.apache.struts.action.ActionForm form,
                                                   javax.servlet.http.HttpServletRequest request,
                                                   javax.servlet.http.HttpServletResponse response)
                                            throws Exception
Calls setupMaintenance for copy action.

Throws:
Exception

edit

public org.apache.struts.action.ActionForward edit(org.apache.struts.action.ActionMapping mapping,
                                                   org.apache.struts.action.ActionForm form,
                                                   javax.servlet.http.HttpServletRequest request,
                                                   javax.servlet.http.HttpServletResponse response)
                                            throws Exception
Calls setupMaintenance for edit action.

Throws:
Exception

delete

public org.apache.struts.action.ActionForward delete(org.apache.struts.action.ActionMapping mapping,
                                                     org.apache.struts.action.ActionForm form,
                                                     javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response)
                                              throws Exception
KUALRice 3070 Calls setupMaintenance for delete action.

Overrides:
delete in class KualiDocumentActionBase
Returns:
ActionForward
Throws:
Exception

newWithExisting

public org.apache.struts.action.ActionForward newWithExisting(org.apache.struts.action.ActionMapping mapping,
                                                              org.apache.struts.action.ActionForm form,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
                                                       throws Exception
Calls setupMaintenance for new object that have existing objects attributes.

Throws:
Exception

setupMaintenance

protected org.apache.struts.action.ActionForward setupMaintenance(org.apache.struts.action.ActionMapping mapping,
                                                                  org.apache.struts.action.ActionForm form,
                                                                  javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response,
                                                                  String maintenanceAction)
                                                           throws Exception
Gets a new document for a maintenance record. The maintainable is specified with the documentTypeName or business object class request parameter and request parameters are parsed for key values for retrieving the business object. Forward to the maintenance jsp which renders the page based on the maintainable's field specifications. Retrieves an existing business object for edit and copy. Checks locking on edit.

Throws:
Exception

populateBOWithCopyKeyValues

protected void populateBOWithCopyKeyValues(javax.servlet.http.HttpServletRequest request,
                                           PersistableBusinessObject oldBusinessObject,
                                           Maintainable oldMaintainableObject)
                                    throws Exception
Throws:
Exception

copyParametersToBO

protected void copyParametersToBO(Map<String,String> parameters,
                                  PersistableBusinessObject newBO)
                           throws Exception
Throws:
Exception

downloadAttachment

public org.apache.struts.action.ActionForward downloadAttachment(org.apache.struts.action.ActionMapping mapping,
                                                                 org.apache.struts.action.ActionForm form,
                                                                 javax.servlet.http.HttpServletRequest request,
                                                                 javax.servlet.http.HttpServletResponse response)
                                                          throws Exception
Downloads the attachment to the user's browser

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

replaceAttachment

public org.apache.struts.action.ActionForward replaceAttachment(org.apache.struts.action.ActionMapping mapping,
                                                                org.apache.struts.action.ActionForm form,
                                                                javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response)
                                                         throws Exception
This method used to replace the attachment

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

route

public org.apache.struts.action.ActionForward route(org.apache.struts.action.ActionMapping mapping,
                                                    org.apache.struts.action.ActionForm form,
                                                    javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.http.HttpServletResponse response)
                                             throws Exception
route the document using the document service

Overrides:
route in class KualiDocumentActionBase
Parameters:
mapping -
form -
request -
response -
Returns:
ActionForward
Throws:
Exception

docHandler

public org.apache.struts.action.ActionForward docHandler(org.apache.struts.action.ActionMapping mapping,
                                                         org.apache.struts.action.ActionForm form,
                                                         javax.servlet.http.HttpServletRequest request,
                                                         javax.servlet.http.HttpServletResponse response)
                                                  throws Exception
Handles creating and loading of documents.

Overrides:
docHandler in class KualiDocumentActionBase
Returns:
ActionForward
Throws:
Exception

refresh

public org.apache.struts.action.ActionForward refresh(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws Exception
Called on return from a lookup.

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

buildKeyMapFromRequest

protected Map buildKeyMapFromRequest(Maintainable maintainable,
                                     javax.servlet.http.HttpServletRequest request)
Gets keys for the maintainable business object from the persistence metadata explorer. Checks for existence of key property names as request parameters, if found adds them to the returned hash map.


getRequestParameters

protected Map<String,String> getRequestParameters(List keyFieldNames,
                                                  Maintainable maintainable,
                                                  javax.servlet.http.HttpServletRequest request)

addLine

public org.apache.struts.action.ActionForward addLine(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws Exception
Adds a line to a collection being maintained in a many section.

Throws:
Exception

getSubCollectionIndex

protected int getSubCollectionIndex(Object object,
                                    String documentTypeName)

deleteLine

public org.apache.struts.action.ActionForward deleteLine(org.apache.struts.action.ActionMapping mapping,
                                                         org.apache.struts.action.ActionForm form,
                                                         javax.servlet.http.HttpServletRequest request,
                                                         javax.servlet.http.HttpServletResponse response)
                                                  throws Exception
Deletes a collection line that is pending by this document. The collection name and the index to delete is embedded into the delete button name. These parameters are extracted, the collection pulled out of the parent business object, and finally the collection record at the specified index is removed for the new maintainable, and the old if we are dealing with an edit.

Throws:
Exception

toggleInactiveRecordDisplay

public org.apache.struts.action.ActionForward toggleInactiveRecordDisplay(org.apache.struts.action.ActionMapping mapping,
                                                                          org.apache.struts.action.ActionForm form,
                                                                          javax.servlet.http.HttpServletRequest request,
                                                                          javax.servlet.http.HttpServletResponse response)
                                                                   throws Exception
Turns on (or off) the inactive record display for a maintenance collection.

Throws:
Exception

clearPrimaryKeyFields

protected void clearPrimaryKeyFields(MaintenanceDocument document)
This method clears the value of the primary key fields on a Business Object.

Parameters:
document - - document to clear the pk fields on

clearUnauthorizedNewFields

protected void clearUnauthorizedNewFields(MaintenanceDocument document)
This method is used as part of the Copy functionality, to clear any field values that the user making the copy does not have permissions to modify. This will prevent authorization errors on a copy.

Parameters:
document - - document to be adjusted

doProcessingAfterPost

protected void doProcessingAfterPost(KualiForm form,
                                     javax.servlet.http.HttpServletRequest request)
This method does all special processing on a document that should happen on each HTTP post (ie, save, route, approve, etc).

Overrides:
doProcessingAfterPost in class KualiDocumentActionBase
Parameters:
form -

doProcessingAfterPost

protected void doProcessingAfterPost(KualiForm form,
                                     Map<String,String[]> parameters)

populateAuthorizationFields

protected void populateAuthorizationFields(KualiDocumentFormBase formBase)
Overrides:
populateAuthorizationFields in class KualiDocumentActionBase

getLookupService

public LookupService getLookupService()

getLookupResultsService

public LookupResultsService getLookupResultsService()


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