Package lumis.doui.control
Class Control
- java.lang.Object
-
- lumis.doui.control.Control
-
- All Implemented Interfaces:
javax.servlet.jsp.el.VariableResolver
,IControl
- Direct Known Subclasses:
ActivityStreamConfigurationInfoControl
,AdminMemberConditionalRenderControl
,AsyncProgressControl
,AutoEmbeddedInterfaceStandardButtonsControl
,AutoInterfaceStandardButtonsControl
,AutoPopupInterfaceStandardButtonsControl
,CommentsAddControl
,ConditionalRenderControl
,ConsumerConfigurationInterfaceVerificationControl
,ControlGroupControl
,DataControl
,FCKEditorPopUpFixerControl
,FormControl
,IncludeControl
,InterfaceHeaderButtonsControl
,InterfaceHeaderControl
,InterfaceInstancePreviewControl
,LinkControl
,ManageConditionalRenderControl
,PageGeneratorConditionalRenderControl
,PositionFieldInterfaceHeaderControl
,PreviewCssControl
,PropertyPageControl
,RemotePortletConfigurationInterfaceControl
,RequiredValuesDescriptorControl
,ScriptControl
,SelectChannelPageTreeControl
,SelectChannelPageTreeControl
,SelectImagesControl
,ServiceInstanceUsedByControl
,SourceBoundControl
,StringsControl
,TopicViewCounterControl
,ValidatorControl
,WebsiteChangeCheckControl
@StableMinor(version="17.0", sinceVersion="4.0") public class Control extends java.lang.Object implements IControl, javax.servlet.jsp.el.VariableResolver
Base class for all controls. Implements all the default methods for controls.- Since:
- 4.0.0
- Version:
- $Revision$ $Date$
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<IControl>
childControls
protected ControlContainer
controlContainer
protected org.w3c.dom.Node
controlDefinitionNode
protected IResource
controlResource
protected DouiContext
douiContext
protected boolean
hasValidatorSubControls
protected boolean
isValid
protected java.util.Locale
locale
static java.lang.String
ON_EVENT_CLOSE_WINDOW
static java.lang.String
ON_EVENT_LINK
static java.lang.String
ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE
static java.lang.String
ON_EVENT_POPUP_RUNTIME_INTERFACE
static java.lang.String
ON_EVENT_PROCESS_ACTION
static java.lang.String
ON_EVENT_RENDER_ACTION
static java.lang.String
ON_EVENT_REPLACE_INTERFACE
static java.lang.String
ON_EVENT_SCRIPT
static java.lang.String
ON_EVENT_VALIDATE
protected java.util.HashMap<java.lang.String,java.lang.String>
onEventScripts
static java.lang.String
PARAMETER_TYPE_FIRST_SELECTED
static java.lang.String
PARAMETER_TYPE_GET_VALUE
protected IControl
parentControl
protected java.util.List<IResource>
resources
protected java.lang.String
type
static java.lang.String
VALIDATION_SELECTED_MANY
static java.lang.String
VALIDATION_SELECTED_ONE
-
Constructor Summary
Constructors Constructor Description Control()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
appendSubControl(org.w3c.dom.Node subControlNode)
protected void
appendSubControls(java.lang.String subControlsXmlString)
protected void
applyOnEventScripts()
void
buildSubControls()
protected java.lang.String
convertToStandardValue(java.lang.String value)
Deprecated.Since 8.0.0.void
createContainer(java.lang.String containerId)
Creates a container for the control.void
disconnect()
protected boolean
fixedIdentifierRequired()
protected java.lang.String
generateControlId()
protected java.lang.String
generateControlIdPrefix()
protected java.lang.String
getAdditionalParameters(org.w3c.dom.Node onEventNode)
protected java.lang.String
getAdditionalParameters(org.w3c.dom.Node onEventNode, boolean otherParametersExist)
protected <T extends IControl>
TgetAncestor(java.lang.Class<T> ancestorClass)
Searchs for an ancestor control assignable to the given class.java.util.List<IControl>
getChildControls()
protected java.lang.String
getClientEventHandlerScript(java.lang.String eventName, boolean forHref)
IResource
getControlResource()
java.lang.String
getId()
protected java.util.Locale
getLocale()
java.lang.String
getName()
Returns the name for this control.java.lang.String
getNamespace()
Returns the namespace for this control.IControl
getParentControl()
java.lang.String
getPrepareForReadScript()
java.lang.String
getRenderData()
Returns an xml string representation of the control for rendering via xsl.java.util.List<IResource>
getResources()
protected Source
getRuntimeDefaultSource()
Returns default source to use in the context of the current control when evaluating runtime attributes.protected java.lang.String
getScriptActionValidation(org.w3c.dom.Node[] actionNodes, java.lang.String formName, ITransaction portalTransaction)
ISourceContext
getSourceContext()
protected java.util.Map<java.lang.String,java.lang.String>
getStringsToLocalize()
java.lang.String
getType()
protected java.lang.String
getValidationScript(org.w3c.dom.Node onEventNode)
protected java.lang.String
getWindowProperties(java.lang.String interfaceId)
Returns the window properties used when a "popupRunTimeInterface" is used as an event handler.protected java.lang.String
getWindowProperties(java.lang.String interfaceId, java.lang.String popupSize)
void
init(org.w3c.dom.Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl)
protected boolean
isRequired()
Returns whether this control is required.
The default implementation checks whether there is aRequiredValueValidatorControl
bound to this control.boolean
isValid()
protected java.lang.String
localize(java.lang.String text)
protected void
localizeStrings()
protected java.lang.String
processCustomTags(java.lang.String scriptNodeText)
void
registerOnEventScript(java.lang.String onEvent, java.lang.String script)
void
removeChild(IControl childControl)
void
removeChildren()
java.lang.Object
resolveVariable(java.lang.String name)
protected void
setName(java.lang.String name)
Sets the name for this control.void
setRenderData()
void
setRuntimeAttributes()
Replaces runtime attributes in this control's definition node with their evaluated values.void
setValid(boolean isValid)
-
-
-
Field Detail
-
ON_EVENT_POPUP_RUNTIME_INTERFACE
public static final java.lang.String ON_EVENT_POPUP_RUNTIME_INTERFACE
- See Also:
- Constant Field Values
-
ON_EVENT_PROCESS_ACTION
public static final java.lang.String ON_EVENT_PROCESS_ACTION
- See Also:
- Constant Field Values
-
ON_EVENT_RENDER_ACTION
public static final java.lang.String ON_EVENT_RENDER_ACTION
- See Also:
- Constant Field Values
-
ON_EVENT_CLOSE_WINDOW
public static final java.lang.String ON_EVENT_CLOSE_WINDOW
- See Also:
- Constant Field Values
-
ON_EVENT_LINK
public static final java.lang.String ON_EVENT_LINK
- See Also:
- Constant Field Values
-
ON_EVENT_SCRIPT
public static final java.lang.String ON_EVENT_SCRIPT
- See Also:
- Constant Field Values
-
ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE
public static final java.lang.String ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE
- See Also:
- Constant Field Values
-
ON_EVENT_REPLACE_INTERFACE
public static final java.lang.String ON_EVENT_REPLACE_INTERFACE
- See Also:
- Constant Field Values
-
ON_EVENT_VALIDATE
public static final java.lang.String ON_EVENT_VALIDATE
- See Also:
- Constant Field Values
-
VALIDATION_SELECTED_ONE
public static final java.lang.String VALIDATION_SELECTED_ONE
- See Also:
- Constant Field Values
-
VALIDATION_SELECTED_MANY
public static final java.lang.String VALIDATION_SELECTED_MANY
- See Also:
- Constant Field Values
-
PARAMETER_TYPE_FIRST_SELECTED
public static final java.lang.String PARAMETER_TYPE_FIRST_SELECTED
- See Also:
- Constant Field Values
-
PARAMETER_TYPE_GET_VALUE
public static final java.lang.String PARAMETER_TYPE_GET_VALUE
- See Also:
- Constant Field Values
-
douiContext
protected DouiContext douiContext
-
controlDefinitionNode
protected org.w3c.dom.Node controlDefinitionNode
-
controlContainer
protected ControlContainer controlContainer
-
parentControl
protected IControl parentControl
-
childControls
protected java.util.ArrayList<IControl> childControls
-
resources
protected java.util.List<IResource> resources
-
controlResource
protected IResource controlResource
-
locale
protected java.util.Locale locale
-
onEventScripts
protected java.util.HashMap<java.lang.String,java.lang.String> onEventScripts
-
isValid
protected boolean isValid
-
hasValidatorSubControls
protected boolean hasValidatorSubControls
-
type
protected java.lang.String type
-
-
Method Detail
-
init
public void init(org.w3c.dom.Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl) throws PortalException
- Specified by:
init
in interfaceIControl
- Throws:
PortalException
-
fixedIdentifierRequired
protected boolean fixedIdentifierRequired()
-
generateControlId
protected java.lang.String generateControlId()
-
generateControlIdPrefix
protected java.lang.String generateControlIdPrefix()
-
buildSubControls
public void buildSubControls() throws PortalException
- Specified by:
buildSubControls
in interfaceIControl
- Throws:
PortalException
-
appendSubControls
protected void appendSubControls(java.lang.String subControlsXmlString) throws PortalException
- Throws:
PortalException
-
appendSubControl
protected void appendSubControl(org.w3c.dom.Node subControlNode) throws PortalException
- Throws:
PortalException
-
disconnect
public void disconnect() throws PortalException
- Specified by:
disconnect
in interfaceIControl
- Throws:
PortalException
-
removeChild
public void removeChild(IControl childControl) throws PortalException
- Specified by:
removeChild
in interfaceIControl
- Throws:
PortalException
-
removeChildren
public void removeChildren() throws PortalException
- Specified by:
removeChildren
in interfaceIControl
- Throws:
PortalException
-
getChildControls
public java.util.List<IControl> getChildControls() throws PortalException
- Specified by:
getChildControls
in interfaceIControl
- 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 java.lang.Object resolveVariable(java.lang.String name) throws javax.servlet.jsp.el.ELException
- Specified by:
resolveVariable
in interfacejavax.servlet.jsp.el.VariableResolver
- Throws:
javax.servlet.jsp.el.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 theControlContainer
.- Specified by:
setRuntimeAttributes
in interfaceIControl
- See Also:
ControlContainer
-
setRenderData
public void setRenderData() throws PortalException
- Specified by:
setRenderData
in interfaceIControl
- Throws:
PortalException
-
getId
public java.lang.String getId()
-
getName
public java.lang.String getName()
Description copied from interface:IControl
Returns the name for this control. This is usually a friendly name suitable for final user. For example, in input controls it is usually the label of the field being edited.
-
setName
protected void setName(java.lang.String name)
Sets the name for this control.The generic control implementation usually sets its name during
init(Node, ControlContainer, IControl)
based on the control definition xml. This method may be used to change its name.- Parameters:
name
- the name to set.- Since:
- 7.1.0
-
getType
public java.lang.String getType()
-
getParentControl
public IControl getParentControl()
- Specified by:
getParentControl
in interfaceIControl
- Returns:
- Returns the parentControl.
-
getClientEventHandlerScript
protected java.lang.String getClientEventHandlerScript(java.lang.String eventName, boolean forHref) throws ControlException, PortalException
- Throws:
ControlException
PortalException
-
getWindowProperties
protected java.lang.String getWindowProperties(java.lang.String interfaceId) throws PortalException
Returns the window properties used when a "popupRunTimeInterface" is used as an event handler.- Parameters:
interfaceId
- the interface identifier that is the target for opening.- Returns:
- the window properties used when a "popupRunTimeInterface" is used as an event handler.
- Throws:
PortalException
- Since:
- 7.0.0
-
getWindowProperties
protected java.lang.String getWindowProperties(java.lang.String interfaceId, java.lang.String popupSize) throws PortalException
- Throws:
PortalException
-
getScriptActionValidation
protected java.lang.String getScriptActionValidation(org.w3c.dom.Node[] actionNodes, java.lang.String formName, ITransaction portalTransaction) throws PortalException
- Throws:
PortalException
-
getValidationScript
protected java.lang.String getValidationScript(org.w3c.dom.Node onEventNode) throws PortalException
- Throws:
PortalException
-
getResources
public java.util.List<IResource> getResources() throws PortalException
- Specified by:
getResources
in interfaceIControl
- Throws:
PortalException
-
getAdditionalParameters
protected java.lang.String getAdditionalParameters(org.w3c.dom.Node onEventNode) throws PortalException
- Throws:
PortalException
-
getAdditionalParameters
protected java.lang.String getAdditionalParameters(org.w3c.dom.Node onEventNode, boolean otherParametersExist) throws PortalException
- Throws:
PortalException
-
convertToStandardValue
@Deprecated protected java.lang.String convertToStandardValue(java.lang.String value) throws PortalException
Deprecated.Since 8.0.0. Consider usingDouiStandardValue.convertStandardValue(DouiContext, Object)
instead.- Throws:
PortalException
- See Also:
DouiStandardValue.convertStandardValue(DouiContext, Object)
-
getControlResource
public IResource getControlResource() throws PortalException
- Specified by:
getControlResource
in interfaceIControl
- Throws:
PortalException
-
registerOnEventScript
public void registerOnEventScript(java.lang.String onEvent, java.lang.String script) throws PortalException
- Specified by:
registerOnEventScript
in interfaceIControl
- Throws:
PortalException
-
applyOnEventScripts
protected void applyOnEventScripts() throws PortalException
- Throws:
PortalException
-
isValid
public boolean isValid() throws PortalException
- Specified by:
isValid
in interfaceIControl
- Returns:
- Returns the isValid.
- Throws:
PortalException
-
setValid
public void setValid(boolean isValid) throws PortalException
- Specified by:
setValid
in interfaceIControl
- Parameters:
isValid
- The isValid to set.- Throws:
PortalException
-
getLocale
protected java.util.Locale getLocale()
- Returns:
- Returns the locale.
-
localize
protected java.lang.String localize(java.lang.String text) throws PortalException
- Throws:
PortalException
-
localizeStrings
protected void localizeStrings() throws PortalException
- Throws:
PortalException
-
getStringsToLocalize
protected java.util.Map<java.lang.String,java.lang.String> getStringsToLocalize()
-
getAncestor
protected <T extends IControl> T getAncestor(java.lang.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 java.lang.String processCustomTags(java.lang.String scriptNodeText) throws PortalException
- Throws:
PortalException
-
getPrepareForReadScript
public java.lang.String getPrepareForReadScript() throws PortalException
- Specified by:
getPrepareForReadScript
in interfaceIControl
- Throws:
PortalException
-
createContainer
public void createContainer(java.lang.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 interfaceIControl
- Throws:
PortalException
-
getRenderData
public java.lang.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 interfaceIControl
- Returns:
- Throws:
PortalException
-
getNamespace
public java.lang.String getNamespace()
Returns the namespace for this control. The namespace is a unique string for this control in the current page render request.- Returns:
- this control's namespace.
- Since:
- 4.1.1
-
isRequired
protected boolean isRequired() throws PortalException
Returns whether this control is required.
The default implementation checks whether there is aRequiredValueValidatorControl
bound to this control.- Returns:
- whether this control is required.
- Throws:
PortalException
- Since:
- 10.4.0
-
-