Project Wonder 2.0

er.directtoweb
Class ERDCustomComponent

java.lang.Object
  extended bycom.webobjects.appserver.WOElement
      extended bycom.webobjects.appserver.WOComponent
          extended byer.extensions.ERXNonSynchronizingComponent
              extended byer.directtoweb.ERDCustomComponent
All Implemented Interfaces:
Cloneable, ERXExceptionHolder, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, WOActionResults
Direct Known Subclasses:
ERDActionButton, ERDAttributeRepetition, ERDBannerComponent, ERDCustomEditComponent, ERDCustomQueryComponent, ERDEmptyListMessage, ERDSectionImage, ERDSectionText, ERDTabText

public abstract class ERDCustomComponent
extends ERXNonSynchronizingComponent
implements ERXExceptionHolder

Base class of many custom components.
Has alot 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 standalone 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 inherited from class com.webobjects.appserver.WOComponent
WOComponent._EventLoggingEnabler, WOComponent.Event
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.DefaultImplementation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.Utility, NSKeyValueCoding.ValueAccessor
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes inherited from class com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
protected  Object extraBindings
          Holds the extra bindings.
protected static Integer FALSE
           
static ERXLogger log
          logging support
protected static Integer TRUE
           
 
Fields inherited from class er.extensions.ERXNonSynchronizingComponent
_dynamicBindings
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
_CLASS, NullValue
 
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
ERDCustomComponent(WOContext context)
          Designated constructor
 
Method Summary
 void appendToResponse(WOResponse r, WOContext c)
           
 boolean booleanForBinding(String binding)
          Deprecated. use booleanValueForBinding() instead
 void clearValidationFailed()
          Implementation of the ERXExceptionHolder interface.
 boolean d2wComponentNameDebuggingEnabled()
          Should the component name be shown.
 D2WContext d2wContext()
          The active D2WContext.
protected  D2WContext d2wContextFromBindings()
          Returns the active d2wContext.
protected  Object d2wContextValueForBinding(String binding)
          Utility to pull the value from the D2WContext.
 boolean d2wDebuggingEnabled()
          Is D2W debugging enabled.
 boolean d2wPropertyKeyDebuggingEnabled()
          Should the property keys be shown.
 Object extraBindings()
          Extra bindings supplied to the component.
protected  Object extraBindingsValueForBinding(String binding)
          Utility to pull the value from the extra bindings if supplied.
 boolean hasBinding(String binding)
          Checks if the binding can be pulled.
 Integer integerBooleanForBinding(String binding)
           
 String key()
          The active property key.
 D2WContext localContext()
          The active D2WContext.
protected  void logDebugInfo()
          Utility to dump some debug info about this component and its parent
protected  Object originalValueForBinding(String binding)
          Utility to pull the value from the components actual bindings.
protected  Object parentValueForBinding(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 setD2wContext(D2WContext value)
          Sets the D2WContext.
 void setExtraBindings(Object value)
          Sets the extra bindings.
 void setKey(String newKey)
          Sets the property key.
 void setLocalContext(D2WContext value)
          Sets the D2WContext.
 boolean synchronizesVariablesWithBindings()
          Overridden from superclass to turn on component synching, which is the default.
 void validationFailedWithException(Throwable e, Object value, String keyPath)
          Validation Support.
 Object valueForBinding(String binding)
          Fetches an object from the bindings.
 
Methods inherited from class er.extensions.ERXNonSynchronizingComponent
booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, dynamicBindings, intValueForBinding, isStateless, localizer, objectValueForBinding, objectValueForBinding, stringValueForBinding, stringValueForBinding
 
Methods inherited from class com.webobjects.appserver.WOComponent
_associationWithName, _awakeInContext, _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, invokeAction, isCachingEnabled, isEventLoggingEnabled, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, 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 ERXLogger log
logging support


extraBindings

protected Object extraBindings
Holds the extra bindings.


TRUE

protected static Integer TRUE

FALSE

protected static Integer FALSE
Constructor Detail

ERDCustomComponent

public ERDCustomComponent(WOContext context)
Designated constructor

Method Detail

setLocalContext

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


setD2wContext

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


localContext

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


d2wContext

public D2WContext d2wContext()
The active D2WContext.


d2wContextFromBindings

protected 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


validationFailedWithException

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


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(String binding)
Deprecated. use booleanValueForBinding() instead


integerBooleanForBinding

public Integer integerBooleanForBinding(String binding)

hasBinding

public boolean hasBinding(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.


logDebugInfo

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


parentValueForBinding

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


originalValueForBinding

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


d2wContextValueForBinding

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


extraBindingsValueForBinding

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


valueForBinding

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


reset

public void reset()
Used by stateless subclasses.


setExtraBindings

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


extraBindings

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


setKey

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


key

public 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.


appendToResponse

public void appendToResponse(WOResponse r,
                             WOContext c)

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.