Project Wonder 5.0.0.8660

er.attachment.components
Class ERAttachmentUpload

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by 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
           

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
ERAttachmentUpload(WOContext context)
           
 
Method Summary
 ERAttachment _uploadSucceeded()
           
 boolean ajax()
           
 String filePath()
           
 String finalFilePath()
           
 WOActionResults invokeAction(WORequest request, WOContext context)
           
 void setFilePath(String filePath)
           
 void setFinalFilePath(String finalFilePath)
           
 boolean synchronizesVariablesWithBindings()
           
 String tempFilePath()
           
 WOActionResults uploadSucceeded()
           
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ERAttachmentUpload

public ERAttachmentUpload(WOContext context)
Method Detail

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

Last updated: Sat, Nov 22, 2008 • 04:41 AM EST

Copyright © 2002 – 2007 Project Wonder.