lumis.doui.control
Class DataControl

Package class diagram package DataControl
java.lang.Object
  extended by lumis.doui.control.Control
      extended by lumis.doui.control.DataControl
All Implemented Interfaces:
VariableResolver, IControl, IDataControl, IRenderer
Direct Known Subclasses:
AutoRefreshControl, CalendarControl, DataBoundControl, ErrorSummaryControl, TabbedControl

@StableMinor(version="4.1",
             sinceVersion="4.0")
public abstract class DataControl
extends Control
implements IDataControl, IRenderer

Base implementation for IDataControl

Since:
4.0.0

Field Summary
static String FORCE_CASE_LOWER
           
static String FORCE_CASE_NONE
           
static String FORCE_CASE_UPPER
           
protected  String forceCase
           
protected  String requestParameterName
           
protected  IDouiDataType UNKNOWN_DATA_TYPE
          The instance used for dataType for controls for which the data type is not known.
protected  Object value
           
protected  boolean valuePreviouslySet
           
 
Fields inherited from class lumis.doui.control.Control
childControls, controlContainer, controlDefinitionNode, controlResource, douiContext, hasValidatorSubControls, isValid, locale, ON_EVENT_CLOSE_WINDOW, ON_EVENT_LINK, ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE, ON_EVENT_POPUP_RUNTIME_INTERFACE, ON_EVENT_PROCESS_ACTION, ON_EVENT_RENDER_ACTION, ON_EVENT_SCRIPT, onEventScripts, PARAMETER_TYPE_FIRST_SELECTED, PARAMETER_TYPE_GET_VALUE, parentControl, resources, type, VALIDATION_SELECTED_MANY, VALIDATION_SELECTED_ONE
 
Constructor Summary
DataControl()
           
 
Method Summary
protected  Object convertValueToControlValue(Object value, Locale locale, String pattern)
          Method to centralize the implementation of conversion of a value to this control's value.
protected  IConverter createConverter()
          Creates the converter instance for this control.
protected  IDouiDataType createDataType()
          Creates the data type to be used for this control.
 IConverter getConverter()
          Returns the converter that is able to convert this control's value.
protected  IDouiDataType getDataType()
          Returns the data type for this control.
protected  Object getDefaultValue()
           
protected  String getProcessActionHandlerParameterName()
          Define the name of the process action parameter to be set.
protected  String getRequestParameterName()
           
 Object getValue()
           
<T> T
getValue(Class<T> expectedClass)
           
protected  Class<?> getValueClass()
          Returns the class the possible values of this control are assignable to.
 void init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl)
           
protected  boolean isTrim()
          Returns if the value for this control should be trimmed.
 void loadFromRequest()
           
protected  void loadSubControlFromRequest(IControl control)
           
protected  void loadSubControlsFromRequest()
           
protected  void setDefaultValue()
           
protected  void setProcessActionHandlerParameter(IProcessActionHandler processActionHandler, String parameterName)
          Set the process action parameter for the control, defining the appropriate value.
 void setProcessActionHandlerParameters(IProcessActionHandler processActionHandler)
          Sets the control value as a process action handler parameter.
protected  void setRawValue(Object value)
          Sets directly the value in this control.
protected  void setTrim(boolean trim)
          Sets if the value for this control should be trimmed.
 void setValue(Object value)
          Sets the value for this control.
 boolean valueIsArray()
          Returns true if the value in the control is expected to be an array.
 
Methods inherited from class lumis.doui.control.Control
appendSubControl, appendSubControls, applyOnEventScripts, buildSubControls, convertToStandardValue, createContainer, disconnect, fixedIdentifierRequired, generateControlId, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getControlResource, getId, getLocale, getParentControl, getPrepareForReadScript, getRenderData, getResources, getRuntimeDefaultSource, getScriptActionValidation, getScriptGetValues, getScriptGetValuesFunctionImplementation, getScriptGetValuesFunctionName, getScriptGetValuesRegistration, getSourceContext, getStringsToLocalize, getType, getValidationScript, isValid, localize, localizeStrings, processCustomTags, registerOnEventScript, removeChild, removeChildren, resolveVariable, setRenderData, setRuntimeAttributes, setValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lumis.doui.control.IControl
buildSubControls, createContainer, disconnect, getChildControls, getControlResource, getId, getParentControl, getPrepareForReadScript, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRenderData, setRuntimeAttributes, setValid
 
Methods inherited from interface lumis.doui.render.IRenderer
getResources, getSourceContext
 

Field Detail

FORCE_CASE_NONE

public static final String FORCE_CASE_NONE
See Also:
Constant Field Values

FORCE_CASE_UPPER

public static final String FORCE_CASE_UPPER
See Also:
Constant Field Values

FORCE_CASE_LOWER

public static final String FORCE_CASE_LOWER
See Also:
Constant Field Values

UNKNOWN_DATA_TYPE

protected final IDouiDataType UNKNOWN_DATA_TYPE
The instance used for dataType for controls for which the data type is not known.

Since:
4.0.10
See Also:
createDataType(), getDataType()

forceCase

protected String forceCase

value

protected Object value

valuePreviouslySet

protected boolean valuePreviouslySet

requestParameterName

protected String requestParameterName
Constructor Detail

DataControl

public DataControl()
Method Detail

init

public void init(Node controlDefinitionNode,
                 ControlContainer controlContainer,
                 IControl parentControl)
          throws PortalException
Specified by:
init in interface IControl
Overrides:
init in class Control
Throws:
PortalException

createDataType

protected IDouiDataType createDataType()
                                throws PortalException
Creates the data type to be used for this control.

Returns:
the data type to be used for this control, or null if this control does not knows which data type to use.
Throws:
PortalException
Since:
4.0.10

getDataType

protected final IDouiDataType getDataType()
Returns the data type for this control. If the data type for this control is not known, UNKNOWN_DATA_TYPE is returned.

Returns:
the data type for this control.
Since:
4.0.10
See Also:
createDataType()

createConverter

protected IConverter createConverter()
                              throws PortalException
Creates the converter instance for this control.

Returns:
the converter instance or null if this control has no converter.
Throws:
PortalException
Since:
4.0.10

setDefaultValue

protected void setDefaultValue()
                        throws PortalException
Throws:
PortalException

getDefaultValue

protected Object getDefaultValue()
                          throws PortalException
Throws:
PortalException

getValueClass

protected Class<?> getValueClass()
                          throws PortalException
Returns the class the possible values of this control are assignable to.

This default implementation uses IDouiDataType.getValueClass() of the data type of this control.

Returns:
the class the possible values of this control are assignable to.
Throws:
PortalException
Since:
4.0.4

convertValueToControlValue

protected Object convertValueToControlValue(Object value,
                                            Locale locale,
                                            String pattern)
                                     throws PortalException,
                                            ConversionException
Method to centralize the implementation of conversion of a value to this control's value.

Uses this control's converter to convert the value to this control's value class.

Parameters:
value - the value.
locale - the locale to use in the conversion.
pattern - the pattern to use in the conversion.
Returns:
the value converted to this control's value class.
Throws:
ConversionException - if an exception is thrown by this control's converter.
PortalException
Since:
4.0.10

isTrim

protected boolean isTrim()
Returns if the value for this control should be trimmed. The trimming should occur in the setValue(Object) method.

Returns:
if the value for this control should be trimmed.
Since:
4.0.11

setTrim

protected void setTrim(boolean trim)
Sets if the value for this control should be trimmed.

Parameters:
trim - true to enable the trimming or false to disable it. This does not affect the value already set in the control.
Since:
4.0.11
See Also:
isTrim()

setValue

public void setValue(Object value)
              throws PortalException
Sets the value for this control. The value is converted to this control's value class using convertValueToControlValue(Object, Locale, String). Then the value is set using setRawValue(Object).

Specified by:
setValue in interface IDataControl
Parameters:
value - the value to set. It is automatically converted as necessary.
Throws:
PortalException

setRawValue

protected void setRawValue(Object value)
                    throws PortalException
Sets directly the value in this control.

Parameters:
value - the value to set.
Throws:
PortalException
Since:
4.0.4

getValue

public Object getValue()
                throws PortalException
Specified by:
getValue in interface IDataControl
Throws:
PortalException

getValue

public <T> T getValue(Class<T> expectedClass)
           throws PortalException
Specified by:
getValue in interface IDataControl
Throws:
PortalException

getRequestParameterName

protected String getRequestParameterName()
                                  throws PortalException
Returns:
Returns the dataId.
Throws:
PortalException

loadFromRequest

public void loadFromRequest()
                     throws PortalException
Specified by:
loadFromRequest in interface IDataControl
Throws:
PortalException

valueIsArray

public boolean valueIsArray()
                     throws PortalException
Returns true if the value in the control is expected to be an array.

Returns:
Throws:
PortalException

loadSubControlsFromRequest

protected void loadSubControlsFromRequest()
                                   throws PortalException
Throws:
PortalException

loadSubControlFromRequest

protected void loadSubControlFromRequest(IControl control)
                                  throws PortalException
Throws:
PortalException

setProcessActionHandlerParameters

public void setProcessActionHandlerParameters(IProcessActionHandler processActionHandler)
                                       throws PortalException
Sets the control value as a process action handler parameter.

Specified by:
setProcessActionHandlerParameters in interface IDataControl
Parameters:
processActionHandler -
Throws:
PortalException

setProcessActionHandlerParameter

protected void setProcessActionHandlerParameter(IProcessActionHandler processActionHandler,
                                                String parameterName)
                                         throws PortalException
Set the process action parameter for the control, defining the appropriate value. The default value is the control value.

Parameters:
processActionHandler -
parameterName -
Throws:
PortalException

getProcessActionHandlerParameterName

protected String getProcessActionHandlerParameterName()
                                               throws PortalException
Define the name of the process action parameter to be set. This name is defined by the processActionParameterName attribute of the control definition. If undefined, the default name will be the control id.

Returns:
the name of the process action parameter set by the control.
Throws:
PortalException

getConverter

public IConverter getConverter()
                        throws PortalException
Description copied from interface: IDataControl
Returns the converter that is able to convert this control's value.

Specified by:
getConverter in interface IDataControl
Specified by:
getConverter in interface IRenderer
Returns:
the converter or null if this control has no converter.
Throws:
PortalException


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.