AjaxFlexibleFileUpload Class Reference

Inherits er::ajax::AjaxFileUpload.

Collaboration diagram for AjaxFlexibleFileUpload:

Collaboration graph
[legend]

List of all members.

Classes

interface  Keys

Public Types

enum  UploadState {
  DORMANT, STARTED, INPROGRESS, CANCELED,
  FAILED, SUCCEEDED, FINISHED
}

Public Member Functions

 AjaxFlexibleFileUpload (WOContext context)
String ajaxUploadData ()
String ajaxUploadOptions ()
String ajaxUploadScript ()
void appendToResponse (WOResponse response, WOContext context)
Boolean autoSubmit ()
String cancelButtonClass ()
String cancelFunction ()
String cancelLabel ()
WOActionResults cancelUpload ()
String cancelUrl ()
String clearButtonClass ()
WOActionResults clearFileResults ()
String clearLabel ()
void clearUploadProgress ()
WOActionResults containerRefreshed ()
boolean fileChosen ()
String fileName ()
String fileNameId ()
String iframeId ()
String innerContainerRefreshFunction ()
String innerUpdateContainerId ()
String onChangeFunction ()
String onCompleteFunction ()
String onSubmitFunction ()
String outerContainerRefreshCompleteFunction ()
String outerUpdateContainerId ()
String progressClass ()
String progressStyle ()
String refreshTime ()
String selectFileButtonClass ()
String selectFileLabel ()
void setFileName (String fn)
boolean showClearButton ()
boolean showFileSelect ()
boolean showProgressBar ()
boolean showUploadButton ()
boolean showUploadStarting ()
String startFunction ()
String stopFunction ()
String submitUploadFunction ()
String uploadButtonClass ()
String uploadButtonId ()
WOActionResults uploadCanceled ()
WOActionResults uploadFailed ()
String uploadLabel ()
String uploadName ()
AjaxUploadProgress uploadProgress ()
WOActionResults uploadSucceeded ()

Public Attributes

UploadState state = UploadState.DORMANT
boolean testFlag = false

Protected Member Functions

NSArray< String_ajaxUploadData ()
NSArray< String_ajaxUploadOptions ()

Protected Attributes

final Logger log = Logger.getLogger(getClass())

Private Attributes

Boolean _autoSubmit
String _cancelButtonClass
String _cancelLabel
String _clearButtonClass
String _clearLabel
boolean _clearUpload
boolean _fileChosen
String _fileName
String _refreshTime
String _selectFileButtonClass
String _selectFileLabel
String _uploadButtonClass
String _uploadLabel


Detailed Description

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.

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

Author:
dleber

mschrag


Member Enumeration Documentation

Enumerator:
DORMANT 
STARTED 
INPROGRESS 
CANCELED 
FAILED 
SUCCEEDED 
FINISHED 


Constructor & Destructor Documentation

AjaxFlexibleFileUpload ( WOContext  context  ) 


Member Function Documentation

NSArray<String> _ajaxUploadData (  )  [protected]

Builds the array of required additional AjaxUpload data items (wosid, id).

Returns:
array of required additional AjaxUpload data items (wosid, id).

NSArray<String> _ajaxUploadOptions (  )  [protected]

Builds the array of AjaxUpload options

Returns:
array of AjaxUpload options

String ajaxUploadData (  ) 

Returns a comma separated string of AjaxUpload data items.

Returns:
comma separated string of AjaxUpload data items.

String ajaxUploadOptions (  ) 

Returns a comma separated string of AjaxUpload options.

Returns:
comma separated string of AjaxUpload options.

String ajaxUploadScript (  ) 

Generates the script to initialize a new AjaxUpload JS object

Returns:
script to initialize a new AjaxUpload JS object

void appendToResponse ( WOResponse  response,
WOContext  context 
)

Reimplemented from AjaxFileUpload.

Boolean autoSubmit (  ) 

Boolean which determines whether the upload should occur automatically after a file is selected.

Returns:
value for 'autoSubmit' binding

String cancelButtonClass (  ) 

CSS Class for the cancel upload button

Returns:
string value for 'cancelButtonClass' binding

String cancelFunction (  ) 

JS Function string to cancel the iframe upload (by changing it's src url).

Returns:
string to cancel the iframe upload (by changing it's src url).

String cancelLabel (  ) 

Label for the cancel button

Returns:
string value for 'cancelLabel' binding

WOActionResults cancelUpload (  ) 

Action called by the cancel upload button

Returns:
results of action

String cancelUrl (  ) 

Returns a closeHTTPSession DA action URL passed to the iframe to cancel the client-side upload

Returns:
url sent to the iframe to cancel

String clearButtonClass (  ) 

CSS Class for the clear upload button

Returns:
string value for 'clearButtonClass' binding

WOActionResults clearFileResults (  ) 

Action called by the clear button, resets the uploader for a new file selection

Returns:
results of action

String clearLabel (  ) 

Label for the clear button

Returns:
string value for 'clearLabel' binding

void clearUploadProgress (  ) 

Helper to reset the uploader and unregister the AjaxProgress object

WOActionResults containerRefreshed (  ) 

Action called when the either update container refreshes

Returns:
results of action

boolean fileChosen (  ) 

Has a file been selected, but the upload not started.

Returns:
boolean true if a file has been chosen

String fileName (  ) 

Accessor for the local fileName

Returns:
string value of fileName

String fileNameId (  ) 

Unique identifier for the fileName container

Returns:
identifier for the fileName container

String iframeId (  ) 

Unique identifier for the iframe generated by the AjaxUploader.js

Returns:
identifier for the iframe generated by the AjaxUploader.js

String innerContainerRefreshFunction (  ) 

JS Function called when the inner container refreshes

Returns:
string JS Function called when the inner container refreshes

String innerUpdateContainerId (  ) 

Unique identifier for the inner update container

Returns:
identifier for the inner update container

String onChangeFunction (  ) 

JS Function called when the AjaxUpload registers a change

Returns:
string JS Function called when the AjaxUpload registers a change

String onCompleteFunction (  ) 

JS Function called when the AjaxUploader is completes.

Returns:
string JS Function called when the AjaxUploader is completes.

String onSubmitFunction (  ) 

JS Function called when the AjaxUploader submits

Returns:
string JS Function called when the AjaxUploader submits

String outerContainerRefreshCompleteFunction (  ) 

JS Function called when the outer container refreshes

Returns:
string JS Function called when the outer container refreshes

String outerUpdateContainerId (  ) 

Unique identifier for the outer update container

Returns:
identifier for the outer update container

String progressClass (  ) 

Returns the css class for the progress bar ('AMFUProgressAmount' or 'AMFUProgressAmount AMFUProgressAmountIndeterminate')

Returns:
string class applied to the progress bar

String progressStyle (  ) 

Returns a style string containing the width of the progress element

Returns:
string style applied to the progress element

String refreshTime (  ) 

Returns the value for the binding 'refreshTime'

The binding takes milliseconds between refreshes, this returns seconds

Returns:
value of the 'refreshTime' binding converted to seconds

String selectFileButtonClass (  ) 

CSS Class for the select file button

Returns:
string value for 'selectFileButtonClass' binding

String selectFileLabel (  ) 

Label for the select file button

Returns:
string value for 'selectFileLabel' binding

void setFileName ( String  fn  ) 

Setter for the local fileName

Parameters:
fn 

boolean showClearButton (  ) 

Is the upload completed.

Returns:
boolean true if the upload is complete

boolean showFileSelect (  ) 

Is there no file?

Returns:
boolean true if there no file

boolean showProgressBar (  ) 

Is there an upload currently in progress.

Returns:
boolean if an upload currently in progress.

boolean showUploadButton (  ) 

Controls whether the upload button is displayed (this only occurs when the autoSubmit binding is false)

Returns:
boolean controls whether the upload button is displayed

boolean showUploadStarting (  ) 

Should the component show the upload starting text?

Returns:
boolean should show the starting text

String startFunction (  ) 

JS Function string to start the inner update container

Returns:
string to start the inner update container

String stopFunction (  ) 

JS Function string to stop the inner update container

Returns:
string to stop the inner update container

String submitUploadFunction (  ) 

JS Function called by the manual submit button.

Returns:
string JS Function called by the manual submit button.

String uploadButtonClass (  ) 

CSS Class for the upload file button

Returns:
string value for 'uploadButtonClass' binding

String uploadButtonId (  ) 

Unique identifier for the select files button

Returns:
identifier for the select files button

WOActionResults uploadCanceled (  ) 

Hook for add-in action called when an upload is canceled

Returns:
results of action

Reimplemented from AjaxFileUpload.

WOActionResults uploadFailed (  ) 

Hook for add-in action called when an upload fails

Returns:
results of action

Reimplemented from AjaxFileUpload.

String uploadLabel (  ) 

Label for the upload button

Returns:
string value for 'uploadLabel' binding

Reimplemented from AjaxFileUpload.

String uploadName (  ) 

Unique identifier for the upload name

Returns:
identifier for the upload name

AjaxUploadProgress uploadProgress (  ) 

Returns the upload progress for this uploader

Reimplemented from AjaxFileUpload.

WOActionResults uploadSucceeded (  ) 

Reimplemented from AjaxFileUpload.


Member Data Documentation

Boolean _autoSubmit [private]

String _cancelLabel [private]

String _clearLabel [private]

boolean _clearUpload [private]

boolean _fileChosen [private]

String _fileName [private]

String _refreshTime [private]

String _uploadLabel [private]

final Logger log = Logger.getLogger(getClass()) [protected]

UploadState state = UploadState.DORMANT

boolean testFlag = false


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:38 2012 for Project Wonder by  doxygen 1.5.8