This conversation has been locked due to inactivity. Please create a new post.
This conversation has been locked due to inactivity. Please create a new post.
Hi,
I'm enabling the RTE plugins using the API. So I enabled the EditToolsPlugin as below:
JSONObject editPlugin = new JSONObject(); editPlugin.put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED); editPlugin.put("features", "*"); rtePlugins.put("edit", editPlugin);
When I access the dialog I have all the edit functions/icons displayed. However I need to set the features to paste-plaintext as thats the only option I require from the plugin. I've tried change the feature code line to a number of combinations from String to String Arrays.
None of these appear to work. The API for the plugin does say "You may provide a String value of "*" to enable all features of the respective plugin, or provide a String[] that contains the IDs of active features" .... so what does it mean for "active features" and is this relevant?
I've probably missed or not done something but any assistance to resolve this is appreciated
Thanks....Gary
Solved! Go to Solution.
Views
Replies
Total Likes
I have read that page on "Configuring the Rich Text Editor" and while more focuses on the non-API method does have the following section
For this "plugin" node (i.e. named after the plugin) add the property features.
There are two methods of configuring the property:
CAUTION
Even if you are only setting one specific value of features you do have to use String[].
String is only valid when defining features as *.
So I know that having a string with "*" works fine, but that when if you want to define one or more features it must be a String Array must be defining/coding that incorrectly. The question is how do I do that programmatically ?
Views
Replies
Total Likes
If 5.6 please file daycare & ask for fix for CUI-438
Views
Replies
Total Likes
Did you read all the AEM documentation located here:
http://dev.day.com/docs/en/cq/current/administering/configuring_rich_text_editor.html
HTH
Views
Replies
Total Likes
I have read that page on "Configuring the Rich Text Editor" and while more focuses on the non-API method does have the following section
For this "plugin" node (i.e. named after the plugin) add the property features.
There are two methods of configuring the property:
CAUTION
Even if you are only setting one specific value of features you do have to use String[].
String is only valid when defining features as *.
So I know that having a string with "*" works fine, but that when if you want to define one or more features it must be a String Array must be defining/coding that incorrectly. The question is how do I do that programmatically ?
Views
Replies
Total Likes
I'm using CQ 5.3 unfortunately
Views
Replies
Total Likes
Finally!!.. I have it working now . I had to replace the line
editPlugin.put("features", "*");
with a JSONArray object for the features that I wanted (I tested with the "copy" and "paste" features as an example)
JSONArray editPluginFeatures = new JSONArray(); editPluginFeatures.put("copy"); editPluginFeatures.put("cut"); editPlugin.put("features", editPluginFeatures);
so the full example code for the "copy" & "paste" features is..
JSONObject editPlugin = new JSONObject(); editPlugin.put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED); editPlugin.put("defaultPasteMode", "plaintext"); JSONArray editPluginFeatures = new JSONArray(); editPluginFeatures.put("copy"); editPluginFeatures.put("cut"); editPlugin.put("features", editPluginFeatures); rtePlugins.put("edit", editPlugin);
I can now start to apply all the features and others options as I need. Thanks to everyone for their feedback
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies