Class FileControllerServiceImpl
java.lang.Object
org.kuali.rice.krad.web.service.impl.FileControllerServiceImpl
- All Implemented Interfaces:
FileControllerService
Default implementation of the file controller service.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.ModelAndViewaddFileUploadLine(UifFormBase form) Invoked by the multiFile upload element to add a file object to the collection it controls.org.springframework.web.servlet.ModelAndViewInvoked by the multiFile upload widget to delete a file; Inform the model of file to delete.protected CollectionControllerServicevoidgetFileFromLine(UifFormBase form, javax.servlet.http.HttpServletResponse response) Invoked by the multiFile upload widget to get the file contents for a file upload line.protected ModelAndViewServiceprotected voidsendFileFromLineResponse(UifFormBase form, javax.servlet.http.HttpServletResponse response, List<FileMeta> collection, FileMeta fileLine) Hook controller method to send a response back by using response.flushBuffer() using request/collection/fileLine information provided.voidsetCollectionControllerService(CollectionControllerService collectionControllerService) voidsetModelAndViewService(ModelAndViewService modelAndViewService)
-
Field Details
-
DELETE_FILE_UPLOAD_LINE_DIALOG
- See Also:
-
-
Constructor Details
-
FileControllerServiceImpl
public FileControllerServiceImpl()
-
-
Method Details
-
addFileUploadLine
Invoked by the multiFile upload element to add a file object to the collection it controls.- Specified by:
addFileUploadLinein interfaceFileControllerService- Parameters:
form- form instance containing the file data- Returns:
- ModelAndView instance for rendering the view
-
deleteFileUploadLine
Invoked by the multiFile upload widget to delete a file; Inform the model of file to delete.- Specified by:
deleteFileUploadLinein interfaceFileControllerService- Parameters:
form- form instance containing the file data- Returns:
- ModelAndView instance for rendering the view
-
getFileFromLine
Invoked by the multiFile upload widget to get the file contents for a file upload line.- Specified by:
getFileFromLinein interfaceFileControllerService- Parameters:
form- form instance containing the file request dataresponse- Http response for streaming back the file contents
-
sendFileFromLineResponse
protected void sendFileFromLineResponse(UifFormBase form, javax.servlet.http.HttpServletResponse response, List<FileMeta> collection, FileMeta fileLine) Hook controller method to send a response back by using response.flushBuffer() using request/collection/fileLine information provided.A sample implementation may look like:
if (fileLine instanceof FileMetaBlob) { InputStream is = ((FileMetaBlob) fileLine).getBlob().getBinaryStream(); response.setContentType("application/force-download"); response.setHeader("Content-Disposition", "attachment; filename=" + fileLine.getName()); // copy it to response's OutputStream FileCopyUtils.copy(is, response.getOutputStream()); response.flushBuffer(); }- Parameters:
form- form instance containing the file request dataresponse- Http response object for streaming back the file contentscollection- collection the file object belongs tofileLine- the particular file line instance the contents should be sent back for
-
getCollectionControllerService
-
setCollectionControllerService
-
getModelAndViewService
-
setModelAndViewService
-