|
WebObjects 5.4.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.directtoweb.D2WContext
public class 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/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueCodingAdditions |
---|
EOKeyValueCodingAdditions.DefaultImplementation, EOKeyValueCodingAdditions.Utility |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding |
---|
NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding |
---|
NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, 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 |
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 VALUE_TO_BE_DERIVED
public static final Object NULL_VALUE
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 D2WModel model()
public Object valueForKeyNoInference(String key)
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 void takeValueForInferrableKey(Object newValue, String key)
public void computeDerivedValues()
public void clearDerivedValues()
public void nullOutDerivedValues()
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
,
NSKeyValueCoding.DefaultImplementation
,
NSKeyValueCoding.ErrorHandling
,
NSKeyValueCoding.ErrorHandling.handleTakeValueForUnboundKey(java.lang.Object, java.lang.String)
public static String propertyTypeForUnknownKeyPath(String keyPath, EOEntity entity)
public Object inferValueForKey(String key)
key
.
key
- key to get value of
public Object inferSystemValueForKey(String key)
public Vector inferAllPossibleValuesForKey(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 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 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 String task()
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 void setTask(String newValue)
newValue
under the key D2WModel.TaskKey.
newValue
- string value of the current task.public EOEntity entity()
public void setEntity(EOEntity newValue)
newValue
- value of the current entity.public String dynamicPage()
public void setDynamicPage(String newValue)
newValue
- name for the named Configurationpublic String startupEntityName()
public String propertyKey()
public boolean propertyKeyIsKeyPath()
public void setPropertyKey(String newValue)
newValue
- string name of the current property.public String displayNameForProperty()
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 EORelationship relationship()
protected EORelationship relationship(String propertyKey)
protected EORelationship relationshipForProperty(String propertyKey)
public EORelationship distantRelationship(String propertyKey, EOEntity entity)
public EOAttribute attribute()
protected EOAttribute attribute(String propertyKey)
protected EOAttribute attributeForProperty(String propertyKey)
public EOAttribute distantAttribute(String propertyKey, EOEntity entity)
public int propertyType()
public boolean componentClassPresentInRuntime(String componentClassName)
public Vector componentsAvailable()
public Vector pagesAvailable()
public String rawPageName()
public String rawSystemPageName()
public String pageName()
public String componentName()
public String toString()
toString
in class Object
public boolean frame()
public boolean isGenerating()
public void sessionDidTimeOut(NSNotification notification)
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 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)
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 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 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
,
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
,
NSKeyValueCoding.UnknownKeyException
,
NSKeyValueCoding.DefaultImplementation
public void unableToSetNullForKey(String key)
unableToSetNullForKey
in interface NSKeyValueCoding.ErrorHandling
key
- the name of the property which generated this errorNSKeyValueCoding.takeValueForKey
,
NSKeyValueCoding.DefaultImplementation
|
Last updated June 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |