WebObjects 5.4.2

com.webobjects.directtoweb
Class D2WSwitchComponent

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by com.webobjects.directtoweb.D2WSwitchComponent
All Implemented Interfaces:
WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, Cloneable

public class D2WSwitchComponent
extends WOComponent

The D2WSwitchComponent class gives a reusable Direct to Web component the option to choose which D2WComponent to use in a given context.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
WOComponent.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
protected static Vector possibleBindings
          The set of possible bindings.
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
KeyPathSeparator
 
Constructor Summary
D2WSwitchComponent(WOContext aContext)
          Creates an instance of D2WSwitchComponent with the specified context.
 
Method Summary
static void addToPossibleBindings(String newBinding)
          Adds the specified binding to the set of possible bindings.
 void awake()
          Throws an exception if any of the required bindings are missing.
 String componentName()
          Gets the name of the component.
 String entityName()
          Gets the name of the entity.
 NSDictionary extraBindings()
          Gets the extra bindings.
 String lookFromSettings()
          Gets the name of the look from the settings.
 void setExtraBindings(Object newValue)
          Sets the extra bindings to the specified value.
 void setSubContext(Object newValue)
          Sets the sub-context.
 NSDictionary settings()
          Gets the settings with the display properties.
 void sleep()
          Clears the local settings.
 D2WContext subContext()
          Gets the sub-context.
 boolean synchronizesVariablesWithBindings()
          Indicates that the component does not synchronize variables with bindings.
 String task()
          Gets the name of the task.
 
Methods inherited from class com.webobjects.appserver.WOComponent
appendToResponse, application, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, invokeAction, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, reset, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, setVariableValueForName, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, template, templateWithHTMLString, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding, variableValueForName, variableWithName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

possibleBindings

protected static Vector possibleBindings
The set of possible bindings.

In the current implementation, the bindings include: nextPageDelegate, dataSource, queryDataSource, nextPage, object, masterObjectAndRelationshipKey, selectedObject, fetchSpecificationName, action, and menu.

The implementation is subject to change in future releases.

Constructor Detail

D2WSwitchComponent

public D2WSwitchComponent(WOContext aContext)
Creates an instance of D2WSwitchComponent with the specified context.

Parameters:
aContext - instance of WOContext
See Also:
WOComponent.WOComponent(WOContext)
Method Detail

awake

public void awake()
Throws an exception if any of the required bindings are missing.

The current implementation requires the following bindings: _dynamicPage, _task, _entityName.

The implementation is subject to change in future releases.

Overrides:
awake in class WOComponent
Throws:
IllegalArgumentException - if required bindings are missing
See Also:
D2WSwitchComponent.subContext(), D2WSwitchComponent.task(), D2WSwitchComponent.entityName(), WOComponent.awake()

synchronizesVariablesWithBindings

public boolean synchronizesVariablesWithBindings()
Indicates that the component does not synchronize variables with bindings.

Overrides:
synchronizesVariablesWithBindings in class WOComponent
Returns:
false
See Also:
WOComponent.synchronizesVariablesWithBindings()

task

public String task()
Gets the name of the task.

The current implementation uses the binding _task.

The implementation is subject to change in future releases.

Returns:
task name

entityName

public String entityName()
Gets the name of the entity.

The current implementation uses the binding _entityName.

The implementation is subject to change in future releases.

Returns:
entity name

settings

public NSDictionary settings()
Gets the settings with the display properties.

The current implementation uses the bindings _settings and displayKeys. Parses a property list if the value for settings is a String.

The implementation is subject to change in future releases.

Returns:
instance of NSDictionary

lookFromSettings

public String lookFromSettings()
Gets the name of the look from the settings.

Returns:
look name
See Also:
D2WSwitchComponent.settings()

subContext

public D2WContext subContext()
Gets the sub-context.

The current implementation uses the binding _dynamicPage. Takes value from the settings and the look from settings.

The implementation is subject to change in future releases.

Returns:
instance of D2WContext
See Also:
D2WSwitchComponent.lookFromSettings(), D2WSwitchComponent.settings(), D2WContext.takeValueForInferrableKey(Object, String)

setSubContext

public void setSubContext(Object newValue)
Sets the sub-context.

The current implementation does nothing.

The implementation is subject to change in future releases.

Parameters:
newValue - instance of Object - ignored

componentName

public String componentName()
Gets the name of the component.

Throws an exception if no rule can be found to decide which page to embed in the parent to display in the sub-context.

Returns:
component name
Throws:
D2WModelException - if name cannot be determined
See Also:
D2WSwitchComponent.subContext(), D2WContext.pageName(), D2WContext.rawSystemPageName(), WOComponent.parent()

addToPossibleBindings

public static void addToPossibleBindings(String newBinding)
Adds the specified binding to the set of possible bindings.

Parameters:
newBinding - instance of String
See Also:
D2WSwitchComponent.possibleBindings

extraBindings

public NSDictionary extraBindings()
Gets the extra bindings.

The current implementation removes all objects and copies the values for the possible bindings.

The implementation is subject to change in future releases.

Returns:
instance of NSDictionary
See Also:
D2WSwitchComponent.possibleBindings, D2WSwitchComponent.setExtraBindings(Object), WOComponent.valueForBinding(String)

setExtraBindings

public void setExtraBindings(Object newValue)
Sets the extra bindings to the specified value.

The current implementation expects the new value to be an instance of NSMutableDictionary and sets the values for the bindings.

The implementation is subject to change in future releases.

Parameters:
newValue - instance of NSMutableDictionary - expected
See Also:
D2WSwitchComponent.possibleBindings, D2WSwitchComponent.extraBindings(), WOComponent.setValueForBinding(Object, String)

sleep

public void sleep()
Clears the local settings.

Overrides:
sleep in class WOComponent
See Also:
D2WSwitchComponent.settings(), WOComponent.sleep()

Last updated June 2008

Copyright © 2000-2008 Apple Inc.