CKEditor in Lotus Domino

November 21, 2010 § 2 Comments

After spending a few hours dismantling the CKEditor in Domino this is what I have found out.

It is a quite a lot of JavaScript code that makes the Domino implementation of CKEditor tick. Most of the code is unaltered for the Domino implementation, but there are some changes. You will find the the code for CKEditor in the folder <data folder>\domino\html\ckeditor\ on the domino server.

By using a tool like grep you can search for any file withe the word IBM in it and you will find the files that has been altered for the Domino implementation. Also please note that the JavaScript files each as two versions one obfuscated for size reasons and one with the original code. You will find the readable versions in the folder _source.

If you want to change how the editor works I would not recommend you to make changes in these files. It is better to programmatically change the things you want to change. The problem with xPages is that it can be hard to guess the id that is assigned to different elements. And that makes it harder to get a handle on an element. One way to do this for the CKEditor is to loop through all instances and get the name of each instance. This example isn’t very useful, but you get the idea:

for(var i in CKEDITOR.instances) {
    alert(CKEDITOR.instances[i].name); // alerting for testing purposes only
}

Also note that the name of the CKEditor instance is the same as the id-tag of the containing textarea-element.

To get the CKEditor integrated into the whole xPages thing there are also a couple of dojo-files needed. You will find these files in the folder <data folder>\domino\js\dojo-x.y.z\ibm\xsp\widget\layout\ (where x.y.z is the current dojo-version used by Domino). The interesting files for the CKEditor-integration are xspCKEditor.js and CKEditorWrapper.js.

The file xspCKEditor.js defines the ajax-call used for uploading an image to the server. The return value of this call contains a short code snippet that contains the URL to the uploaded image.

var url = document.location.href.substring(0, document.location.href.indexOf('?'));
if(null != url){
  this.filebrowserImageUploadUrl = url +
    "?$$axtarget=" + options.id +
    "&$$viewid=" + XSP.findForm(options.id)["$$viewid"].value +
    "&command=QuickUpload&type=Images&SessionID=" +
    readCookie("SessionID");
}

I have not been able to find any documentation of what argument the call can use, but you can make some deductions from the code itself. And you should be able to make your own upload controls by following the patterns in the code above.

As the other half of the programming crew in my shop is quiting around Christmas I won’t be able to take the time to experiment with his. But maybe you, the unknown reader, have the time 😉

 

Advertisements

Tagged: , , ,

§ 2 Responses to CKEditor in Lotus Domino

  • Carlos de Luna Saenz says:

    I am having troubles with the editor and xpsClientDojo.js… both are 404 for the client.. i haven’t found a solution for t… do you know if i have to enable my server someway to serve them to the clients? Lotus Domino 9.0.1 running on Windows Server 2012R2
    Thanks in advance for any sugestions… i’m getting mad on this

    • javakingen says:

      I havent worked with Domino for over a year now, so I’m not really up to speed with this.

      But as the version number is part of the path are the client and the server using the same versions of the editor?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading CKEditor in Lotus Domino at Strange Epiphany.

meta

%d bloggers like this: