Project Wonder 5.0

er.extensions.components
Class ERXInlineTemplate

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.extensions.components.ERXInlineTemplate
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
Direct Known Subclasses:
ERXStatelessInlineTemplate

public class ERXInlineTemplate
extends ERXNonSynchronizingComponent

ERXInlineTemplate allows to specify a component's template dynamically.
The content which would usually go into the ".html" file within a WOComponent's bundle, is specified using the "html" binding, the ".wod" part is pecified by the "wod" binding.

When using WOOgnl with "ognl.helperFunctions = true" and "ognl.inlineBindings = true", you can leave out the WOD part.

When keys are accessed, the component first determines the first element of the path (e.g. key "foo" for path "foo.bar") and looks, if there is a binding with that key.
If there is such a binding, the value is retrieved and the rest of the keyPath applied to it (valueForBinding("foo").valueForKeyPath("bar")).
If there is no binding with that name and "proxyParent" is true, the keyPath is resolved against the parent component.
Otherwise, dynamicBindings (ERXComponent#dynamicBindings()) are used.
You can switch off the usage of dynamicBindings by setting the binding "defaultToDynamicBindings" to false. Then a warning will be logged for unknown keys.

When an error occurs, an error message is displayed. The message can be altered using the "errorTemplate" binding.

Optionally, a "cacheKey" (String) can be specified, under which the parsed WOElement will be cached. To allow updating, a "cacheVersion" (Object) is available. When the version changes, the value is recalculated.

See Also:
Serialized Form
Author:
th
Bindings
html HTML-part of the component (required)
           
wod WOD-part of the component (optional)
           
cacheKey Key under which to cache the WOElement (optional)
           
cacheVersion Hint to determine if the cached object is up-to-date (optional)
           
errorTemplate Template to use for displaying error messages. Uses {@link ERXSimpleTemplateParser} for display. Method name and HTML-escaped message are provided by the "method" and "message" keys. (optional)
           
proxyParent whether to proxy key path lookup to the parent (default is false)
           
defaultToDynamicBindings whether to use dynamicBindings for unknown keys (default is true)
           

Nested Class Summary
static class ERXInlineTemplate.Error
           
 
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  ERXInlineTemplate.Error _deferredError
           
 
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
ERXInlineTemplate(com.webobjects.appserver.WOContext context)
           
 
Method Summary
 void appendToResponse(com.webobjects.appserver.WOResponse woresponse, com.webobjects.appserver.WOContext wocontext)
          Calls ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent() prior to super.appendToResponse.
 boolean defaultToDynamicBindings()
           
 java.lang.String errorTemplate()
           
 boolean proxyParent()
           
 void takeValueForKey(java.lang.Object obj, java.lang.String s)
           
 void takeValueForKeyPath(java.lang.Object value, java.lang.String keyPath)
           
 com.webobjects.appserver.WOElement template()
           
 java.lang.Object valueForKey(java.lang.String s)
           
 java.lang.Object valueForKeyPath(java.lang.String keyPath)
           
 
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, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_deferredError

protected ERXInlineTemplate.Error _deferredError
Constructor Detail

ERXInlineTemplate

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

appendToResponse

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

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

errorTemplate

public java.lang.String errorTemplate()

proxyParent

public boolean proxyParent()

defaultToDynamicBindings

public boolean defaultToDynamicBindings()

takeValueForKeyPath

public void takeValueForKeyPath(java.lang.Object value,
                                java.lang.String keyPath)
Specified by:
takeValueForKeyPath in interface com.webobjects.foundation.NSKeyValueCodingAdditions
Overrides:
takeValueForKeyPath in class com.webobjects.appserver.WOComponent

valueForKeyPath

public java.lang.Object valueForKeyPath(java.lang.String keyPath)
Specified by:
valueForKeyPath in interface com.webobjects.foundation.NSKeyValueCodingAdditions
Overrides:
valueForKeyPath in class com.webobjects.appserver.WOComponent

takeValueForKey

public void takeValueForKey(java.lang.Object obj,
                            java.lang.String s)
Specified by:
takeValueForKey in interface com.webobjects.foundation.NSKeyValueCoding
Overrides:
takeValueForKey in class com.webobjects.appserver.WOComponent

valueForKey

public java.lang.Object valueForKey(java.lang.String s)
Specified by:
valueForKey in interface com.webobjects.foundation.NSKeyValueCoding
Overrides:
valueForKey in class com.webobjects.appserver.WOComponent

template

public com.webobjects.appserver.WOElement template()
Overrides:
template in class com.webobjects.appserver.WOComponent

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

Copyright © 2002 – 2007 Project Wonder.