How I added Textbox.io rich text editor to XPages

Tags: : Xpages
What about replacing the built in rich text editor in XPages with a super-modern editor which accepts image-pasting directly, without configuring anything on the server?

A picture named M2


How to find the "thing" causing Windows 7 x64 to loose focus

Tags: : Windows 7

For some time now I have had a huge problem with my Windows 7 x64 installation. Almost making day-to-day work with Windows unbearable!!

For some reason Windows looses focus every 3-5 seconds, making for example drag and drop almost impossible. When I say “loose focus” it is not like “loosing focus completely”, like deactivating the current application. The currently active application is not loosing its application focus. It is more like the mouse is loosing it’s “hold”. The symptomes are typical that the mouse “releases” by itself during drag and drop, and this cause for example:

  • When moving files with drag-and-drop in Explorer, the files may suddenly be dropped somewhere! This is of course extremely irritating, as I have to find out where the files where dropped (thank God for Everything Search, my absolute favorite file-finder in Windows).
  • When moving e-mails from my inbox to any folders, they may get dropped anywhere. As for the scenario above, I have to look up where the e-mails ended up!
  • When moving e-mails into folders, the “auto-release” of the mouse - all by itself - find out that “hey, he is not dragging any e-mails anymore” and instead move the folder currently under the mouse, around within the folders …
  • When working in graphics programs, the selection tool suddenly stops. Either the selection is cancelled right there with the selection still intact, but smaller than I intended, or it is cancelled all together!
  • When dragging any application around on the Windows desktop, the mouse “auto releases”, instantly drop the dragged application, but since the mouse-key still is pressed, it automatically select whatever is under the mouse during the movement ….
  • When selecting text in any editor, the selection was abrouptly cancelled and I started a new selection where the mouse were at failure!

Read on to see how I found the culprit and regained control in Windows!



Just for the fun of it... here are some wordles for Lotusphere-abstracts since 2000 up to 2014 ...

Tags: : Lotusphere

I love Wordles (for a free online generator see http://www.wordle.net/). Sometimes a word-cloud can say a lot about the content. For example, below you see a wordle for all Lotusphere (errh, Connect, errrh ConnectED) session abstracts combined from 2000 up to 2014:


Click on all images for a larger version!

Below you will find wordles for each year from 2000 to 2014. Fun to see how company name changes, and how the focus slighty changes from year to year. The wordles has been created by extracting the abstracts from all the session-databases I have archived, using the cool tool named Wordaizer.

Before diving into the wordles themselves, I thank Ben Langhinrichs from Genii Software which assembled all the abstracts into an easy-to-use Notes database for over a decade! You might even get the old session databases from the links I provide at the end of the article.

I also thank Mat Newman and more, which has taken over the last two years and created the session databases for 2013 and 2014.

Why are the session databases important?

For some reason IBM has created their own Session Preview Tool, which allows you to find sessions and their abstracts. Right now it looks like this:


I find the interface above un-intuitive and hard to use. Yes, you can get a list, but I can’t tweak it the way I want! Perhaps I am just too old…

I have allways liked the Notes-version much better – you know what you get when you have it in a Notes database!!


Long live Notes!

Click Read more below to see the wordles year by year!



How I got around the Notes C API problem with MailAddMessageBodyComposite creating error 315 on larger HTML files

Tags: : Notes C API
I have always wanted to be able to import HTML into Notes with the C API in a proper way. Well ... as "proper" as proper can be. We all know that the quality and fidelity of the HTML import in Notes can be so-so, but it is always nicer to be able to do some import rather than none.

To make a long story short, searching around on the net points you to some few pages outlining techniques using the undocumented function ImportHTMLTextFile in the import DLL niHTML.dll. This is probably the very same function the Notes client uses when you import a HTML file into a rich text field. The ImportHTMLTextFile function swallow parameters specifying the URL you want to import, and generates a CD-record file. This is in essence a file with the CD-records as you would believe they would occure in the rich text field. To understand more about CD-records, take a look here. In order to transport the CD-records from the file generated by the ImportHTMLTextFile -function, we use another function named MailAddMessageBodyComposite. Looking in the reference guide it clearly states "This function creates multiple items of the same name and therefore is not limited to 64KB of input". Below you see a snippet of C/C++ code using these functions (note, all error handling is removed for clarity)

/* Prime the Import function with a temporary CD file name and create the CD-record file*/

/* Import the HTML with the undocumented import function in the Import Library NIHTML.DLL from Notes */
error = m_dllImportHTML.ImportHtmlTextFile(&stImpExp,3,0,"",szHTMLFileName);

/* Coming here, we are ready to use the MailAddMessageBodyComposite */
error = NSFItemDelete(m_hDocNote,szRichTextFieldName, strRichTextFieldName.GetLength());
error = MailAddMessageBodyComposite(m_hDocNote,szRichTextFieldName,stImpExp.OutputFileName);

Running the code above on URLs with code below 64 KB went fine, but when the page-size grew beyond 64 KB I got error 315 .... "Memory Allocation Exceeded 65,000 bytes" from MailAddMessageBodyComposite. The ImportHtmlTextFile-function didn't have any problems swallowing huge pages. The 315-error led me to post the question Has anybody got the C API function MailAddMessageBodyComposite working with larger HTML? on the Notes 9 forum.

Since I didn't get any answers, and couldn't get MailAddMessageBodyComposite to work, I finally got my head around the MIME-functions in the C API and the following technique worked nicely - also with huge pages!

In order to get the pseudo-code to work, you must have your HTML file local first. Let's say it is stored as c:\temp\MyHTML.htm. Please note that the code below is not complete nor has error handling in place. Also note that the variable m_docNote is the NOTEHANDLE of the open note. The note will of course be saved after a successful import.

MIMEHANDLE        hMIMEStream;

/* Open a MIME stream. This will receive the strings from the file */        
error = MIMEStreamOpen(m_hDocNote, // note handle
        NULL,                               // item name
        0,                               // item name length
        MIME_STREAM_OPEN_WRITE,         // open flags
        &hMIMEStream );

/* Tell the stream that we will receive HTML soon */
error = MIMEStreamPutLine("Content-Type: text/html", hMIMEStream);

/* Loop through the lines in the file. You can use any kind of array or iterator here as long as you can get the file line-by-line */
for (lCur = 0; lCur < lMax; lCur++)
        error = MIMEStreamPutLine((char *)arrayFile[lCur], hMIMEStream);

/* Delete any potential field with the specified name and convert the MIME Stream to an itemized field */
error = NSFItemDelete(m_hDocNote,"Body", 4);
error = MIMEStreamItemize( m_hDocNote,

/* Close MIME Stream */

The pepper in the code above is simply to put the "Content-type"-string into the stream so the MIMEStreamItemize later understand the text as HTML. Also note that the flag MIME_STREAM_ITEMIZE_BODY limits the itemizer to render only the body field of the incoming mime.

Knowing that this technique worked with "fake MIME" as described above, I also tried to use the technique with real MIME files such as EML (drag a mail document from your inbox to your desktop and voila - you have an EML file of that mail!) or other MIME files. The code even imported embedded images without any problem.

Hopefully these tips are helpful if you struggle with MailAddMessageBodyComposite!


Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J - Part 3

Tags: : LotusScript Java Connections

This part 3 of 3 in the article series “Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J”.

Read the others here:

Part 1

Part 2



Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J - Part 2

Tags: : LotusScript Java Connections

This part 2 of 3 in the article series “Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J”.

Read the others here:

Part 1

Part 3



Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J - Part 1

Tags: : LotusScript Java Connections

This part 1 of 3 in the article series “Classic Notes: How to communicate with IBM Connections from LotusScript wrapping IBM SBT with LS2J”.

Read the others here:

Part 2

Part 3

… embark! …

You have seen the cool IBM Social Business Toolkit (IBM SBT), and you played around with the ??bercool Playground application. You dive into the code and quickly discover that you need some Java or JavaScript knowledge.

- Ooops, but I am mostly doing LotusScript, you say … what now?

Perhaps you ask a question on StackOverflow to see if anybody has some advice for your scenario (just completely out of the sky – perhaps something similar to this question Smilefjes). The chances are that you’d get a lot of advice abandoning your old and tired LotusScript  in favor for the much more modern Java language. Your challenge is that you have a lot of LotusScript code that you would love to enhance with the new cool IBM SBT possibilities, and perhaps not the time to take the heavy plunge into learning a new language.

This article – which assumes a whole bunch of details are in place – will show you how to have this small piece of LotusScript code …


… put an entry into an Activity Stream in a specified community like this;




How I got Lotus Connectors (LCLSX) to finally connect from our IBM i to a remote Windows DB/2 server

Tags: : LotusScript Connectors

If you have seen error messages like “30061 - Error: Relational database BLABLA not found.,  Connector 'db2',  Method -Connect-  (-30061) - Relational database BLABLA not found.” or “Error: Communication error occurred on distributed database processing.  See SQ30080 for invalid possibilities.  A common error is that the  password is case sensitive and is not being provided in the correct case” you’re not alone!

Read on how to see the bigger picture on how IBM i’s “Relational Database Directory Entries” should be configured based on what you see in the real target database. Finally you’ll see how to code Lotus Connectors LSX (LCLSX) to use this information to connect to the database.

Most of our Domino servers run on IBM i (aka System i, iSeries and AS/400). Since IBM i have DB2 natively supported, there is no need to install DB2 Client or DB2 Data Server Drivers (more on those below). The target DB/2 server is running on a remote Windows server, and I thought it would be a breeze to connect IBM i and the Windows machine together. Not so! First and foremost, there is sparse information on the net on how to exactly do this. You very quickly find sample code similar to this;


So how come the code above bails out at the Connect-method?




Tags: : Web Services Java LotusScript


Classic Notes Development: Updated code to open design elements from Notes - in Designer

Tags: : LotusScript

Thanks to Stephan Wissel who pointed me in the correct direction regarding how to open design elements directly – from the Notes client with LotusScript.