lumis.doui.control
Class Control

Package class diagram package Control
java.lang.Object
  extended by lumis.doui.control.Control
All Implemented Interfaces:
VariableResolver, IControl
Direct Known Subclasses:
AsyncProgressControl, AutoEmbeddedInterfaceStandardButtonsControl, AutoInterfaceStandardButtonsControl, AutoPopupInterfaceStandardButtonsControl, BaseParametersControl, ControlGroupControl, DataControl, FormControl, InterfaceHeaderControl, LinkControl, PropertyPageControl, RequiredValuesDescriptorControl, ScriptControl, SelectChannelPageTreeControl, ServiceInstanceUsedByControl, StringsControl, ValidatorControl

@StableMinor(version="4.1",
             sinceVersion="4.0")
public class Control
extends Object
implements IControl, VariableResolver

Base class for all controls. Implements all the default methods for controls.

Since:
4.0.0

Field Summary
protected  ArrayList<IControl> childControls
           
protected  ControlContainer controlContainer
           
protected  Node controlDefinitionNode
           
protected  IResource controlResource
           
protected  DouiContext douiContext
           
protected  boolean hasValidatorSubControls
           
protected  boolean isValid
           
protected  Locale locale
           
static String ON_EVENT_CLOSE_WINDOW
           
static String ON_EVENT_LINK
           
static String ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE
           
static String ON_EVENT_POPUP_RUNTIME_INTERFACE
           
static String ON_EVENT_PROCESS_ACTION
           
static String ON_EVENT_RENDER_ACTION
           
static String ON_EVENT_SCRIPT
           
protected  HashMap<String,String> onEventScripts
           
static String PARAMETER_TYPE_FIRST_SELECTED
           
static String PARAMETER_TYPE_GET_VALUE
           
protected  IControl parentControl
           
protected  List<IResource> resources
           
protected  String type
           
static String VALIDATION_SELECTED_MANY
           
static String VALIDATION_SELECTED_ONE
           
 
Constructor Summary
Control()
           
 
Method Summary
protected  void appendSubControl(Node subControlNode)
           
protected  void appendSubControls(String subControlsXmlString)
           
protected  void applyOnEventScripts()
           
 void buildSubControls()
           
protected  String convertToStandardValue(String value)
           
 void createContainer(String containerId)
          Creates a container for the control.
 void disconnect()
           
protected  boolean fixedIdentifierRequired()
           
protected  String generateControlId()
           
protected  String getAdditionalParameters(Node onEventNode)
           
protected
<T extends IControl>
T
getAncestor(Class<T> ancestorClass)
          Searchs for an ancestor control assignable to the given class.
 List<IControl> getChildControls()
           
protected  String getClientEventHandlerScript(String eventName, boolean forHref)
           
 IResource getControlResource()
           
 String getId()
           
protected  Locale getLocale()
           
 IControl getParentControl()
           
 String getPrepareForReadScript()
           
 String getRenderData()
          Returns an xml string representation of the control for rendering via xsl.
 List<IResource> getResources()
           
protected  Source getRuntimeDefaultSource()
          Returns default source to use in the context of the current control when evaluating runtime attributes.
protected  String getScriptActionValidation(Node[] actionNodes, String formName, ITransaction portalTransaction)
           
 String getScriptGetValues()
           
protected  String getScriptGetValuesFunctionImplementation()
           
protected  String getScriptGetValuesFunctionName()
           
 String getScriptGetValuesRegistration()
           
 ISourceContext getSourceContext()
           
protected  Map<String,String> getStringsToLocalize()
           
 String getType()
           
protected  String getValidationScript(Node onEventNode)
           
 void init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl)
           
 boolean isValid()
           
protected  String localize(String text)
           
protected  void localizeStrings()
           
protected  String processCustomTags(String scriptNodeText)
           
 void registerOnEventScript(String onEvent, String script)
           
 void removeChild(IControl childControl)
           
 void removeChildren()
           
 Object resolveVariable(String name)
           
 void setRenderData()
           
 void setRuntimeAttributes()
          Replaces runtime attributes in this control's definition node with their evaluated values.
 void setValid(boolean isValid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON_EVENT_POPUP_RUNTIME_INTERFACE

public static final String ON_EVENT_POPUP_RUNTIME_INTERFACE
See Also:
Constant Field Values

ON_EVENT_PROCESS_ACTION

public static final String ON_EVENT_PROCESS_ACTION
See Also:
Constant Field Values

ON_EVENT_RENDER_ACTION

public static final String ON_EVENT_RENDER_ACTION
See Also:
Constant Field Values

ON_EVENT_CLOSE_WINDOW

public static final String ON_EVENT_CLOSE_WINDOW
See Also:
Constant Field Values

ON_EVENT_LINK

public static final String ON_EVENT_LINK
See Also:
Constant Field Values

ON_EVENT_SCRIPT

public static final String ON_EVENT_SCRIPT
See Also:
Constant Field Values

ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE

public static final String ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE
See Also:
Constant Field Values

VALIDATION_SELECTED_ONE

public static final String VALIDATION_SELECTED_ONE
See Also:
Constant Field Values

VALIDATION_SELECTED_MANY

public static final String VALIDATION_SELECTED_MANY
See Also:
Constant Field Values

PARAMETER_TYPE_FIRST_SELECTED

public static final String PARAMETER_TYPE_FIRST_SELECTED
See Also:
Constant Field Values

PARAMETER_TYPE_GET_VALUE

public static final String PARAMETER_TYPE_GET_VALUE
See Also:
Constant Field Values

douiContext

protected DouiContext douiContext

controlDefinitionNode

protected Node controlDefinitionNode

controlContainer

protected ControlContainer controlContainer

parentControl

protected IControl parentControl

childControls

protected ArrayList<IControl> childControls

resources

protected List<IResource> resources

controlResource

protected IResource controlResource

locale

protected Locale locale

onEventScripts

protected HashMap<String,String> onEventScripts

isValid

protected boolean isValid

hasValidatorSubControls

protected boolean hasValidatorSubControls

type

protected String type
Constructor Detail

Control

public Control()
Method Detail

init

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

fixedIdentifierRequired

protected boolean fixedIdentifierRequired()

generateControlId

protected String generateControlId()

buildSubControls

public void buildSubControls()
                      throws PortalException
Specified by:
buildSubControls in interface IControl
Throws:
PortalException

appendSubControls

protected void appendSubControls(String subControlsXmlString)
                          throws PortalException
Throws:
PortalException

appendSubControl

protected void appendSubControl(Node subControlNode)
                         throws PortalException
Throws:
PortalException

disconnect

public void disconnect()
                throws PortalException
Specified by:
disconnect in interface IControl
Throws:
PortalException

removeChild

public void removeChild(IControl childControl)
                 throws PortalException
Specified by:
removeChild in interface IControl
Throws:
PortalException

removeChildren

public void removeChildren()
                    throws PortalException
Specified by:
removeChildren in interface IControl
Throws:
PortalException

getChildControls

public List<IControl> getChildControls()
                                throws PortalException
Specified by:
getChildControls in interface IControl
Throws:
PortalException

getRuntimeDefaultSource

protected Source getRuntimeDefaultSource()
Returns default source to use in the context of the current control when evaluating runtime attributes.

Returns:
the default source, or null if there is no source.
Since:
4.0.3

resolveVariable

public Object resolveVariable(String name)
                       throws ELException
Specified by:
resolveVariable in interface VariableResolver
Throws:
ELException

setRuntimeAttributes

public void setRuntimeAttributes()
Description copied from interface: IControl
Replaces runtime attributes in this control's definition node with their evaluated values. A runtime attribute follows the EL syntax.

This method is executed before IControl.setRenderData() by the ControlContainer.

Specified by:
setRuntimeAttributes in interface IControl
See Also:
ControlContainer

setRenderData

public void setRenderData()
                   throws PortalException
Specified by:
setRenderData in interface IControl
Throws:
PortalException

getId

public String getId()
Specified by:
getId in interface IControl
Returns:
Returns the id.

getType

public String getType()
Specified by:
getType in interface IControl
Returns:
Returns the control type.

getParentControl

public IControl getParentControl()
Specified by:
getParentControl in interface IControl
Returns:
Returns the parentControl.

getClientEventHandlerScript

protected String getClientEventHandlerScript(String eventName,
                                             boolean forHref)
                                      throws ControlException,
                                             PortalException
Throws:
ControlException
PortalException

getScriptActionValidation

protected String getScriptActionValidation(Node[] actionNodes,
                                           String formName,
                                           ITransaction portalTransaction)
                                    throws PortalException
Throws:
PortalException

getValidationScript

protected String getValidationScript(Node onEventNode)
                              throws PortalException
Throws:
PortalException

getResources

public List<IResource> getResources()
                             throws PortalException
Specified by:
getResources in interface IControl
Throws:
PortalException

getAdditionalParameters

protected String getAdditionalParameters(Node onEventNode)
                                  throws PortalException
Throws:
PortalException

convertToStandardValue

protected String convertToStandardValue(String value)
                                 throws PortalException
Throws:
PortalException

getControlResource

public IResource getControlResource()
                             throws PortalException
Specified by:
getControlResource in interface IControl
Throws:
PortalException

registerOnEventScript

public void registerOnEventScript(String onEvent,
                                  String script)
                           throws PortalException
Specified by:
registerOnEventScript in interface IControl
Throws:
PortalException

applyOnEventScripts

protected void applyOnEventScripts()
                            throws PortalException
Throws:
PortalException

isValid

public boolean isValid()
                throws PortalException
Specified by:
isValid in interface IControl
Returns:
Returns the isValid.
Throws:
PortalException

setValid

public void setValid(boolean isValid)
              throws PortalException
Specified by:
setValid in interface IControl
Parameters:
isValid - The isValid to set.
Throws:
PortalException

getLocale

protected Locale getLocale()
Returns:
Returns the locale.

getScriptGetValuesRegistration

public final String getScriptGetValuesRegistration()
                                            throws PortalException
Throws:
PortalException

getScriptGetValues

public final String getScriptGetValues()
                                throws ControlException,
                                       PortalException
Throws:
ControlException
PortalException

getScriptGetValuesFunctionName

protected final String getScriptGetValuesFunctionName()
                                               throws ControlException,
                                                      PortalException
Throws:
ControlException
PortalException

getScriptGetValuesFunctionImplementation

protected String getScriptGetValuesFunctionImplementation()
                                                   throws ControlException,
                                                          PortalException
Throws:
ControlException
PortalException

localize

protected String localize(String text)
                   throws PortalException
Throws:
PortalException

localizeStrings

protected void localizeStrings()
                        throws PortalException
Throws:
PortalException

getStringsToLocalize

protected Map<String,String> getStringsToLocalize()

getAncestor

protected <T extends IControl> T getAncestor(Class<T> ancestorClass)
Searchs for an ancestor control assignable to the given class. The nearest ancestor is returned.

Type Parameters:
T - the ancestor class for compile-time type casting checking.
Parameters:
ancestorClass - the class or interface the ancestor control must be assignable to.
Returns:
the ancestor control or null if it was not found.

getSourceContext

public ISourceContext getSourceContext()

processCustomTags

protected String processCustomTags(String scriptNodeText)
                            throws PortalException
Throws:
PortalException

getPrepareForReadScript

public String getPrepareForReadScript()
                               throws PortalException
Specified by:
getPrepareForReadScript in interface IControl
Throws:
PortalException

createContainer

public void createContainer(String containerId)
                     throws PortalException
Description copied from interface: IControl
Creates a container for the control.

This method us used by the framework when a control needs to be updated client side.

Specified by:
createContainer in interface IControl
Throws:
PortalException

getRenderData

public String getRenderData()
                     throws PortalException
Description copied from interface: IControl
Returns an xml string representation of the control for rendering via xsl.

Specified by:
getRenderData in interface IControl
Returns:
Throws:
PortalException


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