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
-
Constructor Summary
ConstructorDescriptionAjaxFileUploadBehavior
(org.apache.wicket.markup.html.WebMarkupContainer container) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
onAfterUpload
(org.apache.commons.fileupload2.core.FileItem<?> file, FileUploadInfo fileUploadInfo) protected void
onBeforeUpload
(FileUploadInfo fileUploadInfo) 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
-
APPLICATION_JSON
- See Also:
-
JQUERY_FILEUPLOAD_FILES
- See Also:
-
JQUERY_FILEUPLOAD_NAME
- See Also:
-
JQUERY_FILEUPLOAD_SIZE
- See Also:
-
JQUERY_FILEUPLOAD_ERROR
- See Also:
-
-
Constructor Details
-
AjaxFileUploadBehavior
public AjaxFileUploadBehavior(org.apache.wicket.markup.html.WebMarkupContainer container)
-
-
Method Details
-
onRequest
public void onRequest() -
onBeforeUpload
Event is fired before processing the uploaded file. -
onUploadError
-
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)
-