How to customize theXPages CKEditor toolbar with a Java bean

chatFrank van der Linden | e-office 17 December 2013 19:53:01
How it started
I have build a Social Intranet Framework powered by XPages, included integration with IBM Connection.
When I was at a customer to implement the framework on their Domino server, the content manager was wondering if it was possible to paste HTML code inside the richtext fields. Which is based on CKEditor.
So after some research I found the toolbar was build up by several plugins.

So a quick fix was made to the code to load the Source button and the content was able to add some weather information HTML in the widget.

My solution
I was thinking about a more solid solution. Why not give the intranet admin the opportunity to decide which plugin should be available for the content managers.
At the website of the CKEditor I found a list of possible toolbar options.

In the faces-config.xml I defined the toolbar managed bean
Image:How to customize theXPages CKEditor toolbar with a Java bean
I created a XPages with the most common options for the toolbar, with the possibility to check an item if the option should be loaded.
Image:How to customize theXPages CKEditor toolbar with a Java bean
On the save of the XPage, the managed bean will be updated with the latest choices.
Image:How to customize theXPages CKEditor toolbar with a Java bean

On a content page where a Richtext field is used I added a 'toolbar' Dojo attribute to the field. The toolbar attribute will get the options from the Managed Bean which should be loaded.
Image:How to customize theXPages CKEditor toolbar with a Java bean

The  toolbarBean.composeToolbar calls the method in the bean to get all the needed options and produce the output in the correct syntax
Image:How to customize theXPages CKEditor toolbar with a Java bean

I also made a small video to see the the toolbar configuration in action by checking and unchecking options and see the result in a richtextitem after a save.

Comments Disabled

A workaround to install the embedded Sametime 9 on the Mac.

chatFrank van der Linden | e-office 9 December 2013 08:00:00
Today I was installing the embedded Sametime 9 in my Notes clients.
As a Mac user I run several virtual machines with Windows.

The installation on the Windows platform was easy enough. Shutdown the Notes client and run the setup.

However on OSX I did the same by running the pkg file, but ran in a problem.
Image:A workaround to install the embedded Sametime 9 on the Mac.
When I looked in my Windows Virtual Machine at the pkg file, I noticed that inside there was inside the Contents directory an zip file, as marked in the screenshot below.
Image:A workaround to install the embedded Sametime 9 on the Mac.

When I opened the zipfile 'sametime.embedded.addon.macosx.20130911-1333' to my suprise there was an site.xml, so the zipfile was an updatesite.
Image:A workaround to install the embedded Sametime 9 on the Mac.

So I copied the zipfile to my OSX filesystem and did a 'normal' update site install in Mac client by clicking File --> Application --> Install
Image:A workaround to install the embedded Sametime 9 on the Mac.

And point the installer to the previous mentioned zipfile.
After the required restart of the Notes Client, the new embedded Sametime 9 client was installed.
Image:A workaround to install the embedded Sametime 9 on the Mac.

Hope this can help you.
Comments Disabled

Two IBM Champions @ e-office

chatFrank van der Linden | e-office 6 December 2013 19:23:34
I am honored to be re-elected as IBM Champion.
Thanks to all the persons who has nominated me.

But........ for me no suprise, Sasja Beerendonk was also elected as an IBM Champion.
I am very happy for her, she deserved it.

So e-office has now 2 IBM Champions. It shows their commitment to the IBM portfolio.

For all the IBM Champions 2014, see the blog of Oliver Heinz, our new Community Manager,

Image:Two IBM Champions @ e-office
Comments Disabled

What am I doing lately, lots of Java development

chatFrank van der Linden | e-office 26 November 2013 07:51:18
This blog is a little bit quit the last few months.
So what am I doing the last months, a short update

Since my summer holiday, who was a great roadtrip through the USA with family and friends, I am full time at a customer.
And with fulltime I mean fulltime. In the evening or weekend I cannot find times to blog about it.

Notes developement
At the customer I am doing maintenance of long existing Notes apps. It is no rocket science, but I experience some difficulties with Lotusscript.
The last year when I was doing XPages development the programming language was Java. So the Lotusscript syntax was difficult again.
Don't use try and catch ;-)

Java developement
Aside of the maintenance part I was involved the last month in a real Java project.
And when I mean real Java, I mean real Java. No Domino designer

The goal of the project was to make a webapp, who will be deployed on a JBoss server. The WebApp can be called by posting JSON, so there is a servlet part. The webapp will get more information from Oracle, and post all the information to a external service.
The response XML will contain new information, which we store in Oracle and some information is returned to the servlet.
And the whole connection with the external service is secured by passwords and client certificates, stored in a keystore.

The webapp, as said, will be deployed on a JBoss server and is using the Spring Framework.
When I was learning and using the Spring Framework, I was realizing Spring is using beans and can be called in the Java code by the Expression Language.

Unit testing is part of real Java development, so I had also to learn Unit test frameworks to make mockups. At the customer we are using Mockito and Harmcrest. Very usefull to make tests quickly, but it require another way of thinking.

Maven is used to manage the dependencies of the required libraries and off course building and validating the webapp.

The webapp is almost finished, some loose ends, but it already is running smoothly on development server.

At the customer till now there  is no need of XPages. Their strategy is to transform the whole business to Java.
I was able to convince the Notes developers Java is not a disqualification of Notes apps.
When Java is their way, why not make use of XPages to modernize their Notes apps.
We are now planning a presentation and demo for the IT managers, so may be XPages will be introduced shortly when they realize how quick the can modernize their Notes apps.

Aside my daily tasks I am busy with transforming a heavily used Notes agent, who is called from webpages to get data out of Oracle, to a OSGi plugin and Java. The notes agent is experience performance issues, so when the code is placed outside of the Agent Manager the perfomance we improve. And the code will be Java, so approved technology ;-)

So lots to do and learn at my current day job.
Comments Disabled

An XPager’s Guide to Process Server-Side Jobs on Domino

chatFrank van der Linden | e-office 6 September 2013 16:03:58
This week I had the privilege to present together with Serdar Besagmez at ICON UK about DOTS, Jobs and Threads. For everyone who was not able to attend our session or who wants to start with DOTS. Here are the slides
Comments Disabled

Strange behaviour checkbox values in Java

chatFrank van der Linden | e-office 24 June 2013 13:49:08
Currently I am developing a Survey application, which can integrated in a community of IBM Connections.

It is very lean en mean, not very complex.
The most common field types are implented, like a textarea, a radiobutton and of course the checkbox.

Everything is controled by a managed bean, who also do the save of the questions etc.
In my Utilitty class I have a method with one parameter, the component name, to get the submittedValue of that component. So you don't need to bother for in which phase the XPage is.
It will return an Object, so it can be casted to required class if the value(s) should saved, as is the case in my Survey Application

This weekend I discovered a very strange behaviour of the checkbox field if I was trying to get the value(s).

Everything went well if I checked to values in my checkbox, everything saved very fine in a Notes Document.
But.... when I only check one value, the Java code was throwing an error to my OpenLog database
Image:Strange behaviour checkbox values in Java

So I was turning the Java Debugger on, while I was using the IBM Developer 9.
In the debugger I was looking for the returned Object of my Java submittedValue method.

When I checked 2 values, I found as the className 'java.util.Vector' class
Image:Strange behaviour checkbox values in Java

But when I checked only 1 value, I found as the className 'java.util.ArrayList'
Image:Strange behaviour checkbox values in Java

That is very strange to me.

In my Utility Class an extra method, who first collect the Object from the submittedValue method.
Next I do a check of the className.
If it is an ArrayList, I will return the first value of the ArrayList as an Object, otherwise it will return the Vector Object.
Image:Strange behaviour checkbox values in Java

Comments Disabled

Java Logging: specify your own logfile

chatFrank van der Linden | e-office 19 June 2013 09:42:51
Image:Java Logging: specify your own logfile
Last week I was at a customer, to investigate some problems with the DOTS tasklet.
This DOTS tasklet has 2 methods, one to push data from a Notes Database to MS SQL and one to check in MS SQL if there are some specific changes to the corresponding record. If so, the changes are pulled back into the Notes Databse and update the notes document.

Inside the DOTS tasklet I had build in Java Logging, who can turned on by a specify a notes.ini parameter.
All these logging will shown in the Java console of IBM Domino server. So far so good.

At the customer I was not able to start the Java Console. After consulting a co-worker, no result.
After some digging I found a very easy workaround

In my DOTS tasklet I use the build in java.util.logging.Logger functionality. I found out, you can also specify your own log file by adding a FileHandler to the Logger Object

How does this look in code

In my Utility class I have a Logger instance, with the getter and setter.

Image:Java Logging: specify your own logfile

On initialize of my main Java in the DOTS tasklet, I added a few lines of code to specify my own log file.
Image:Java Logging: specify your own logfile

Every time DOTS is loaded on the server, there is a new log file created.
And it solved my problem to see the logging from my DOTS tasklets and the the problem was found and fixed.

Comments Disabled

Generic XPages and HTML Widgets for IBM Connections

chatFrank van der Linden | e-office 11 June 2013 12:39:48
On OpenNTF there is a project called 'XPages for Connections'.
It contains lots of examples how to extend IBM Connections with your own code.

It also includes to Generic Widgets, one for XPages and one for HTML. Goal of these generic Widgets is to deploy it once by the IBM Connections Admin, afterwards you can include your own external code by adding these widgets to a community.

In the provided code all the modes are inside the View Mode and with some javascript the edit fields or the view fields were hidden.

I have implemented a 'true' Edit mode, so you can use the edit link in the drop down menu of the widget.

Image:Generic XPages and HTML Widgets for IBM Connections
The edit mode looks like this, not much difference as the initial version ;-)
Image:Generic XPages and HTML Widgets for IBM Connections

After clicking the Save button, the input will be saved and switch back to the View mode
Image:Generic XPages and HTML Widgets for IBM Connections

There is also support for Fullpage mode. To get it full functional you need to add some extra lines of code to the 'xspScopeClass.js'. I added a file with the extra lines of code in the project.
Even the Generic HTML Widget has a fullpage mode, what till know misssing in the initial code.

You can download and try the code from OpenNTF.
Comments Disabled

XPages quicktip: "Select all documents" in a XPages view

chatFrank van der Linden | e-office 5 June 2013 15:06:00
My colleague, Diana Aue, pointed me last week to a nice little feature to select all the documents in a Viewpanel at once.

It is very easy to achieve

Step 1: On the viewcolumn tick the 'Check box' checkbox
Image:XPages quicktip: "Select all documents" in a XPages view

Step 2: In the view ColumnHeader also thick the checkbox 'Checkbox'
Image:XPages quicktip: "Select all documents" in a XPages view

Step 3: rebuild your Appliction and refresh your XPage with the viewpanel in the browser. At the top of your checkbox column you will see a checkbox, who will select all your entries in the viewpanel.
Image:XPages quicktip: "Select all documents" in a XPages view
I hope this will help you.

Comments Disabled

DOTS and IBM Domino 9: an update

chatFrank van der Linden | e-office 2 April 2013 21:02:20
This weekend I blogged about an issue with DOTS on IBM Domino 9

Today I recieved a blog comment from Charles Ross.
Your presentation on DOTS is very helpful, I found it on Slideshare and appreciate it. 

postscript: Domino 9 actually will support DOTS, if you also load the "OpenSocial Component" server install package. This was not made clear by IBM. The message needs to be clarified. I am using a newly installed instance today, trying to get the JDBC Access driver to run under DOTS. 

So it is good to know if you want to use DOTS then you need the OpenSocial Compenents installed on your Domino server

Comments Disabled