Database.getApiPath(): One of the Hidden Gems of OpenNTF Domino API

Home » Database.getApiPath(): One of the Hidden Gems of OpenNTF Domino API

Currently I’m in the process of going through ensuring documentation is available for all methods in OpenNTF Domino API. It’s going to take some time, not least because Javadocs need adding for all lotus.domino methods, as well as the additional methods we’ve added. One of the benefits is I’m finding out about methods that have been available for a long time that are really useful.

One of those is Database.getApiPath().

Although the name may seem unclear for a start, it’s a method that’s very useful in an XPages application, as will immediately become apparent from looking at the implementation:

public String getApiPath() {
if (server_.length() > 0)
return server_ + "!!" + path_;
return path_;
}

It returns a format required for many datasources in XPages myServer!!myDbPath. Many developers may already have a utility method that returns that format for a given database, or may be computing it in each place it’s needed. Now with the API, there is one call that returns the format for you.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top