Package lumis.doui.control
Class Control
- java.lang.Object
-
- lumis.doui.control.Control
-
- All Implemented Interfaces:
VariableResolver
,IControl
- Direct Known Subclasses:
ActivityStreamConfigurationInfoControl
,AdminMemberConditionalRenderControl
,AsyncProgressControl
,AutoEmbeddedInterfaceStandardButtonsControl
,AutoInterfaceStandardButtonsControl
,AutoPopupInterfaceStandardButtonsControl
,CommentsAddControl
,ConditionalRenderControl
,ConsumerConfigurationInterfaceVerificationControl
,ControlGroupControl
,DataControl
,FCKEditorPopUpFixerControl
,FormControl
,IncludeControl
,InterfaceHeaderButtonsControl
,InterfaceHeaderControl
,InterfaceInstancePreviewControl
,LinkControl
,PositionFieldInterfaceHeaderControl
,PreviewCssControl
,PropertyPageControl
,RemotePortletConfigurationInterfaceControl
,RequiredValuesDescriptorControl
,ScriptControl
,SelectChannelPageTreeControl
,SelectChannelPageTreeControl
,SelectImagesControl
,ServiceInstanceUsedByControl
,SourceBoundControl
,StringsControl
,TopicViewCounterControl
,ValidatorControl
,WebsiteChangeCheckControl
@StableMinor(version="14.2", 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
- Version:
- $Revision: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
-
-
Field Summary
Fields Modifier and Type Field Description 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_REPLACE_INTERFACE
static String
ON_EVENT_SCRIPT
static String
ON_EVENT_VALIDATE
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
Constructors Constructor Description Control()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
appendSubControl(Node subControlNode)
protected void
appendSubControls(String subControlsXmlString)
protected void
applyOnEventScripts()
void
buildSubControls()
protected String
convertToStandardValue(String value)
Deprecated.Since 8.0.0.void
createContainer(String containerId)
Creates a container for the control.void
disconnect()
protected boolean
fixedIdentifierRequired()
protected String
generateControlId()
protected String
generateControlIdPrefix()
protected String
getAdditionalParameters(Node onEventNode)
protected String
getAdditionalParameters(Node onEventNode, boolean otherParametersExist)
protected <T extends IControl>
TgetAncestor(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()
String
getName()
Returns the name for this control.String
getNamespace()
Returns the namespace for this control.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)
ISourceContext
getSourceContext()
protected Map<String,String>
getStringsToLocalize()
String
getType()
protected String
getValidationScript(Node onEventNode)
protected String
getWindowProperties(String interfaceId)
Returns the window properties used when a "popupRunTimeInterface" is used as an event handler.protected String
getWindowProperties(String interfaceId, String popupSize)
void
init(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 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)
protected void
setName(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 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
-
ON_EVENT_REPLACE_INTERFACE
public static final String ON_EVENT_REPLACE_INTERFACE
- See Also:
- Constant Field Values
-
ON_EVENT_VALIDATE
public static final String ON_EVENT_VALIDATE
- 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
-
controlResource
protected IResource controlResource
-
locale
protected Locale locale
-
isValid
protected boolean isValid
-
hasValidatorSubControls
protected boolean hasValidatorSubControls
-
type
protected String type
-
-
Method Detail
-
init
public void init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl) throws PortalException
- Specified by:
init
in interfaceIControl
- Throws:
PortalException
-
fixedIdentifierRequired
protected boolean fixedIdentifierRequired()
-
generateControlId
protected String generateControlId()
-
generateControlIdPrefix
protected String generateControlIdPrefix()
-
buildSubControls
public void buildSubControls() throws PortalException
- Specified by:
buildSubControls
in interfaceIControl
- 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 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 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 Object resolveVariable(String name) throws ELException
- Specified by:
resolveVariable
in interfaceVariableResolver
- 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 theControlContainer
.- Specified by:
setRuntimeAttributes
in interfaceIControl
- See Also:
ControlContainer
-
setRenderData
public void setRenderData() throws PortalException
- Specified by:
setRenderData
in interfaceIControl
- Throws:
PortalException
-
getName
public 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(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 String getType()
-
getParentControl
public IControl getParentControl()
- Specified by:
getParentControl
in interfaceIControl
- Returns:
- Returns the parentControl.
-
getClientEventHandlerScript
protected String getClientEventHandlerScript(String eventName, boolean forHref) throws ControlException, PortalException
- Throws:
ControlException
PortalException
-
getWindowProperties
protected String getWindowProperties(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 String getWindowProperties(String interfaceId, String popupSize) throws PortalException
- Throws:
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 interfaceIControl
- Throws:
PortalException
-
getAdditionalParameters
protected String getAdditionalParameters(Node onEventNode) throws PortalException
- Throws:
PortalException
-
getAdditionalParameters
protected String getAdditionalParameters(Node onEventNode, boolean otherParametersExist) throws PortalException
- Throws:
PortalException
-
convertToStandardValue
@Deprecated protected String convertToStandardValue(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(String onEvent, 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 Locale getLocale()
- Returns:
- Returns the locale.
-
localize
protected String localize(String text) throws PortalException
- Throws:
PortalException
-
localizeStrings
protected void localizeStrings() throws PortalException
- Throws:
PortalException
-
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 interfaceIControl
- 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 interfaceIControl
- 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 interfaceIControl
- Returns:
- Throws:
PortalException
-
getNamespace
public 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
-
-