nl.gx.webmanager.handler.forms
Interface FormComponentConfig


public interface FormComponentConfig

This interface defines the api used by the form handler used to pass information to a form component during initialization and execution.


Method Summary
 boolean getBooleanParameterValue(java.lang.String parameterName)
          Returns the value of a config parameter parsed as a boolean.
 java.util.Calendar getCalendarParameterValue(java.lang.String parameterName, java.lang.String datepattern)
          Returns the value of a config parameter parsed as a Calendar object.
 double getDoubleParameterValue(java.lang.String parameterName)
          Returns the value of a config parameter parsed as a double.
 float getFloatParameterValue(java.lang.String parameterName)
          Returns the value of a config parameter parsed as a float.
 int getIntegerParameterValue(java.lang.String parameterName)
          Returns the value of a config parameter parsed as an int.
 java.lang.String[] getParameterNames()
          Return an array of all parameter names.
 java.lang.String getParameterValue(java.lang.String parameterName)
          Returns the value of a config parameter.
 java.lang.String getParameterValue(java.lang.String parameterName, java.lang.String defaultValue)
          Returns the value of a config parameter.
 java.lang.String[] getParameterValues(java.lang.String parameterName)
          Returns the values of a config parameter.
 java.lang.String getRequiredParameterValue(java.lang.String parameterName)
          Returns the value of a required config parameter.
 java.lang.String getText(State state, javax.servlet.http.HttpServletRequest req, java.lang.String parameterName)
          Reads a parameter from the config and post processes it, using the getTextValue() method.
 java.lang.String[] getTexts(State state, javax.servlet.http.HttpServletRequest req, java.lang.String parameterName)
          Reads the parameter values from the config and post processes them, using the getTextValue() method.
 java.lang.String getTextValue(State state, javax.servlet.http.HttpServletRequest req, java.lang.String stylesheet)
          Processes a stylesheet using the xml from the client's session as xml input.
 

Method Detail

getParameterValue

java.lang.String getParameterValue(java.lang.String parameterName)
Returns the value of a config parameter.

Parameters:
parameterName - The name of the parameter for which the value should be returned.
Returns:
The value of the first matching config parameter value, or null no parameter with the specified name could be found.

getParameterValue

java.lang.String getParameterValue(java.lang.String parameterName,
                                   java.lang.String defaultValue)
Returns the value of a config parameter.

Parameters:
parameterName - The name of the parameter for which the value should be returned.
defaultValue - The value that should be returned if no matching parameter could be found in the config.
Returns:
The value of the first matching config parameter value, or defaultValue no parameter with the specified name could be found.

getParameterValues

java.lang.String[] getParameterValues(java.lang.String parameterName)
Returns the values of a config parameter.

Parameters:
parameterName - The name of the parameter for which the values should be returned.
Returns:
The values of all matching config parameters.

getParameterNames

java.lang.String[] getParameterNames()
Return an array of all parameter names.

Returns:
an array of all parameter names.

getRequiredParameterValue

java.lang.String getRequiredParameterValue(java.lang.String parameterName)
                                           throws InitializationException
Returns the value of a required config parameter.

Parameters:
parameterName - The name of the parameter for which the value should be returned.
Returns:
The value of the first matching config parameter value.
Throws:
InitializationException - If no parameter with the specified name could be found.

getBooleanParameterValue

boolean getBooleanParameterValue(java.lang.String parameterName)
                                 throws InitializationException
Returns the value of a config parameter parsed as a boolean.

Parameters:
parameterName - The name of the parameter for which the value should be returned.
Returns:
The parsed boolean value
Throws:
InitializationException - if the value is not a boolean or if the no parameter with the specified name is found

getIntegerParameterValue

int getIntegerParameterValue(java.lang.String parameterName)
                             throws InitializationException
Returns the value of a config parameter parsed as an int.

Parameters:
parameterName - The name of the parameter for which the value should be returned.
Returns:
The parsed int value
Throws:
InitializationException - if the value is not an int or if the no parameter with the specified name is found

getDoubleParameterValue

double getDoubleParameterValue(java.lang.String parameterName)
                               throws InitializationException
Returns the value of a config parameter parsed as a double.

Parameters:
parameterName -
Returns:
The parsed double value
Throws:
InitializationException - if the value is not a double or if the no parameter with the specified name is found

getFloatParameterValue

float getFloatParameterValue(java.lang.String parameterName)
                             throws InitializationException
Returns the value of a config parameter parsed as a float.

Parameters:
parameterName -
Returns:
The parsed float value
Throws:
InitializationException - if the value is not a float or if the no parameter with the specified name is found

getCalendarParameterValue

java.util.Calendar getCalendarParameterValue(java.lang.String parameterName,
                                             java.lang.String datepattern)
                                             throws InitializationException
Returns the value of a config parameter parsed as a Calendar object.

Parameters:
parameterName -
datepattern -
Returns:
The parsed Calendar value
Throws:
InitializationException - if the value is not a valid date or if the no parameter with the specified name is found

getText

java.lang.String getText(State state,
                         javax.servlet.http.HttpServletRequest req,
                         java.lang.String parameterName)
Reads a parameter from the config and post processes it, using the getTextValue() method.

Parameters:
state - The state of the formflow, which is used for retrieving the flowvalues, session etc.
req - The HttpRequest that triggered the form processing.
parameterName - The name of the parameter from which the value should be used.
Returns:
The first processed value of the parameter, or null if no such value could be found.

getTexts

java.lang.String[] getTexts(State state,
                            javax.servlet.http.HttpServletRequest req,
                            java.lang.String parameterName)
Reads the parameter values from the config and post processes them, using the getTextValue() method.

Parameters:
state - The state of the formflow, which is used for retrieving the flowvalues, session etc.
req - The HttpRequest that triggered the form processing.
parameterName - The name of the parameter from which the values should be used.
Returns:
The processed values of the parameter or an empty array if no such values could be found in the config.

getTextValue

java.lang.String getTextValue(State state,
                              javax.servlet.http.HttpServletRequest req,
                              java.lang.String stylesheet)
Processes a stylesheet using the xml from the client's session as xml input.

Parameters:
state - The state of the formflow, which is used for retrieving the flowvalues, session etc.
req - The HttpRequest that triggered the form processing.
stylesheet - The xsl stylesheet or simple parameter that should be processed.
Returns:
If the stylesheet argument doesn't contain xsl, then the value of the argument is returned. Otherwise, an xml document is constructed which contains the session values in the session keys starting with "GX_". The userinfo and shopcart xml are added to this xml document aswell. The root element of the document is <handler>, so the path the xml stored in the GX_test session, will be /handler/test.


Copyright © 2007-2010 GX creative online development BV. All Rights Reserved.