Class AbstractAsynchronousUploadHandler

    • Constructor Detail

      • AbstractAsynchronousUploadHandler

        public AbstractAsynchronousUploadHandler()
    • Method Detail

      • process

        public void process​(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            Map<String,​Object> map,
                            List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload)
        Specified by:
        process in interface fr.paris.lutece.portal.web.upload.IAsynchronousUploadHandler2
      • getUploadAction

        public String getUploadAction​(javax.servlet.http.HttpServletRequest request)
        Checks the request parameters to see if an upload submit has been called.
        Parameters:
        request - the HTTP request
        Returns:
        the name of the upload action, if any. Null otherwise.
      • doRemoveFile

        public void doRemoveFile​(javax.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.
        Specified by:
        doRemoveFile in interface IAsyncUploadHandler
        Parameters:
        request - The request
        strFieldName - The field name
      • doRemoveUploadedFile

        public String doRemoveUploadedFile​(javax.servlet.http.HttpServletRequest request,
                                           String strFieldName,
                                           List<Integer> listIndexesFilesToRemove)
        Do remove a list of files from uploaded files.
        Specified by:
        doRemoveUploadedFile in interface IAsyncUploadHandler
        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
      • hasRemoveFlag

        public boolean hasRemoveFlag​(javax.servlet.http.HttpServletRequest request,
                                     String strFieldName)
        Check if the request has a remove flag for a given entry.
        Specified by:
        hasRemoveFlag in interface IAsyncUploadHandler
        Parameters:
        request - The request
        strFieldName - The field name
        Returns:
        True if the request has a remove flag for the given entry, false otherwise
      • isInvoked

        public boolean isInvoked​(javax.servlet.http.HttpServletRequest request)
        Specified by:
        isInvoked in interface fr.paris.lutece.portal.web.upload.IAsynchronousUploadHandler2
      • hasAddFileFlag

        public boolean hasAddFileFlag​(javax.servlet.http.HttpServletRequest request,
                                      String strFieldName)
        Check if the request has the flag to submit a file without submitting the form.
        Specified by:
        hasAddFileFlag in interface IAsyncUploadHandler
        Parameters:
        request - The request
        strFieldName - The id of the entry
        Returns:
        True if the flag is present in the request, false otherwise
      • addFilesUploadedSynchronously

        public void addFilesUploadedSynchronously​(javax.servlet.http.HttpServletRequest request,
                                                  String strFieldName)
        Add files uploaded synchronously for a given field
        Specified by:
        addFilesUploadedSynchronously in interface IAsyncUploadHandler
        Parameters:
        request - The request
        strFieldName - The name of the field to add files of
      • doRetrieveUploadedFile

        public byte[] doRetrieveUploadedFile​(javax.servlet.http.HttpServletRequest request)
        Do retrieve a file from uploaded files.
        Specified by:
        doRetrieveUploadedFile in interface IAsyncUploadHandler
        Parameters:
        request - The request
        Returns:
        The file
      • getListPartialUploadedFiles

        public List<org.apache.commons.fileupload.FileItem> getListPartialUploadedFiles​(String strFieldName,
                                                                                        javax.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.
        Specified by:
        getListPartialUploadedFiles in interface IAsyncUploadHandler
        Parameters:
        strFieldName - the field name
        session - The session of the current user
        Returns:
        the fileItem found, null otherwise.
      • addFileItemToPartialUploadedFilesList

        public void addFileItemToPartialUploadedFilesList​(org.apache.commons.fileupload.FileItem fileItem,
                                                          String strFieldName,
                                                          javax.servlet.http.HttpServletRequest request)
        Add file item to the list of partial uploaded files
        Specified by:
        addFileItemToPartialUploadedFilesList in interface IAsyncUploadHandler
        Parameters:
        fileItem - the file item
        strFieldName - the field name
        request - the request
      • removeAllFileItem

        public void removeAllFileItem​(javax.servlet.http.HttpSession session)
        Remove all file Item for a given session
        Specified by:
        removeAllFileItem in interface IAsyncUploadHandler
        Parameters:
        session - The session of the current user