org.kuali.rice.krad.web.controller
Class DocumentControllerBase

java.lang.Object
  extended by org.kuali.rice.krad.web.controller.UifControllerBase
      extended by org.kuali.rice.krad.web.controller.DocumentControllerBase
Direct Known Subclasses:
MaintenanceDocumentController

public abstract class DocumentControllerBase
extends UifControllerBase

Base controller class for all KRAD DocumentView screens working with Document models

Provides default controller implementations for the standard document actions including: doc handler (retrieve from doc search and action list), save, route (and other KEW actions)

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected static String[] DOCUMENT_LOAD_COMMANDS
           
 
Fields inherited from class org.kuali.rice.krad.web.controller.UifControllerBase
REDIRECT_PREFIX
 
Constructor Summary
DocumentControllerBase()
           
 
Method Summary
 org.springframework.web.servlet.ModelAndView acknowledge(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Performs the acknowledge workflow action on the form document instance
 org.springframework.web.servlet.ModelAndView approve(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Performs the approve workflow action on the form document instance
 org.springframework.web.servlet.ModelAndView blanketApprove(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Performs the blanket approve workflow action on the form document instance
protected  DocumentAuthorizationException buildAuthorizationException(String action, Document document)
          Convenience method for building authorization exceptions
 org.springframework.web.servlet.ModelAndView cancel(UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Prompts user to confirm the cancel action then if confirmed cancels the document instance contained on the form
 org.springframework.web.servlet.ModelAndView cancelAttachment(UifFormBase uifForm, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the cancel attachment action on a note.
protected  String checkAndWarnAboutSensitiveData(DocumentFormBase form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String fieldName, String fieldValue, String caller, String context)
          Checks if the given value matches patterns that indicate sensitive data and if configured to give a warning for sensitive data will prompt the user to continue.
protected  List<AdHocRouteRecipient> combineAdHocRecipients(DocumentFormBase form)
          Convenience method to combine the two lists of ad hoc recipients into one which should be done before calling any of the document service methods that expect a list of ad hoc recipients
protected  void createDocument(DocumentFormBase form)
          Creates a new document of the type specified by the docTypeName property of the given form.
protected abstract  DocumentFormBase createInitialForm(javax.servlet.http.HttpServletRequest request)
          Called to create a new model(form) object when necessary.
 org.springframework.web.servlet.ModelAndView deleteNote(UifFormBase uifForm, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the delete note action for deleting a note.
 org.springframework.web.servlet.ModelAndView disapprove(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Performs the disapprove workflow action on the form document instance
 org.springframework.web.servlet.ModelAndView docHandler(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Used to funnel all document handling through, we could do useful things like log and record various openings and status Additionally it may be nice to have a single dispatcher that can know how to dispatch to a redirect url for document specific handling but we may not need that as all we should need is the document to be able to load itself based on document id and then which action forward or redirect is pertinent for the document type.
 org.springframework.web.servlet.ModelAndView downloadAttachment(UifFormBase uifForm, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the download attachment action on a note.
 org.springframework.web.servlet.ModelAndView fyi(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Performs the fyi workflow action on the form document instance
 AttachmentService getAttachmentService()
           
 BusinessObjectService getBusinessObjectService()
           
 ConfigurationService getConfigurationService()
           
 DataDictionaryService getDataDictionaryService()
           
 DocumentDictionaryService getDocumentDictionaryService()
           
 DocumentService getDocumentService()
           
 NoteService getNoteService()
           
 org.springframework.web.servlet.ModelAndView insertNote(UifFormBase uifForm, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the add note action for adding a note.
protected  void loadDocument(DocumentFormBase form)
          Loads the document by its provided document header id.
protected  void performWorkflowAction(DocumentFormBase form, UifConstants.WorkflowAction action, boolean checkSensitiveData)
          Invokes the DocumentService to carry out a request workflow action and adds a success message, if requested a check for sensitive data is also performed
 org.springframework.web.servlet.ModelAndView reload(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Reloads the document contained on the form from the database
 org.springframework.web.servlet.ModelAndView route(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Routes the document instance contained on the form
 org.springframework.web.servlet.ModelAndView save(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Saves the document instance contained on the form
 void setBusinessObjectService(BusinessObjectService businessObjectService)
           
 void setDataDictionaryService(DataDictionaryService dataDictionaryService)
           
 void setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService)
           
 void setDocumentService(DocumentService documentService)
           
 org.springframework.web.servlet.ModelAndView supervisorFunctions(DocumentFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Redirects to the supervisor functions page
 
Methods inherited from class org.kuali.rice.krad.web.controller.UifControllerBase
addLine, checkViewAuthorization, close, deleteLine, getSessionDocumentService, getUIFModelAndView, getUIFModelAndView, getViewService, initForm, navigate, performFieldQuery, performFieldSuggest, performLookup, performRedirect, refresh, returnToHistory, returnToHub, returnToPrevious, start, toggleInactiveRecordDisplay, updateComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT_LOAD_COMMANDS

protected static final String[] DOCUMENT_LOAD_COMMANDS
Constructor Detail

DocumentControllerBase

public DocumentControllerBase()
Method Detail

createInitialForm

protected abstract DocumentFormBase createInitialForm(javax.servlet.http.HttpServletRequest request)
Description copied from class: UifControllerBase
Called to create a new model(form) object when necessary. This usually occurs on the initial request in a conversation (when the model is not present in the session). This method must be overridden when extending a controller and using a different form type than the superclass.

Specified by:
createInitialForm in class UifControllerBase
Parameters:
request - - the http request that was made
See Also:
UifControllerBase.createInitialForm(javax.servlet.http.HttpServletRequest)

docHandler

@RequestMapping(params="methodToCall=docHandler")
public org.springframework.web.servlet.ModelAndView docHandler(@ModelAttribute(value="KualiForm")
                                                                              DocumentFormBase form,
                                                                              org.springframework.validation.BindingResult result,
                                                                              javax.servlet.http.HttpServletRequest request,
                                                                              javax.servlet.http.HttpServletResponse response)
                                                        throws Exception
Used to funnel all document handling through, we could do useful things like log and record various openings and status Additionally it may be nice to have a single dispatcher that can know how to dispatch to a redirect url for document specific handling but we may not need that as all we should need is the document to be able to load itself based on document id and then which action forward or redirect is pertinent for the document type.

Throws:
Exception

loadDocument

protected void loadDocument(DocumentFormBase form)
                     throws WorkflowException
Loads the document by its provided document header id. This has been abstracted out so that it can be overridden in children if the need arises

Parameters:
form - - form instance that contains the doc id parameter and where the retrieved document instance should be set
Throws:
WorkflowException

createDocument

protected void createDocument(DocumentFormBase form)
                       throws WorkflowException
Creates a new document of the type specified by the docTypeName property of the given form. This has been abstracted out so that it can be overridden in children if the need arises.

Parameters:
form - - form instance that contains the doc type parameter and where the new document instance should be set
Throws:
WorkflowException

reload

@RequestMapping(params="methodToCall=reload")
public org.springframework.web.servlet.ModelAndView reload(@ModelAttribute(value="KualiForm")
                                                                          DocumentFormBase form,
                                                                          org.springframework.validation.BindingResult result,
                                                                          javax.servlet.http.HttpServletRequest request,
                                                                          javax.servlet.http.HttpServletResponse response)
                                                    throws Exception
Reloads the document contained on the form from the database

Parameters:
form - - document form base containing the document instance from which the document number will be retrieved and used to fetch the document from the database
Returns:
ModelAndView
Throws:
Exception

cancel

@RequestMapping(params="methodToCall=cancel")
public org.springframework.web.servlet.ModelAndView cancel(@ModelAttribute(value="KualiForm")
                                                                          UifFormBase form,
                                                                          org.springframework.validation.BindingResult result,
                                                                          javax.servlet.http.HttpServletRequest request,
                                                                          javax.servlet.http.HttpServletResponse response)
Prompts user to confirm the cancel action then if confirmed cancels the document instance contained on the form

Overrides:
cancel in class UifControllerBase
Parameters:
form - - document form base containing the document instance that will be cancelled
Returns:
ModelAndView

save

@RequestMapping(params="methodToCall=save")
public org.springframework.web.servlet.ModelAndView save(@ModelAttribute(value="KualiForm")
                                                                        DocumentFormBase form,
                                                                        org.springframework.validation.BindingResult result,
                                                                        javax.servlet.http.HttpServletRequest request,
                                                                        javax.servlet.http.HttpServletResponse response)
                                                  throws Exception
Saves the document instance contained on the form

Parameters:
form - - document form base containing the document instance that will be saved
Returns:
ModelAndView
Throws:
Exception

route

@RequestMapping(params="methodToCall=route")
public org.springframework.web.servlet.ModelAndView route(@ModelAttribute(value="KualiForm")
                                                                         DocumentFormBase form,
                                                                         org.springframework.validation.BindingResult result,
                                                                         javax.servlet.http.HttpServletRequest request,
                                                                         javax.servlet.http.HttpServletResponse response)
                                                   throws Exception
Routes the document instance contained on the form

Parameters:
form - - document form base containing the document instance that will be routed
Returns:
ModelAndView
Throws:
Exception

blanketApprove

@RequestMapping(params="methodToCall=blanketApprove")
public org.springframework.web.servlet.ModelAndView blanketApprove(@ModelAttribute(value="KualiForm")
                                                                                  DocumentFormBase form,
                                                                                  org.springframework.validation.BindingResult result,
                                                                                  javax.servlet.http.HttpServletRequest request,
                                                                                  javax.servlet.http.HttpServletResponse response)
                                                            throws Exception
Performs the blanket approve workflow action on the form document instance

Parameters:
form - - document form base containing the document instance that will be blanket approved
Returns:
ModelAndView
Throws:
Exception

approve

@RequestMapping(params="methodToCall=approve")
public org.springframework.web.servlet.ModelAndView approve(@ModelAttribute(value="KualiForm")
                                                                           DocumentFormBase form,
                                                                           org.springframework.validation.BindingResult result,
                                                                           javax.servlet.http.HttpServletRequest request,
                                                                           javax.servlet.http.HttpServletResponse response)
                                                     throws Exception
Performs the approve workflow action on the form document instance

Parameters:
form - - document form base containing the document instance that will be approved
Returns:
ModelAndView
Throws:
Exception

disapprove

@RequestMapping(params="methodToCall=disapprove")
public org.springframework.web.servlet.ModelAndView disapprove(@ModelAttribute(value="KualiForm")
                                                                              DocumentFormBase form,
                                                                              org.springframework.validation.BindingResult result,
                                                                              javax.servlet.http.HttpServletRequest request,
                                                                              javax.servlet.http.HttpServletResponse response)
                                                        throws Exception
Performs the disapprove workflow action on the form document instance

Parameters:
form - - document form base containing the document instance that will be disapproved
Returns:
ModelAndView
Throws:
Exception

fyi

@RequestMapping(params="methodToCall=fyi")
public org.springframework.web.servlet.ModelAndView fyi(@ModelAttribute(value="KualiForm")
                                                                       DocumentFormBase form,
                                                                       org.springframework.validation.BindingResult result,
                                                                       javax.servlet.http.HttpServletRequest request,
                                                                       javax.servlet.http.HttpServletResponse response)
                                                 throws Exception
Performs the fyi workflow action on the form document instance

Parameters:
form - - document form base containing the document instance the fyi will be taken on
Returns:
ModelAndView
Throws:
Exception

acknowledge

@RequestMapping(params="methodToCall=acknowledge")
public org.springframework.web.servlet.ModelAndView acknowledge(@ModelAttribute(value="KualiForm")
                                                                               DocumentFormBase form,
                                                                               org.springframework.validation.BindingResult result,
                                                                               javax.servlet.http.HttpServletRequest request,
                                                                               javax.servlet.http.HttpServletResponse response)
                                                         throws Exception
Performs the acknowledge workflow action on the form document instance

Parameters:
form - - document form base containing the document instance the acknowledge will be taken on
Returns:
ModelAndView
Throws:
Exception

performWorkflowAction

protected void performWorkflowAction(DocumentFormBase form,
                                     UifConstants.WorkflowAction action,
                                     boolean checkSensitiveData)
Invokes the DocumentService to carry out a request workflow action and adds a success message, if requested a check for sensitive data is also performed

Parameters:
form - - document form instance containing the document for which the action will be taken on
action - - UifConstants.WorkflowAction enum indicating what workflow action to take
checkSensitiveData - - boolean indicating whether a check for sensitive data should occur

supervisorFunctions

@RequestMapping(params="methodToCall=supervisorFunctions")
public org.springframework.web.servlet.ModelAndView supervisorFunctions(@ModelAttribute(value="KualiForm")
                                                                                       DocumentFormBase form,
                                                                                       org.springframework.validation.BindingResult result,
                                                                                       javax.servlet.http.HttpServletRequest request,
                                                                                       javax.servlet.http.HttpServletResponse response)
                                                                 throws Exception
Redirects to the supervisor functions page

Returns:
ModelAndView - model and view configured for the redirect URL
Throws:
Exception

insertNote

@RequestMapping(method=POST,
                params="methodToCall=insertNote")
public org.springframework.web.servlet.ModelAndView insertNote(@ModelAttribute(value="KualiForm")
                                                                              UifFormBase uifForm,
                                                                              org.springframework.validation.BindingResult result,
                                                                              javax.servlet.http.HttpServletRequest request,
                                                                              javax.servlet.http.HttpServletResponse response)
Called by the add note action for adding a note. Method validates, saves attachment and adds the time stamp and author. Calls the UifControllerBase.addLine method to handle generic actions.

Parameters:
uifForm - - document form base containing the note instance that will be inserted into the document
Returns:
ModelAndView

deleteNote

@RequestMapping(method=POST,
                params="methodToCall=deleteNote")
public org.springframework.web.servlet.ModelAndView deleteNote(@ModelAttribute(value="KualiForm")
                                                                              UifFormBase uifForm,
                                                                              org.springframework.validation.BindingResult result,
                                                                              javax.servlet.http.HttpServletRequest request,
                                                                              javax.servlet.http.HttpServletResponse response)
Called by the delete note action for deleting a note. Calls the UifControllerBase.deleteLine method to handle generic actions.


downloadAttachment

@RequestMapping(method=POST,
                params="methodToCall=downloadAttachment")
public org.springframework.web.servlet.ModelAndView downloadAttachment(@ModelAttribute(value="KualiForm")
                                                                                      UifFormBase uifForm,
                                                                                      org.springframework.validation.BindingResult result,
                                                                                      javax.servlet.http.HttpServletRequest request,
                                                                                      javax.servlet.http.HttpServletResponse response)
                                                                throws org.springframework.web.bind.ServletRequestBindingException,
                                                                       FileNotFoundException,
                                                                       IOException
Called by the download attachment action on a note. Method gets the attachment input stream from the AttachmentService and writes it to the request output stream.

Throws:
org.springframework.web.bind.ServletRequestBindingException
FileNotFoundException
IOException

cancelAttachment

@RequestMapping(method=POST,
                params="methodToCall=cancelAttachment")
public org.springframework.web.servlet.ModelAndView cancelAttachment(@ModelAttribute(value="KualiForm")
                                                                                    UifFormBase uifForm,
                                                                                    org.springframework.validation.BindingResult result,
                                                                                    javax.servlet.http.HttpServletRequest request,
                                                                                    javax.servlet.http.HttpServletResponse response)
Called by the cancel attachment action on a note. Method removes the attachment file from the form.


checkAndWarnAboutSensitiveData

protected String checkAndWarnAboutSensitiveData(DocumentFormBase form,
                                                javax.servlet.http.HttpServletRequest request,
                                                javax.servlet.http.HttpServletResponse response,
                                                String fieldName,
                                                String fieldValue,
                                                String caller,
                                                String context)
                                         throws Exception
Checks if the given value matches patterns that indicate sensitive data and if configured to give a warning for sensitive data will prompt the user to continue.

Parameters:
form -
request -
response -
fieldName - - name of field with value being checked
fieldValue - - value to check for sensitive data
caller - - method that should be called back from question
context - - additional context that needs to be passed back with the question response
Returns:
- view for spring to forward to, or null if processing should continue
Throws:
Exception

combineAdHocRecipients

protected List<AdHocRouteRecipient> combineAdHocRecipients(DocumentFormBase form)
Convenience method to combine the two lists of ad hoc recipients into one which should be done before calling any of the document service methods that expect a list of ad hoc recipients

Parameters:
form - - document form instance containing the ad hod lists
Returns:
List combined ad hoc recipients

buildAuthorizationException

protected DocumentAuthorizationException buildAuthorizationException(String action,
                                                                     Document document)
Convenience method for building authorization exceptions

Parameters:
action - - the action that was requested
document - - document instance the action was requested for

getBusinessObjectService

public BusinessObjectService getBusinessObjectService()

setBusinessObjectService

public void setBusinessObjectService(BusinessObjectService businessObjectService)

getDataDictionaryService

public DataDictionaryService getDataDictionaryService()

setDataDictionaryService

public void setDataDictionaryService(DataDictionaryService dataDictionaryService)

getDocumentService

public DocumentService getDocumentService()

setDocumentService

public void setDocumentService(DocumentService documentService)

getDocumentDictionaryService

public DocumentDictionaryService getDocumentDictionaryService()

setDocumentDictionaryService

public void setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService)

getAttachmentService

public AttachmentService getAttachmentService()

getNoteService

public NoteService getNoteService()

getConfigurationService

public ConfigurationService getConfigurationService()


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