|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webobjects.appserver.WOElement
com.webobjects.appserver.WOComponent
er.ajax.AjaxFileUpload
er.ajax.AjaxFlexibleFileUpload
public class AjaxFlexibleFileUpload
AjaxFlexibleFileUpload is an enhanced file upload component that uses a call to a hidden iFrame to handle a file upload. It is based on the code in AjaxFileUpload but extends it by using Andrew Valums' ajaxupload.js (from http://valums.com/ajax-upload/). This dynamically creates the iFrame at the end of the current page content freeing this component to be used in or out of a form. The component is fully styleable (including the upload button) and supports upload progress and canceling.
Bindings | |
cancelLabel | the label for for the cancel button (defaults to "Cancel") |
startingText | the text to display when the progress is starting (defaults "Upload Starting..."); |
selectFileLabel | the label for the select file button (defaults to "Select File...") |
clearLabel | the label for the button used to clear a selected file or uploaded file (defaults to "Clear") |
uploadLabel | the label for the Upload button (defaults to "Upload") |
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 |
refreshTime | the number of milliseconds to wait between refreshes (defaults to 2000) |
keepTempFile | if true, don't delete the temp file that AjaxFileUpload creates |
uploadFunctionName | the upload button will instead be a function with the given name |
autoSubmit | should the upload start immediately after a file is selected (defaults to true) |
injectDefaultCSS | inject the default stylesheet from the Ajax framework (defaults to true); |
selectFileButtonClass | class for the select file button (defaults to "Button ObjButton SelectFileObjButton"); |
uploadButtonClass | class for the select file button (defaults to "Button ObjButton UploadFileObjButton") |
cancelButtonClass | class for the select file button (defaults to "Button ObjButton CancelUploadObjButton") |
clearButtonClass | class for the select file button (defaults to "Button ObjButton ClearUploadObjButton") |
clearUploadProgressOnSuccess | if true, displays the select file button instead of the uploaded file name on completion of a successful upload |
mimeType | set from the content-type of the upload header if available |
Nested Class Summary | |
---|---|
static interface |
AjaxFlexibleFileUpload.Keys
|
static class |
AjaxFlexibleFileUpload.UploadState
|
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent |
---|
com.webobjects.appserver.WOComponent._EventLoggingEnabler, com.webobjects.appserver.WOComponent.Event |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
---|
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding |
---|
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation |
---|
com.webobjects.foundation.NSValidation._MethodBinding, com.webobjects.foundation.NSValidation._ValidationBinding, com.webobjects.foundation.NSValidation.DefaultImplementation, com.webobjects.foundation.NSValidation.Utility, com.webobjects.foundation.NSValidation.ValidationException |
Field Summary | |
---|---|
protected org.apache.log4j.Logger |
log
|
AjaxFlexibleFileUpload.UploadState |
state
|
boolean |
testFlag
|
Fields inherited from class er.ajax.AjaxFileUpload |
---|
_progress, _triggerUploadStart, _uploadStarted |
Fields inherited from class com.webobjects.appserver.WOComponent |
---|
_Extension, _IsEventLoggingEnabled, _keyAssociations |
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.NSKeyValueCoding |
---|
NullValue |
Fields inherited from interface com.webobjects.foundation.NSValidation |
---|
_CLASS |
Constructor Summary | |
---|---|
AjaxFlexibleFileUpload(com.webobjects.appserver.WOContext context)
|
Method Summary | |
---|---|
protected com.webobjects.foundation.NSArray<java.lang.String> |
_ajaxUploadData()
Builds the array of required additional AjaxUpload data items (wosid, id). |
protected com.webobjects.foundation.NSArray<java.lang.String> |
_ajaxUploadOptions()
Builds the array of AjaxUpload options |
java.lang.String |
ajaxUploadData()
Returns a comma separated string of AjaxUpload data items. |
java.lang.String |
ajaxUploadOptions()
Returns a comma separated string of AjaxUpload options. |
java.lang.String |
ajaxUploadScript()
Generates the script to initialize a new AjaxUpload JS object |
void |
appendToResponse(com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOContext context)
|
java.lang.Boolean |
autoSubmit()
Boolean which determines whether the upload should occur automatically after a file is selected. |
java.lang.String |
cancelButtonClass()
CSS Class for the cancel upload button |
java.lang.String |
cancelFunction()
JS Function string to cancel the iframe upload (by changing it's src url). |
java.lang.String |
cancelLabel()
Label for the cancel button |
com.webobjects.appserver.WOActionResults |
cancelUpload()
Action called by the cancel upload button |
java.lang.String |
cancelUrl()
Returns a closeHTTPSession DA action URL passed to the iframe to cancel the client-side upload |
java.lang.String |
clearButtonClass()
CSS Class for the clear upload button |
com.webobjects.appserver.WOActionResults |
clearFileResults()
Action called by the clear button, resets the uploader for a new file selection |
java.lang.String |
clearLabel()
Label for the clear button |
void |
clearUploadProgress()
Helper to reset the uploader and unregister the AjaxProgress object |
com.webobjects.appserver.WOActionResults |
containerRefreshed()
Action called when the either update container refreshes |
boolean |
fileChosen()
Has a file been selected, but the upload not started. |
java.lang.String |
fileName()
Accessor for the local fileName |
java.lang.String |
fileNameId()
Unique identifier for the fileName container |
java.lang.String |
iframeId()
Unique identifier for the iframe generated by the AjaxUploader.js |
java.lang.String |
innerContainerRefreshFunction()
JS Function called when the inner container refreshes |
java.lang.String |
innerUpdateContainerId()
Unique identifier for the inner update container |
java.lang.String |
onChangeFunction()
JS Function called when the AjaxUpload registers a change |
java.lang.String |
onCompleteFunction()
JS Function called when the AjaxUploader is completes. |
java.lang.String |
onSubmitFunction()
JS Function called when the AjaxUploader submits |
java.lang.String |
outerContainerRefreshCompleteFunction()
JS Function called when the outer container refreshes |
java.lang.String |
outerUpdateContainerId()
Unique identifier for the outer update container |
java.lang.String |
progressClass()
Returns the css class for the progress bar ('AMFUProgressAmount' or 'AMFUProgressAmount AMFUProgressAmountIndeterminate') |
java.lang.String |
progressStyle()
Returns a style string containing the width of the progress element |
java.lang.String |
refreshTime()
Returns the value for the binding 'refreshTime' The binding takes milliseconds between refreshes, this returns seconds |
java.lang.String |
selectFileButtonClass()
CSS Class for the select file button |
java.lang.String |
selectFileLabel()
Label for the select file button |
void |
setFileName(java.lang.String fn)
Setter for the local fileName |
boolean |
showClearButton()
Is the upload completed. |
boolean |
showFileSelect()
Is there no file? |
boolean |
showProgressBar()
Is there an upload currently in progress. |
boolean |
showUploadButton()
Controls whether the upload button is displayed (this only occurs when the autoSubmit binding is false) |
boolean |
showUploadStarting()
Should the component show the upload starting text? |
java.lang.String |
startFunction()
JS Function string to start the inner update container |
java.lang.String |
stopFunction()
JS Function string to stop the inner update container |
java.lang.String |
submitUploadFunction()
JS Function called by the manual submit button. |
java.lang.String |
uploadButtonClass()
CSS Class for the upload file button |
java.lang.String |
uploadButtonId()
Unique identifier for the select files button |
com.webobjects.appserver.WOActionResults |
uploadCanceled()
Hook for add-in action called when an upload is canceled |
com.webobjects.appserver.WOActionResults |
uploadFailed()
Hook for add-in action called when an upload fails |
java.lang.String |
uploadLabel()
Label for the upload button |
java.lang.String |
uploadName()
Unique identifier for the upload name |
AjaxUploadProgress |
uploadProgress()
Returns the upload progress for this uploader |
com.webobjects.appserver.WOActionResults |
uploadSucceeded()
|
Methods inherited from class com.webobjects.appserver.WOComponent |
---|
_associationWithName, _awakeInContext, _childTemplate, _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, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForKey, valueForKeyPath |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final org.apache.log4j.Logger log
public boolean testFlag
public AjaxFlexibleFileUpload.UploadState state
Constructor Detail |
---|
public AjaxFlexibleFileUpload(com.webobjects.appserver.WOContext context)
Method Detail |
---|
public void appendToResponse(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
appendToResponse
in class AjaxFileUpload
public java.lang.String ajaxUploadScript()
protected com.webobjects.foundation.NSArray<java.lang.String> _ajaxUploadData()
public java.lang.String ajaxUploadData()
protected com.webobjects.foundation.NSArray<java.lang.String> _ajaxUploadOptions()
public java.lang.String ajaxUploadOptions()
public java.lang.String startFunction()
public java.lang.String stopFunction()
public java.lang.String onChangeFunction()
public java.lang.String onCompleteFunction()
public java.lang.String onSubmitFunction()
public java.lang.String innerContainerRefreshFunction()
public java.lang.String outerContainerRefreshCompleteFunction()
public java.lang.String submitUploadFunction()
public java.lang.String cancelFunction()
public java.lang.String innerUpdateContainerId()
public java.lang.String outerUpdateContainerId()
public java.lang.String uploadButtonId()
public java.lang.String iframeId()
public java.lang.String fileNameId()
public java.lang.String uploadName()
public java.lang.String cancelUrl()
public com.webobjects.appserver.WOActionResults containerRefreshed()
public com.webobjects.appserver.WOActionResults cancelUpload()
public com.webobjects.appserver.WOActionResults clearFileResults()
public com.webobjects.appserver.WOActionResults uploadCanceled()
uploadCanceled
in class AjaxFileUpload
public com.webobjects.appserver.WOActionResults uploadFailed()
uploadFailed
in class AjaxFileUpload
public com.webobjects.appserver.WOActionResults uploadSucceeded()
uploadSucceeded
in class AjaxFileUpload
public void clearUploadProgress()
public boolean showProgressBar()
public boolean showFileSelect()
public boolean showClearButton()
public boolean showUploadStarting()
public boolean fileChosen()
public boolean showUploadButton()
public AjaxUploadProgress uploadProgress()
uploadProgress
in class AjaxFileUpload
public java.lang.Boolean autoSubmit()
public java.lang.String progressStyle()
public java.lang.String progressClass()
public java.lang.String refreshTime()
public java.lang.String fileName()
public void setFileName(java.lang.String fn)
fn
- public java.lang.String uploadLabel()
uploadLabel
in class AjaxFileUpload
public java.lang.String clearLabel()
public java.lang.String cancelLabel()
public java.lang.String selectFileLabel()
public java.lang.String selectFileButtonClass()
public java.lang.String uploadButtonClass()
public java.lang.String cancelButtonClass()
public java.lang.String clearButtonClass()
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |