IBM Notes and Domino 9.0 Social Edition beta now available

Ed Brill just announced that the IBM Notes and Domino 9.0 Social Edition betas are now available for download. The beta program is open for everyone so go ahead and sign up and try the new IBM Notes 9.0 🙂 Use the 9.0 beta forum for feedback.

Here’s the beautiful IBM Notes 9.0 (Mac) client:
IBM Notes 9

I have upgraded my developer environment to 9.0 and look forward to lots of improvements to IBM Domino Designer.

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:

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.

DanNotes 47th conference: links to presentations

The DanNotes 47th conference takes place today and tomorrow. Here are links to presentations available online:

DanNotes logo

Presentation: Create an app in 1 hour (almost) with XPages Extension Library

I gave this presentation along with a live coding demo at the monthly NotesNet.dk meeting on April 19, 2012. The presentation covers elements of the XPages Extension Library that you can use to rapidly convert an existing Lotus Notes client application to a web application.

The sample database is available for download and uses a custom forum database as “backend”. You can easily modify the code to use another backend database.

XPages: 2 very easy performance optimization tricks

Here are 2 very easy ways to optimize performance for your XPages applications:

  • Enable “Use runtime optimized JavaScript and CSS resources” to have your JS and CSS files combined into fewer files. This reduces the number of HTTP requests that the browser has to make against your server and application and thereby makes the site load much faster.
  • Select “GZip” as the compression method to have your Domino server compress files and images. This reduces the amount of data that the browser has to retrieve from your server and application which again makes your application load much faster

Both of these settings are in Application Properties on the XPages tab.

Once you have done those two, you now have more time to go into detailed performance optimization and look at optimizing backend code, server settings, and much more. Tim Tripcony has answered a question in the XPages Development forum about performance optimization that has a lot of details about performance optimization.

Learning XPages: available resources

I often hear people new to XPages ask: what resources are available if you want to learn XPages?

The following lists (some of the) available resources if you want to learn XPages.

IBM provided resources

Books

Free community provided resources

  • XPages.info: lots of links to useful resources
  • XPageswiki.com
  • XPages.TV:  Notes In 9 videos, 2 hours of XPages jumpstart, and a introduction to Java for XPages develovers series
  • XPagescheatsheet.com: home of the original XPages cheatsheet and the new Social Tools cheatsheet

Free courses

Paid courses

Community provided support

Blogs
  • There are lots of blogs that cover XPages. Keep an eye on the XPages.info/news section that is updated daily with links to blog entries, wiki articles, OpenNTF projects and more.
Twitter
Happy XPages learning!