Forum OpenACS Q&A: Still having problems configuring ckeditor for Xowiki.
The problem in the end was twofold:
1) specifying 'extraPlugins=xowikiimage' causes ckeditor to fail because I do not have the OpenACS image uploader code for ckeditor, and without a means of browsing the CVS repository, I have not been able to obtain it from CVS.
2) I had mis-understood Gustaf's post here:
....that '_description:omit _page_order:omit' were to be added to the plugins space delimited. I now see that this is a programmatic form spec and these are directives to omit these default CR fields from the xowiki.Form when new instances are being created for filling in. Should have seen that sooner.
So the only remaining issue is trying to get the xowikiimage plugin code.
I think version 4 of ckeditor would be good to have so I will play with trying to get that working too.
Firstly, I found where the image uploader was hiding:
cvs -d:pserver:mailto:email@example.com:/cvsroot co openacs-4/packages/xowiki/www/ckeditor-images/
But once downloaded, it still didn't work.
Turns out the reason is that the path that is passed into the xowiki.Formpage is imageSelectorDialog: '/xowiki/ckeditor-images/',
However, I have put this instance of xowiki onto a url called something else. This means that this path should be '/somethingelse/ckeditor-images'.
in form-field-procs.tcl in the render_input method of richtext::ckeditor, this path is generated by:
Tomorrow I will track down where this property is set and will try to change it to use the current url for the package instance instead of assuming /xowiki/.
even though the path is now correct, and there are now no script errors in the browser, the editor doesn't load. I guess I must still be missing some aspect of the image uploader code.
xowikiimage code was missing from the ckeditor plugins directory. This because I had not downloaded from cvs.
I have tried version 3.5.2 (which is the one committed to cvs) and also version 3.6.2. Both load fine, but there is still a problem with the image uploader. This error is thrown whenever the cancel button is clicked:
SCRIPT5009: 'xowiki_image_dialog' is undefined
1449?m=edit, line 1 character 1
in IE and
ReferenceError: xowiki_image_dialog is not defined
but that reference in cancel button is to:
...but where oh where is that set?
in the onclick method of the close button.
Ok. So now I have a better understanding, maybe I should try to get the newest version (4) to work.
To get the icon to display you have to add a 15 x 16 pixel icon (i.e. xowikiimage.png). The path specified in the xowikiimages plugin is not consistent with the ckeditor standard.
To be standard, add an 'images' directory under plugins/xowikiimages/ and place the gif in there.
Edit plugins/xowikiimages/plugin.js to include the icon declaration in the editor.ui.addButton function:
icon: this.path + 'images/xowikiimage.png'
The problem was that "icon: this.path + 'images/xowikiimage.png'" this was incorrectly located in the CKEDITOR.plugins.add function instead.
On first impression the new version seems to have substantially streamlined the process of activating the editor, and dramatically reducing the number of files and components that have to be loaded. It seems to be substantially optimised. Along the way they have changed the calling method names, and have changed the way options are passed to each instance of the editor.
I'd happily put some time into doing this, but I think I'd need someone to walk me through the existing integration since there are still some bits that I am a little foggy about.
I was unable to obtain ckeditor using cvs as follows:
cvs co openacs-4/packages/xowiki/www/resources/ckeditor
Just now, i was trying ckeditor on a fresh installation of OpenACS head with the contained xowiki version. If you have an xowiki version from cvs head, there is no need for an additional checkout, just "cvs update -d" is sufficient. The image selector is not finished (e.g. icon, message keys, etc.), but it is not essential either.
I have not yet looked into newer version of ckedit.
I have already created the icon for my installation from an open source icon library, and will be doing the message keys shortly.
If you would like I can provide them, though I would have to refresh my memory on my CVS login details and permission.