Package org.kuali.rice.krad.document
Class DocumentControllerServiceImpl
java.lang.Object
org.kuali.rice.krad.web.service.impl.ControllerServiceImpl
org.kuali.rice.krad.document.DocumentControllerServiceImpl
- All Implemented Interfaces:
DocumentControllerService,ControllerService
- Direct Known Subclasses:
MaintenanceDocumentControllerServiceImpl,TransactionalDocumentControllerServiceImpl
public class DocumentControllerServiceImpl
extends ControllerServiceImpl
implements DocumentControllerService
Default implementation of the document controller service.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.ModelAndViewacknowledge(DocumentFormBase form) Sends a acknowledge workflow action for the document contained on the form.org.springframework.web.servlet.ModelAndViewapprove(DocumentFormBase form) Sends a approve workflow action for the document contained on the form.org.springframework.web.servlet.ModelAndViewSends a blanket approve workflow action for the document contained on the form.protected DocumentAuthorizationExceptionbuildAuthorizationException(String action, Document document) Convenience method for building document authorization exceptions.org.springframework.web.servlet.ModelAndViewcancel(UifFormBase form) Navigates back to a previous point (depending on how the view was requested).org.springframework.web.servlet.ModelAndViewInvoked to remove an attachment that was uploaded for the add note instance.protected org.springframework.web.servlet.ModelAndViewcheckSensitiveDataAndWarningDialog(String field, UifFormBase form) Helper method to check if sensitive data is present in a given string and dialog display.org.springframework.web.servlet.ModelAndViewclose(DocumentFormBase form) Closes the document and returns to the hub.protected List<AdHocRouteRecipient> 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.org.springframework.web.servlet.ModelAndViewcomplete(DocumentFormBase form) Sends a complete workflow action for the document contained on the form.protected voidCreates a new document of the type specified by the docTypeName property of the given form.org.springframework.web.servlet.ModelAndViewdeleteNote(DocumentFormBase form) Invoked by the delete note action to delete a note instance contained on document (within the form).org.springframework.web.servlet.ModelAndViewdisapprove(DocumentFormBase form) Sends a disapprove workflow action for the document contained on the form.org.springframework.web.servlet.ModelAndViewdocHandler(DocumentFormBase form) Determines whether a new document instance needs created or we need to load an existing document by checking theDocumentFormBase.getCommand()value, then delegates to a helper method to carry out the action.org.springframework.web.servlet.ModelAndViewdownloadAttachment(DocumentFormBase form, javax.servlet.http.HttpServletResponse response) Retrieves a note attachment by either the line index of the note within the documents note collection, or by the note identifier.org.springframework.web.servlet.ModelAndViewfyi(DocumentFormBase form) Sends a fyi workflow action for the document contained on the form.protected StringConvenience method for generating disapproval note with text from the explanation dialog.protected NoteRetrieves the note instance on the form that should be added to the document notes.protected AttachmentServiceprotected CollectionControllerServiceprotected ConfigurationServiceprotected DataDictionaryServiceprotected DocumentDictionaryServiceprotected DocumentServiceprotected LegacyDataAdapterprotected ModelAndViewServiceprotected NavigationControllerServiceprotected AttachmentgetNewNoteAttachment(DocumentFormBase form, Document document, Note newNote) Builds an attachment for the file (if any) associated with the add note instance.protected NoteServiceprotected ParameterServiceprotected org.kuali.rice.kew.api.action.WorkflowDocumentActionsServicegetWorkflowDocumentActionsService(String documentTypeId) Helper method to get the correctWorkflowDocumentActionsServicefrom theapplicationIdof the document type.org.springframework.web.servlet.ModelAndViewinsertNote(DocumentFormBase form) Validates the note, saves attachment, adds the time stamp and author, and calls the generic addLine method.protected voidloadDocument(DocumentFormBase form) Loads the document by its provided document header id on the given form.voidInvokes theDocumentServiceto carry out a super user request workflow action and adds a success message.voidperformSuperUserWorkflowAction(DocumentFormBase form, UifConstants.SuperUserWorkflowAction action, org.kuali.rice.kew.api.action.ActionRequest actionRequest) Invokes theDocumentServiceto carry out a super user request workflow action and adds a success message.voidperformWorkflowAction(DocumentFormBase form, UifConstants.WorkflowAction action) Invokes theDocumentServiceto carry out a request workflow action and adds a success message, if requested a check for sensitive data is also performed.voidperformWorkflowAction(DocumentFormBase form, UifConstants.WorkflowAction action, DocumentEvent documentEvent) Invokes theDocumentServiceto 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.ModelAndViewrecall(DocumentFormBase form) Recalls the document with the given id on the form from workflow.org.springframework.web.servlet.ModelAndViewreload(DocumentFormBase form) Reloads from the database the document with the doc id on the given form.org.springframework.web.servlet.ModelAndViewroute(DocumentFormBase form) Sends a route workflow action for the document contained on the form.org.springframework.web.servlet.ModelAndViewsave(DocumentFormBase form) Saves the document instance contained on the given form.org.springframework.web.servlet.ModelAndViewsave(DocumentFormBase form, SaveDocumentEvent saveDocumentEvent) Saves the document instance contained on the given form and passes the given event for rule evaluation.protected voidsaveNewNote(DocumentFormBase form, Document document, Note newNote) Saves a new note instance to the data store if the document state allows it.org.springframework.web.servlet.ModelAndViewSends AdHoc workflow Requests for the document instance contained on the form to the AdHoc recipients contained on the form.voidsetAttachmentService(AttachmentService attachmentService) voidsetCollectionControllerService(CollectionControllerService collectionControllerService) voidsetConfigurationService(ConfigurationService configurationService) voidsetDataDictionaryService(DataDictionaryService dataDictionaryService) voidsetDocumentDictionaryService(DocumentDictionaryService documentDictionaryService) voidsetDocumentService(DocumentService documentService) voidsetLegacyDataAdapter(LegacyDataAdapter legacyDataAdapter) voidsetModelAndViewService(ModelAndViewService modelAndViewService) voidsetNavigationControllerService(NavigationControllerService navigationControllerService) protected voidsetNewNoteProperties(DocumentFormBase form, Document document, Note newNote) Defaults properties (posted timestamp, object id, author) on the note instance that will be added.voidsetNoteService(NoteService noteService) voidsetParameterService(ParameterService parameterService) org.springframework.web.servlet.ModelAndViewSends a super user approve workflow action for the document contained on the form.org.springframework.web.servlet.ModelAndViewSends a super user disapprove workflow action for the document contained on the form.org.springframework.web.servlet.ModelAndViewInvoked to take super user actions on a document.org.springframework.web.servlet.ModelAndViewRedirects to the supervisor workflow view.Methods inherited from class org.kuali.rice.krad.web.service.impl.ControllerServiceImpl
checkViewAuthorization, sessionTimeout, startMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.web.service.ControllerService
checkViewAuthorization, sessionTimeout, start
-
Field Details
-
DOCUMENT_LOAD_COMMANDS
-
SENSITIVE_DATA_DIALOG
- See Also:
-
EXPLANATION_DIALOG
- See Also:
-
-
Constructor Details
-
DocumentControllerServiceImpl
public DocumentControllerServiceImpl()
-
-
Method Details
-
docHandler
public org.springframework.web.servlet.ModelAndView docHandler(DocumentFormBase form) throws org.kuali.rice.kew.api.exception.WorkflowException Determines whether a new document instance needs created or we need to load an existing document by checking theDocumentFormBase.getCommand()value, then delegates to a helper method to carry out the action. Handles all requests for a new document instance or to load an existing document based on the given form parameters.- Specified by:
docHandlerin interfaceDocumentControllerService- Parameters:
form- form instance containing the document data- Returns:
- ModelAndView instance for rendering the document view
- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- if a document cannot be created or loaded
-
loadDocument
protected void loadDocument(DocumentFormBase form) throws org.kuali.rice.kew.api.exception.WorkflowException Loads the document by its provided document header id on 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 id parameter and where the retrieved document instance should be set- Throws:
org.kuali.rice.kew.api.exception.WorkflowException
-
createDocument
protected void createDocument(DocumentFormBase form) throws org.kuali.rice.kew.api.exception.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:
org.kuali.rice.kew.api.exception.WorkflowException
-
cancel
Navigates back to a previous point (depending on how the view was requested). Invoked when the cancel action is invoked on a view. org.kuali.rice.krad.web.service.impl.NavigationControllerServiceImpl#back(org.kuali.rice.krad.web.form.UifFormBase, boolean)- Specified by:
cancelin interfaceControllerService- Overrides:
cancelin classControllerServiceImpl- Parameters:
form- form instance containing the model data- Returns:
- ModelAndView instance for rendering the view
-
reload
public org.springframework.web.servlet.ModelAndView reload(DocumentFormBase form) throws org.kuali.rice.kew.api.exception.WorkflowException Reloads from the database the document with the doc id on the given form.- Specified by:
reloadin interfaceDocumentControllerService- Parameters:
form- form instance containing the document id that will be reloaded- Returns:
- ModelAndView instance for rendering the reloaded document view
- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- if the document cannot be reloaded
-
recall
Recalls the document with the given id on the form from workflow.- Specified by:
recallin interfaceDocumentControllerService- Parameters:
form- form instance containing the document id that will be recalled- Returns:
- ModelAndView instance for rendering the document view
-
save
Saves the document instance contained on the given form.- Specified by:
savein interfaceDocumentControllerService- Parameters:
form- form instance containing the document that will be saved- Returns:
- ModelAndView instance for rendering the document view
-
save
public org.springframework.web.servlet.ModelAndView save(DocumentFormBase form, SaveDocumentEvent saveDocumentEvent) Saves the document instance contained on the given form and passes the given event for rule evaluation.- Specified by:
savein interfaceDocumentControllerService- Parameters:
form- form instance containing the document that will be savedsaveDocumentEvent- rule event that will be processed with the save operation- Returns:
- ModelAndView instance for rendering the document view
-
complete
Sends a complete workflow action for the document contained on the form.- Specified by:
completein interfaceDocumentControllerService- Parameters:
form- form instance containing the document the complete request will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
route
Sends a route workflow action for the document contained on the form.- Specified by:
routein interfaceDocumentControllerService- Parameters:
form- form instance containing the document the route request will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
blanketApprove
Sends a blanket approve workflow action for the document contained on the form.- Specified by:
blanketApprovein interfaceDocumentControllerService- Parameters:
form- form instance containing the document the blanket approve request will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
approve
Sends a approve workflow action for the document contained on the form.- Specified by:
approvein interfaceDocumentControllerService- Parameters:
form- form instance containing the document the approve request will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
disapprove
Sends a disapprove workflow action for the document contained on the form.- Specified by:
disapprovein interfaceDocumentControllerService- Parameters:
form- form instance containing the document the disapprove request will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
generateDisapprovalNote
Convenience method for generating disapproval note with text from the explanation dialog.- Parameters:
form- document form instance containing the explanation dialog- Returns:
-
fyi
Sends a fyi workflow action for the document contained on the form.- Specified by:
fyiin interfaceDocumentControllerService- Parameters:
form- form instance containing the document the fyi request will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
acknowledge
Sends a acknowledge workflow action for the document contained on the form.- Specified by:
acknowledgein interfaceDocumentControllerService- Parameters:
form- form instance containing the document the acknowledge request will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
sendAdHocRequests
Sends AdHoc workflow Requests for the document instance contained on the form to the AdHoc recipients contained on the form.- Specified by:
sendAdHocRequestsin interfaceDocumentControllerService- Parameters:
form- form instance containing the document and recipients the requests will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
supervisorFunctions
Redirects to the supervisor workflow view.- Specified by:
supervisorFunctionsin interfaceDocumentControllerService- Parameters:
form- form instance containing the document instance- Returns:
- ModelAndView instance for rendering the supervisor workflow view
-
close
Closes the document and returns to the hub.- Specified by:
closein interfaceDocumentControllerService- Parameters:
form- form instance containing the document instance- Returns:
- ModelAndView instance for rendering the document view
-
insertNote
Validates the note, saves attachment, adds the time stamp and author, and calls the generic addLine method. Invoked by the add note action to adding the note instance contained of the given form.- Specified by:
insertNotein interfaceDocumentControllerService- Parameters:
form- form instance containing the note instance- Returns:
- ModelAndView instance for rendering the document view
-
getAddLineNoteInstance
Retrieves the note instance on the form that should be added to the document notes.- Parameters:
form- form instance containing the add note instance- Returns:
-
setNewNoteProperties
Defaults properties (posted timestamp, object id, author) on the note instance that will be added.- Parameters:
form- form instance containing the add note instancedocument- document instance the note will be added tonewNote- note instance to set properties on
-
getNewNoteAttachment
Builds an attachment for the file (if any) associated with the add note instance.- Parameters:
form- form instance containing the attachment filedocument- document instance the attachment should be associated withnewNote- note instance the attachment should be associated with- Returns:
- Attachment instance for the note, or null if no attachment file was present
-
saveNewNote
Saves a new note instance to the data store if the document state allows it.- Parameters:
form- form instance containing the add note instancedocument- document instance the note is associated withnewNote- note instance to save
-
deleteNote
Invoked by the delete note action to delete a note instance contained on document (within the form).- Specified by:
deleteNotein interfaceDocumentControllerService- Parameters:
form- form instance containing the note instance- Returns:
- ModelAndView instance for rendering the document view
-
downloadAttachment
public org.springframework.web.servlet.ModelAndView downloadAttachment(DocumentFormBase form, javax.servlet.http.HttpServletResponse response) Retrieves a note attachment by either the line index of the note within the documents note collection, or by the note identifier. Invoked to download an attachment that has been uploaded for a note.- Specified by:
downloadAttachmentin interfaceDocumentControllerService- Parameters:
form- form instance containing the note (and attachment) instanceresponse- http servlet response instance for sending back the attachment contents- Returns:
- ModelAndView instance for rendering the document view, or null if the response has been finished
-
cancelAttachment
Invoked to remove an attachment that was uploaded for the add note instance.- Specified by:
cancelAttachmentin interfaceDocumentControllerService- Parameters:
form- form instance containing the attachment.- Returns:
- ModelAndView instance for rendering the document view
-
superUserTakeActions
Invoked to take super user actions on a document.- Specified by:
superUserTakeActionsin interfaceDocumentControllerService- Parameters:
form- form instance containing the actions.- Returns:
- ModelAndView instance for rendering the document view
-
superUserApprove
Sends a super user approve workflow action for the document contained on the form.- Specified by:
superUserApprovein interfaceDocumentControllerService- Parameters:
form- form instance containing the document the super user approve request will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
superUserDisapprove
Sends a super user disapprove workflow action for the document contained on the form.- Specified by:
superUserDisapprovein interfaceDocumentControllerService- Parameters:
form- form instance containing the document the super user disapprove request will be generated for- Returns:
- ModelAndView instance for rendering the document view
-
performWorkflowAction
Invokes theDocumentServiceto carry out a request workflow action and adds a success message, if requested a check for sensitive data is also performed.- Specified by:
performWorkflowActionin interfaceDocumentControllerService- Parameters:
form- document form instance containing the document for which the action will be taken onaction-UifConstants.WorkflowActionenum indicating what workflow action to take
-
performWorkflowAction
public void performWorkflowAction(DocumentFormBase form, UifConstants.WorkflowAction action, DocumentEvent documentEvent) Invokes theDocumentServiceto carry out a request workflow action and adds a success message, if requested a check for sensitive data is also performed.- Specified by:
performWorkflowActionin interfaceDocumentControllerService- Parameters:
form- document form instance containing the document for which the action will be taken onaction-UifConstants.WorkflowActionenum indicating what workflow action to takedocumentEvent- rule event instance that will be evaluated with the workflow action, only currently supported for the save action
-
combineAdHocRecipients
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
-
performSuperUserWorkflowAction
public void performSuperUserWorkflowAction(DocumentFormBase form, UifConstants.SuperUserWorkflowAction action) Invokes theDocumentServiceto carry out a super user request workflow action and adds a success message.- Specified by:
performSuperUserWorkflowActionin interfaceDocumentControllerService- Parameters:
form- document form instance containing the document for which the super user action will be taken onaction-UifConstants.SuperUserWorkflowActionenum indicating what super user workflow action to take
-
performSuperUserWorkflowAction
public void performSuperUserWorkflowAction(DocumentFormBase form, UifConstants.SuperUserWorkflowAction action, org.kuali.rice.kew.api.action.ActionRequest actionRequest) Invokes theDocumentServiceto carry out a super user request workflow action and adds a success message.- Specified by:
performSuperUserWorkflowActionin interfaceDocumentControllerService- Parameters:
form- document form instance containing the document for which the super user action will be taken onaction-UifConstants.SuperUserWorkflowActionenum indicating what super user workflow action to takeactionRequest- the requested action to take, currenly only available for take action
-
getWorkflowDocumentActionsService
protected org.kuali.rice.kew.api.action.WorkflowDocumentActionsService getWorkflowDocumentActionsService(String documentTypeId) Helper method to get the correctWorkflowDocumentActionsServicefrom theapplicationIdof the document type.- Parameters:
documentTypeId- the document type to get the application id from- Returns:
- the correct
WorkflowDocumentActionsServicefrom theapplicationIdof the document type
-
checkSensitiveDataAndWarningDialog
protected org.springframework.web.servlet.ModelAndView checkSensitiveDataAndWarningDialog(String field, UifFormBase form) Helper method to check if sensitive data is present in a given string and dialog display.If the string is sensitive we want to return a dialog box to make sure user wants to continue, else we just return null
- Parameters:
field- the string to check for sensitive dataform- the form to add the dialog to- Returns:
- the model and view for the dialog or null if there isn't one
-
buildAuthorizationException
protected DocumentAuthorizationException buildAuthorizationException(String action, Document document) Convenience method for building document authorization exceptions.- Parameters:
action- the action that was requesteddocument- document instance the action was requested for
-
getLegacyDataAdapter
-
setLegacyDataAdapter
-
getDataDictionaryService
-
setDataDictionaryService
-
getDocumentService
-
setDocumentService
-
getDocumentDictionaryService
-
setDocumentDictionaryService
-
getAttachmentService
-
setAttachmentService
-
getNoteService
-
setNoteService
-
getModelAndViewService
- Overrides:
getModelAndViewServicein classControllerServiceImpl
-
setModelAndViewService
- Overrides:
setModelAndViewServicein classControllerServiceImpl
-
getConfigurationService
-
setConfigurationService
-
getCollectionControllerService
-
setCollectionControllerService
-
getParameterService
-
setParameterService
-