|
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
public abstract class ERXComponent
ERXComponent provides a common base class for WOComponents along with a bunch of miscellaneous handy features.
Nested Class Summary |
---|
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 com.webobjects.foundation.NSMutableDictionary |
_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 | |
---|---|
ERXComponent(com.webobjects.appserver.WOContext context)
Constructs a new ERXComponent. |
Method Summary | ||
---|---|---|
void |
_awakeInContext(com.webobjects.appserver.WOContext aArg0)
|
|
protected void |
_checkAccess()
_checkAccess is called prior to all three phases of the R-R loop to ensure that the user has permission to access this component. |
|
protected java.lang.String |
_frameworkName()
Returns the name of this component's framework or "app" if frameworkName() returns null. |
|
protected void |
_includeCSSResources(com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOContext context)
Injects per-component CSS dependencies into the head tag based on the definitions in useDefaultComponentCSS(), defaultCSSPath(), primaryCSSFile(), and additionalCSSFiles(). |
|
protected void |
_includeJavascriptResources(com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOContext context)
Injects per-component javascript dependencies into the head tag based on the definitions in useDefaultComponentJavascript(), defaultJavascriptPath(), primaryJavascriptFile(), and additionalJavascriptFiles(). |
|
protected com.webobjects.foundation.NSArray<java.lang.String> |
additionalCSSFiles()
Returns an array of additional CSS files for this component, or null (or empty array) if there aren't any. |
|
protected com.webobjects.foundation.NSArray<java.lang.String> |
additionalJavascriptFiles()
Returns an array of additional Javascript files for this component, or null (or empty array) if there aren't any. |
|
void |
appendToResponse(com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOContext context)
Calls _checkAccess prior to super.appendToResponse and adds support for ClickToOpen (TM). |
|
protected boolean |
booleanValueForBinding(java.lang.String binding)
Resolves a given binding as a boolean value. |
|
protected boolean |
booleanValueForBinding(java.lang.String binding,
boolean defaultValue)
Resolves a given binding as a boolean value. |
|
protected boolean |
booleanValueForBinding(java.lang.String binding,
ERXUtilities.BooleanOperation defaultValue)
Resolves a given binding as a boolean value with the option of specifing a boolean operator as the default value. |
|
protected void |
checkAccess()
Override to provide custom security checks. |
|
boolean |
clickToOpenEnabled(com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOContext context)
Returns whether or not click-to-open should be enabled for this component. |
|
java.lang.String |
componentName()
Returns the name of this component without the package name. |
|
protected java.lang.String |
defaultCSSPath()
Returns the default path prefix for CSS, which will be prepended to all required CSS files for this component. |
|
protected java.lang.String |
defaultJavascriptPath()
Returns the default path prefix for Javascript, which will be prepended to all required Javascript files for this component. |
|
com.webobjects.foundation.NSMutableDictionary |
dynamicBindings()
Lazily initialized dictionary which can be used for the 'item' binding in a repetition for example: 'item = dynamicBindings.myVariable'. |
|
protected float |
floatValueForBinding(java.lang.String binding,
float defaultValue)
Resolves a given binding as a float value. |
|
protected int |
intValueForBinding(java.lang.String binding,
int defaultValue)
Resolves a given binding as a int value. |
|
com.webobjects.appserver.WOActionResults |
invokeAction(com.webobjects.appserver.WORequest request,
com.webobjects.appserver.WOContext context)
Calls _checkAccess prior to super.invokeAction. |
|
protected boolean |
isPageAccessAllowed()
Override and return true for any components to which you would like to allow page level access. |
|
ERXLocalizer |
localizer()
Convenience method to get the localizer. |
|
protected java.lang.Object |
objectValueForBinding(java.lang.String binding)
Resolves a given binding as an object in the normal fashion of calling valueForBinding . |
|
protected java.lang.Object |
objectValueForBinding(java.lang.String binding,
java.lang.Object defaultValue)
Resolves a given binding as an object in the normal fashion of calling valueForBinding . |
|
|
pageWithName(java.lang.Class<T> componentClass)
This variant of pageWithName provides a Java5 genericized version of the original pageWithName. |
|
protected void |
postAppendToResponse(com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOContext context)
Override to hook into appendToResponse after super.appendToResponse. |
|
protected void |
preAppendToResponse(com.webobjects.appserver.WOResponse response,
com.webobjects.appserver.WOContext context)
Override to hook into appendToResponse after security checks but before the super.appendToResponse. |
|
protected java.lang.String |
primaryCSSFile()
Returns the primary CSS file for this component, or null if there isn't one. |
|
protected java.lang.String |
primaryJavascriptFile()
Returns the primary Javascript file for this component, or null if there isn't one. |
|
void |
reset()
|
|
protected java.lang.String |
stringValueForBinding(java.lang.String binding)
Retrieves a given binding and if it is not null then returns toString called on the bound object. |
|
protected java.lang.String |
stringValueForBinding(java.lang.String binding,
java.lang.String defaultValue)
Retrieves a given binding and if it is not null then returns toString called on the bound object. |
|
void |
takeValuesFromRequest(com.webobjects.appserver.WORequest request,
com.webobjects.appserver.WOContext context)
Calls _checkAccess prior to super.takeValuesFromRequest. |
|
protected boolean |
useDefaultComponentCSS()
Returns true if this component provides a default CSS file that has the same name as the component itself. |
|
protected boolean |
useDefaultComponentJavascript()
Returns true if this component provides a default Javascript file that has the same name as the component itself. |
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, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, synchronizesVariablesWithBindings, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForKey, valueForKeyPath |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected com.webobjects.foundation.NSMutableDictionary _dynamicBindings
Constructor Detail |
---|
public ERXComponent(com.webobjects.appserver.WOContext context)
context
- the WOContextMethod Detail |
---|
public <T extends com.webobjects.appserver.WOComponent> T pageWithName(java.lang.Class<T> componentClass)
T
- the type of component to createcomponentClass
- the Class of the component to load
public void _awakeInContext(com.webobjects.appserver.WOContext aArg0)
_awakeInContext
in class com.webobjects.appserver.WOComponent
protected void _checkAccess() throws java.lang.SecurityException
java.lang.SecurityException
- if the user does not have permissionpublic void takeValuesFromRequest(com.webobjects.appserver.WORequest request, com.webobjects.appserver.WOContext context)
takeValuesFromRequest
in class com.webobjects.appserver.WOComponent
public com.webobjects.appserver.WOActionResults invokeAction(com.webobjects.appserver.WORequest request, com.webobjects.appserver.WOContext context)
invokeAction
in class com.webobjects.appserver.WOComponent
public void appendToResponse(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
appendToResponse
in class com.webobjects.appserver.WOComponent
public boolean clickToOpenEnabled(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
response
- the responsecontext
- the context
protected int intValueForBinding(java.lang.String binding, int defaultValue)
binding
- binding to be resolved as a int value.defaultValue
- default int value to be used if the binding is not bound.
protected float floatValueForBinding(java.lang.String binding, float defaultValue)
binding
- binding to be resolved as a float value.defaultValue
- default float value to be used if the binding is not bound.
protected boolean booleanValueForBinding(java.lang.String binding)
binding
- binding to be resolved as a boolean value.
protected boolean booleanValueForBinding(java.lang.String binding, boolean defaultValue)
binding
- binding to be resolved as a boolean value.defaultValue
- default boolean value to be used if the binding is not bound.
protected boolean booleanValueForBinding(java.lang.String binding, ERXUtilities.BooleanOperation defaultValue)
binding
- name of the component binding.defaultValue
- boolean operator to be evaluated if the binding is not
present.
protected java.lang.Object objectValueForBinding(java.lang.String binding)
valueForBinding
. This has the one advantage of being able to
resolve the resulting object as a {link ERXUtilities$Operation} if it is
an Operation and then returning the result as the evaluation of that
operation.
binding
- name of the component binding.
protected java.lang.Object objectValueForBinding(java.lang.String binding, java.lang.Object defaultValue)
valueForBinding
. This has the one advantage of being able to
resolve the resulting object as a {link ERXUtilities$Operation} if it is
an Operation and then returning the result as the evaluation of that
operation.
binding
- name of the component binding.defaultValue
- value to be used if valueForBinding
returns null.
protected java.lang.String stringValueForBinding(java.lang.String binding)
toString
called on the bound object.
binding
- to be resolved
protected java.lang.String stringValueForBinding(java.lang.String binding, java.lang.String defaultValue)
toString
called on the bound object.
binding
- to be resolveddefaultValue
- value to be used if valueForBinding
returns null.
public ERXLocalizer localizer()
public com.webobjects.foundation.NSMutableDictionary dynamicBindings()
public void reset()
reset
in class com.webobjects.appserver.WOComponent
public java.lang.String componentName()
protected void _includeCSSResources(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
Injects per-component CSS dependencies into the head tag based on the definitions in useDefaultComponentCSS(), defaultCSSPath(), primaryCSSFile(), and additionalCSSFiles().
If you return true for useDefaultComponentCSS (and do not override primaryCSSFile), this component will inject a reference to defaultCSSPath() + /YourComponentName.css. For instance, if your component is named HeaderFooter, useDefaultComponentCSS will automatically add a reference to defaultCSSPath() + /HeaderFooter.css for you. This allows you to very easily specify per-component CSS files without upper-level components knowing about them. Currently _includeCSSResources does not try to do anything fancy in terms of recombinding CSS files.
Override defaultCSSPath to provide the base path relative to WebServerResources that contains your CSS files. If all of your CSS is in WebServerResources/css, you would return "css" from defaultCSSPath().
If you do not want to use the component's name as the name of the CSS file, you can optionally override primaryCSSFile() to return the name of a specific CSS file, as well as additionalCSSFiles() to return an NSArray of CSS files. All of these file names will be prepended with the defaultCSSPath if it is set.
response
- the response to write intocontext
- the current contextprotected void _includeJavascriptResources(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
Injects per-component javascript dependencies into the head tag based on the definitions in useDefaultComponentJavascript(), defaultJavascriptPath(), primaryJavascriptFile(), and additionalJavascriptFiles().
If you return true for useDefaultComponentJavascript (and do not override primaryJavascriptFile), this component will inject a reference to defaultJavascriptPath() + /YourComponentName.js. For instance, if your component is named HeaderFooter, useDefaultComponentJavascript will automatically add a reference to defaultJavascriptPath() + /HeaderFooter.js for you. This allows you to very easily specify per-component Javascript files without upper-level components knowing about them. Currently _includeJavascriptResources does not try to do anything fancy in terms of recombinding Javascript files.
Override defaultJavascriptPath to provide the base path relative to WebServerResources that contains your Javascript files. If all of your Javascript is in WebServerResources/scripts, you would return "scripts" from defaultJavascriptPath().
If you do not want to use the component's name as the name of the Javascript file, you can optionally override primaryJavascriptFile() to return the name of a specific Javascript file, as well as additionalJavascriptFiles() to return an NSArray of Javascript files. All of these file names will be prepended with the defaultJavascriptPath if it is set.
response
- the response to write intocontext
- the current contextprotected java.lang.String _frameworkName()
protected boolean useDefaultComponentCSS()
protected java.lang.String defaultCSSPath()
protected java.lang.String primaryCSSFile()
protected com.webobjects.foundation.NSArray<java.lang.String> additionalCSSFiles()
protected boolean useDefaultComponentJavascript()
protected java.lang.String defaultJavascriptPath()
protected java.lang.String primaryJavascriptFile()
protected com.webobjects.foundation.NSArray<java.lang.String> additionalJavascriptFiles()
protected boolean isPageAccessAllowed()
protected void checkAccess() throws java.lang.SecurityException
java.lang.SecurityException
- if the security check failsprotected void preAppendToResponse(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
response
- the current responsecontext
- the current contextprotected void postAppendToResponse(com.webobjects.appserver.WOResponse response, com.webobjects.appserver.WOContext context)
response
- the current responsecontext
- the current context
|
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 |