|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.directtoweb.D2WContext
Direct to Web contexts are objects of the D2WContext class. When a Direct to Web template renders, it does so with the help of a Direct to Web context which provides values for bindings in the template and maintains state information about the rendering process. See the "Direct to Web Architecture" chapter of Developing WebObjects Applications With Direct to Web for more information about the Direct to Web context.
The primary function of the Direct to Web context is to implement the
EOKeyValueCoding interface (defined in the EOControl framework) by implementing
valueForKey
and takeValueForKey
. It resolves the keys with the help of the rule system.
Many of the keys mentioned in the class are defined as constants in the D2WModel class.
D2WContext also provides two methods for accessing key paths such as entity.name.
These are valueForKeyPath
and takeValueForKeyPath
. When you use the d2wContext
key
in a Direct to Web template's bindings (.wod) file, you indirectly use one of these methods.
For a list of the keys implemented by the D2WContext, see Direct To Web Context Keys. The D2WContext class also provides convenience methods to access keys in Java.
Nested Class Summary |
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueCodingAdditions |
EOKeyValueCodingAdditions.DefaultImplementation, EOKeyValueCodingAdditions.Utility |
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding |
NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor |
Field Summary | |
static Object |
NULL_VALUE
This constant is intentionally undocumented. |
static Object |
VALUE_TO_BE_DERIVED
This constant is intentionally undocumented. |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
KeyPathSeparator |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
NullValue |
Constructor Summary | |
D2WContext()
Standard no-argument constructions. |
|
D2WContext(D2WContext parentContext)
Creates a new instance with the values of parentContext . |
|
D2WContext(WOSession session)
Creates a new instance of a context. |
Method Summary | |
EOAttribute |
attribute()
Returns the EOAttribute object for the current property |
protected EOAttribute |
attribute(String propertyKey)
This is an intentionally undocumented private use method. |
protected EOAttribute |
attributeForProperty(String propertyKey)
This is an intentionally undocumented private use method. |
void |
clearDerivedValues()
This is an intentionally undocumented private use method. |
boolean |
componentClassPresentInRuntime(String componentClassName)
This is an intentionally undocumented private use method. |
String |
componentName()
Returns the name of the property-level component to display based on the current property.. |
Vector |
componentsAvailable()
This is an intentionally undocumented private use method. |
void |
computeDerivedValues()
This is an intentionally undocumented private use method. |
String |
displayNameForProperty()
Returns a String containing a user-presentable name for the current property. |
EOAttribute |
distantAttribute(String propertyKey,
EOEntity entity)
This is an intentionally undocumented private use method. |
EORelationship |
distantRelationship(String propertyKey,
EOEntity entity)
This is an intentionally undocumented private use method. |
String |
dynamicPage()
Returns the value of the current named configuration |
EOEntity |
entity()
Returns the setting for the current entity. |
boolean |
frame()
This is an intentionally undocumented private use method. |
Object |
handleQueryWithUnboundKey(String key)
This is an intentionally undocumented private use method. |
void |
handleTakeValueForUnboundKey(Object value,
String key)
This is an intentionally undocumented private use method. |
Vector |
inferAllPossibleValuesForKey(String key)
This is an intentionally undocumented private use method. |
Object |
inferSystemValueForKey(String key)
This is an intentionally undocumented private use method. |
Object |
inferValueForKey(String key)
Forces the use of the Rule System to get the value of key . |
boolean |
isGenerating()
This is an intentionally undocumented private use method. |
String |
keyWhenRelationship()
When the current property is a relationship, returns the key for a property of the destination entity that identifies the entity. |
D2WModel |
model()
Returns model being used by context to derive values. |
void |
nullOutDerivedValues()
This is an intentionally undocumented private use method. |
String |
pageName()
Returns the name of the Direct to Web template based on the current task and entity. |
Vector |
pagesAvailable()
This is an intentionally undocumented private use method. |
String |
propertyKey()
Returns the value of the current property. |
boolean |
propertyKeyIsKeyPath()
Returns true if the current property key is a key path. |
int |
propertyType()
This is an intentionally undocumented private use method. |
static String |
propertyTypeForUnknownKeyPath(String keyPath,
EOEntity entity)
This is an intentionally undocumented private use method. |
String |
rawPageName()
This is an intentionally undocumented private use method. |
String |
rawSystemPageName()
This is an intentionally undocumented private use method. |
EORelationship |
relationship()
Returns the relationship object for the current property. |
protected EORelationship |
relationship(String propertyKey)
This is an intentionally undocumented private use method. |
protected EORelationship |
relationshipForProperty(String propertyKey)
This is an intentionally undocumented private use method. |
void |
sessionDidTimeOut(NSNotification notification)
This is an intentionally undocumented private use method. |
void |
setDynamicPage(String newValue)
Sets the value of the current named configuration |
void |
setEntity(EOEntity newValue)
Sets the value of the current entity. |
void |
setPropertyKey(String newValue)
Sets the value of the current property. |
void |
setTask(String newValue)
Sets the value of the current task. |
String |
startupEntityName()
This is an intentionally undocumented private use method. |
String |
startupTask()
Returns the setting for the start up task. |
Object |
storedValueForKey(String key)
This is an intentionally undocumented private use method. |
void |
takeStoredValueForKey(Object value,
String key)
This is an intentionally undocumented private use method. |
void |
takeValueForInferrableKey(Object newValue,
String key)
This is an intentionally undocumented private use method. |
void |
takeValueForKey(Object newValue,
String key)
Sets the value of key to newValue in the local cache. |
void |
takeValueForKeyPath(Object value,
String keyPath)
Sets the value of key path to value in the local cache. |
void |
takeValuesFromDictionary(NSDictionary dict)
This is an intentionally undocumented private use method. |
void |
takeValuesFromDictionaryWithMapping(NSDictionary dictionary,
NSDictionary mapping)
This is an intentionally undocumented private use method. |
String |
task()
Returns the setting for the current task. |
String |
toString()
This is an intentionally undocumented private use method. |
void |
unableToSetNullForKey(String key)
This is an intentionally undocumented private use method. |
Object |
valueForKey(String key)
Returns the value of 'key' using the Rule System. |
Object |
valueForKeyNoInference(String key)
Returns the value of 'key' without using the Rule System. |
Object |
valueForKeyPath(String keyPath)
Returns the inferred value of keyPath . |
Object |
valueForKeyPathNoInference(String keyPath)
Returns the value of 'keyPath' using the Rule System. |
NSDictionary |
valuesForKeys(NSArray keys)
This is an intentionally undocumented private use method. |
NSDictionary |
valuesForKeysWithMapping(NSDictionary mapping)
This is an intentionally undocumented private use method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Object NULL_VALUE
public static final Object VALUE_TO_BE_DERIVED
Constructor Detail |
public D2WContext()
public D2WContext(WOSession session)
session
- object set as the value to the key D2WModel.SessionKey. This way you can access the current session.public D2WContext(D2WContext parentContext)
parentContext
.
The new instance is initialized with the key-value pairs in parentContext
.
parentContext
- a context to copy initial values from.Method Detail |
public EOAttribute attribute()
protected EOAttribute attribute(String propertyKey)
protected EOAttribute attributeForProperty(String propertyKey)
public void clearDerivedValues()
public boolean componentClassPresentInRuntime(String componentClassName)
public String componentName()
public Vector componentsAvailable()
public void computeDerivedValues()
public String displayNameForProperty()
public EOAttribute distantAttribute(String propertyKey, EOEntity entity)
public EORelationship distantRelationship(String propertyKey, EOEntity entity)
public String dynamicPage()
public EOEntity entity()
public boolean frame()
public Object handleQueryWithUnboundKey(String key)
handleQueryWithUnboundKey
in interface NSKeyValueCoding.ErrorHandling
key
- the property name which generated this error
null
that the custom implementation desires. The default implementation throws an exception instead.NSKeyValueCoding.valueForKey(java.lang.String)
,
NSKeyValueCoding.UnknownKeyException
,
NSKeyValueCoding.DefaultImplementation
public void handleTakeValueForUnboundKey(Object value, String key)
handleTakeValueForUnboundKey
in interface NSKeyValueCoding.ErrorHandling
value
- the new value which could not be setkey
- the name of the property which generated this errorNSKeyValueCoding.takeValueForKey(java.lang.Object, java.lang.String)
,
NSKeyValueCoding.UnknownKeyException
,
NSKeyValueCoding.DefaultImplementation
public Vector inferAllPossibleValuesForKey(String key)
public Object inferSystemValueForKey(String key)
public Object inferValueForKey(String key)
key
.
key
- key to get value of
public boolean isGenerating()
public String keyWhenRelationship()
toStudio
relationship (and thus the destination entity is Studio), an appropriate value for
keyWhenRelationship
is name since the name property identifies the studio.
public D2WModel model()
public void nullOutDerivedValues()
public String pageName()
public Vector pagesAvailable()
public String propertyKey()
public boolean propertyKeyIsKeyPath()
public int propertyType()
public static String propertyTypeForUnknownKeyPath(String keyPath, EOEntity entity)
public String rawPageName()
public String rawSystemPageName()
public EORelationship relationship()
protected EORelationship relationship(String propertyKey)
protected EORelationship relationshipForProperty(String propertyKey)
public void sessionDidTimeOut(NSNotification notification)
public void setDynamicPage(String newValue)
newValue
- name for the named Configurationpublic void setEntity(EOEntity newValue)
newValue
- value of the current entity.public void setPropertyKey(String newValue)
newValue
- string name of the current property.public void setTask(String newValue)
newValue
under the key D2WModel.TaskKey.
newValue
- string value of the current task.public String startupEntityName()
public String startupTask()
defaultPage
method and is the first page displayed after the
user logs into an application. A user can change this start up page by adding
a rule that overrides the default value of startupTask
.
public Object storedValueForKey(String key)
storedValueForKey
in interface EOKeyValueCoding
key
- the property of the object
key
NSKeyValueCoding
,
NSKeyValueCoding.ErrorHandling
,
NSKeyValueCoding.valueForKey(String)
,
NSKeyValueCoding.ErrorHandling.handleQueryWithUnboundKey(String)
public void takeStoredValueForKey(Object value, String key)
takeStoredValueForKey
in interface EOKeyValueCoding
value
- the value to store in the receiverkey
- the property of the objectNSKeyValueCoding
,
NSKeyValueCoding.ErrorHandling
,
NSKeyValueCoding.takeValueForKey(Object, String)
,
NSKeyValueCoding.ErrorHandling.handleTakeValueForUnboundKey(Object, String)
public void takeValueForInferrableKey(Object newValue, String key)
public void takeValueForKey(Object newValue, String key)
newValue
in the local cache.
takeValueForKey
in interface NSKeyValueCoding
key
- key under which newValue
is storednewValue
- value of keyNSKeyValueCoding.NullValue
,
NSKeyValueCoding.valueForKey(java.lang.String)
,
NSKeyValueCoding.DefaultImplementation
,
NSKeyValueCoding.ErrorHandling
,
NSKeyValueCoding.ErrorHandling.handleTakeValueForUnboundKey(java.lang.Object, java.lang.String)
public void takeValueForKeyPath(Object value, String keyPath)
takeValueForKeyPath
in interface NSKeyValueCodingAdditions
keyPath
- key path under which value is storedvalue
- value of keyNSKeyValueCoding.takeValueForKey(java.lang.Object, java.lang.String)
,
NSKeyValueCodingAdditions.valueForKeyPath(java.lang.String)
,
NSKeyValueCodingAdditions.DefaultImplementation
public void takeValuesFromDictionary(NSDictionary dict)
takeValuesFromDictionary
in interface EOKeyValueCodingAdditions
dict
- the key-value pairs to be setNSKeyValueCoding.takeValueForKey(Object, String)
public void takeValuesFromDictionaryWithMapping(NSDictionary dictionary, NSDictionary mapping)
takeValuesFromDictionaryWithMapping
in interface EOKeyValueCodingAdditions
dictionary
- the key-value pairs to be setmapping
- the dictionary that maps arbitrary external names to
internal property namesNSKeyValueCoding.takeValueForKey(Object, String)
public String task()
public String toString()
public void unableToSetNullForKey(String key)
unableToSetNullForKey
in interface NSKeyValueCoding.ErrorHandling
key
- the name of the property which generated this errorNSKeyValueCoding.takeValueForKey(Object value, String key)
,
NSKeyValueCoding.DefaultImplementation
public Object valueForKey(String key)
valueForKey
in interface NSKeyValueCoding
key
- key the user is requesting a value for
NSKeyValueCoding.NullValue
,
NSKeyValueCoding.takeValueForKey(java.lang.Object, java.lang.String)
,
NSKeyValueCoding.DefaultImplementation
,
NSKeyValueCoding.ErrorHandling
,
NSKeyValueCoding.ErrorHandling.handleQueryWithUnboundKey(java.lang.String)
public Object valueForKeyNoInference(String key)
public Object valueForKeyPath(String keyPath)
keyPath
.
This method works similarly to valueForKey
except that you can pass a key path such as entity.name.
valueForKeyPath
in interface NSKeyValueCodingAdditions
keyPath
- key path to resolve
NSKeyValueCoding.valueForKey(java.lang.String)
,
NSKeyValueCodingAdditions.takeValueForKeyPath(java.lang.Object, java.lang.String)
,
NSKeyValueCodingAdditions.DefaultImplementation
public Object valueForKeyPathNoInference(String keyPath)
keyPath
.
This method may resolve the key path using the rule system.
keyPath
- key path the user is requesting a value for
public NSDictionary valuesForKeys(NSArray keys)
valuesForKeys
in interface EOKeyValueCodingAdditions
keys
- the array of keys whose values are to be retrieved
NSKeyValueCoding.valueForKey(String)
public NSDictionary valuesForKeysWithMapping(NSDictionary mapping)
valuesForKeysWithMapping
in interface EOKeyValueCodingAdditions
mapping
- the dictionary that maps arbitrary external names to
internal property names
NSKeyValueCoding.valueForKey(String)
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |