Interface EditorOptionsContributor
EditorConfigContributor
.
This interface facilitates configuring options at a higher level than using
EditorConfigContributor
. The former requires knowledge about the
editor internals, while the latter is more versatile in terms of
customization.
The options specified through this interface are not tied to any particular
editor implementation. A EditorConfigTransformer
transforms these
high level options to a low level configuration object.
Implementations must be OSGi components that are registered in the OSGi Registry.
The options can be targeted for specific editors, based on three criteria: portlet name, editor config key, and editor name. These criteria can be defined as OSGi properties with the following names:
-
javax.portlet.name
: The portlet name. If specified, the options are applied to every editor used in that portlet. -
editor.config.key
: The key used to identify the editor (theinput-editor
taglib tag'sconfigKey
attribute value). If specified, the options are applied to every editor with the specifiedconfigKey
. -
editor.name
: The name of the editor (theinput-editor
taglib tag'seditorName
attribute value:ckeditor
,ckeditor_bbcode
,alloyeditor
, etc.). If specified, the options are applied to every editor with that name.
In case there's more than one options contributor, they're prioritized by the following criteria combinations (the lower the criteria's number, the higher it's prioritized):
- portlet name, editor config key, editor name
- portlet name, editor config key
- editor config key, editor name
- portlet name, editor name
- editor config key
- portlet name
- editor name
- empty
If there are multiple contributors with the same criteria elements, they're prioritized by service rank.
- Author:
- Sergio González
-
Method Summary
Modifier and TypeMethodDescriptionvoid
populateEditorOptions
(EditorOptions editorOptions, Map<String, Object> inputEditorTaglibAttributes, ThemeDisplay themeDisplay, RequestBackedPortletURLFactory requestBackedPortletURLFactory) Updates the originalEditorOptions
object with new options.
-
Method Details
-
populateEditorOptions
void populateEditorOptions(EditorOptions editorOptions, Map<String, Object> inputEditorTaglibAttributes, ThemeDisplay themeDisplay, RequestBackedPortletURLFactory requestBackedPortletURLFactory) Updates the originalEditorOptions
object with new options. It can even update or delete the original options, or any other options introduced by any otherEditorOptionsContributor
.The editor options object contains the options to be transformed by the Editor Config Transformer to a configuration JSON object.
- Parameters:
editorOptions
- the originalEditorOptions
object containing the options set byEditorOptionsContributor
modulesinputEditorTaglibAttributes
- the attributes specified to the input taglib tag that renders the editorthemeDisplay
- the theme display
-