OpenNTF webinars for the open source community

logo

OpenNTF has announced a new initiative called OpenNTF Webinars.

The first webinar takes place tomorrow, Tuesday May 7, and is all about OpenNTF. Join the web meeting and hear Bruce Elgort, Serdar BasegmezJesse Gallagher, Niklas Heidloff, Peter Tanner and me talk about OpenNTF and about what OpenNTF can offer the open source community.

Future webinars will be announced at the webinar landing page.

Using an existing SSL certificate on IBM Domino

A customer of mine had an existing wild card SSL certificate running on IIS. They wanted to use this wild card SSL certificate for their IBM Domino server.

I had all the SSL certificate files available (the trusted root CA, the certificate and the private key). So I quickly found the guide from Gab Davis and did something similar: I created a key ring using the Server Certificate application on the Domino server and installed the trusted root certificate into the key ring. I then opened the key ring file in the gsk5 version of iKeyman (on Windows XP in order for it to run) but ran into the issue that I was unable to import the private key (.pfx).

The solution was to import the private key file in the Certificates program (certmgr.msc) by opening the private key file (and providing the password for the file and selecting the option to mark the key as exportable). Once imported I then exported the same private key as PKCS#12 (.pfx) and I was now able to import the private key as a personal certificate in the gsk5 version of iKeyman.

I saved the updated key file, added it to the IBM Domino server, and HTTPS was then working as expected.

How to force a reload of JS and CSS files when changed

Caching of Javascript and CSS files is great and really improves performance in the browser. But caching also means that changes to the files are not picked up. So how do you get the browser to automatically reload the files when you have updated them because of new requirements, bug fixed etc.?

There are several ways to achieve this. On Apache you can for instance use the modpagespeed module that automatically changes links to resources when the backend resource files change. Other ways include manually adding a version number to your resources (?version=1234), and changing the file name of the resource.

For IBM Domino, IBM XWork Server and XPages you can of course manually change the file name of your resources when content changes (and remember to update references to those files in your code). A better method is to create your own versioning system for your resources based on the idea of adding a unique id to the link to the resources. The following describes this method.

You can add a version number to an application scoped bean and then update that version number whenever you want the browser to reload your resources. Here’s a code snippet for such a version number bean (this is only some of the stuff needed for a bean – see my blog post about creating a bean for more details) :

public class Config implements Serializable {
	private static final long serialVersionUID = 6469339826789980362L;
	private static final String version = "20130410";

	public static String getVersion() {
		return version;
	}
}

Using this bean I can then create links to my Javascript and CSS files like this:

<xp:this.resources>
	<xp:script clientSide="true">
		<xp:this.src><![CDATA[${javascript:"/jsCommon?open&v=" + config.getVersion()}]]></xp:this.src>
	</xp:script>
	<xp:styleSheet>
		<xp:this.href><![CDATA[${javascript:"/custom.css?open&v=" + config.getVersion()}]]></xp:this.href>
	</xp:styleSheet>
</xp:this.resources>

The links then look like this in the browser:

db.nsf/custom.css?open&amp;v=20130410
db.nsf/jsCommon?open&amp;v=20130410

Whenever I want to force a reload, I then update the version string in my Config bean. The resources are then reloaded.

My impressions from IBM Connect 2013

Here are my impressions from the IBM Connect 2013 conference that I attended last week.

Social collaboration
IBM connections 4.5 is coming this March and is improved in many areas such as the new file sync feature.

Customers with a valid IBM Domino entitlement can continue to use IBM Connections Files and Profiles features for free.

Embedded applications in IBM Notes, IBM iNotes (web mail) and IBM Connections activity streams make it possible to act on business applications directly within the context of your mail or your activity stream.

Business applications
The IBM platform for building powerful business web applications for the IBM Collaboration Solutions platform across desktop, tablets and smartphones is XPages running on IBM Domino 9.0 or IBM XWork Server 9.0.

The platform contains many improvements such as including the XPages Extension Library in the default server and client install. XPages Extension LIbrary makes development and deployment of modern business applications faster and more powerful.

The license for IBM XWork Server 9.0 is now $1,000 per 8 databases which further makes the IBM XWork Server a very competitive platform for business web applications.

The IBM Social Business Toolkit (IBM SBT) allows you to integrate the different IBM Collaboration Solutions products. You can as an example use  the SBT to create embedded experiences in XPages that runs in the activity stream of IBM Connections. You can check out the features of IBM SBT in the Social Business Toolkit Playground.

Mail
IBM Domino 9.0, IBM Notes 9.0 and IBM iNotes 9.0 continues to be the center of mail and messaging.

IBM Domino 9.0 makes it easy to migrate from Microsoft Exchange by using the Domino Migration Utility which is part of the 9.0 installation.

IBM Connections Mail makes it possible to use mail directly within the context of IBM Connections.

IBM Notes and IBM Domino
IBM Notes 9.0 Social Edition and IBM Domino 9.0 arrives in March 2013. The roadmap for IBM Domino has detailed plans until 2015 – showing a strong commitment from IBM towards IBM Notes and Domino.

The IBM Notes 9.0 client comes with many improvements in areas such as usability, productivity, and social collaboration – including a browser-based version of IBM Notes (Notes browser plugin) for use in combination with for example iNotes to be able to access applications that do not have a web frontend. IBM Notes 9.0 Social Edition also provides an activity stream for your IBM Connections updates and for embedded experiences for custom-built business applications.

The IBM Domino 9.0 server adds lots of improvements to security (such as the option to run IBM Notes with no need for a local ID file!), OS support (Domino is finally available in a 64-bit version for Linux), maintenance, serviceability and performance.

IBM can help you double check your investment in IBM Notes and Domino. Contact IBM for a free engagement where IBM will analyze your Domino environment and give you facts that you can use when comparing Domino with alternative solutions. IBM uses DNA by Trust Factory for this analysis. This offering is now called IBM Domino DoubleCheck – Powered by Trust Factory.

Cloud
IBM does cloud too (and at a great price) – whether it’s about moving your mail to the cloud, adding social collaboration including collaborative editing of documents and instant messaging or going hybrid (cloud and on-premises servers).

With the before metioned IBM Social Business Toolkit you can extend your on-premises business applications in the cloud.

Chat
The IBM Sametime product family will be enhanced with version 9 which is expected in the second half of 2013.

Final thoughts
Overall it’s a very impressive product family.

Personally, I look forward to continue to build great business applications based on XPages for my customers.

All presentations from the sessions at IBM Connect 2013 are available for registered attendees. Some of the presentations from the sessions are also available publicly. Furthermore, some sessions have been recorded and are available as video including the Opening General Session.

XPages: dynamically updating rich text content in a CKEditor

For the Sherlock Web solution I had a need to be able to update rich text content in a CKEditor with rich text content from backend document templates. These backend document templates can be created and edited with the Lotus Notes client and will in some cases contain rich text content of type Rich Text (and not MIME). I can not change these backend document templates to be stored as MIME, so in order to be able to update the rich text content in a CKEditor, I thought I had to wrestle with conversion of Rich Text to MIME.

I spent a lot of time getting Rich Text to MIME conversion to work in order to add the backend document templates to the rich text content in the CKEditor. I ended up with a clumsy solution that involved saving the XPages backend document in order for the updated content to appear. I had a lot of inspiration from the answers to this Stack Overflow question on appending and prepending text to a rich text field. It worked, but…

A couple of good XPages guys suggested I took a look at using the datasource getValue() and setValue() methods instead. This turned out to be right way to go.

Part of trick is that I use the wrapDocument() function from XSnippet  to get a NotesXspDocument representation of the backend document template. I can then just use getValue(“body”) on that NotesXspDocument followed by getHTML() to get a HTML representation of the content. Brilliant!

The setValue method on the inputRichText control expects MIME and not text, so I use an XPages supplied method that converts from HTML to MIME. This is necessary in order to save the document at all.

So here is the important part of my code that reads content from the target field and updates it with a backend document field contaning Notes Rich Text, and ends up saving it as MIME:

if (templateDoc != null) {
   // Insert contents into existing field
   if (templateDoc.hasItem("body")) {
      var orgValue = document.getValue(bodyFieldName);
      var origValue;
      if (orgValue != null) {
         // The target field already has content
         origValue = ((typeof orgValue == "string")? orgValue : orgValue.getHTML()) + "";
      } else {
         // The target field is empty
         origValue = "";
      }

      var templateField = wrapDocument(templateDoc).getValue("body");
      importPackage(com.ibm.xsp.http);
      document.setValue(bodyFieldName, com.ibm.xsp.http.MimeMultipart.fromHTML(origValue + templateField.getHTML()));
   }
}

I also used an answer from Sven Hasselbach on partially refreshing contents in a CKEditor to put my inputRichText control inside a div control in order to partially refresh the div control when the above logic runs.

Using this method I am completely rid of the need to save the backend document. This just works! 🙂

I have added the part about updating the inputRichText control with MIME to the OpenNTF XSnippets catalog.

Notice: this code snippet does not work with embedded images and attachments.

Update October 2013: Here’s my solution for adding embedded images.

Source Control with Domino Designer 8.5.3 and Git (my talk at DanNotes, November 2012)

The 48th DanNotes conference took place yesterday and today.
I had 2 sessions. My first session was on the subject of XPages for administrators. My second session was on the topic of source control with Domino Designer 8.5.3 and Git. Here is my presention from that session:

Intro to XPages for Administrators (my talk at DanNotes, November 2012)

The 48th DanNotes conference took place yesterday and today. It was 2 days filled with lots of interesting sessions.

I had 2 sessions. My first session was on the subject of XPages for administrators. My second session was on the topic of source control with Domino Designer 8.5.3 and Git.

Here is my presentation from my XPages for Administrators session:

DanNotes 48th conference in November

The DanNotes 48th conference takes place on November 28 and 29. We have lots of interesting sessions and speakers:

I will also be speaking at the conference on the subject of XPages for administrators. The purpose of the session is to introduce administrators to XPages and to lots of useful tips and tools that can improve the use of XPages within their organizations. I am looking forward to this as it is my first speaking engagement at a Lotus user group conference.

If you are interested in joining the conference, then head over to the DanNotes website and register. There is a Facebook eventa LinkedIn event and a Lanyrd event for the conference if you are interested in tracking the conference using social tools.

I hope to see you at the conference 🙂

Update November 21: I will also be speaking about source control with Domino Designer 8.5.3.

I am now an IBM Certified Advanced Application Developer – Lotus Notes and Domino 8.5

I recently passed the LOT-922 certification test (Developing IBM Lotus Domino 8.5.2 Applications: Advanced XPage Design). The test is a multiple choice test with 32 questions and a required passing score of 75%- I scored 90%.

Since I was already an IBM Certified Application Developer on Notes/Domino 8.5 the passing of the test upgraded my certification level to IBM Certified Advanced Application Developer – Lotus Notes and Domino 8.5.

I prepared for the test by reading the test objectives and by practicing using a practice test from CertFX. The test focuses on advanced XPages programming and covers the following areas:

  • Building themes
  • Extending the data sources
  • Optimizing, troubleshooting and localization
  • Using advanced Dojo controls
  • Using Server-side JavaScript
  • Using XPages for mobile user interfaces
  • Working with Java

Unfortunately, the test is already somewhat outdated in its focus on Domino Designer 8.5.2. So be prepared for that if you plan to take the test.

Have a question on XPages?

Stack Overflow is a programming Q&A site for developers with more than 3.5 million questions and even more anwers on every programming language you can image.

On Stack Overflow you can also find questions and answers related to XPages. At the time of writing this blog post there are 597 questions tagged XPages on Stack Overflow with questions and answers coming in every day. If you have a question on XPages then have a look at some of the already asked questions and  their answers and see if that helps you. If not, then go ahead and ask a question.

I will also encourage you to help the community by answering questions and also upvoting great answers and downvoting misleading answers. This will improve the quality of Stack Overflow as a Q&A site for XPages.

XPages.info always lists the latest questions tagged XPages and also the top users for the XPages tag on the Stack Overflow tab.