er.attachment.components
Class ERAttachmentUpload
java.lang.Object
com.webobjects.appserver.WOElement
com.webobjects.appserver.WOComponent
er.attachment.components.ERAttachmentUpload
- All Implemented Interfaces:
- WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, Cloneable
public class ERAttachmentUpload
- extends WOComponent
ERAttachmentUpload provides a very simple wrapper around either a WOFileUpload
or an AjaxFileUpload component (depending on the value of the "ajax" binding).
When the upload is successfully completed, this component will automatically
process the attachment. It is not necessary to use this component -- it's
only to make the process slightly easier. If you want to use your own
existing file upload setup, in your completion action, you can simply call:
ERAttachment attachment = ERAttachmentProcessor.processorForType(storageType).process(editingContext, fileUploadFinalFilePath, fileUploadFilePath, mimeType, configurationName, ownerID);
- Author:
- mschrag
- See Also:
- Serialized Form
| Bindings |
attachment | the binding to store the newly created attachment in |
editingContext | the editing context to create the attachment in |
storageType | the type of attachment to create, i.e. "s3", "db", or "file" -- defaults to "db" (or the value of er.attachment.storageType) |
mimeType | (optional) the mime type of the upload (will be guessed by extension if not set) |
ajax | (optional) if true, AjaxFileUpload is used, if false WOFileUpload is used |
configurationName | (optional) the configuration name for this attachment (see top level documentation) |
ownerID | (optional) a string ID of the "owner" of this attachment (Person.primaryKey for instance) |
others | all AjaxFileUpload bindings are proxied |
cleanup | (optional) if true, the old attachment binding value will be deleted |
| Methods inherited from class com.webobjects.appserver.WOComponent |
__valueForBinding, _associationWithName, _awakeInContext, _childTemplate, _cleanUpStatelessComponent, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, appendToResponse, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, 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 |
ERAttachmentUpload
public ERAttachmentUpload(WOContext context)
setFilePath
public void setFilePath(String filePath)
filePath
public String filePath()
setFinalFilePath
public void setFinalFilePath(String finalFilePath)
finalFilePath
public String finalFilePath()
synchronizesVariablesWithBindings
public boolean synchronizesVariablesWithBindings()
- Overrides:
synchronizesVariablesWithBindings in class WOComponent
ajax
public boolean ajax()
invokeAction
public WOActionResults invokeAction(WORequest request,
WOContext context)
- Overrides:
invokeAction in class WOComponent
tempFilePath
public String tempFilePath()
throws IOException
- Throws:
IOException
_uploadSucceeded
public ERAttachment _uploadSucceeded()
throws IOException
- Throws:
IOException
uploadSucceeded
public WOActionResults uploadSucceeded()
throws MalformedURLException,
IOException
- Throws:
MalformedURLException
IOException
Copyright © 2002 – 2007 Project Wonder.