Package lumis.doui.control.htmleditor
Class HtmlEditorControl
- java.lang.Object
-
- lumis.doui.control.Control
-
- lumis.doui.control.DataControl
-
- lumis.doui.control.DataBoundControl<Source<?>>
-
- lumis.doui.control.htmleditor.HtmlEditorControl
-
- All Implemented Interfaces:
java.util.Observer
,VariableResolver
,IControl
,IDataBoundControl
,IDataControl
,IRenderer
public class HtmlEditorControl extends DataBoundControl<Source<?>>
Control for editing html content.- Since:
- 4.0.0
- Version:
- $Revision: 25809 $ $Date: 2023-07-04 15:23:22 -0300 (Tue, 04 Jul 2023) $
-
-
Field Summary
-
Fields inherited from class lumis.doui.control.DataControl
FORCE_CASE_LOWER, FORCE_CASE_NONE, FORCE_CASE_UPPER, forceCase, requestParameterName, UNKNOWN_DATA_TYPE, value, 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_REPLACE_INTERFACE, ON_EVENT_SCRIPT, ON_EVENT_VALIDATE, onEventScripts, PARAMETER_TYPE_FIRST_SELECTED, PARAMETER_TYPE_GET_VALUE, parentControl, resources, type, VALIDATION_SELECTED_MANY, VALIDATION_SELECTED_ONE
-
-
Constructor Summary
Constructors Constructor Description HtmlEditorControl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildSubControls()
static java.lang.String
decodeEditorFormatToHtml(java.lang.String html)
static java.lang.String
encodeHtmlForEditor(java.lang.String html, DouiContext douiContext)
Encodes the HTML for use in the editor.protected boolean
fixedIdentifierRequired()
IResource
getControlResource()
java.lang.String
getPrepareForReadScript()
static java.util.List<java.lang.String>
getPreviewCsss(ServiceInstanceConfig siConfig)
Returns the CSS to be used when previewing the HTML for a content in the given service instance.protected java.util.Map<java.lang.String,java.lang.String>
getStringsToLocalize()
protected java.lang.Class<?>
getValueClass()
Returns the class the possible values of this control are assignable to.void
init(org.w3c.dom.Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl)
void
loadFromRequest()
static java.lang.String
markWidgetHtmlBoundaries(java.lang.String widgetHtml)
Includes HTML marks around the widget HTML so it can later be decoded properly.static java.lang.String
processHtmlForEditor(java.lang.String html, HttpServletRequest request, HttpServletResponse response)
Processes the HTML for use in the editor.void
setProcessActionHandlerParameters(IProcessActionHandler processActionHandler)
Sets the control value as a process action handler parameter.void
setRenderData()
-
Methods inherited from class lumis.doui.control.DataBoundControl
autoAddDateTimeValueValidator, autoAddDoubleValueValidator, autoAddFileSizeValidator, autoAddIntegerValueValidator, autoAddLengthValidator, autoAddLongValueValidator, autoAddRequiredValueValidator, autoAddValidators, createConverter, createDataType, getDataId, getFieldName, getProcessActionHandlerParameterName, getReload, getRequestHelpDefinition, getRuntimeDefaultSource, getSource, getSourceById, getSourceContext, getUnboundedConverter, setDefaultValue, setRawValue, setReload, setSourceParameter, setValid, setValueFromSource, setValueFromSource, update
-
Methods inherited from class lumis.doui.control.DataControl
convertValueToControlValue, getConverter, getDataType, getDefaultValue, getParameterValue, getProcessActionIds, getRequestParameterName, getValue, getValue, initProcessActionIds, isTrim, loadSubControlFromRequest, loadSubControlsFromRequest, setProcessActionHandlerParameter, setProcessActionHandlerParameter, setSourceParameter, setSourceParameters, setTrim, setValue, valueIsArray
-
Methods inherited from class lumis.doui.control.Control
appendSubControl, appendSubControls, applyOnEventScripts, convertToStandardValue, createContainer, disconnect, generateControlId, generateControlIdPrefix, getAdditionalParameters, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getId, getLocale, getName, getNamespace, getParentControl, getRenderData, getResources, getScriptActionValidation, getType, getValidationScript, getWindowProperties, getWindowProperties, isRequired, isValid, localize, localizeStrings, processCustomTags, registerOnEventScript, removeChild, removeChildren, resolveVariable, setName, setRuntimeAttributes
-
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
createContainer, disconnect, getChildControls, getId, getName, getParentControl, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRuntimeAttributes
-
Methods inherited from interface lumis.doui.control.IDataControl
getConverter, getProcessActionIds, getValue, getValue, setValue
-
Methods inherited from interface lumis.doui.render.IRenderer
getResources
-
-
-
-
Method Detail
-
init
public void init(org.w3c.dom.Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl) throws PortalException
- Specified by:
init
in interfaceIControl
- Overrides:
init
in classDataBoundControl<Source<?>>
- Throws:
PortalException
-
fixedIdentifierRequired
protected boolean fixedIdentifierRequired()
- Overrides:
fixedIdentifierRequired
in classControl
-
getValueClass
protected java.lang.Class<?> getValueClass() throws PortalException
Description copied from class:DataControl
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.- Overrides:
getValueClass
in classDataControl
- Returns:
- the class the possible values of this control are assignable to.
- Throws:
PortalException
-
encodeHtmlForEditor
public static java.lang.String encodeHtmlForEditor(java.lang.String html, DouiContext douiContext) throws PortalException
Encodes the HTML for use in the editor.- Parameters:
html
- the original html.douiContext
- the renderization DOUI context.- Returns:
- the HTML source code, escaped for use in JS string.
- Throws:
PortalException
- Since:
- 15.0.0
-
processHtmlForEditor
public static java.lang.String processHtmlForEditor(java.lang.String html, HttpServletRequest request, HttpServletResponse response) throws PortalException
Processes the HTML for use in the editor.- Parameters:
html
- the original html.request
- the request.response
- the response.- Returns:
- the resulting HTML source code.
- Throws:
PortalException
- Since:
- 15.0.0
-
markWidgetHtmlBoundaries
public static java.lang.String markWidgetHtmlBoundaries(java.lang.String widgetHtml)
Includes HTML marks around the widget HTML so it can later be decoded properly.- Parameters:
widgetHtml
- the widget HTML (only the widget service interface instance renderization HTML, does not include the special div widget container).- Returns:
- returns the widget HTML with marks included to be used when generating the HTML for this HTML editor.
- Since:
- 15.0.0
-
decodeEditorFormatToHtml
public static java.lang.String decodeEditorFormatToHtml(java.lang.String html)
-
loadFromRequest
public void loadFromRequest() throws PortalException
- Specified by:
loadFromRequest
in interfaceIDataControl
- Overrides:
loadFromRequest
in classDataBoundControl<Source<?>>
- Throws:
PortalException
-
setProcessActionHandlerParameters
public void setProcessActionHandlerParameters(IProcessActionHandler processActionHandler) throws PortalException
Description copied from class:DataControl
Sets the control value as a process action handler parameter.- Specified by:
setProcessActionHandlerParameters
in interfaceIDataControl
- Overrides:
setProcessActionHandlerParameters
in classDataControl
- Throws:
PortalException
-
setRenderData
public void setRenderData() throws PortalException
- Specified by:
setRenderData
in interfaceIControl
- Overrides:
setRenderData
in classDataBoundControl<Source<?>>
- Throws:
PortalException
-
getPreviewCsss
public static java.util.List<java.lang.String> getPreviewCsss(ServiceInstanceConfig siConfig) throws PortalException
Returns the CSS to be used when previewing the HTML for a content in the given service instance.- Parameters:
siConfig
- the service instance.- Returns:
- a list with the CSS hrefs or an empty list if there is no CSS to be used.
- Throws:
PortalException
- Since:
- 14.2.0
-
getPrepareForReadScript
public java.lang.String getPrepareForReadScript() throws PortalException
- Specified by:
getPrepareForReadScript
in interfaceIControl
- Overrides:
getPrepareForReadScript
in classControl
- Throws:
PortalException
-
buildSubControls
public void buildSubControls() throws PortalException
- Specified by:
buildSubControls
in interfaceIControl
- Overrides:
buildSubControls
in classDataBoundControl<Source<?>>
- Throws:
PortalException
-
getControlResource
public IResource getControlResource() throws PortalException
- Specified by:
getControlResource
in interfaceIControl
- Overrides:
getControlResource
in classControl
- Throws:
PortalException
-
getStringsToLocalize
protected java.util.Map<java.lang.String,java.lang.String> getStringsToLocalize()
- Overrides:
getStringsToLocalize
in classControl
-
-