Sorting a NotesDocumentCollection by multiple field values (Show’n Tell Thursday)

I have been using Joe Littons sortCollection function with success to sort a NotesDocumentCollection by the value in a specific field name. However the function can only sort by one field value and I recently had the requirement to be able to sort by multiple field values.

Max Flodén has created a function that does exactly that: sorts a NotesDocumentCollection by one or more field values. But the code from Max uses Evaluate and @Sort to do the actual sorting – and therefore has problems with quotes in the values and apparently also a problem with large collections (see comments to his post).

So I have combined the best from the two sort functions – the sortValues function from Joe Litton that uses Shell sort and the option to sort by multiple field values from Max Flodén – to get a function that sorts a NotesDocumentCollection by one or more field values.

Update: I have updated the sort function to use a fast and easy way of creating an empty NotesDocumentCollection introduced by Peter von Stöckel.

Update November 21: During testing I found an unnecessary loop in the sortCollection function. I have therefore updated the sort function.

Update December 9, 2011: The function is now available on the new OpenNTF XSnippets site.

getItemValueString and Domino 6.5.5 and 7.0 (Show’n Tell Thursday)

The return value of the Java method getItemValueString has been changed in Lotus Domino 6.5.5, Lotus Domino 7.0 and later releases. Before 6.5.5 the method getItemValueString returns null if the item is empty or if the item does not exist. In 6.5.5, 7.0 and later releases getItemValueString returns the empty string (“”) instead.

I upgraded three servers from 6.5.4 to 6.5.5 and found out the hard way when the application didn’t work as expected. Conditions checking getItemValueString for null values were never met so lots of logic was skipped.

So if you plan to upgrade to 6.5.5 og 7.0 or later then check your Java code for the use of getItemValueString.

Update: I have added this post to the Lotus Notes and Domino Blogging Community Show’n Tell Thursday series.

Lotus Domino and designing for accessibility (Show’n Tell Thursday)

I have just completed a project with the purpose of modifying an existing web site based on Lotus Domino to make it accessible – that is to allow access to people with disabilities. The changes to the web site makes it usable to for example a person with visual disabilities who can use a screen reader such as IBM Home Page Reader to have the web site read and navigate using the keyboard only.

In the US it is required by law that all US federal agencies make their information technology accessible to their employees and customers with disabilities. This is stated in section 508 of the Rehabilitation Act Amendments of 1998.

The Lotus Notes Application Accessibility Checklist is a valuable checklist with specific information on how to make your Lotus Notes client application and Lotus Domino web application compliant with section 508. The following is one of the many checks to go through when designing for accessibility:

  • Associate labels with editable fields on forms using field help or HTML TITLE”.
    This involves applying the <label> tag to all editable fields and relating the tags to the ID of each editable field.

If you want to apply the <label> tag to a field with no associated label text then you can apply the <label> tag around a hidden descriptive label text by surrounding the label text with <>. This creates a descriptive label text for the field that a screen reader can read. The following example shows how to do this:
<label for=”examplefieldID”><example field description></label>

Architectural patterns and Domino (Show’n Tell Thursday)

This is my first contribution to the Lotus Notes and Domino Blogging Community Show’n Tell Thursday series. I will give a high-level introduction to architectural patterns using Patterns for e-business as the specific example of architectural patterns and introduce how Patterns for e-business can be used for Lotus Domino applications.

What are Patterns for e-business?: Patterns for e-business are specific architectural patterns and not design patterns (that can be transformed directly into code such as fundamental, creational, structural, behavioral, and concurrency patterns). From the Patterns for e-business site: “Patterns for e-business are a group of reusable assets that can help speed the process of developing Web-based applications” and “customer requirements are quickly translated through the different levels of Patterns assets to identify a final solution design and product mapping appropriate for the application being developed.

The Patterns for e-business site also describes the process to follow to arrive at a specific architectural pattern for a specific business problem: “For simpler implementations, the Patterns Web site is designed to navigate you through a logical, step by step process to arrive at a previously tested solution design appropriate for use in your e-business application deployment. The steps involved in this process are as follows:

  1. Select a Business pattern to meet the needs of the application you’re developing.
  2. Select an Application pattern that can implement the application’s specific functionality.
  3. Review Runtime patterns and select a pattern that satisfies the system requirements of the solution.
  4. Review Product mappings to determine which products have been successfully used for the Runtime pattern selected in step 3.
  5. Review Guidelines and related links for the Application pattern and product mapping you selected in steps 2 and 4.

Patterns for e-business are generic architectural patterns for e-business implementations and can be used with any type of application servers and middleware – not just IBM products. As it is stated: “Note also that, where IBM products are listed as part of pattern implementations, IBM products are not the only solution option.

The pattern implementations include Self-Service and Collaboration patterns implementations using Domino and Websphere which makes this interesting for Domino developers, architects and administrators. The specific Domino and Websphere product mappings shows how to implement the different patterns such as putting a load balancer and a caching proxy (reverse proxy) in front of several back end Domino servers but also how to combine Lotus Domino with Websphere, Sametime, external directory servers and relational database servers.

Several redbooks and other resources exist on the subject of Patterns for e-business.