Awareness with Notes 6.5.1 against Sametime 7.0 server – broken?

I upgraded the combined Domino/Sametime server at a remote site from Domino 6.5.4/Sametime 6.5.1 to Domino 7.0/Sametime 7.0 the other day. The only issue during the upgrade were some problems with some files being written to the wrong place. Afterwards the install tested out okay. The problem was however that I tested using my Notes 7.x client… 🙁

As mentioned I thought everything was fine – the problems started this morning however. The users (running awareness from Notes 6.5.1 clients) started complaining about Sametime connectivity issues. It appears that Sametime 7.0 isn’t allowing connections from Notes 6.5.1 clients (Sametime error: 0x8000003). The solution so far appears to be upgrading the clients to 6.5.4 (or downgrading the server).

I don’t want to downgrade the server so I have to decide whether to go with Notes 6.5.5 or Notes 7.0 (I’m still having issues with my Notes 7.0.1 install).

Technorati tag(s): ,

Opening a database by replica id with failover – possible at all?

While opening a database using LotusScript using failover is simple, opening the same database using the replica id (also with failover) doesn’t seem so… The goals and premises of the below snippets are:

  • I would like to open a database, with failover, using the replica id
  • I know the database is normally available on server1/Example
  • I do not know which other servers are in cluster with server1/Example

Normally opening a database is as simple as:

Dim db As New NotesDatabase("server1/Example", "maildadminis.nsf")
If db.IsOpen Then
   Msgbox "Database at " + db.Server + "!!" + db.FilePath + " is open..."
Else
   Msgbox "Couldn't open database..."
End If

After replacing one line of code the snippet becomes cluster aware and fails over beautifully to server2/Example if server1/Example is down.

Dim db As New NotesDatabase("", "")
Call db.OpenWithFailover("server1/Example", "maildadminis.nsf")
If db.IsOpen Then
   Msgbox "Database at " + db.Server + "!!" + db.FilePath + " is open..."
Else
   Msgbox "Couldn't open database..."
End If

Moving along I would like this code to work with a replica id instead of a filename. The obvious choice was to try and open the database using the replica id on server1/Example (which would be down), grab the filename and then open the found filename on server1/Example – now using failover.

Dim exists_in_cluster As Boolean
Dim db As New NotesDatabase("", "")
Call db.OpenByReplicaID("server1/Example", "C125711B0076CBF4")
If Not db.IsOpen Then
   'try opening with failover
   exists_in_cluster = db.OpenWithFailover(db.Server, db.Filepath)
End If

If exists_in_cluster Then
   Msgbox "Database at " + db.Server + "!!" + db.FilePath + " is open..."
Else
   Msgbox "Couldn't open database..."
End If

As you might expect this doesn’t work. The database filename isn’t available (after line 3) since the code has no way of translating the replica id to a filename (server1/Example is down – remember).

Another option would be to try and use the NotesDbDirectory class.

Dim dbdir As New NotesDbDirectory("server1/Example")
Dim db As NotesDatabase
Dim path As String
Dim next_db As Boolean

next_db = True

Set db = dbdir.GetFirstDatabase(DATABASE)
While Not (db Is Nothing) And next_db
   If db.ReplicaID = "C125711B0076CBF4" Then
      path = db.FilePath
      next_db = False
   Else
      Set db = dbdir.GetNextDatabase()
   End If
Wend

'try and open the database on server1
Call db.Open("", "")
If Not db.IsOpen Then
   'try and open with failover in cluster
   Set db = New NotesDatabase("", "")
   Call db.OpenWithFailOver("server1/Example", path)
End If

If db.IsOpen Then
   Msgbox "Database at " + db.Server + "!!" + db.FilePath + " is open..."
Else
   Msgbox "Couldn't open database..."
End If

This doesn’t work either because server1/Example is down hence I’m unable to get a directory listing from the server.

So… What is a LotusScript programmer to do? I could give in and use the Domino Cluster Directory to find the filename for a replica id and then go directly to opening the database using failover. I would however really like to avoid using the Cluster Directory which in my book is a system database which is best left alone. Another option is to use the catalog.nsf to do the same thing.

What really bothers me is that the Domino server and/or the Notes client must already have the functionality since it is used when failing the client over. Why not expose it?

Technorati tag(s): ,

Trying to explain inheritance and polymorphism

Disclaimer: Sorry for the boilerplate but I have to state here, that the text is my (Mikkel Heisterberg) property and may not be reproduced without written concent from the author.

As a LotusScript programmer you use objected-oriented programming (OOP) every day whether you realize it or not. The built-in LotusScript classes (NotesSession, NotesDatabase etc.) are classes based on OOP, written by IBM Lotus Software to make it easier for you to program Lotus Notes using abstractions you understand (such as databases, views, documents etc.) instead of dealing with a lot of low-level details.

In OOP parlance a class is a prototype object (it is a template) instructing the computer how to construct an object of a given type. The NotesDocument class creates NotesDocument objects.

OOP is built upon two core concepts:

  • Inheritance
  • Polymorphism

Inheritance means that one class can inherit its functionality (e.g. subs, functions and properties) from a parent class. If you recall the class hierarchy of the built-in LotusScript classes, NotesRichTextItem inherits from the NotesItem class making a NotesRichTextItem have all the same functionality of a NotesItem. Apart from the NotesItem functionality the NotesRichTextItem class also knows how to handle rich text formatting, doc-links etc.

Making NotesRichTextItem inherit from NotesItem means that the developer does not have to repeat all the code of the NotesItem class in the NotesRichTextItem class (it’s inherited).

Additionally inheritance also affords polymorphism. This means, in our NotesItem/NotesRichTextItem discussion, that every place I use a NotesItem In my code I can use a NotesRichTextItem instead since it is guaranteed to have all the same functionality since it is inherited. This means I can write code as follows:

Dim item As NotesItem
Set item = doc.GetFirstItem("MyNormalItem")
Msgbox item.Name
Set item = doc.GetFirstItem("MyRichTextItem")
Msgbox item.Name

This is a very powerful concept though it can take some time to really understand the benefits and be able to fully exploit it. To help clarify let me use an analogy.

Suppose you are out walking in the woods with your friend and his 5 year old son. You are a passionate about birds and know all about the different species, how and where they feed, breed etc. Your friend isn’t knowledgeable about birds – his son even less so. When spotting a specific species of bird, say a Red-tailed hawk, you can tell your friend to look at the hawk. Not being into birds himself your friend doesn’t know all the details about that specific species – he only knows that it is a predatory bird. It still means, however, that even without knowing any specifics about hawks your friend can talk intelligently about it since he knows it’s a predatory bird and it hence inherits many of its traits from predatory birds in general. In a sense he’s thinking “predatory bird” when you say “Red-tailed hawk”. Your friends’ son doesn’t need to distinguish between the different species and hence only sees a “bird”. He does know some general traits about birds though (they lay eggs, they can fly etc.).

Both are using polymorphism since they’re using a more general term (predatory bird / bird) instead of your specific term (Red-tailed hawk). They may now know specifics but they know enough to talk about the bird in decreasing detail.

Returning to our LotusScript example suppose you are writing a function returning a NotesItem (“bird”). You colleague doesn’t need to know that you sometimes return a rich text item (“hawk”) and sometimes a normal item (“bird”) since they can be used interchangeably as long as you only need access to common functionality (“it can fly”, “it lay eggs” etc.)

Thus you are leveraging polymorphism to help shield your colleague from the details he maybe does not need to know.

Show ‘n Tell Thursday: Fixing the sorting in the “Recent Messages” (16 Feb 2006)

If you are like me (and most of the organizations I do consulting for) you like the newest e-mails to be on top in the inbox which is the opposite of the default sorting in the inbox. Previously, Notes 5 and earlier, you had to customize the $Inbox-folder in the mail template to achieve this. Since Notes 6 and the addition of persistant sorting of view/folder columns you don’t need to do this anymore since the users can do it themselves.

This is all well and good but if you use the “My Work” bookmarks page you will see that the newest e-mails are at the bottom of the “Recent Messages” list on the Today-page no matter how to sort your e-mails. This annoyed me for a while until I decided to track down why the sorting of the $Inbox-folder wasn’t honored.

As you can see below I found the offending option and fixed it.

To fix the sorting you need to open the bookmark.nsf database in the Designer and go to the list of forms. Find the form called “ng-today_mail” and open it for editing.

Now select the embedded view in the content pane and bring up the preference box. Go to the second tab and deselect the “Show recent first” option. Save and close the design element.

That should do it.

Technorati tags:

I dare you to further shorten it further… (search syntax part 3)

As pointed out you can really shorten the syntax used when fulltext searching. I thought I had found the Grail of search syntax but Jens let me know it can actually be further shortened so that

(FIELD xxx CONTAINS yyy) OR (FIELD xxx CONTAINS zzz) OR (FIELD xxx CONTAINS www)

becomes

[xxx] = (yyy, zzz, www)

Are we just a short step from cognative computing so the Domino server simply knows what we want to search for?

Dropping the FIELD-keyword from the fulltext search syntax…

As posted the other day (To OR or not to OR…) you can use parenthesis’ to condense the fulltext search string in Notes when OR’ing terms together. Another option I just discovered today is to use square brackets instead of the “FIELD”-keyword.

The search query

FIELD xxx CONTAINS yyy

can therefore also be written as

[xxx] CONTAINS yyy

Combining this with my previous post a verbose search query such as

(FIELD xxx CONTAINS yyy) OR (FIELD xxx CONTAINS zzz) OR (FIELD xxx CONTAINS www)

can therefore be written much shorter as

[xxx] CONTAINS (yyy, zzz, www)

It makes you wonder which other gems are hidden in the fulltext search syntax doesn’t it…

Displaytag 1.1 released

For those of you who do Web applications in Java (using JSPs) make sure to look into displaytag. Displaytag is a set of open source tag libraries for displaying tables in all shapes and forms. I use it (Displaytag 1.0) on a number of projects and can highly recommend it.

Now displaytag 1.1 has been released (changelog / migration guide) so that is something to look into.

Installing Sametime 7 to a Domino server with a “custom” data-directory

After installing Sametime 7 at a customer running Domino 7.0 server I noticed that a data-directory had been created under the binary directory. The customer has mapped the data-directory onto a separate disk-system using a notes.ini setting.

All the files appeared to have been copied to the correct directories below the data-directory also so the damage wasn’t too severe. Only the help help database in the datahelp-database wasn’t copied correctly. Wierd. I have never experienced that before.

In the screenshot below the window in the back is the “real” data-directory and the circled data-directory on the windows in front is the one the Sametime installation created.

To OR or not to OR…

Many of you might know this already but when fulltext searching a Domino database and you need to OR some arguments together you have two choices for the syntax.

The verbose option (which I have been using so far):

(FIELD xxx CONTAINS yyy) OR (FIELD xxx CONTAINS zzz) OR (FIELD xxx CONTAINS www)

or the much less verbose option that achieves the same as the above example (which I learned today from a co-worker):

FIELD xxx CONTAINS (yyy, zzz, www)

He found the syntax using trial-and-error – go figure!! 🙂

P.S.: It would be really interesting if there is a AND shorthand as well…

Some people wait too long before upgrading

Disclaimer: Before starting I just want to point out that I know that there might be legitimate business reasons for not upgrading sooner.

While going through the Lotus developerWorks forum today (using the RSS main topic feed) I saw a post asking a question regarding ODBC before upgrading their server to version 7 later in the year. The versions used in the setup amazes me:

  • Domino server on 4.6.7a
  • OS of Domino server is NT4 SP5
  • Workstations running Notes 4.6.7a (on Windows XP though)

Here we all are discussing Domino/Notes 6.5+ features and can’t wait for Notes 7.5 / Hannover and then someone is still running 4.6!! On Windows NT4!! Amazing.

If it aint broken – don’t fix it!!

If nothing else it just proves that Domino just runs, and runs, and runs, and runs…