Class WFPostletUpload

Description

Implements interfaces:

A Java upload widget for our framework.

This widget allows easy bulk uploading from the desktop to the web server.

To use, simply add a WFPostletUpload to your web page using

  1. {WFView id="myUpload"}
. Note that WFPostletUpload is a WFForm subclass itself, so be sure that your WFPostletUpload instance is not nested inside of another form.

All you need to do to receive the uploaded files is create a single function to handle the uploaded file. When someone uploads file(s) through the bulk uploader, your module's hasUploadCallback will be called, once for each file uploaded. From this function you can do as you please with each uploaded file.

This widget uses the Postlet open-source Java applet. The code is GPL licensed and is distributed with PHOCOA for convenience. Full source is available from the above link. The version included with PHOCOA includes a patch to the release version of Postlet, explained here: http://sourceforge.net/forum/message.php?msg_id=4841853 The current bundled version is 0.14-alan (which is a customized version to support our needs -- we will upgraded to the latest version once our patches are accepted). The current bundled is self-signed by me (Alan Pinstein).

  • todo: At some point in the future, maybe fall 2008, remove the embeddedcontent_min stuff because it should be fixed: http://www.swffix.org/devblog/?p=19

Located in /framework/widgets/WFPostletUpload.php (line 28)

WFObject
   |
   --WFView
      |
      --WFWidget
         |
         --WFForm
            |
            --WFPostletUpload
Variable Summary
Method Summary
WFPostletUpload __construct ( $id,  $page)
void enableAutoDropMode (string $endpage)
void hasUpload ()
void mimeType ()
void render ([ $blockContent = NULL])
void restoreState ()
void setBackgroundcolour ( $webColor)
void setHasUploadCallback (mixed $callback)
void setTableheaderbackgroundcolour ( $webColor)
void setTableheadercolour ( $webColor)
void tmpFileName ()
Variables
mixed $addbutton (line 65)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $autoupload (line 62)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $backgroundcolour (line 58)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $baseurl (line 54)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $dropimage (line 55)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $dropimageupload (line 56)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $endpage (line 67)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $hasUploadCallback (line 49)
  • var: A valid php callback object that will be called on each uploaded file. The prototype is: void handleUploadedFile($page, $params, object WFPostletUpload).
  • access: protected
mixed $helpbutton (line 63)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $maxthreads (line 57)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
string $mimeType (line 37)
  • var: The mime type of the uploaded file. This is the mime-type reported by the browser, so remember that it can be faked!
  • access: protected
string $originalFileName (line 41)
  • var: The name of the actual file.
  • access: protected
mixed $removebutton (line 64)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $tableheaderbackgroundcolour (line 59)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $tableheadercolour (line 60)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
string $tmpFileName (line 33)
  • var: The temp file name of the uploaded file.
  • access: protected
mixed $uploadbutton (line 66)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected
mixed $warnmessage (line 61)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • access: protected

Inherited Variables

Inherited from WFForm

WFForm::$action
WFForm::$defaultSubmitID
WFForm::$isAjax
WFForm::$method
WFForm::$phocoaFormParameters

Inherited from WFWidget

WFWidget::$bindings
WFWidget::$class
WFWidget::$errors
WFWidget::$formatter
WFWidget::$hasRestoredState
WFWidget::$hidden
WFWidget::$name
WFWidget::$value
WFWidget::$widgetLabel

Inherited from WFView

WFView::$children
WFView::$cssImports
WFView::$enabled
WFView::$id
WFView::$importInHead
WFView::$jsActions
WFView::$jsEvents
WFView::$jsImports
WFView::$originalOnEvent
WFView::$page
WFView::$parent
Methods
Constructor __construct (line 72)

Constructor.

  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
WFPostletUpload __construct ( $id,  $page)
  • $id
  • $page

Redefinition of:
WFForm::__construct()
Constructor.
canPushValueBinding (line 260)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void canPushValueBinding ()

Redefinition of:
WFForm::canPushValueBinding()
enableAutoDropMode (line 104)

Turn the widget into a fire-n-forget drop zone for file uploading.

Enabling this mode hides all buttons, enables the drop images, turns on autoupload, and requires an endpage to be set.

  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void enableAutoDropMode (string $endpage)
  • string $endpage: The destination URL to go to when the upload is complete.
handleUploadedFile (line 202)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void handleUploadedFile ()
hasUpload (line 161)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void hasUpload ()
mimeType (line 156)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void mimeType ()

Implementation of:
WFUploadedFile::mimeType()
originalFileName (line 151)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void originalFileName ()

Implementation of:
WFUploadedFile::originalFileName()
render (line 225)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void render ([ $blockContent = NULL])
  • $blockContent

Redefinition of:
WFForm::render()
restoreState (line 166)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void restoreState ()

Redefinition of:
WFWidget::restoreState()
Restore the UI state of this widget from the $_REQUEST data.
setBackgroundcolour (line 115)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void setBackgroundcolour ( $webColor)
  • $webColor
setHasUploadCallback (line 136)

Set the callback function to be used to process the uploaded file.

  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
  • throws: object Exception
void setHasUploadCallback (mixed $callback)
  • mixed $callback: String: the method of the current page delegate to call. Array: a php callback.
setTableheaderbackgroundcolour (line 120)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void setTableheaderbackgroundcolour ( $webColor)
  • $webColor
setTableheadercolour (line 125)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void setTableheadercolour ( $webColor)
  • $webColor
tmpFileName (line 146)
  • var: Same as the setting as documeted. For convenience, color proeprties take in web colors (ie red = FF0000).
void tmpFileName ()

Implementation of:
WFUploadedFile::tmpFileName()

Inherited Methods

Inherited From WFForm

WFForm::__construct()
WFForm::addChild()
WFForm::allConfigFinishedLoading()
WFForm::calculateCSRFParams()
WFForm::canPushValueBinding()
WFForm::defaultSubmitID()
WFForm::exposedProperties()
WFForm::isAjax()
WFForm::phocoaFormParameters()
WFForm::render()
WFForm::setAction()
WFForm::setIsAjax()
WFForm::setMethod()

Inherited From WFWidget

WFWidget::__construct()
WFWidget::addError()
WFWidget::addErrors()
WFWidget::bind()
WFWidget::bindingByName()
WFWidget::bindings()
WFWidget::canPushValueBinding()
WFWidget::errors()
WFWidget::exposedBindings()
WFWidget::exposedProperties()
WFWidget::formattedValue()
WFWidget::formatter()
WFWidget::hasRestoredState()
WFWidget::hidden()
WFWidget::name()
WFWidget::processBindingOptions()
WFWidget::propagateValueToBinding()
WFWidget::pullBindings()
WFWidget::pushBindings()
WFWidget::restoreState()
WFWidget::setFormatter()
WFWidget::setHidden()
WFWidget::setName()
WFWidget::setupExposedBindings()
WFWidget::setValue()
WFWidget::setWidgetLabel()
WFWidget::unbind()
WFWidget::value()
WFWidget::valueForBinding()
WFWidget::widgetLabel()

Inherited From WFView

WFView::__construct()
WFView::addChild()
WFView::allConfigFinishedLoading()
WFView::children()
WFView::cloneWithID()
WFView::enabled()
WFView::exposedProperties()
WFView::getForm()
WFView::getJSActions()
WFView::getListenerJS()
WFView::getListenerJSInScriptTag()
WFView::getOnEvent()
WFView::getWidgetDir()
WFView::getWidgetWWWDir()
WFView::id()
WFView::importCSS()
WFView::importJS()
WFView::jsEndHTML()
WFView::jsStartHTML()
WFView::page()
WFView::parent()
WFView::removeChild()
WFView::render()
WFView::setEnabled()
WFView::setId()
WFView::setJSonBlur()
WFView::setJSonClick()
WFView::setListener()
WFView::setOnEvent()
WFView::setParent()
WFView::yuiPath()

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::setValuesForKeys()
WFObject::validatedSetValueForKey()
WFObject::validatedSetValueForKeyPath()
WFObject::validateObject()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForStaticKey()
WFObject::valueForStaticKeyPath()
WFObject::valueForTargetAndKeyPath()
WFObject::valueForUndefinedKey()
WFObject::valueForUndefinedStaticKey()
WFObject::valuesForKeyPaths()
WFObject::valuesForKeys()
WFObject::_valueForStaticKey()
WFObject::__toString()
Class Constants

Documentation generated on Thu, 14 May 2009 16:20:20 -0400 by phpDocumentor 1.4.2