Class AjaxFileUploadBehavior

java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.behavior.AbstractAjaxBehavior
org.hippoecm.frontend.plugins.jquery.upload.behaviors.AjaxFileUploadBehavior
All Implemented Interfaces:
Serializable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.IRequestListener, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, org.apache.wicket.util.io.IClusterable

public abstract class AjaxFileUploadBehavior extends org.apache.wicket.behavior.AbstractAjaxBehavior
The file upload behavior to handle uploads sent by ajax requests. The component container can override the following events:
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AjaxFileUploadBehavior(org.apache.wicket.markup.html.WebMarkupContainer container)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    onAfterUpload(org.apache.commons.fileupload2.core.FileItem<?> file, FileUploadInfo fileUploadInfo)
     
    protected void
    Event is fired before processing the uploaded file.
    void
     
    protected void
    onResponse(org.apache.wicket.protocol.http.servlet.ServletWebRequest request, Map<String,FileUploadInfo> uploadedFiles)
     
    protected void
    onUploadError(FileUploadInfo fileUploadInfo)
     
    protected org.apache.wicket.markup.html.form.upload.FileUpload
    preProcess(org.apache.commons.fileupload2.core.FileItem<?> fileItem, org.apache.wicket.markup.html.form.upload.FileUpload originalFileUpload)
     
    protected abstract void
    process(org.apache.wicket.markup.html.form.upload.FileUpload fileUpload)
     
    protected void
    setResponse(org.apache.wicket.protocol.http.servlet.ServletWebRequest request, Map<String,FileUploadInfo> uploadedFiles)
     
    protected void
    validate(org.apache.wicket.markup.html.form.upload.FileUpload fileUpload)
     
    protected boolean
    wantsHtml(org.apache.wicket.protocol.http.servlet.ServletWebRequest request)
    Decides what should be the response's content type depending on the 'Accept' request header.

    Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior

    afterRender, bind, getCallbackUrl, getComponent, onBind, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind

    Methods inherited from class org.apache.wicket.behavior.Behavior

    beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag, renderHead

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.wicket.IRequestListener

    rendersPage
  • Field Details

  • Constructor Details

    • AjaxFileUploadBehavior

      public AjaxFileUploadBehavior(org.apache.wicket.markup.html.WebMarkupContainer container)
  • Method Details

    • onRequest

      public void onRequest()
    • onBeforeUpload

      protected void onBeforeUpload(FileUploadInfo fileUploadInfo)
      Event is fired before processing the uploaded file.
    • onUploadError

      protected void onUploadError(FileUploadInfo fileUploadInfo)
    • validate

      protected void validate(org.apache.wicket.markup.html.form.upload.FileUpload fileUpload) throws FileUploadViolationException
      Throws:
      FileUploadViolationException
    • preProcess

      protected org.apache.wicket.markup.html.form.upload.FileUpload preProcess(org.apache.commons.fileupload2.core.FileItem<?> fileItem, org.apache.wicket.markup.html.form.upload.FileUpload originalFileUpload) throws Exception
      Throws:
      Exception
    • process

      protected abstract void process(org.apache.wicket.markup.html.form.upload.FileUpload fileUpload) throws FileUploadViolationException
      Throws:
      FileUploadViolationException
    • setResponse

      protected void setResponse(org.apache.wicket.protocol.http.servlet.ServletWebRequest request, Map<String,FileUploadInfo> uploadedFiles)
    • wantsHtml

      protected boolean wantsHtml(org.apache.wicket.protocol.http.servlet.ServletWebRequest request)
      Decides what should be the response's content type depending on the 'Accept' request header. HTML5-browsers work with "application/json", older ones use IFrame to make the upload and the response should be HTML.
    • onAfterUpload

      protected void onAfterUpload(org.apache.commons.fileupload2.core.FileItem<?> file, FileUploadInfo fileUploadInfo)
    • onResponse

      protected void onResponse(org.apache.wicket.protocol.http.servlet.ServletWebRequest request, Map<String,FileUploadInfo> uploadedFiles)