Project Wonder 5.0

er.directtoweb.components
Class ERDCustomComponent

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.directtoweb.components.ERDCustomComponent
All Implemented Interfaces:
com.webobjects.appserver.WOActionResults, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation.NSValidation, ERXExceptionHolder, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AjaxNotificationCenter, AjaxObservingSwitch, ERCDisplayHelpText, ERDActionButton, ERDAttributeRepetition, ERDBannerComponent, ERDCustomEditComponent, ERDCustomQueryComponent, ERDDisplayTemplateString, ERDEmptyListMessage, ERDQuickSearch, ERDSectionImage, ERDSectionText, ERDSpacer, ERDTabText, ERMD2WHeader, ERMD2WTableHeader, ERMDActionButton, ERMDBatchSizeControl

public abstract class ERDCustomComponent
extends ERXNonSynchronizingComponent
implements ERXExceptionHolder

Base class of many custom components.
Has a lot of nifty features including resolving bindings against the rule system and inherits all the value pulling methods from ERXNonSynchronizingComponent. Subclasses should be able to run stand alone without a D2W context. This is achieved by pulling values first from the bindings, then from the d2wContext and finally from an "extraBindings" binding.

See Also:
Serialized Form

Nested Class Summary
static interface ERDCustomComponent.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  java.lang.Object extraBindings
          Holds the extra bindings.
protected static java.lang.Integer FALSE
           
static org.apache.log4j.Logger log
          logging support
protected static java.lang.Integer TRUE
           
 
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
ERDCustomComponent(com.webobjects.appserver.WOContext context)
          Designated constructor
 
Method Summary
 void appendToResponse(com.webobjects.appserver.WOResponse r, com.webobjects.appserver.WOContext c)
          Calls ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.appendToResponse.
 boolean booleanForBinding(java.lang.String binding)
          Deprecated. use booleanValueForBinding() instead
 void clearValidationFailed()
          Implementation of the ERXExceptionHolder interface.
 boolean d2wComponentNameDebuggingEnabled()
          Should the component name be shown.
 com.webobjects.directtoweb.D2WContext d2wContext()
          The active D2WContext.
protected  com.webobjects.directtoweb.D2WContext d2wContextFromBindings()
          Returns the active d2wContext.
protected  java.lang.Object d2wContextValueForBinding(java.lang.String binding)
          Utility to pull the value from the D2WContext.
 boolean d2wDebuggingEnabled()
          Is D2W debugging enabled.
 com.webobjects.directtoweb.D2WPage d2wPage()
          Finds the containing D2WPage, if possible.
 boolean d2wPropertyKeyDebuggingEnabled()
          Should the property keys be shown.
 java.lang.Object extraBindings()
          Extra bindings supplied to the component.
protected  java.lang.Object extraBindingsValueForBinding(java.lang.String binding)
          Utility to pull the value from the extra bindings if supplied.
 boolean hasBinding(java.lang.String binding)
          Checks if the binding can be pulled.
 java.lang.Integer integerBooleanForBinding(java.lang.String binding)
           
 java.lang.String key()
          The active property key.
 com.webobjects.directtoweb.D2WContext localContext()
          The active D2WContext.
protected  void logDebugInfo()
          Utility to dump some debug info about this component and its parent
protected  java.lang.Object originalValueForBinding(java.lang.String binding)
          Utility to pull the value from the components actual bindings.
protected  java.lang.Object parentValueForBinding(java.lang.String binding)
          Utility to pull the value from the components parent, if the parent is a D2W wrapper component.
 void reset()
          Used by stateless subclasses.
 void resetCachedBindingsInStatefulComponent()
          Used by stateful but non-synching subclasses
 void setD2wContext(com.webobjects.directtoweb.D2WContext value)
          Sets the D2WContext.
 void setExtraBindings(java.lang.Object value)
          Sets the extra bindings.
 void setKey(java.lang.String newKey)
          Sets the property key.
 void setLocalContext(com.webobjects.directtoweb.D2WContext value)
          Sets the D2WContext.
 boolean synchronizesVariablesWithBindings()
          Overridden from superclass to turn on component synching, which is the default.
 java.lang.String task()
          Gets the current D2W task.
 boolean taskIsEdit()
           
 boolean taskIsInspect()
           
 boolean taskIsList()
           
 void validationFailedWithException(java.lang.Throwable e, java.lang.Object value, java.lang.String keyPath)
          Validation Support.
 java.lang.Object valueForBinding(java.lang.String binding)
          Fetches an object from the bindings.
 
Methods inherited from class er.extensions.components.ERXNonSynchronizingComponent
invokeAction, isStateless, 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, 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, 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, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
logging support


extraBindings

protected java.lang.Object extraBindings
Holds the extra bindings.


TRUE

protected static final java.lang.Integer TRUE

FALSE

protected static final java.lang.Integer FALSE
Constructor Detail

ERDCustomComponent

public ERDCustomComponent(com.webobjects.appserver.WOContext context)
Designated constructor

Method Detail

setLocalContext

public void setLocalContext(com.webobjects.directtoweb.D2WContext value)
Sets the D2WContext. Applies when used inside a D2WCustomComponent.


setD2wContext

public void setD2wContext(com.webobjects.directtoweb.D2WContext value)
Sets the D2WContext. Applies when used inside a property key repetition.


localContext

public com.webobjects.directtoweb.D2WContext localContext()
The active D2WContext. Simply calls to d2wContext()


d2wContext

public com.webobjects.directtoweb.D2WContext d2wContext()
The active D2WContext.


d2wContextFromBindings

protected com.webobjects.directtoweb.D2WContext d2wContextFromBindings()
Returns the active d2wContext. If the value was not set via KVC, tries to get the value from the bindings if the component is non-syncing


task

public java.lang.String task()
Gets the current D2W task.


taskIsEdit

public boolean taskIsEdit()

taskIsInspect

public boolean taskIsInspect()

taskIsList

public boolean taskIsList()

validationFailedWithException

public void validationFailedWithException(java.lang.Throwable e,
                                          java.lang.Object value,
                                          java.lang.String keyPath)
Validation Support. Passes errors to the parent.

Overrides:
validationFailedWithException in class com.webobjects.appserver.WOComponent

clearValidationFailed

public void clearValidationFailed()
Implementation of the ERXExceptionHolder interface. Clears exceptions in the parent if possible.

Specified by:
clearValidationFailed in interface ERXExceptionHolder

booleanForBinding

public boolean booleanForBinding(java.lang.String binding)
Deprecated. use booleanValueForBinding() instead


integerBooleanForBinding

public java.lang.Integer integerBooleanForBinding(java.lang.String binding)

hasBinding

public boolean hasBinding(java.lang.String binding)
Checks if the binding can be pulled. If the component is synching, throws an Exception. Otherwise checks the superclass and if the value for the binding is not null.

Overrides:
hasBinding in class com.webobjects.appserver.WOComponent

logDebugInfo

protected void logDebugInfo()
Utility to dump some debug info about this component and its parent


parentValueForBinding

protected java.lang.Object parentValueForBinding(java.lang.String binding)
Utility to pull the value from the components parent, if the parent is a D2W wrapper component.


originalValueForBinding

protected java.lang.Object originalValueForBinding(java.lang.String binding)
Utility to pull the value from the components actual bindings.


d2wContextValueForBinding

protected java.lang.Object d2wContextValueForBinding(java.lang.String binding)
Utility to pull the value from the D2WContext.


extraBindingsValueForBinding

protected java.lang.Object extraBindingsValueForBinding(java.lang.String binding)
Utility to pull the value from the extra bindings if supplied.


valueForBinding

public java.lang.Object valueForBinding(java.lang.String binding)
Fetches an object from the bindings. Tries the actual supplied bindings, the supplied d2wContext, the parent and finally the extra bindings dictionary.

Overrides:
valueForBinding in class com.webobjects.appserver.WOComponent

resetCachedBindingsInStatefulComponent

public void resetCachedBindingsInStatefulComponent()
Used by stateful but non-synching subclasses

Overrides:
resetCachedBindingsInStatefulComponent in class ERXNonSynchronizingComponent

reset

public void reset()
Used by stateless subclasses.

Overrides:
reset in class ERXComponent

setExtraBindings

public void setExtraBindings(java.lang.Object value)
Sets the extra bindings.


extraBindings

public java.lang.Object extraBindings()
Extra bindings supplied to the component. If this is a dictionary, it will be used for additional bindings.


setKey

public void setKey(java.lang.String newKey)
Sets the property key.


key

public java.lang.String key()
The active property key.


synchronizesVariablesWithBindings

public boolean synchronizesVariablesWithBindings()
Overridden from superclass to turn on component synching, which is the default.

Overrides:
synchronizesVariablesWithBindings in class ERXNonSynchronizingComponent

d2wDebuggingEnabled

public boolean d2wDebuggingEnabled()
Is D2W debugging enabled.


d2wComponentNameDebuggingEnabled

public boolean d2wComponentNameDebuggingEnabled()
Should the component name be shown.


d2wPropertyKeyDebuggingEnabled

public boolean d2wPropertyKeyDebuggingEnabled()
Should the property keys be shown.


d2wPage

public com.webobjects.directtoweb.D2WPage d2wPage()
Finds the containing D2WPage, if possible. There are certain situations when having a reference to the containing D2W page is useful, e.g., when needing to use the userInfo dictionary of ERD2WPage to pass information between subcomponents.

Returns:
the containing D2WPage

appendToResponse

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

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

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

Copyright © 2002 – 2007 Project Wonder.