wt.vc.config
Class SetConfigSpecDelegate

java.lang.Object
  extended bywt.vc.config.SetConfigSpecDelegate
All Implemented Interfaces:
FormActionDelegate

public class SetConfigSpecDelegate
extends Object
implements FormActionDelegate

Form action delegate which handles creating a Configuration Specification from given Form data. This delegate is the action associated with the form created and specified by the ConfigSpecProcessor form processor.

See Also:
FormActionDelegate, ConfigSpec

Nested Class Summary
 class SetConfigSpecDelegate.ConfigSpecHolder
          Helper class for taking in the information passed in the form and converting it into a configuration specification.
 
Field Summary
private  Object actionObject
          The Action object which is the context object for this delegate.
static String ENCODED_CONFIG_SPEC_KEY
          The key whose value specifies the configuration specification encoded in a base-64 encoding.
private static String RESOURCE
          Resource bundle class to be used for messages in this class
static String RETURN_ACTION
          Specifies the default action to be set after invoking 'processAction' on this delegate.
static String RETURN_ACTION_KEY
          The key whose value specifies the action which should occur as a result of invoking 'processAction' on this delegate.
static String RETURN_OID_KEY
          The key whose value specifies the oid of the object which should be set as the context object as a result of invoking 'processAction' on this delegate.
static String RETURN_TEMPLATE
          Specifies the default template which should be displayed as a result of invoking 'processAction' on this delegate.
static String RETURN_TEMPLATE_KEY
          The key whose value specifies the template which should be displayed as a result of invoking 'processAction' on this delegate.
static String RETURN_TEMPLATE_PROCESSOR
          Specifies the default template which should be displayed as a result of invoking 'processAction' on this delegate.
static String RETURN_TEMPLATE_PROCESSOR_KEY
          The key whose value specifies the template which should be displayed as a result of invoking 'processAction' on this delegate.
private static boolean VERBOSE
          Flag for providing additional debugging information.
 
Fields inherited from interface wt.enterprise.FormActionDelegate
ACTION_OBJECT
 
Constructor Summary
SetConfigSpecDelegate()
           
 
Method Summary
 SetConfigSpecDelegate.ConfigSpecHolder createConfigSpecHolder(Properties props)
          Creates a ConfigSpecHolder from the given Properties hashtable.
 Object getActionObject()
          Return the object which is the context for this Action Delegate.
static String getClassDisplayName(Class class_obj)
          Returns the display name for the given class.
 WTPartConfigSpec getConfigSpec()
           
static String getEncodedConfigSpec(ConfigSpec config_spec)
          Returns the given ConfigSpec encoded in a String using base-64 encoding.
protected static Object getObjectBySearch(Class search_class, String attr_name, String attr_value)
          Attempts to retrieve an EffContext based on the given String name.
 Properties processAction(Properties props, ContentHTTPStream contentStream, Locale locale)
          Process the given form data and create the resulting configuration specification.
 void setActionObject(Object action_object)
          Sets the object which is the context for this Action Delegate.
 void setConfigSpec(ConfigSpec config_spec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
Resource bundle class to be used for messages in this class

See Also:
Constant Field Values

VERBOSE

private static boolean VERBOSE
Flag for providing additional debugging information. The value of this flag is taken from the wt.enterprise.verbose property in wt.properties.


actionObject

private Object actionObject
The Action object which is the context object for this delegate. The action object for this delegate should be a ConfigSpec object.


RETURN_TEMPLATE

public static final String RETURN_TEMPLATE
Specifies the default template which should be displayed as a result of invoking 'processAction' on this delegate.

See Also:
Constant Field Values

RETURN_TEMPLATE_PROCESSOR

public static final String RETURN_TEMPLATE_PROCESSOR
Specifies the default template which should be displayed as a result of invoking 'processAction' on this delegate.

See Also:
Constant Field Values

RETURN_ACTION

public static final String RETURN_ACTION
Specifies the default action to be set after invoking 'processAction' on this delegate. The action is used by URLProcessor to determine what page to display.

See Also:
Constant Field Values

RETURN_TEMPLATE_KEY

public static final String RETURN_TEMPLATE_KEY
The key whose value specifies the template which should be displayed as a result of invoking 'processAction' on this delegate. This key is used to get the template value from a Properties object.

See Also:
Constant Field Values

RETURN_TEMPLATE_PROCESSOR_KEY

public static final String RETURN_TEMPLATE_PROCESSOR_KEY
The key whose value specifies the template which should be displayed as a result of invoking 'processAction' on this delegate. This key is used to get the template value from a Properties object.

See Also:
Constant Field Values

RETURN_ACTION_KEY

public static final String RETURN_ACTION_KEY
The key whose value specifies the action which should occur as a result of invoking 'processAction' on this delegate. This key is used to get the action value from a Properties object.

See Also:
Constant Field Values

RETURN_OID_KEY

public static final String RETURN_OID_KEY
The key whose value specifies the oid of the object which should be set as the context object as a result of invoking 'processAction' on this delegate. This key is used to get the oid value from a Properties object.

See Also:
Constant Field Values

ENCODED_CONFIG_SPEC_KEY

public static final String ENCODED_CONFIG_SPEC_KEY
The key whose value specifies the configuration specification encoded in a base-64 encoding. The config spec is communicated by being encoded directly in a form field. This key is used to get that form value from a Properties object.

See Also:
Constant Field Values
Constructor Detail

SetConfigSpecDelegate

public SetConfigSpecDelegate()
Method Detail

getActionObject

public Object getActionObject()
Return the object which is the context for this Action Delegate. The returned object should be of type ConfigSpec.

Specified by:
getActionObject in interface FormActionDelegate
Returns:
the object which is the context for this delegate.

setActionObject

public void setActionObject(Object action_object)
                     throws WTPropertyVetoException
Sets the object which is the context for this Action Delegate. The given object should be of type ConfigSpec.

Specified by:
setActionObject in interface FormActionDelegate
Parameters:
action_object - the object which is the context for this delegate
Throws:
WTPropertyVetoException

processAction

public Properties processAction(Properties props,
                                ContentHTTPStream contentStream,
                                Locale locale)
                         throws Exception
Process the given form data and create the resulting configuration specification. The given properties object contains the values used to set a configuration specification. In addition to the config spec values, this method attempts to retrieve the following values from the given properties object: return template - the template to be processed after this method completes return action - the action to be set after this method completes return oid - the oid of the object which will be the context object after this method completes.

Specified by:
processAction in interface FormActionDelegate
Parameters:
props - the Properties which was built from the form data
contentStream - this parameter is ignored
locale - the locale of the client
Returns:
Properties
Throws:
Exception
See Also:
FormProcessor, wt.content.ContentHttpStream

getConfigSpec

public WTPartConfigSpec getConfigSpec()

setConfigSpec

public void setConfigSpec(ConfigSpec config_spec)
                   throws WTPropertyVetoException
Throws:
WTPropertyVetoException

createConfigSpecHolder

public SetConfigSpecDelegate.ConfigSpecHolder createConfigSpecHolder(Properties props)
Creates a ConfigSpecHolder from the given Properties hashtable. The given Properties contains the values passed in the form.

Parameters:
props - the Properties passed in from the form
Returns:
a ConfigSpecHolder containing the data extracted from the given Properties

getEncodedConfigSpec

public static String getEncodedConfigSpec(ConfigSpec config_spec)
                                   throws IOException
Returns the given ConfigSpec encoded in a String using base-64 encoding.

Parameters:
config_spec - the config spec to be encoded
Returns:
a String encoding of the config spec using base-64 encoding
Throws:
IOException

getObjectBySearch

protected static Object getObjectBySearch(Class search_class,
                                          String attr_name,
                                          String attr_value)
                                   throws WTException
Attempts to retrieve an EffContext based on the given String name. This method will query using the given name for an EffContext.

Returns:
the EffContext corresponding to the given name.
Throws:
WTException

getClassDisplayName

public static String getClassDisplayName(Class class_obj)
Returns the display name for the given class. This method attempts to use WTIntrospection to retrieve the display name from the ClassInfo for the given class.

Parameters:
class_obj - the Class whose display name is returned.
Returns:
the String display name of the class.