|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webobjects.appserver.WOElement
com.webobjects.appserver.WOComponent
er.extensions.components.ERXComponent
er.extensions.components.ERXNonSynchronizingComponent
er.extensions.components.ERXInlineTemplate
public class ERXInlineTemplate
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.
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 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 |
---|
protected ERXInlineTemplate.Error _deferredError
Constructor Detail |
---|
public ERXInlineTemplate(com.webobjects.appserver.WOContext context)
Method Detail |
---|
public void appendToResponse(com.webobjects.appserver.WOResponse woresponse, com.webobjects.appserver.WOContext wocontext)
ERXNonSynchronizingComponent
ERXNonSynchronizingComponent.resetCachedBindingsInStatefulComponent()
prior to super.appendToResponse.
appendToResponse
in class ERXNonSynchronizingComponent
woresponse
- to which we are appendingwocontext
- context of the responsepublic java.lang.String errorTemplate()
public boolean proxyParent()
public boolean defaultToDynamicBindings()
public void takeValueForKeyPath(java.lang.Object value, java.lang.String keyPath)
takeValueForKeyPath
in interface com.webobjects.foundation.NSKeyValueCodingAdditions
takeValueForKeyPath
in class com.webobjects.appserver.WOComponent
public java.lang.Object valueForKeyPath(java.lang.String keyPath)
valueForKeyPath
in interface com.webobjects.foundation.NSKeyValueCodingAdditions
valueForKeyPath
in class com.webobjects.appserver.WOComponent
public void takeValueForKey(java.lang.Object obj, java.lang.String s)
takeValueForKey
in interface com.webobjects.foundation.NSKeyValueCoding
takeValueForKey
in class com.webobjects.appserver.WOComponent
public java.lang.Object valueForKey(java.lang.String s)
valueForKey
in interface com.webobjects.foundation.NSKeyValueCoding
valueForKey
in class com.webobjects.appserver.WOComponent
public com.webobjects.appserver.WOElement template()
template
in class com.webobjects.appserver.WOComponent
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |