Project Wonder 5.0

er.attachment.components
Class ERAttachmentFlexibleEditor

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by er.extensions.components.ERXComponent
              extended by er.extensions.components.ERXNonSynchronizingComponent
                  extended by er.attachment.components.ERAttachmentFlexibleEditor
All Implemented Interfaces:
com.webobjects.appserver.WOActionResults, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation.NSValidation, java.io.Serializable, java.lang.Cloneable

public class ERAttachmentFlexibleEditor
extends ERXNonSynchronizingComponent

ERAttachmentFlexibleEditor is a wrapper around ERAttachmentFlexibleUpload and ERAttachmentViewer It provides a one stop shop for editing a to-one relationship between a masterObject and an ERAttachment. Switching back and forth between edit and view modes is handled by ajax updates.

There is one scenario where there is the potential for an orphaned ERAttachment and associated file. 1. User lands on an edit page for the masterObject 2. User selects and successfully uploads a file for the attachment 3. User leaves the masterObject edit page without saving changes

See Also:
Serialized Form
Author:
david
Bindings
masterObject (required) - Parent object owning the relationship to this attachment
           
relationshipKey (required) - Name of the to-one relationship to the attachment
           
injectDefaultCSS - inject the default stylesheet from the Ajax framework (defaults to true);
           
id - unique identifier for this component (generated if null)
           
editorEditLabel - label for the edit button (defaults to "Edit")
           
editorEditButtonClass - css class for the edit button (defaults to "Button ObjButton EditObjButton")
           
editorCancelLabel - label for the cancel button (defaults to "Cancel")
           
editorCancelButtonClass - css class for the cancel button (defaults to "Button ObjButton CancelObjButton")
           
configurationName - configuration name for configuring ERAttachment
           
storageType - storage type for configuring ERAttachment
           
viewShowFileName - show the attachment file name in the view mode (defaults to true)
           
viewShowAttachmentLink - if viewShowFilename is true, wrap it with an ERAttachmentLink (defaults to true)
           
uploadDialogHeaderText - the text of the upload header (defaults to "Edit Attachment")
           
viewHeight - see: {@link ERAttachmentViewer}
           
viewWidth - see: {@link ERAttachmentViewer}
           
viewAllowDownload - see: {@link ERAttachmentLink}
           
uploadAllowCancel - for the following see: {@link ERAttachmentFlexibleUpload}
           
uploadFinishedFunctionuploadFinishedFunction
           
uploadCancelButtonClassuploadCancelButtonClass
           
uploadCancelLabeluploadCancelLabel
           
uploadCanceledActionuploadCanceledAction
           
uploadCanceledFunctionuploadCanceledFunction
           
uploadCancelingTextuploadCancelingText
           
uploadClearClassuploadClearClass
           
uploadFailedActionuploadFailedAction
           
uploadFailedFunctionuploadFailedFunction
           
uploadHeightuploadHeight
           
uploadWidthuploadWidth
           
uploadMimeTypeuploadMimeType
           
uploadOwnerIDuploadOwnerID
           
uploadRefreshTimeuploadRefreshTime
           
uploadSelectFileButtonClassuploadSelectFileButtonClass
           
uploadSelectFileLabeluploadSelectFileLabel
           
uploadStartedFunctionuploadStartedFunction
           
Properties
er.attachment.[configurationName].tempFolder (optional) the temp folder to use for WOFileUploads
           
er.attachment.tempFolder (optional) the temp folder to use for WOFileUploads
           
er.attachment.[configurationName].storageTypeer.attachment.[configurationName].storageType
           
er.attachment.storageTypeer.attachment.storageType
           
er.attachment.[configurationName].widther.attachment.[configurationName].width
           
er.attachment.widther.attachment.width
           
er.attachment.[configurationName].heighter.attachment.[configurationName].height
           
er.attachment.heighter.attachment.height
           

Nested Class Summary
static interface ERAttachmentFlexibleEditor.Keys
           
 
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
           
 
Fields inherited from class er.extensions.components.ERXComponent
_dynamicBindings
 
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
ERAttachmentFlexibleEditor(com.webobjects.appserver.WOContext context)
           
 
Method Summary
 boolean allowCancel()
           
 boolean allowDownload()
           
 void appendToResponse(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
          Calls ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.appendToResponse.
 com.webobjects.eocontrol.EOEditingContext attachmentEC()
          Local peer EOEditingContext for the uploaded attachment
 java.lang.String cancelButtonWrapperID()
          Unique identifier for the cancel button wrapper div
 com.webobjects.appserver.WOActionResults cancelEdit()
          Action bound to the cancel button
 com.webobjects.appserver.WOActionResults editAttachment()
          Action bound to the edit button
 java.lang.String editorCancelButtonClass()
          The css class for the main cancel button Defaults to "Button ObjButton CancelObjButton"
 java.lang.String editorCancelLabel()
          The label for the main cancel button Defaults to "Cancel"
 java.lang.String editorEditButtonClass()
          The css class for the main edit button Defaults to "Button ObjButton EditObjButton"
 java.lang.String editorEditLabel()
          The label for the main edit button Defaults to "Edit"
 com.webobjects.appserver.WOActionResults finishedAction()
           
 java.lang.String id()
          Base unique identifier, used to create the other id's in the component
 boolean injectDefaultCSS()
          Should the component inject the default css in the head of the page
 com.webobjects.eocontrol.EOEnterpriseObject localParent()
          Convenience accessor, returns a local instance of the masterObject in the workingEC
 com.webobjects.eocontrol.EOEnterpriseObject masterObject()
          Getter for the masterObject
 ERAttachment newAttachment()
           
 java.lang.String refreshContainerFunction()
          Function to update the main update container
 java.lang.String relationshipKey()
          Getter for the relationhipKey
 void setNewAttachment(ERAttachment a)
           
 boolean showFileName()
          Controls whether the file name should be displayed Defaults to true
 boolean showLink()
          Controls whether the file name should be shown as a link Defaults to true
 boolean showUpload()
          Controls whether the upload component is shown
 java.lang.String startedFunction()
          Function called when the upload starts
 java.lang.String updateContainerID()
          Unique identifier for the main update container
 java.lang.String uploadCancelLabel()
          The label to apply to the upload components cancel button Defaults to "Cancel Upload"
 java.lang.String uploadDialogHeaderText()
          The text to display in the header of the edit box
 java.lang.String uploadFinishedFunction()
          Function called when the upload finishes
 com.webobjects.appserver.WOActionResults uploadSucceededAction()
          Action called when an upload succeeds
 ERAttachment viewerAttachment()
          The masterObject's attachment
 com.webobjects.eocontrol.EOEditingContext workingEC()
          Local child editing context of the masterObject for building the relationship
 
Methods inherited from class er.extensions.components.ERXNonSynchronizingComponent
invokeAction, isStateless, resetCachedBindingsInStatefulComponent, synchronizesVariablesWithBindings, takeValuesFromRequest
 
Methods inherited from class er.extensions.components.ERXComponent
_awakeInContext, _checkAccess, _frameworkName, _includeCSSResources, _includeJavascriptResources, additionalCSSFiles, additionalJavascriptFiles, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, checkAccess, clickToOpenEnabled, componentName, defaultCSSPath, defaultJavascriptPath, dynamicBindings, floatValueForBinding, intValueForBinding, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, reset, stringValueForBinding, stringValueForBinding, useDefaultComponentCSS, useDefaultComponentJavascript
 
Methods inherited from class com.webobjects.appserver.WOComponent
_associationWithName, _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, isCachingEnabled, isEventLoggingEnabled, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, 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

log

protected final org.apache.log4j.Logger log
Constructor Detail

ERAttachmentFlexibleEditor

public ERAttachmentFlexibleEditor(com.webobjects.appserver.WOContext context)
Method Detail

appendToResponse

public void appendToResponse(com.webobjects.appserver.WOResponse response,
                             com.webobjects.appserver.WOContext context)
Description copied from class: ERXNonSynchronizingComponent
Calls ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.appendToResponse.

Overrides:
appendToResponse in class ERXNonSynchronizingComponent
Parameters:
response - to which we are appending
context - context of the response

editAttachment

public com.webobjects.appserver.WOActionResults editAttachment()
Action bound to the edit button

Returns:
null

cancelEdit

public com.webobjects.appserver.WOActionResults cancelEdit()
Action bound to the cancel button

Returns:
null

uploadSucceededAction

public com.webobjects.appserver.WOActionResults uploadSucceededAction()
Action called when an upload succeeds

Returns:
results of the

finishedAction

public com.webobjects.appserver.WOActionResults finishedAction()

showUpload

public boolean showUpload()
Controls whether the upload component is shown

Returns:
boolean

newAttachment

public ERAttachment newAttachment()

setNewAttachment

public void setNewAttachment(ERAttachment a)

attachmentEC

public com.webobjects.eocontrol.EOEditingContext attachmentEC()
Local peer EOEditingContext for the uploaded attachment

Returns:
EOEditingContext

workingEC

public com.webobjects.eocontrol.EOEditingContext workingEC()
Local child editing context of the masterObject for building the relationship

Returns:
EOEditingContext

localParent

public com.webobjects.eocontrol.EOEnterpriseObject localParent()
Convenience accessor, returns a local instance of the masterObject in the workingEC

Returns:
EOEnterpriseObject

allowCancel

public boolean allowCancel()

uploadCancelLabel

public java.lang.String uploadCancelLabel()
The label to apply to the upload components cancel button Defaults to "Cancel Upload"

Returns:
String the uploadCancelLabel

viewerAttachment

public ERAttachment viewerAttachment()
The masterObject's attachment

Returns:
ERAttachment

showFileName

public boolean showFileName()
Controls whether the file name should be displayed Defaults to true

Returns:
boolean

showLink

public boolean showLink()
Controls whether the file name should be shown as a link Defaults to true

Returns:
boolean

allowDownload

public boolean allowDownload()

editorEditButtonClass

public java.lang.String editorEditButtonClass()
The css class for the main edit button Defaults to "Button ObjButton EditObjButton"

Returns:
the editorEditButtonClass

editorCancelButtonClass

public java.lang.String editorCancelButtonClass()
The css class for the main cancel button Defaults to "Button ObjButton CancelObjButton"

Returns:
the editorCancelButtonClass

editorEditLabel

public java.lang.String editorEditLabel()
The label for the main edit button Defaults to "Edit"

Returns:
the editorEditLabel

editorCancelLabel

public java.lang.String editorCancelLabel()
The label for the main cancel button Defaults to "Cancel"

Returns:
the _editorCancelLabel

uploadDialogHeaderText

public java.lang.String uploadDialogHeaderText()
The text to display in the header of the edit box

Returns:
the uploadDialogHeaderText

masterObject

public com.webobjects.eocontrol.EOEnterpriseObject masterObject()
Getter for the masterObject

Returns:
the masterObject

relationshipKey

public java.lang.String relationshipKey()
Getter for the relationhipKey

Returns:
the relationshipKey

injectDefaultCSS

public boolean injectDefaultCSS()
Should the component inject the default css in the head of the page

Returns:
boolean

id

public java.lang.String id()
Base unique identifier, used to create the other id's in the component

Returns:
String

updateContainerID

public java.lang.String updateContainerID()
Unique identifier for the main update container

Returns:
String

cancelButtonWrapperID

public java.lang.String cancelButtonWrapperID()
Unique identifier for the cancel button wrapper div

Returns:
String

refreshContainerFunction

public java.lang.String refreshContainerFunction()
Function to update the main update container

Returns:
String

uploadFinishedFunction

public java.lang.String uploadFinishedFunction()
Function called when the upload finishes

Returns:
String

startedFunction

public java.lang.String startedFunction()
Function called when the upload starts

Returns:
String

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.