BLUG 2013 recap

BLUG 2013 took place from March, 21 – 22 2013 in Leuven , Belgium. The Faculty Club was a wonderful venue and also the conference hotel was a great place to stay during the conference.

I attended BLUG for the first time as a vendor and speaker after choosing to work at BCC since November 2012. So I had to be at our booth most of the time, but thanks to Fathima Gany ( BCC Sales ) and Sarah Steffen ( BCC Development ) I also had the chance to attend some sessions.


Scott Souder and Louis Richardson presented at the OGS. I only saw a small part of the session, but according to other attendees it was great. .

During the 2 days, I met some people, I only knew only virtually. It was fantastic, to meet you in person, guys ( and gals ) .

The usual suspect gathered together on wednesday evening for the welcome reception. A lot of different beer was served along with some excellent food. Lesson learnt: Do not drink too many different beers. Headache guaranteed.

Thursday evening I had to present at SpeedSponsoring. It was the first time for me and to be honest, I was a bit scared all over the day. But after the first round I had fun doing the presentation. OK, I managed to do my 3 minutes take in only 2 minutes in the first round, but that was a good practice, as Paul Mooney decreased the presentation time from 3 to 2 minutes during the one hour of screaming and shouting in the sponsors area.

On friday I presented  “Life in the fast lane: Full speed XPages”. With the help of Matthew Fyleman from We4IT it was a great presentation. Matthew and I never presented together before and we only ran thru the slides once on friday, just a couple of hours before the presentation.

I got some great feedback after the session. Also there was a tweet saying that the presentation has helped to identify a bottleneck in an application.


During the closing session the raffle took place and as always many valuable stuff was given to the attendees ( iPad Mini, Apple TV, Books, Ytria Software licenses, TLCC course licenses and more )


The number of attendees at the 5th BLUG conference was about 325 ( if I recall correctly ). This is a huge success for the organizers. Congratulations.


Next BLUG ( now called the BENELUX Notes User Group ) will be in Breda, The Netherlands. Watch for details.

Convert @Created to Unix Timestamp using @formula

In a multi-language enabled application I’m using JSON from a view as a datasource for a jqGrid in an XPage. To convert the date-time in the JSON, I need the date/time value a UNIX timestamp.

It’s easy in LS, but I do not want to change the programming of the application, to calculate the timestamp on document creation and store the value in an item on the document.

To convert the @created date into an UNIX timestamp I use the following @formula:

@ToNumber(@Hour(@Created))*3600 + 
@ToNumber(@Minute(@Created)) * 60 + 
((@BusinessDays(@Date(1970;1;1);@Created) - 1 )*86400) + _seconds

Update: Well, the formula is nice and does what it should. But there is a much easier way to achieve the aim.

@Created -  @Date(1970;1;1;0;0;0) - 1

gives exactly the same result …

Get all available language resource files for language selection

Assume you have built a multi language XPage application and want to add a language switcher to the application. The content for the selector should be build automatically when you add a new language resource to the application.

I store my language resource files in the files section of Domino Designer. Each file has a file suffix of “”


To get a list of all files with this specific suffix I put together some Java. The code builds a NoteCollection of MiscFormatElements and then does a serach within the collection to return only elements that match the search criteria.

package de.eknori;

import java.util.Vector;

import javax.faces.context.FacesContext;

import lotus.domino.Database;
import lotus.domino.Document;
import lotus.domino.NoteCollection;
import lotus.domino.NotesException;

public class Design {
	private static final String SUFFIX_PROPERTY = "";
	private static final String EMPTY_STRING = "";
	private static final String FIELD_TITLE = "$TITLE";

	public static Vector getLangFiles() throws NotesException {
		Vector vec = new Vector();
		try {
			FacesContext fc = FacesContext.getCurrentInstance();
			Database db = (Database) fc.getApplication().getVariableResolver()
			.resolveVariable(fc, "database");
			NoteCollection nc = null;
			nc = db.createNoteCollection(false);
			nc.setSelectionFormula("@Contains(" + FIELD_TITLE + ";\""
					+ SUFFIX_PROPERTY + "\")");
			String nid = EMPTY_STRING;
			nid = nc.getFirstNoteID();
			Document doc = null;
			while (!(EMPTY_STRING.equals(nid))) {
				doc = db.getDocumentByID(nid);
				nid = nc.getNextNoteID(nid);
		} catch (Exception e) {

		return vec;

In your XPage, you can then simply make a call to the method from a combobox

< ?xml version="1.0" encoding="UTF-8"?>



And here is the result


And with just a little tweak you can use the code to get a list of available themes and build a theme switcher …  Happy coding!

XSnippets – DBColumn / DBLookup (Java) & XPages Toolbox

Ferry Kranenburg posted a new XSnippet on OpenNTF. “Pure Java version of DbLookup & DbColumn, with cache, sort and unique” . I use similar code in my projects and thougt that it would be a great idea to do a performance test. I’m using XPages Toolbox to profile the backend code. Here is the result for a DBColumn call on 18044 documents in a view

Elapsed time: 1622 msec
Methods profiled: 9
Total measured time: 1168 msec


Looking at the profiled classes, you can see that the ViewNavigator.getFirst() method is obviously invoked 2 time, but the code itself only contains 1 call to this method. Not sure, if this is due to a bug in XPagesToolbox or a bug in the ViewNavigator class. Anyone aware of this issue ?


[Connect-O-Sphere] Yes, I’m still alive

According to some tweets, people seem to be seriously concerned about me still being alive while I’m attending my first LotusSphere ever.


As far as I can say, I’m safe and sound. Although I’m not sure if my feet share this opinion.


Thanks to all who are eager to help a LotusSphere rookie to not get lost at the conference.

VMWARE: Converting Multiple VMDK files into one

VMware supports both growable and pre-allocated virtual disks. In addition, the disks can be specified to be contained in a single file, or divided into multiple 2GB files

I recently had to work on some older VMs and thought it would be a good idea to do some housekeeping. Renaming the machines and vmdk files to a more meaningful name and also consolidating multiple 2GB file into a single one.

All these tasks can be done in one single step using the VMware Disk Management Tool

The VMware Disk Management Tool is a command line tool which is installed by default with VMware Workstation or Server.
The executable file is named vmware-vdiskmanager and is located in the VMWare program directory on Windows hosts, and /usr/bin on Linux systems.

To convert multiple VMDKs into a single file, I used the following command (Windows 2000 Server-cl3.vmdk is the name of the first VMDK file – i.e. the one attached to the VM):

vmware-vdiskmanager -r “Windows 2000 Server-cl4.vmdk” -t 0 win2003-32.vmdk

The above operation takes a while, but not too long. It shows its progress as it completes.

Next, you can configure your VM to use the new VMDK file and delete the obsolete files from the disk.

Convert VirtualBox (vdi) hard drive image to VMWare (vmdk) format

I recently installed VMWare Workstation 9 on my laptop. I also have VMWare Server 2.0.2 running. Using virtual machines from VMWare Server on the workstaion is not a problem. But I have a couple of virtual machines that have been created with VirtualBox.

The vdi files are not compatible with VMWare Workstation or Server.

Fortunately, the VBoxManage utility of VirtualBox can actually convert a VirtualBox vdi image to the vmdk format used by VMWare. It can do it rather easily, as well.

The command format is:

VBoxManage clonehd

[–format VDI|VMDK|VHD|RAW|]
[–variant Standard,Fixed,Split2G,Stream,ESX]


Example (Windows):

C:\VirtualBox\VBoxManage.exe clonehd “vb_Win8_64.vdi” win8_64.vmdk  –format vmdk –variant standard

Successful run gets this output:

Next, open VMWare and select Create a new virtual machine

  • Select “I will install the operating system later”
  • Make your OS selection about the OS that’s currently on the vmdk you will be using. (The guest OS, not the host OS).
  • Later on, you will have the option to use an existing vmdk image as your virtual hard drive. Do so.

You should now be able to finish setup and boot your converted disk image.

Windows 8 – Get The Start Button Back

When users found out that Microsoft’s next version of Windows wouldn’t have a Start button, they panicked.
Replaced in Windows 8 by the user interface formerly known as “Metro,” that tiny button is apparently so important to long-time Windows users that they can’t imagine life without it.
Rest easy, neophobes — adding the Start button back to Windows 8 is easy and free.

Windows developer Ivo Beltchev has created a utility called Classic Shell . The utility allows users to bring back the classic Windows Start menu layout and customize it in a number of ways.

In addition to getting the Start Button back, ClassicShell allows you to directly display the desktop instead of the still uncommon start page.


UPDATE: ClassicShell also works on Windows Server 2012



IBM XPages Performance Masterclass

From October, 17-18th, XPages Performance MasterClass took place at the IBM Labs in Dublin, Ireland. The event was sponsored by IBM; only transportation and hotel had to be paid by attendees.

40+ people from all over Europe ( Germany, Austria, Italy, Greece, Sweden, Czech Republic … ) gathered together for all things XPages Performance optimization.

Maire Kehoe, Martin Donnelly and Tony McGuckin did an excellent job sharing their knowledge. They provided  4 deep dive sessions each of the two days,  covering all aspects of the JSF lifecycle, partial refresh / exectution mode, design patterns and Java debugging, just to name a few of many topics.

Eamon Muldoon from IBM Ireland said, that his team setup this masterclass on top of their daily job. Aside from preparing the next major release launch and working on PMRs and also new stuff, they prepared all the content, slides and samples to cover almost 16 hours.

All I can say after 2 days packed with first class information is “Thank You!!”.  It was great to have the opportunity to attend this event.



Access AVM FRITZ!Box 7390 PhoneCall In/Out Information from Java

AVM Fritz!Box provides a phone call monitor. To access the information, you have to activate Port 1012 in the Box. The setting is not available from the GUI, but you can use your phone to switch the feature on and off.

Dial #96*5* to enable the call monitor #96*5* to disable ).

To access the information via telnet for example, you also have to enable telnetd in your FRITZ!Box . Dial #96*7* to enable the telnetd #96*8* to disable ).

Here is some simple code that monitors the phone call manager via telnet on port 1012

package de.eknori.test;


public class CallMonitor {
	public static void main(String[] argv) {
		new CallMonitor().getCall("", 1012);

	private void getCall(String host, int portNum) {

		System.out.println("Host " + host + "; port " + portNum);
		try {
			Socket s = new Socket(host, portNum);
			new Pipe(s.getInputStream(), System.out).start();
			new Pipe(, s.getOutputStream()).start();
		} catch (IOException e) {
		System.out.println("Connected OK");

	 * This class handles one half of a full-duplex connection.
	class Pipe extends Thread {
		BufferedReader is;
		PrintStream os;
		Pipe(InputStream is, OutputStream os) { = new BufferedReader(new InputStreamReader(is));
			this.os = new PrintStream(os);


When you run the code, you will see something like this as an output

* 14.10.12 10:56:19;CALL;1;10;XXX5670;XXX8506;SIP0;
* 14.10.12 10:56:19;RING;2;02104XXX5670;XXX8506;SIP2;
* 14.10.12 10:56:21;DISCONNECT;2;0;
* 14.10.12 10:56:21;CONNECT;1;10;XXX8506;
* 14.10.12 10:56:24;DISCONNECT;1;4;
* 14.10.12 10:56:21;RING;0;02104XXX5670;XXX8506;SIP2;
* 14.10.12 10:56:21;CONNECT;0;5;02104XXX5670;
* 14.10.12 10:56:24;DISCONNECT;0;4;


I have tested with AVM Fritz!Box 7390

How To Use Custom Fonts On Your XPage With CSS – now with IE

Although I wrote in a previous article, that I would not give a shit about IE in my personal life any longer, I could not resist to find out how custom fonts can be used in the browser wannabe and how to convert an existing ttf font to something that the M$ crap could possibly handle.

M$ IE cannot handle a TTF file; it needs an EOT file instead. If your font does not come with different files for IE and modern browsers, you have to convert it. The easiest way I found to convert an existing TTF file is using a service on the web. I tried a few but had the best results.

Not only the font is converted into an EOT file ( plus SVG and WOFF ) , also the CSS is generated for you.

Just upload your TTF file and get the converted files in return.

/* Generated by Font Squirrel ( on September 30, 2012 */

@font-face {
font-family: "myFont";
src: url("accid___-webfont.eot");
src: url("accid___-webfont.eot?#iefix") format("embedded-opentype"),
url("accid___-webfont.woff") format("woff"),
url("accid___-webfont.ttf") format("truetype"),
url("accid___-webfont.svg#myFont") format("svg");
font-weight: normal;
font-style: normal;

font-family: myFont;
font-size: 3em;

I have tested with IE9 and it works. Not sure, if it will work in IE8 and less. It’s up to you to test and leave a reply …

How To Use Custom Fonts On Your XPage With CSS

With CSS (Cascading Style Sheets) you can use custom fonts on your Xpage. Normally you only see the fonts that are already installed on your computer. So if you use a font that is not installed on your XPage user’s computer then his or her browser will show some other font that exists on the computer. That’s why when you are defining a font for an element (such as <p>) you often specify multiple fonts so that if your preferred font is not available your CSS file should use the available alternatives.

Conventional way of using custom fonts for headings and logos etc. is creating the text in a graphic editor and then using the image file. From the perspective of SEO this is not appropriate; you must use text as much as possible.

Now there is a way around in CSS that lets you use custom fonts, downloadable fonts on your XPage. You can download the font of your preference, let’s say my_font.ttf, and import it as a file resource into your application.

Then from within your CSS file (or wherever you are defining your styles) you have to refer to that font in the following manner:

@font-face {
font-family: my_font;
src: url("accid___.ttf");

After that you can use it just like a normal CSS declaration. Here is en example for an xc:label control:

font-family: my_font; /* no .ttf */
font-size: 2em;

This method works in all modern browsers, except IE ( no surprise is that ).
This is because Internet Explorer does not recognize TTF / OTF, it uses a proprietary format called EOT. To make your @font-face declaration works with IE as well, you must prepare two font files, one in TTF / OTF format and the other one in EOT format. To learn more about EOT, and how to convert TTF / OTF to EOT, please refer to this article.

I have decided not to give a shit about IE when blogging.

Display Stackoverflow entries on an XPage

With just a few lines of code, you can display entries from Stackoverflow on an XPage in your custom application. I’ve used  the StackUnderflow library, that is available from here.

StackUnderflow.js is a lightweight JavaScript library that makes retrieving and rendering question summary information from StackExchange sites simple. It supports retrieving questions by Question ID, tags, keyword, and even by Google search results to enable you to search the body of questions, even though the StackExchange API does not support it (currently limited to 8 results).

Here is the code that is needed to render the output


Wrap The Items In A xe:djextListTextBox

We use xe:djextListTextBox in our application to display and edit lists of keywords and we ran into the problem, that the list does not automatically breaks to a new line when the overall length exceeds the table cell the xe:djextListTextBox is placed into.

But with only a little CSS magic, posted by Martin Jinoch on StackOverflow, the issue is no longer an issue.

Simply wrap the xe:djextListTextBox with an div and assign a styleclass to the div. (i.e. myInlineList )

In your CSS file have an entry

.myInlineList span span {

When you now relod the page, the keywords now automatically break and are displayed in a new line.

IBM Connections, a cornerstone of IBM’s social platform

Available on premises, in the cloud, and on a broad range of mobile devices, IBM Connections integrates activity streams, calendaring, wikis, blogs, a new email capability, and more, and flags relevant data for action. It allows for instant collaboration with one simple click and the ability to build social, secure communities both inside and outside the organization to increase customer loyalty and speed business results. The new Connections mail capability provides simplified access to email within the context of the social networking environment.

Now, organizations can integrate and analyze massive amounts of data generated from people, devices and sensors and more easily align these insights to business processes to make faster, more accurate business decisions. By gaining deeper insights in customer and market trends and employees’ sentiment, businesses can uncover critical patterns to not only react swiftly to market shifts, but predict the effect of future actions.

“I am thoroughly enjoying the ability to engage with a variety of employees through micro-blogging,” said Patrick Thomas, CEO, Bayer MaterialScience. “I can get information out quickly, but even more importantly I can encourage two way communication and stimulate an open communication culture by breaking through barriers.”

The new capabilities empower employees from every line of business, such as marketing, human resources and development to gain actionable insight into the information being generated in their social networks.

For example, the Connections landing page features a single location that allows users to view and interact with content from any third party solution through a social interface, right alongside their company’s content, including email and calendar. The embedded experience of the news feed, also known as an activity stream, allows employees from any department inside an organization to explore structured and unstructured data such as Twitter feeds, Facebook posts, weather data, videos, log files, SAP applications, electronically sign documents, and quickly act on the data as part of their everyday work experience.

To learn more about IBM’s social business initiative, participate in a simulcast on September 13, 2012 at  1 PM ET at or sign-up to attend IBM’s Connect conference (t.c.f.k.a. Lotusphere ) in January 2013.

For more information, please visit

Use RegExp with JavaScript split()

Here is a short snippet the came out of a forum post here.

I you have a string that, for whatever reason, is concatenated using different delimiters, you can use regexp with javascript split() to build an array of single values.

var s = "one#two#three~four~five";


The output will be an array containing 5 elements

Simple example of Windows native library declaration and usage in XPages

I would like to share a simple sample on how to access (Windows) DLLs from Java / XPages.

Java’s JVM allows you to do many smart things but sometimes you may be forced to directly use external library or writing code in pure java would be very time-consuming comparing it with something more low-leveled.

So, how does it work? The only thing you have to do is to download and import JNA (Java Native Access) to your project and write a simple class.

package de.eknori.c;

import com.sun.jna.Library;
import com.sun.jna.Native;

public class Beeper {
	private Kernel32 lib;

	public interface Kernel32 extends Library {
		// FREQUENCY is expressed in hertz and ranges from 37 to 32767
		// DURATION is expressed in milliseconds
		public boolean Beep(int FREQUENCY, int DURATION);

		public void Sleep(int DURATION);

	public Beeper() {
		lib = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class);

	public void test() {
		lib.Beep(500, 500);
		lib.Beep(1000, 500);

From your XPage you can now make a call to the class in a button

var beep:de.eknori.c.Beeper = new de.eknori.c.Beeper();

For a simple beep, this solution might be a bit of an overkill; but imagine what else you can do with it. Accessing elements in an application using the C-API for example. 🙂

Setting Page Generation Properties to HTML5

I’m playing around with bootstrap. Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. To set the doctype in your XPages project do the following:

  • Open Package Explorer
  • Open under WebContent -> WEB-IN
  • Navigate to the Page Generation Properties tab
  • Set the value in HTML doctype
  • Save the changes