Interface EditorConfigContributor
- All Known Implementing Classes:
BaseEditorConfigContributor
EditorOptionsContributor
.
Implementations of this interface are typically specific to a particular editor, since the configuration JSON object updated here can differ from those of other editors.
Implementations of this class must be OSGi components that are registered in the OSGi Registry.
The configuration can be targeted to 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 configuration populated in the JSON object is 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 configuration populated in the JSON object is 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 configuration populated in the JSON object is applied to every editor with that name.
In case there's more than one configuration, 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 configurations with the same criteria elements, they're prioritized by service rank.
- Author:
- Sergio González
-
Method Summary
Modifier and TypeMethodDescriptionvoid
populateConfigJSONObject
(JSONObject jsonObject, Map<String, Object> inputEditorTaglibAttributes, ThemeDisplay themeDisplay, RequestBackedPortletURLFactory requestBackedPortletURLFactory) Updates the original configuration JSON object with some new configuration.
-
Method Details
-
populateConfigJSONObject
void populateConfigJSONObject(JSONObject jsonObject, Map<String, Object> inputEditorTaglibAttributes, ThemeDisplay themeDisplay, RequestBackedPortletURLFactory requestBackedPortletURLFactory) Updates the original configuration JSON object with some new configuration. It can even update or delete the original configuration, or any other configuration introduced by any otherEditorConfigContributor
.The configuration object contains the configuration to be directly used by the editor. The configuration JSON object might, therefore, differ from other editors.
- Parameters:
jsonObject
- the original JSON object composed of the entire configuration set byEditorConfigContributor
modulesinputEditorTaglibAttributes
- the attributes specified to the input taglib tag that renders the editorthemeDisplay
- the theme display
-