Using OpenAudit to save my hair… :-)

At the moment I’m doing old school Notes development and needed to implement audit logging the in application. What better and easier to do than to head over to OpenNTF, grab the latest version of OpenAudit and implement it. Given I had some issues with some form aliases which I need to talk to Chad Schelfhout about it took me all of 90 minutes to implement. The component is now seamlessly embedded in the application – nice, quick and easy…

For me the the number one benefit of using open source is to be able to tweak the code to fit the exact problem domain. When creating applications I like to keep all databases for the application in a separate directory and hence group associated databases. When doing this it makes sense that the databases can automatically find the other databases of the application thus eliminating the need for additional configuration. This goes for Julians OpenLog application as well as OpenAudit. I previously implemented this for OpenLog and hence needed to do the same for Open Audit.

It proved very easy. A simple hack of the setAuditDb-method in the “Open Audit”-script library made it possible. Now when specifying “*/” at the start of the path name in the audit configuration (e.g. */OpenAudit.nsf) the method will assume that the database can be found in the same directory as the calling database.

My changes are in bold:

Public Sub setAuditDb(sServer As String, Byval sDatabase As String, sReplicaID As String)
   On Error Goto ErrorHandler
   If ( dbAudit Is Nothing ) Then
      If sServer = "*" Then
         sServer = System.ThisDatabase.Server
      End If
      If Left(sDatabase, 2) = "*/" Then
         'get database relative to current directory
         Dim session As New NotesSession
         Dim current_directory As String
         Dim sep As String
         If Left(session.Platform, 3) = "Win" Then
            sep = ||
         Else
            sep = |/|
         End If
         current_directory = Strleftback(System.ThisDatabase.FilePath, sep)
         sDatabase = current_directory + sep + Right(sDatabase, Len(sDatabase)-2)
      End If

      Set dbAudit = New NotesDatabase( sServer, sDatabase )
      If dbAudit.isopen Then

      Else
         Call dbAudit.OpenByReplicaID( sServer , sReplicaID )
         If dbAudit.isopen Then
         Else
            Set dbAudit = System.ThisDatabase
         End If
      End If
   End If

   Exit Sub

   'Catches any invalid Replica IDs, and will uses the current database then
   errorHandler:
   Set dbAudit = System.ThisDatabase
   Exit Sub
End Sub

Force Notes to use mail.box when multiple mail.boxes are enabled

Although IBM states that putting e-mails directly in the mail.box isn’t a supported option, and Julie Kadashevich has been touting against it for years on Notes.net, apparently there is a setting for the notes.ini ensuring that Domino will continue to use the mail.box even though multiple mail.boxes has been configured. Only goes to show that it doesn’t help trying to enforce not using a hack that developers use because it is just easier…

Can Notes be forced to use mail.box when multiple mail.boxes are enabled via the Lotus Support RSS feed.

Ahhh…. Old school Notes development

For the past two days I have been blessed with doing plain old school Notes application development. Simple forms, views and a couple of LotusScript agents. Nothing fancy. What a nice way to end the week and a welcome change from all those advanced applications we always seem to be working on. Apart from being nice to simply create a finished, polished application in two days it’s also a nice reminder of how much you can do in Notes in such a short time.

Looking forward to Java 5+ support in Notes

I’m currently trying to figure out some replication issues for a customer and to help me diagnose the problems I’m writing a reporting tool. I hope to be able to share the tool shortly as it has proven an invaluable tool to help monitor cluster replication as well.

The tool is written in Eclipse using Java and I wrote it using some of the features of Java 5 such as the enhanced for-loop, autoboxing and generics since it was to be a one time thing running from a console. Well as with all quickies – they turn out to stick around…

Now the customer would like to keep monitoring the replication and by far the easiest way is to schedule it using an agent. This however meant that I had to port the code to Java 1.4.2… ๐Ÿ™ I don’t think you fully appreciate the new features of Java 5 until you have to revert to Java 1.4.2.

For those not in the know in Java 5 you can use an enhanced version of the for-loop to loop all types of java.util.Collection instances and arrays. This means that instead of writing:

public void loop(Collection my_col) {
  Iterator ite=my_col.iterator();
  while (ite.hasNext()) {
    Customer c = (Customer)ite.next();
    c.bill();
  }
}
...or...
public void loop(Collection my_col) {
  for (Iterator ite=my_col.iterator(); ite.hasNext(); ) {
    Customer c = (Customer)ite.next();
    c.bill();
  }
}

you can simply write

public void loop(Collection<Customer> my_col) {
  for (Customer c : my_col) {
    c.bill();
  }
}

Isn’t that nice… Apart from being shorter is much easier to read and understand. Also the added use of generics (i.e. specifying that the passed collection contains Customer objects by using the bracket notation) means no more casting of objects all the time.

Can’t wait for Java 5+ support in Notes/Domino. I wonder what the Java level is in Hannover…

It’s been a busy browser week…


Just upgraded my Firefox to version 2.0 and I’m posting this using it. Total time of upgrading the browser was 35 seconds incl. downloading the installer. Nice! Try that with Internet Explorer… I have a couple of extensions that no longer work since no compatible versions are available:

  • Qute theme (not an issue since I like the new theme)
  • View formatted source
  • Live HTTP Headers

The new version of Firefox adds a number of nice new features such as in-line spellchecking for web-forms.

Update: I had to disable one of my extensions called “Tab Mix”. When the extension is enabled Firefox refuses to load new pages once the configured homepage(s) has been loaded. Disabling the extension solves the problem.

Sametime 7.5 error message for the math wiz among us…

I have configured 100MB as the maximum filesize for file transfers via Sametime 7.5. I was however a little surprised when I saw how Sametime Connect chose to let me know that the file I was trying to send was above quota. Is there really a need to:

  1. show the maximum configured size in bytes!
  2. show the size of the file in scientific notation (1.024E8) and in bytes!

I guess that’s a thing for service pack 1…

Upgraded to IE7

This morning I upgraded my production laptop to Internet Explorer 7. The upgrade was without problems and I haven’t experienced any problems with it. While I’ll continue using Firefox as my preferred browser I still have some e-banking and some customer stuff I need to do through IE (using the nice IE Tab extension for Firefox) so it’s nice to get the security updates etc. that IE7 affords.

I haven’t messed too much around with the IE7 but I’m impressed by what I have seen so far (new favorites, RSS support, tabbed browsing and dedicated search bar). I think it will become a strong competitor to Firefox for the non-geeks among us… ๐Ÿ™‚