fr.paris.lutece.plugins.form.service.upload
Class FormAsynchronousUploadHandler

java.lang.Object
  extended by fr.paris.lutece.plugins.form.service.upload.FormAsynchronousUploadHandler
All Implemented Interfaces:
fr.paris.lutece.plugins.genericattributes.service.upload.IGAAsyncUploadHandler, fr.paris.lutece.portal.web.upload.IAsynchronousUploadHandler

public class FormAsynchronousUploadHandler
extends Object
implements fr.paris.lutece.plugins.genericattributes.service.upload.IGAAsyncUploadHandler

FormAsynchronousUploadHandler.

See Also:
getFileItems(String, String), removeFileItem(String, String, int)

Constructor Summary
FormAsynchronousUploadHandler()
           
 
Method Summary
 void addFileItemToUploadedFile(org.apache.commons.fileupload.FileItem fileItem, String strIdEntry, javax.servlet.http.HttpSession session)
          Add file item to the list of uploaded files
 String buildFieldName(String strIdEntry)
          Build the field name from a given id entry i.e. : form_1
 void doUploadAction(javax.servlet.http.HttpServletRequest request, String strUploadAction)
          Performs an upload action.
 List<org.apache.commons.fileupload.FileItem> getFileItems(String strIdEntry, String strSessionId)
          
static FormAsynchronousUploadHandler getHandler()
          Get the handler
 String getUploadAction(javax.servlet.http.HttpServletRequest request)
          Checks the request parameters to see if an upload submit has been called.
 boolean isInvoked(javax.servlet.http.HttpServletRequest request)
          
 void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, net.sf.json.JSONObject mainObject, List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload)
          
 void removeFileItem(String strIdEntry, String strSessionId, int nIndex)
          
 void removeSessionFiles(String strSessionId)
          Removes all files associated to the session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormAsynchronousUploadHandler

public FormAsynchronousUploadHandler()
Method Detail

getHandler

public static FormAsynchronousUploadHandler getHandler()
Get the handler

Returns:
the handler

isInvoked

public boolean isInvoked(javax.servlet.http.HttpServletRequest request)

Specified by:
isInvoked in interface fr.paris.lutece.portal.web.upload.IAsynchronousUploadHandler

process

public void process(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response,
                    net.sf.json.JSONObject mainObject,
                    List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload)

Specified by:
process in interface fr.paris.lutece.portal.web.upload.IAsynchronousUploadHandler

getFileItems

public List<org.apache.commons.fileupload.FileItem> getFileItems(String strIdEntry,
                                                                 String strSessionId)

Specified by:
getFileItems in interface fr.paris.lutece.plugins.genericattributes.service.upload.IGAAsyncUploadHandler

removeFileItem

public void removeFileItem(String strIdEntry,
                           String strSessionId,
                           int nIndex)

Specified by:
removeFileItem in interface fr.paris.lutece.plugins.genericattributes.service.upload.IGAAsyncUploadHandler

removeSessionFiles

public void removeSessionFiles(String strSessionId)
Removes all files associated to the session

Parameters:
strSessionId - the session id

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.

doUploadAction

public void doUploadAction(javax.servlet.http.HttpServletRequest request,
                           String strUploadAction)
Performs an upload action.

Parameters:
request - the HTTP request
strUploadAction - the name of the upload action

addFileItemToUploadedFile

public void addFileItemToUploadedFile(org.apache.commons.fileupload.FileItem fileItem,
                                      String strIdEntry,
                                      javax.servlet.http.HttpSession session)
Add file item to the list of uploaded files

Parameters:
fileItem - the file item
strIdEntry - the id entry
session - the session

buildFieldName

public String buildFieldName(String strIdEntry)
Build the field name from a given id entry i.e. : form_1

Parameters:
strIdEntry - the id entry
Returns:
the field name


Copyright © 2014 Mairie de Paris. All Rights Reserved.