Project Wonder 2.0

er.directtoweb
Class ERDDefaultsEmbeddedAssignment

java.lang.Object
  extended bycom.webobjects.directtoweb.Assignment
      extended byer.directtoweb.ERDAssignment
          extended byer.directtoweb.ERDDefaultsEmbeddedAssignment
All Implemented Interfaces:
EOKeyValueArchiving, ERDComputingAssignmentInterface, Serializable

public class ERDDefaultsEmbeddedAssignment
extends ERDAssignment

This assignment calculates default values for embedded page configurations.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueArchiving
EOKeyValueArchiving._NullValueSupport, EOKeyValueArchiving._NumberSupport, EOKeyValueArchiving._TimestampSupport, EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support
 
Field Summary
static NSArray _DEPENDENT_KEYS
          holds the array of dependent keys
 
Fields inherited from class er.directtoweb.ERDAssignment
D2WContextClassArray
 
Fields inherited from class com.webobjects.directtoweb.Assignment
KeyPathKey, ValueKey
 
Fields inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving
_CLASS
 
Constructor Summary
ERDDefaultsEmbeddedAssignment(EOKeyValueUnarchiver u)
          Public constructor
ERDDefaultsEmbeddedAssignment(String key, Object value)
          Public constructor
 
Method Summary
static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver eokeyvalueunarchiver)
          Static constructor required by the EOKeyValueUnarchiver interface.
 NSArray defaultEmbeddedDisplayPropertyKeys(D2WContext c)
          Calculates the default embedded display property keys for a given context.
 String defaultEmbeddedEditPageConfiguration(D2WContext c)
          Calculates and returns the default embedded edit page configuration to be used for embedded edit pages.
 String defaultEmbeddedEntityDisplayName(D2WContext c)
          Calculates and returns the default embedded entity display name.
 Object defaultEmbeddedEntityName(D2WContext c)
          Calculates the default embedded entity name using the current object and propertyKey.
 String defaultEmbeddedInspectPageConfiguration(D2WContext c)
          Calculates and returns the default embedded inspect page configuration to be used for embedded inspect pages.
 String defaultEmbeddedListPageConfiguration(D2WContext c)
          Calculates and returns the default embedded list page configuration to be used for embedded list pages.
 NSArray dependentKeys(String keyPath)
          Implementation of the ERDComputingAssignmentInterface.
 String keyForMethodLookup(D2WContext c)
          By default the key path being requested is used as the key to lookup the method to call on the ERDAssignment subclass.
 ERXLocalizer localizerForContext(D2WContext c)
          Gets the localizer for the current context.
 
Methods inherited from class er.directtoweb.ERDAssignment
booleanContextValueForKey, fire, localizedTemplateStringForKeyInContext, localizedValueForKeyInContext, localizedValueForKeyWithDefaultInContext, logDeprecatedMessage
 
Methods inherited from class com.webobjects.directtoweb.Assignment
encodeWithKeyValueArchiver, keyPath, toString, value, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_DEPENDENT_KEYS

public static final NSArray _DEPENDENT_KEYS
holds the array of dependent keys

Constructor Detail

ERDDefaultsEmbeddedAssignment

public ERDDefaultsEmbeddedAssignment(EOKeyValueUnarchiver u)
Public constructor

Parameters:
u - key-value unarchiver used when unarchiving from rule files.

ERDDefaultsEmbeddedAssignment

public ERDDefaultsEmbeddedAssignment(String key,
                                     Object value)
Public constructor

Parameters:
key - context key
value - of the assignment
Method Detail

decodeWithKeyValueUnarchiver

public static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver eokeyvalueunarchiver)
Static constructor required by the EOKeyValueUnarchiver interface. If this isn't implemented then the default behavior is to construct the first super class that does implement this method. Very lame.

Parameters:
eokeyvalueunarchiver - to be unarchived
Returns:
decoded assignment of this class

dependentKeys

public NSArray dependentKeys(String keyPath)
Implementation of the ERDComputingAssignmentInterface. This assignment depends upon the context keys: "propertyKey", "object.entityName", and "embeddedEntityName". This array of keys is used when constructing the significant keys for the passed in keyPath.

Parameters:
keyPath - to compute significant keys for.
Returns:
array of context keys this assignment depends upon.

localizerForContext

public ERXLocalizer localizerForContext(D2WContext c)
Gets the localizer for the current context. Implementation wise all this method does is get the current session from the context and then calls localizerForSession off of ERXLocalizer.

Overrides:
localizerForContext in class ERDAssignment
Parameters:
c - a D2W context
Returns:
localizer for the session stored in the context.

defaultEmbeddedEntityDisplayName

public String defaultEmbeddedEntityDisplayName(D2WContext c)
Calculates and returns the default embedded entity display name. The results are localized.

Parameters:
c - current context
Returns:
default localized embedded entity name.

defaultEmbeddedDisplayPropertyKeys

public NSArray defaultEmbeddedDisplayPropertyKeys(D2WContext c)
Calculates the default embedded display property keys for a given context. Implementation wise this method uses the embedded entity to determine what all of the class properties are minus all of the relationship keys.

Parameters:
c - current D2W context
Returns:
array of display keys for the current embedded entity.

defaultEmbeddedEntityName

public Object defaultEmbeddedEntityName(D2WContext c)
Calculates the default embedded entity name using the current object and propertyKey.

Parameters:
c - current context
Returns:
name of the entity pointed to by the propertyKey off of the object in the context.

defaultEmbeddedListPageConfiguration

public String defaultEmbeddedListPageConfiguration(D2WContext c)
Calculates and returns the default embedded list page configuration to be used for embedded list pages.

Parameters:
c - current context
Returns:
page configuration of the form: "ListEmbedded" + the the value of the current embeddedEntityname.

defaultEmbeddedInspectPageConfiguration

public String defaultEmbeddedInspectPageConfiguration(D2WContext c)
Calculates and returns the default embedded inspect page configuration to be used for embedded inspect pages.

Parameters:
c - current context
Returns:
page configuration of the form: "InspectEmbedded" + the the value of the current embeddedEntityname.

defaultEmbeddedEditPageConfiguration

public String defaultEmbeddedEditPageConfiguration(D2WContext c)
Calculates and returns the default embedded edit page configuration to be used for embedded edit pages.

Parameters:
c - current context
Returns:
page configuration of the form: "EditEmbedded" + the the value of the current embeddedEntityname.

keyForMethodLookup

public String keyForMethodLookup(D2WContext c)
By default the key path being requested is used as the key to lookup the method to call on the ERDAssignment subclass. However in the case of this assignment we want to use the string value of the value of the assignment as the key to lookup the method. For example if value of this assignment is "foo", then when this assignment is fired the method foo(D2WContext) will be called.

Overrides:
keyForMethodLookup in class ERDAssignment
Parameters:
c - current context
Returns:
key for method lookup, in this case the value of the assignment is returned.

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.