PATH  Documentation > WebObjects 4.5 > Direct to Web

D2WContext

Package: com.apple.yellow.directtoweb

Inherits from:java.lang.Object

Implements:


Class Description

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. 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.

Method Types


Constructors
Static Constants

Convenience Methods
Key-Value Coding
Private Methods
Resolving Keys


Constructors


com.apple.yellow.directtoweb.D2WContext

public D2WContext()

Standard Java no-argument constructor.

com.apple.yellow.directtoweb.D2WContext

public D2WContext(D2WContext d2wContext)

This method is intentionally undocumented. You should never have to invoke or customize it.

com.apple.yellow.directtoweb.D2WContext

D2WContext(Settings settings)

This method is intentionally undocumented. You should never have to invoke or customize it.

com.apple.yellow.directtoweb.D2WContext

public D2WContext(WOSession session)

This method is intentionally undocumented. You should never have to invoke or customize it.
Static Constants



NULL_VALUE
java.lang.Object

This constant is intentionally undocumented.

VALUE_TO_BE_DERIVED
java.lang.Object

This constant is intentionally undocumented.
Methods


attribute

public EOAttribute attribute()

Returns the attribute (an EOAttribute object) corresponding to the current property in this Direct to Web context. Returns null if the property is not an attribute.

The EOAttribute class is define in the EOAccess Framework.



attribute

protected EOAttribute attribute(String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.



clearDerivedValues

public void clearDerivedValues()

This method is intentionally undocumented. You should never have to invoke or customize it.



componentClassPresentInRuntime

public boolean componentClassPresentInRuntime(String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.



componentName

public String componentName()

Returns the name of the property-level component to display based on the receiver's current property. The value is resolved using the rule system.



componentsAvailable

public Vector componentsAvailable()

This method is intentionally undocumented. You should never have to invoke or customize it.



computeDerivedValues

public void computeDerivedValues()

This method is intentionally undocumented. You should never have to invoke or customize it.



displayNameForProperty

public String displayNameForProperty()

Returns a String containing a user-presentable name for the receiver's current property. This value is resolved using the rule system.



distantAttribute

public EOAttribute distantAttribute(String aString, EOEntity anEntity)

This method is intentionally undocumented. You should never have to invoke or customize it.



distantRelationship

public EORelationship distantRelationship(String aString, EOEntity anEntity)

This method is intentionally undocumented. You should never have to invoke or customize it.



dynamicPage

public String dynamicPage()

This method is intentionally undocumented. You should never have to invoke or customize it.



entity

public EOEntity entity()

Returns the receiver's current entity.



frame

public boolean frame()

This method is intentionally undocumented. You should never have to invoke or customize it.



inferAllPossibleValuesForKey

public Vector inferAllPossibleValuesForKey(String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.



inferSystemValueForKey

public Object inferSystemValueForKey(String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.



inferValueForKey

public Object inferValueForKey(String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.



isGenerating

public boolean isGenerating()

This method is intentionally undocumented. You should never have to invoke or customize it.



keyWhenRelationship

public String keyWhenRelationship()

When the receiver's current property is a relationship, returns the key for a property of the destination entity that identifies the entity. For example, if the receiver's current entity is Movie and the current property is the toStudio relationship (and thus the destination entity is Studio), an appropriate value for keyWhenRelationship is name since the name property identifies the studio.



model

public D2WModel model()

This method is intentionally undocumented. You should never have to invoke or customize it.



nullOutDerivedValues

public void nullOutDerivedValues()

This method is intentionally undocumented. You should never have to invoke or customize it.



pageName

public String pageName()

Returns the name of the Direct to Web template based on the receiver's current task and entity. This value is resolved using the rule system.



pagesAvailable

public Vector pagesAvailable()

This method is intentionally undocumented. You should never have to invoke or customize it.



propertyKey

public String propertyKey()

Returns the key corresponding to the receiver's current property.



propertyKeyIsKeyPath

public boolean propertyKeyIsKeyPath()

This method is intentionally undocumented. You should never have to invoke or customize it.



propertyType

public int propertyType()

Returns a String describing the type of the receiver's current property. Returns "r" if the property is a relationship, "a" if the property is an attribute, "c" if the property is a custom property, and "k" if the property is a key path.



propertyTypeForUnknownKeyPath

static public String propertyTypeForUnknownKeyPath(String aString, EOEntity anEntity)

This method is intentionally undocumented. You should never have to invoke or customize it.



rawPageName

public String rawPageName()

This method is intentionally undocumented. You should never have to invoke or customize it.



rawSystemPageName

public String rawSystemPageName()

This method is intentionally undocumented. You should never have to invoke or customize it.



relationship

public EORelationship relationship()

Returns a relationship (an EORelationship object) for the receiver's in the Direct to Web context. Returns null if the property is not a relationship.

The EORelationship class is defined in the EOAccess Framework.



relationship

protected EORelationship relationship(String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.



sessionDidTimeOut

public void sessionDidTimeOut(NSNotification notification)

This method is intentionally undocumented. You should never have to invoke or customize it.



setDynamicPage

public void setDynamicPage(String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.



setEntity

public void setEntity(EOEntity entity)

This method is intentionally undocumented. You should never have to invoke or customize it.



setPropertyKey

public void setPropertyKey(String newPropertyKey)

Sets the property key in the receiver's dictionary to newPropertyKey. This method is usually invoked by a Direct to Web template. See the "Direct to Web Architecture" chapter of Developing WebObjects Applications With Direct To Web for more information.



setTask

public void setTask(String newTask)

This method is intentionally undocumented. You should never have to invoke or customize it.



startupEntityName

public String startupEntityName()

Returns a String containing the name of the entity to use in the startup page. The startup page (a query-all page by default) is the page created by the D2W defaultPage method and is the first page displayed after the user logs into an application generated by the Direct to Web wizard.

This key is resolved using the rule engine. With the default set of rules, this method returns an empty string because the query-all page does not work with any particular entity.

See Also:
defaultPage (D2W)



startupTask

public String startupTask()

Returns a String containing the name of the application's startup page task ("queryAll" by default). The startup page is the page created by D2W defaultPage method and is the first page displayed after the user logs into an application generated by the Direct to Web wizard.

This key is resolved using the rule engine.

See Also:
defaultPage (D2W)



takeValueForInferrableKey

public void takeValueForInferrableKey(Object anObject, String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.



takeValueForKey

public void takeValueForKey(Object newValue, String key)

Sets the receiver's value for key to be newValue. For a list of the keys implemented by D2WContext, see Direct to Web Context Keys.



takeValueForKeyPath

public void takeValueForKeyPath(Object newValue, String keyPath)

Sets the receiver's value for the key path keyPath to newValue. For a list of the keys implemented by D2WContext, see Direct to Web Context Keys.



task

public String task()

Returns a String containing the name of the receiver's current task.



toString

public String toString()

This method is intentionally undocumented. You should never have to invoke or customize it.



valueForKey

public Object valueForKey(String key)

Returns the receiver's value (an Object) for key. This method may resolve the key using the rule system. For an explanation of how you use this method and a list of the keys implemented by D2WContext, see Direct to Web Context Keys.



valueForKeyNoInference

public Object valueForKeyNoInference(String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.



valueForKeyPath

public Object valueForKeyPath(String keyPath)

Returns the receiver's value (an Object) for the key path keyPath. This method enables you to access Direct to Web context keys paths such as entity.name. For an explanation of how you use this method, how the method resolves the key, and a list of the keys implemented by D2WContext, see Direct to Web Context Keys.

See Also:
valueForKey



valueForKeyPathNoInference

public Object valueForKeyPathNoInference(String aString)

This method is intentionally undocumented. You should never have to invoke or customize it.