public abstract class ERXComponent extends WOComponent
WOComponent._EventLoggingEnabler, WOComponent.Event
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
NSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null<T>, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
Modifier and Type | Field and Description |
---|---|
protected NSMutableDictionary |
_dynamicBindings |
_Extension, _IsEventLoggingEnabled, _keyAssociations
_CLASS
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
NullValue
_CLASS
Constructor and Description |
---|
ERXComponent(WOContext context)
Constructs a new ERXComponent.
|
Modifier and Type | Method and Description |
---|---|
void |
_awakeInContext(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 String |
_frameworkName()
Returns the name of this component's framework or "app" if
frameworkName() returns null.
|
protected void |
_includeCSSResources(WOResponse response,
WOContext context)
Injects per-component CSS dependencies into the head tag based on the
definitions in useDefaultComponentCSS(), defaultCSSPath(),
primaryCSSFile(), and additionalCSSFiles().
|
protected void |
_includeJavascriptResources(WOResponse response,
WOContext context)
Injects per-component javascript dependencies into the head tag based on
the definitions in useDefaultComponentJavascript(),
defaultJavascriptPath(), primaryJavascriptFile(), and
additionalJavascriptFiles().
|
protected NSArray<String> |
additionalCSSFiles()
Returns an array of additional CSS files for this component, or null (or
empty array) if there aren't any.
|
protected NSArray<String> |
additionalJavascriptFiles()
Returns an array of additional Javascript files for this component, or
null (or empty array) if there aren't any.
|
void |
appendToResponse(WOResponse response,
WOContext context)
Calls _checkAccess prior to super.appendToResponse and adds support for
ClickToOpen (TM).
|
protected <T> NSArray<T> |
arrayValueForBinding(String binding)
Resolves a given binding as an NSArray object.
|
protected <T> NSArray<T> |
arrayValueForBinding(String binding,
NSArray<T> defaultValue)
Resolves a given binding as an NSArray object.
|
protected boolean |
booleanValueForBinding(String binding)
Resolves a given binding as a boolean value.
|
protected boolean |
booleanValueForBinding(String binding,
boolean defaultValue)
Resolves a given binding as a boolean value.
|
protected boolean |
booleanValueForBinding(String binding,
ERXUtilities.BooleanOperation defaultValue)
Resolves a given binding as a boolean value with the option of specifying
a boolean operator as the default value.
|
ERXBrowser |
browser()
Convenience method to get the browser.
|
protected void |
checkAccess()
Override to provide custom security checks.
|
boolean |
clickToOpenEnabled(WOResponse response,
WOContext context)
Returns whether or not click-to-open should be enabled for this
component.
|
String |
componentName()
Returns the name of this component without the package name.
|
protected String |
defaultCSSPath()
Returns the default path prefix for CSS, which will be prepended to all
required CSS files for this component.
|
protected String |
defaultJavascriptPath()
Returns the default path prefix for Javascript, which will be prepended
to all required Javascript files for this component.
|
NSMutableDictionary |
dynamicBindings()
Lazily initialized dictionary which can be used for the 'item' binding in
a repetition for example: 'item = dynamicBindings.myVariable'.
|
protected float |
floatValueForBinding(String binding,
float defaultValue)
Resolves a given binding as a float value.
|
protected int |
intValueForBinding(String binding,
int defaultValue)
Resolves a given binding as a int value.
|
WOActionResults |
invokeAction(WORequest request,
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 Object |
objectValueForBinding(String binding)
Resolves a given binding as an object in the normal fashion of calling
valueForBinding . |
protected Object |
objectValueForBinding(String binding,
Object defaultValue)
Resolves a given binding as an object in the normal fashion of calling
valueForBinding . |
<T extends WOComponent> |
pageWithName(Class<T> componentClass)
This variant of pageWithName provides a Java5 genericized version of the
original pageWithName.
|
protected void |
postAppendToResponse(WOResponse response,
WOContext context)
Override to hook into appendToResponse after super.appendToResponse.
|
protected void |
preAppendToResponse(WOResponse response,
WOContext context)
Override to hook into appendToResponse after security checks but before
the super.appendToResponse.
|
protected String |
primaryCSSFile()
Returns the primary CSS file for this component, or null if there isn't
one.
|
protected String |
primaryJavascriptFile()
Returns the primary Javascript file for this component, or null if there
isn't one.
|
void |
reset()
このメソッドは、指定されているコンテクストのオブジェクトに対する、
ステートレス・コンポーネントの一時的リファレンスをリセットもしくは削除します。
あるコンポーネントの共有化されたインスタンスが、他のセッションによって再利用されるとき、
このメソッドを利用し、各コンポーネントのインスタンス変数を解放します。
|
protected boolean |
shouldCheckAccess()
Returns whether or not this component should check access before processing any of the request-response loop.
|
protected String |
stringValueForBinding(String binding)
Retrieves a given binding and if it is not null then returns
toString called on the bound object. |
protected String |
stringValueForBinding(String binding,
String defaultValue)
Retrieves a given binding and if it is not null then returns
toString called on the bound object. |
void |
takeValuesFromRequest(WORequest request,
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.
|
__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, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, setVariableValueForName, sleep, synchronizesVariablesWithBindings, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding, variableValueForName, variableWithName
protected NSMutableDictionary _dynamicBindings
public ERXComponent(WOContext context)
context
- the WOContextpublic <T extends WOComponent> T pageWithName(Class<T> componentClass)
T
- componentClass
- public void _awakeInContext(WOContext aArg0)
_awakeInContext
in class WOComponent
protected void _checkAccess() throws SecurityException
SecurityException
- protected boolean shouldCheckAccess()
public void takeValuesFromRequest(WORequest request, WOContext context)
takeValuesFromRequest
in class WOComponent
request
- context
- public WOActionResults invokeAction(WORequest request, WOContext context)
invokeAction
in class WOComponent
request
- context
- public void appendToResponse(WOResponse response, WOContext context)
appendToResponse
in class WOComponent
response
- context
- public boolean clickToOpenEnabled(WOResponse response, WOContext context)
response
- context
- protected int intValueForBinding(String binding, int defaultValue)
binding
- defaultValue
- protected float floatValueForBinding(String binding, float defaultValue)
binding
- defaultValue
- protected boolean booleanValueForBinding(String binding)
binding
- protected boolean booleanValueForBinding(String binding, boolean defaultValue)
binding
- defaultValue
- protected boolean booleanValueForBinding(String binding, ERXUtilities.BooleanOperation defaultValue)
binding
- defaultValue
- protected Object objectValueForBinding(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.
valueForBinding
と違って、結果オブジェクトを{link ERXUtilities$Operation}
として戻され、処理が含まれるの場合、処理の結果を取得します。
binding
- protected Object objectValueForBinding(String binding, 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.
valueForBinding
と違って、結果オブジェクトを{link ERXUtilities$Operation}
として戻され、処理が含まれるの場合、処理の結果を取得します。
binding
- defaultValue
- valueForBinding
returns null.valueForBinding
が null を戻す場合のデフォルト値protected String stringValueForBinding(String binding)
toString
called on the bound object.
toString
が呼ばれ、結果を戻します。
binding
- protected String stringValueForBinding(String binding, String defaultValue)
toString
called on the bound object.
toString
が呼ばれ、結果を戻します。
binding
- defaultValue
- valueForBinding
returns null.valueForBinding
が null を戻す場合のデフォルト値protected <T> NSArray<T> arrayValueForBinding(String binding)
T
- type of array elementsbinding
- protected <T> NSArray<T> arrayValueForBinding(String binding, NSArray<T> defaultValue)
T
- type of array elementsbinding
- defaultValue
- valueForBinding
returns null.public ERXLocalizer localizer()
public ERXBrowser browser()
public NSMutableDictionary dynamicBindings()
public void reset()
reset
in class WOComponent
public String componentName()
protected void _includeCSSResources(WOResponse response, WOContext context)
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 recombining 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.
useDefaultComponentCSS で true を戻す場合 (primaryCSSFileをオーバライドしないで) このコンポーネントは defaultCSSPath() + /YourComponentName.css をヘッダーに挿入します。 例えば、コンポーネントの名前が HeaderFooter とし、useDefaultComponentCSS は自動的に defaultCSSPath() + /HeaderFooter.css へのレファレンスを作成します。 この機能を使うことで、簡単にコンポーネントに属している CSS ファイルを作成でき、上位のコンポーネントを 意識する必要がありません。 現在では _includeCSSResources は CSS ファイルの結合などを行いません。
defaultCSSPath をオーバライドすること、CSS ファイルを含む WebServerResources への元パスを提供します。 すべての CSS が WebServerResources/css 内にある場合、defaultCSSPath() として "css" を戻します。
CSS ファイルとしてコンポーネント名を使用したく無い場合、primaryCSSFile() をオーバライドすることで、 ある CSS ファイル名を戻します。それとも、additionalCSSFiles() で CSS ファイルの NSArray を戻します。 すべてのファイル名は defaultCSSPath を先頭に追加されるのです。
response
- context
- protected void _includeJavascriptResources(WOResponse response, WOContext context)
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.
useDefaultComponentJavascript で true を戻す場合 (primaryJavascriptFileをオーバライドしないで) このコンポーネントは defaultJavascriptPath() + /YourComponentName.js をヘッダーに挿入します。 例えば、コンポーネントの名前が HeaderFooter とし、useDefaultComponentJavascript は自動的に defaultJavascriptPath() + /HeaderFooter.js へのレファレンスを作成します。 この機能を使うことで、簡単にコンポーネントに属している Javascript ファイルを作成でき、上位のコンポーネントを 意識する必要がありません。 現在では _includeJavascriptResources は Javascript ファイルの結合などを行いません。
defaultJavascriptPath をオーバライドすること、Javascript ファイルを含む WebServerResources への元パスを提供します。 すべての Javascript が WebServerResources/scripts 内にある場合、defaultJavascriptPath() として "scripts" を戻します。
Javascript ファイルとしてコンポーネント名を使用したく無い場合、primaryJavascriptFile() をオーバライドすることで、 ある Javascript ファイル名を戻します。それとも、additionalJavascriptFiles() で Javascript ファイルの NSArray を戻します。 すべてのファイル名は defaultJavascriptPath を先頭に追加されるのです。
response
- context
- protected String _frameworkName()
protected boolean useDefaultComponentCSS()
protected String defaultCSSPath()
protected String primaryCSSFile()
protected NSArray<String> additionalCSSFiles()
protected boolean useDefaultComponentJavascript()
protected String defaultJavascriptPath()
protected String primaryJavascriptFile()
protected NSArray<String> additionalJavascriptFiles()
protected boolean isPageAccessAllowed()
protected void checkAccess() throws SecurityException
SecurityException
- protected void preAppendToResponse(WOResponse response, WOContext context)
response
- context
- protected void postAppendToResponse(WOResponse response, WOContext context)
response
- context
- Copyright © 2002 – 2024 Project Wonder.