PATH |
DefaultAssignment
Package: com.webobjects.directtowebInherits from:Assignment
Class Description
This class provides several methods that provide default values for the right-hand sides of rules. Many of these default values depend on the current entity or property in the Direct to Web context that is active when the rule fires.
_context
variable to access the Direct to Web context that is active when the rule fires.
For more information about subclassing
Method Types
Constructors
- public DefaultAssignment(String keyPath, String value)
- public DefaultAssignment(EOKeyValueUnarchiver unarchiver)
Firing the Rule
Private Methods
Providing Default Values
- defaultDisplayNameForProperty
- defaultEntityName
- defaultPropertyKeysFromEntity
- defaultPropertyKeysFromEntityWithoutRelationships
- isEntityReadOnly
- smartDefaultAttributeWidth
- smartDefaultAttributeWidthAsInt
- smartDefaultEntityNames
- smartDefaultKey
- smartDefaultKeyWhenRelationship
- smartDefaultRows
Constructors
DefaultAssignment
public DefaultAssignment(String keyPath, String value)
Creates a
DefaultAssignment
public DefaultAssignment(EOKeyValueUnarchiver unarchiver)
Creates a
Methods
attributeWidth
public int attributeWidth()
This method is intentionally undocumented. You should never have to invoke or customize it.
defaultDisplayNameForProperty
public String defaultDisplayNameForProperty()
Returns a
defaultEntityName
public String defaultEntityName()
Returns the first entity name in the
smartDefaultEntityNames
.See Also:
smartDefaultEntityNames
defaultPropertyKeysFromEntity
public NSArray defaultPropertyKeysFromEntity()
Returns a sorted
defaultPropertyKeysFromEntityWithoutRelationships
public NSArray defaultPropertyKeysFromEntityWithoutRelationships()
Returns a sorted
fire
public synchronized Object fire(D2WContext context)
This method is invoked when the receiver's rule fires. In turn, it invokes the method in this class specified by the receiver's right-hand-side value.
isEntityReadOnly
public Integer isEntityReadOnly()
Returns whether or not the current entity (in the Direct to Web context in which the receiver's rule fires) can be modified. You can specify if an entity can be modified using the Web Assistant. See the "Direct to Web" chapter of WebObjects Tools and Techniques for more details.
You can override this method to provide your own criteria for whether or not a entity can be modified.
smartDefaultAttributeWidth
final public String smartDefaultAttributeWidth()
Returns a
smartDefaultAttributeWidthAsInt
.See Also:
smartDefaultAttributeWidthAsInt
smartDefaultAttributeWidthAsInt
public int smartDefaultAttributeWidthAsInt()
Returns the width of the current attribute in the Direct to Web context in which the receiver's rule fires. Returns 50 if the width of the current attribute is less than 50. Returns 20 if the current property is not an attribute.
smartDefaultEntityNames
public final NSArray smartDefaultEntityNames()
Returns a sorted
smartDefaultKey
public String smartDefaultKey()
Returns the key for the default property of the current entity in the Direct to Web context in which the receiver's rule fires. This method guesses the most likely property with which the user will query for the entity and returns its key.
smartDefaultKeyWhenRelationship
public String smartDefaultKeyWhenRelationship()
Returns a key for the default property of the current relationship's destination object. If the current property (in the Direct to Web context in which the receiver's rule fires) is not a relationship, returns
null
. This method guesses the most likely property with which the user will query for the relationship's destination entity and returns its key.
smartDefaultRows
final public String smartDefaultRows()
Returns a
valueString
public String valueString()
This method is intentionally undocumented. You should never have to invoke or customize it.
© 2001 Apple Computer, Inc.