Project Wonder 5.0.0.8658

er.ajax
Class AjaxFileUpload

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by er.ajax.AjaxFileUpload
All Implemented Interfaces:
WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, Cloneable

public class AjaxFileUpload
extends WOComponent

AjaxFileUpload provides an Ajax wrapper around the file upload process. This works pretty differently than WOFileUpload. The AjaxFileUpload component itself provides its own form and autosubmits when the user selects a file to upload. The upload runs in a hidden iframe, with Ajax updates occurring in the main window. When the final ajax update occurs after the completion of the upload, the appropriate actions fire. This means that if the user navigates away during the upload, no completion/failure/etc notifications will occur.

Author:
mschrag
See Also:
Serialized Form
Bindings
cancelText the text to display for the cancel link
           
cancelingText the text to display when the progress is being canceled
           
startingText the text to display when the progress is starting
           
startedFunction the javascript function to execute when the progress is started
           
canceledFunction the javascript function to execute when the upload is canceled
           
succeededFunction the javascript function to execute when the upload succeeds
           
failedFunction the javascript function to execute when the upload fails
           
finishedFunction the javascript function to execute when the upload finishes (succeeded, failed, or canceled)
           
finishedAction the action to fire when the upload finishes (cancel, failed, or succeeded)
           
canceledAction the action to fire when the upload is canceled
           
succeededAction the action to fire when the upload succeeded
           
failedAction the action to fire when the upload fails
           
data the NSData that will be bound with the contents of the upload
           
inputStream will be bound to an input stream on the contents of the upload
           
outputStream the output stream to write the contents of the upload to
           
streamToFilePath the path to write the upload to, can be a directory
           
finalFilePath the final file path of the upload (when streamToFilePath is set or keepTempFile = true)
           
filePath the name of the uploaded file
           
allowCancel if true, the cancel link is visible
           
progressBarBeforeStart if true, the progress bar is visible before the upload is started
           
progressBarAfterDone if true, the progress bar is visible after the upload is done
           
refreshTime the number of milliseconds to wait between refreshes
           
keepTempFile if true, don't delete the temp file that AjaxFileUpload creates
           
uploadLabel the label to display on the Upload button ("Upload" by default)
           
uploadFunctionName the upload button will instead be a function with the given name
           

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
WOComponent._EventLoggingEnabler, WOComponent.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations, MINUSONE
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSValidation
_CLASS
 
Constructor Summary
AjaxFileUpload(WOContext context)
           
 
Method Summary
 void appendToResponse(WOResponse aResponse, WOContext aContext)
           
 String bytesReadSize()
           
 String cancelingText()
           
 String id()
           
 boolean isUploadStarted()
           
 boolean progressBarAfterDone()
           
 boolean progressBarBeforeStart()
           
 String progressBarID()
           
 String requestHandlerKey()
           
 void setRequestHandlerKey(String requestHandlerKey)
           
 void setUploadProgress(AjaxUploadProgress progress)
           
 String srcUrl()
           
 String startingText()
           
 WOActionResults startUpload()
           
 String startUploadFunctionCall()
           
 String startUploadName()
           
 String streamLengthSize()
           
 boolean synchronizesVariablesWithBindings()
           
 boolean triggerStartUpload()
           
 WOActionResults uploadCanceled()
           
 WOActionResults uploadFailed()
           
 void uploadFinished()
           
 String uploadFormID()
           
 String uploadFrameName()
           
 String uploadLabel()
           
 AjaxUploadProgress uploadProgress()
           
 WOActionResults uploadSucceeded()
           
 String uploadUrl()
           
 
Methods inherited from class com.webobjects.appserver.WOComponent
__valueForBinding, _associationWithName, _awakeInContext, _childTemplate, _cleanUpStatelessComponent, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, invokeAction, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, reset, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, template, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AjaxFileUpload

public AjaxFileUpload(WOContext context)
Method Detail

setRequestHandlerKey

public void setRequestHandlerKey(String requestHandlerKey)

requestHandlerKey

public String requestHandlerKey()

appendToResponse

public void appendToResponse(WOResponse aResponse,
                             WOContext aContext)
Overrides:
appendToResponse in class WOComponent

synchronizesVariablesWithBindings

public boolean synchronizesVariablesWithBindings()
Overrides:
synchronizesVariablesWithBindings in class WOComponent

uploadLabel

public String uploadLabel()

progressBarBeforeStart

public boolean progressBarBeforeStart()

progressBarAfterDone

public boolean progressBarAfterDone()

setUploadProgress

public void setUploadProgress(AjaxUploadProgress progress)

uploadProgress

public AjaxUploadProgress uploadProgress()

id

public String id()

uploadUrl

public String uploadUrl()

bytesReadSize

public String bytesReadSize()

streamLengthSize

public String streamLengthSize()

uploadFrameName

public String uploadFrameName()

startUploadName

public String startUploadName()

startUploadFunctionCall

public String startUploadFunctionCall()

triggerStartUpload

public boolean triggerStartUpload()

uploadFormID

public String uploadFormID()

progressBarID

public String progressBarID()

startingText

public String startingText()

cancelingText

public String cancelingText()

startUpload

public WOActionResults startUpload()

isUploadStarted

public boolean isUploadStarted()

uploadFinished

public void uploadFinished()

uploadCanceled

public WOActionResults uploadCanceled()

uploadSucceeded

public WOActionResults uploadSucceeded()

uploadFailed

public WOActionResults uploadFailed()

srcUrl

public String srcUrl()

Last updated: Fri, Nov 21, 2008 • 04:36 AM EST

Copyright © 2002 – 2007 Project Wonder.