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 Type
    Method
    Description
    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
    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
    void
    addFilesUploadedSynchronously(jakarta.servlet.http.HttpServletRequest request, String strFieldName)
    Add files uploaded synchronously for a given field
    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.
    void
    doRemoveFile(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 prefix
    Get the upload delete prefix
    Get the upload submit prefix
    boolean
    hasAddFileFlag(jakarta.servlet.http.HttpServletRequest request, String strFieldName)
    Check if the request has the flag to submit a file without submitting the form.
    boolean
    hasRemoveFlag(jakarta.servlet.http.HttpServletRequest request, String strFieldName)
    Check if the request has a remove flag for a given entry.
    boolean
     
    void
    removeFileItem(String strFieldName, jakarta.servlet.http.HttpSession session, int nIndex)
    Remove file Item
    void
    removeSessionFiles(jakarta.servlet.http.HttpSession session)
    Cleans up all files associated with the specified session.

    Methods 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 request
      strFieldName - the field name
      listFileItemsToUpload - the list of files to upload
      locale - 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 name
      session - The session of the current user
      Returns:
      the fileItem found, null otherwise.
    • 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 name
      session - The session of the current user
      Returns:
      the fileItem found, null otherwise.
    • removeFileItem

      void removeFileItem(String strFieldName, jakarta.servlet.http.HttpSession session, int nIndex)
      Remove file Item
      Parameters:
      strFieldName - the field name
      session - The session of the current user
      nIndex - 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 method getListUploadedFiles(String, HttpSession)
    • 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 item
      strFieldName - the field name
      request - 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 item
      strFieldName - the field name
      request - the request
    • hasRemoveFlag

      boolean hasRemoveFlag(jakarta.servlet.http.HttpServletRequest request, String strFieldName)
      Check if the request has a remove flag for a given entry.
      Parameters:
      request - The request
      strFieldName - The field name
      Returns:
      True if the request has a remove flag for the given entry, false otherwise
    • doRemoveFile

      void doRemoveFile(jakarta.servlet.http.HttpServletRequest request, String strFieldName)
      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 request
      strFieldName - 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 request
      strFieldName - The field name of the files to remove
      listIndexesFilesToRemove - The list of indexes of files to remove
      Returns:
      The result JSON
    • hasAddFileFlag

      boolean hasAddFileFlag(jakarta.servlet.http.HttpServletRequest request, String strFieldName)
      Check if the request has the flag to submit a file without submitting the form.
      Parameters:
      request - The request
      strFieldName - 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 request
      strFieldName - 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

      void removeSessionFiles(jakarta.servlet.http.HttpSession session)
      Cleans up all files associated with the specified session. Implementations must delete each physical temporary file, typically by calling MultipartItem.delete(), and remove the corresponding session entry from their internal file-item map as part of the same cleanup operation.
      Parameters:
      session - the terminated session