Interface IAsyncUploadHandler
- All Superinterfaces:
fr.paris.lutece.portal.web.upload.IAsynchronousUploadHandler2
- All Known Implementing Classes:
AbstractAsynchronousUploadHandler,AsynchronousUploadHandler
public interface IAsyncUploadHandler
extends fr.paris.lutece.portal.web.upload.IAsynchronousUploadHandler2
Interface for asynchronous upload handlers used by entries of type upload. Handler must be declared as CDI beans.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFileItemToPartialUploadedFilesList(fr.paris.lutece.portal.service.upload.MultipartItem fileItem, String strFieldName, jakarta.servlet.http.HttpServletRequest request) Add file item to the list of partial uploaded filesvoidaddFileItemToUploadedFilesList(fr.paris.lutece.portal.service.upload.MultipartItem fileItem, String strFieldName, jakarta.servlet.http.HttpServletRequest request) Add a file item to the list of uploaded filesvoidaddFilesUploadedSynchronously(jakarta.servlet.http.HttpServletRequest request, String strFieldName) Add files uploaded synchronously for a given fieldcanUploadFiles(jakarta.servlet.http.HttpServletRequest request, String strFieldName, List<fr.paris.lutece.portal.service.upload.MultipartItem> listFileItemsToUpload, Locale locale) Check if the file can be uploaded or not.voiddoRemoveFile(jakarta.servlet.http.HttpServletRequest request, String strFieldName) Do remove a file of a given entry if a flag is present in the request.doRemoveUploadedFile(jakarta.servlet.http.HttpServletRequest request, String strFieldName, List<Integer> listIndexesFilesToRemove) Do remove a list of files from uploaded files.byte[]doRetrieveUploadedFile(jakarta.servlet.http.HttpServletRequest request) Do retrieve a file from uploaded files.Get the name of the handler.List<fr.paris.lutece.portal.service.upload.MultipartItem>getListPartialUploadedFiles(String strFieldName, jakarta.servlet.http.HttpSession session) Gets the list of partial upload files for a given field and a given session.List<fr.paris.lutece.portal.service.upload.MultipartItem>getListUploadedFiles(String strFieldName, jakarta.servlet.http.HttpSession session) Gets the list of upload files for a given field and a given session.Get the upload checkbox prefixGet the upload delete prefixGet the upload submit prefixbooleanhasAddFileFlag(jakarta.servlet.http.HttpServletRequest request, String strFieldName) Check if the request has the flag to submit a file without submitting the form.booleanhasRemoveFlag(jakarta.servlet.http.HttpServletRequest request, String strFieldName) Check if the request has a remove flag for a given entry.booleanvoidremoveAllFileItem(jakarta.servlet.http.HttpSession session) Remove all file Item for a given sessionvoidremoveFileItem(String strFieldName, jakarta.servlet.http.HttpSession session, int nIndex) Remove file Itemdefault voidremoveSessionFiles(jakarta.servlet.http.HttpSession session) Removes all files associated to the sessionMethods inherited from interface fr.paris.lutece.portal.web.upload.IAsynchronousUploadHandler2
isInvoked, process
-
Method Details
-
getUploadSubmitPrefix
String getUploadSubmitPrefix()Get the upload submit prefix- Returns:
- The upload submit prefix
-
getUploadDeletePrefix
String getUploadDeletePrefix()Get the upload delete prefix- Returns:
- The upload delete prefix
-
getUploadCheckboxPrefix
String getUploadCheckboxPrefix()Get the upload checkbox prefix- Returns:
- The upload checkbox prefix
-
canUploadFiles
String canUploadFiles(jakarta.servlet.http.HttpServletRequest request, String strFieldName, List<fr.paris.lutece.portal.service.upload.MultipartItem> listFileItemsToUpload, Locale locale) Check if the file can be uploaded or not.- Parameters:
request- The requeststrFieldName- the field namelistFileItemsToUpload- the list of files to uploadlocale- the locale- Returns:
- The error message if any, or null if the files can be uploaded.
-
getListUploadedFiles
List<fr.paris.lutece.portal.service.upload.MultipartItem> getListUploadedFiles(String strFieldName, jakarta.servlet.http.HttpSession session) Gets the list of upload files for a given field and a given session. The order of files in the list must be the upload order. Their index in this list (from 0 to the list size) will be used to identify them.- Parameters:
strFieldName- the field namesession- The session of the current user- Returns:
- the fileItem found,
nullotherwise.
-
getListPartialUploadedFiles
List<fr.paris.lutece.portal.service.upload.MultipartItem> getListPartialUploadedFiles(String strFieldName, jakarta.servlet.http.HttpSession session) Gets the list of partial upload files for a given field and a given session. The order of files in the list must be the upload order. Their index in this list (from 0 to the list size) will be used to identify them.- Parameters:
strFieldName- the field namesession- The session of the current user- Returns:
- the fileItem found,
nullotherwise.
-
removeFileItem
Remove file Item- Parameters:
strFieldName- the field namesession- The session of the current usernIndex- the index of the file to remove (from 0 to n). The index is the index of the file in the uploaded file list given by the methodgetListUploadedFiles(String, HttpSession)
-
removeAllFileItem
void removeAllFileItem(jakarta.servlet.http.HttpSession session) Remove all file Item for a given session- Parameters:
session- The session of the current user
-
addFileItemToUploadedFilesList
void addFileItemToUploadedFilesList(fr.paris.lutece.portal.service.upload.MultipartItem fileItem, String strFieldName, jakarta.servlet.http.HttpServletRequest request) Add a file item to the list of uploaded files- Parameters:
fileItem- the file itemstrFieldName- the field namerequest- the request
-
addFileItemToPartialUploadedFilesList
void addFileItemToPartialUploadedFilesList(fr.paris.lutece.portal.service.upload.MultipartItem fileItem, String strFieldName, jakarta.servlet.http.HttpServletRequest request) Add file item to the list of partial uploaded files- Parameters:
fileItem- the file itemstrFieldName- the field namerequest- the request
-
hasRemoveFlag
Check if the request has a remove flag for a given entry.- Parameters:
request- The requeststrFieldName- The field name- Returns:
- True if the request has a remove flag for the given entry, false otherwise
-
doRemoveFile
Do remove a file of a given entry if a flag is present in the request. Files are selected from the request.- Parameters:
request- The requeststrFieldName- The field name
-
doRemoveUploadedFile
String doRemoveUploadedFile(jakarta.servlet.http.HttpServletRequest request, String strFieldName, List<Integer> listIndexesFilesToRemove) Do remove a list of files from uploaded files.- Parameters:
request- The requeststrFieldName- The field name of the files to removelistIndexesFilesToRemove- The list of indexes of files to remove- Returns:
- The result JSON
-
hasAddFileFlag
Check if the request has the flag to submit a file without submitting the form.- Parameters:
request- The requeststrFieldName- The id of the entry- Returns:
- True if the flag is present in the request, false otherwise
-
addFilesUploadedSynchronously
void addFilesUploadedSynchronously(jakarta.servlet.http.HttpServletRequest request, String strFieldName) Add files uploaded synchronously for a given field- Parameters:
request- The requeststrFieldName- The name of the field to add files of
-
getHandlerName
String getHandlerName()Get the name of the handler. The name of the handler must be unique. The handler name must only contain alphabetic characters (no point, no space, no coma, no #, ...).- Returns:
- The name of the handler
-
doRetrieveUploadedFile
byte[] doRetrieveUploadedFile(jakarta.servlet.http.HttpServletRequest request) Do retrieve a file from uploaded files.- Parameters:
request- The request- Returns:
- The file
-
isManagePartialContent
boolean isManagePartialContent()- Returns:
- true if the handler manage partial content
-
removeSessionFiles
default void removeSessionFiles(jakarta.servlet.http.HttpSession session) Removes all files associated to the session- Parameters:
strSessionId- the session id
-