Project Wonder 5.0.0.8787

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:
WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, Cloneable

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 no such binding is available, the value is stored in a NSMutableDictionary. The remaining keyPath is applied as above.

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.

Author:
th
See Also:
Serialized Form
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)
           

Nested Class Summary
static class ERXInlineTemplate.Error
           
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
WOComponent._EventLoggingEnabler, WOComponent.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
static Logger log
           
 
Fields inherited from class er.extensions.components.ERXComponent
_dynamicBindings
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations, MINUSONE
 
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
ERXInlineTemplate(WOContext context)
           
 
Method Summary
 void appendToResponse(WOResponse woresponse, WOContext wocontext)
          Calls _checkAccess prior to super.appendToResponse and adds support for ClickToOpen (TM).
 String errorTemplate()
           
 boolean proxyParent()
           
 void takeValueForKey(Object obj, String s)
           
 void takeValueForKeyPath(Object value, String keyPath)
           
 WOElement template()
           
 Object valueForKey(String s)
           
 Object valueForKeyPath(String keyPath)
           
 
Methods inherited from class er.extensions.components.ERXNonSynchronizingComponent
isStateless, synchronizesVariablesWithBindings
 
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, invokeAction, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, reset, stringValueForBinding, stringValueForBinding, takeValuesFromRequest, useDefaultComponentCSS, useDefaultComponentJavascript
 
Methods inherited from class com.webobjects.appserver.WOComponent
__valueForBinding, _associationWithName, _childTemplate, _cleanUpStatelessComponent, _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, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static Logger log
Constructor Detail

ERXInlineTemplate

public ERXInlineTemplate(WOContext context)
Method Detail

appendToResponse

public void appendToResponse(WOResponse woresponse,
                             WOContext wocontext)
Description copied from class: ERXComponent
Calls _checkAccess prior to super.appendToResponse and adds support for ClickToOpen (TM).

Overrides:
appendToResponse in class ERXComponent

errorTemplate

public String errorTemplate()

proxyParent

public boolean proxyParent()

takeValueForKeyPath

public void takeValueForKeyPath(Object value,
                                String keyPath)
Specified by:
takeValueForKeyPath in interface NSKeyValueCodingAdditions
Overrides:
takeValueForKeyPath in class WOComponent

valueForKeyPath

public Object valueForKeyPath(String keyPath)
Specified by:
valueForKeyPath in interface NSKeyValueCodingAdditions
Overrides:
valueForKeyPath in class WOComponent

takeValueForKey

public void takeValueForKey(Object obj,
                            String s)
Specified by:
takeValueForKey in interface NSKeyValueCoding
Overrides:
takeValueForKey in class WOComponent

valueForKey

public Object valueForKey(String s)
Specified by:
valueForKey in interface NSKeyValueCoding
Overrides:
valueForKey in class WOComponent

template

public WOElement template()
Overrides:
template in class WOComponent

Last updated: Wed, Jan 7, 2009 • 04:35 AM EST

Copyright © 2002 – 2007 Project Wonder.