Discovering Notes 8: VMWare, Notes 8 and database corruption


For quite some time I have been a strong proponent of using VMWare for customer development. I used to have 2 or 3 Notes clients in various versions installed on my laptop with a directory pointer per customer linked into my main data directory. A little over a year ago I switched to using VMWare Workstation instead for all development. This setup worked out great for me.

Some customers had their own VMWare images and some customers shared a VMWare image. This also worked out great. Once Notes 8 was released I moved my Notes 7.0.2 installation into a VMWare image with a directory pointer to my “external” Notes data directory. With “external” I mean outside the VMWare image OS. This works out great when running Notes 7.0.2 or earlier outside the VMWare image but once I upgraded to Notes 8 the problems started. I started experiencing database corruption issues of my mail database which I of cause access from both inside and outside VMWare.

After diagnosing these issues I came the conclusion that this kind of setup just isn’t supported with Notes 8 part of the mix. Therefore I have split my shared Notes data directory into two parts; a customer part which is accessible from inside VMWare and a production part which is only accessible from Notes 8 outside VMWare. This has solved the database corruption issues.

While sharing directories linked in with directory pointers between running Notes instances has probably never been officially supported it used to work and now doesn’t. I just thought I would share.

Afterwards I have changed my setup again and moved completely to VMWare for development. In the new setup I have one or two VMWare images per customer (one for Notes and one for Domino) on an external USB drive with the correct Notes/Domino versions installed. This works great and has really simplified development and testing for customers.

Discovering Notes 8: More default browser woes?


As blogged previously there are more than one way to set the default browser for your Notes 8 Standard installation. For some reason the preferences didn’t take effect on my Microsoft Vista install so web links continued to open in IE much to my dismay. I finally found the solution to the issue with a little help from the trusted Notes 8 forum on developerWorks. Below is an excerpt from the solution.

“Hit windows button (start button), select “Default programs”, “Set program access and computer defaults”. Expand the “Custom” section, and set Firefox as default web browser and Lotus Notes as default e-mail program. If you reopen it, it will seem like your changes was not saved, but apparently they are.”

Thanks to Stein Sebak for posting the solution.

Discovering Notes 8: Vista compatible?


I have been running Notes 8 Standard under Windows Vista (with full Aero UI) for a little under a week now. Besides having to get used to the Vista UI and look’n’feel I’m having issues with one dialog that keeps popping up. I have inserted a screenshot of the dialog below. It seems like it occurs when running Java agents in Domino Designer or when doing meeting invites although it isn’t consistent. Unfortunately it doesn’t switch back to Aero on its own as it says…

Anyone experiencing this as well?

Discovering Notes 8: How is your default browser configured?


It appears there are two ways of specifying the default browser (the one to use then clicking a link in an e-mail) in Notes 8. One is on the “Internet Browser” tab of the location document and the other is on the “Web Browser” preferences page (see File/Preferences). The actual browser used to open links is the one configured in the preference pages.

I found this strange so I digged around a little and I found the cause. The problem was that my personal name and address book wasn’t upgraded to R8 design when my client was updated. This in turn meant that the location document form didn’t show the help text describing this. After replacing my design I found the problem and could correct it. So when moving your users to Notes 8 be sure to upgrade the design of their personal address book.

Good thing it’s Friday!

Discovering Notes 8: Showing dialogboxes from SWT in Notes 8


One of the big changes in Notes 8 is the move to a Java threading model which means that showing a messagebox is not something you can *just* do. This has implications for you if you’re developing (or thinking of developing) UI components in Java for Notes 8. These UI components (e.g. sidebar contributions) are developed in SWT and hence follow the SWT way of doing it.

Please note: Although the following may seem (overly) complex nothing of it is new when discussion UI development. The only difference between Notes 7.x and earlier and Notes 8 is that some of these aspects now rears their ugly head.

Now lets get to it…

Since only one thread can access the display and hence draw on the screen at any one time, requests to the display needs to be serialized. In Notes 8 and SWT this is done using the Eclipse Job API. This is done by encapsulating a piece of functionality and asking the platform (the “scheduler”) to execute it. The scheduler adds the job to a queue and and execute it once it is its turn. This may not happen right away though it mostly will.

To display stuff in the UI you use an UIJob instance as shown below. This example simply shows a messagebox with some static content.

new UIJob("Rectangle") {
   public IStatus runInUIThread(IProgressMonitor arg0) {
      MessageDialog.openInformation(
         this.getDisplay().getActiveShell(),
         "HelloWorld", "Hello SWT Job API World");
      return Status.OK_STATUS;
   }
}.schedule();

The second example will show you how to display some Notes data. Since access to the Notes API must be run in a specially initialized thread (remember NotesThread.sinitThread?) you have two options:

  • Manually initialize a thread using NotesThread / extend NotesThread.
  • Take the easy route and use NotesJob.

Using NotesJob is by far the easiest and will handle all the dirty details for you. When you do this you can also use the NotesPlatform class which is an (undocumented) way of getting a lotus.domino.Session instance inside Notes 8.

Using NotesJob will take care of getting at the data – to display it in the UI you still need an UIJob which is why I use two job instances in the example below. Since you can only access final variables from within inner classes I mark the name variable as final.

new NotesJob("Show messagebox") {
   protected IStatus runInNotesThread(IProgressMonitor arg0) throws NotesException {
      Session session = NotesPlatform.getInstance().getSession();
      Name n = session.createName(session.getUserName());
      final String name = n.getAbbreviated();
      new UIJob("My UI job") {
         public IStatus runInUIThread(IProgressMonitor arg0) {
            MessageDialog.openInformation(
               this.getDisplay().getActiveShell(),
               "Username", "Username: " + name);
            return Status.OK_STATUS;
         }
      }.schedule();
      return Status.OK_STATUS;
   }
}.schedule();

I hope this helps you.

Discovering Notes 8: More nice Notes 8 $fields


As posted on friday there is a nice-to-know field in Notes 8 you can use to enable/prevent automatic loading of images in HTML newsletters. This morning I saw two new fields that seems to have AppDev applicability:

  • $AttBytesTruncated: Holds the amount of (binary) data truncated from the document and hence the amount of data needed to be fetched in order for the document to be fully fetched. This is a number field.
  • $Abstract: Holds an abstract in plain text of the Body richtext field. This is a text field.

Both seems to be new (at least I haven’t seen them before) and set on by the Notes 8 client since I’m currently receiving my e-mail through a Domino 7.0.2 server (I know it’s horrible to hear) and they are not visible in the fields list until I replicate the database to my client.

Could be that it is simply because I truncate received e-mails but I don’t think so.

Discovering Notes 8: Automatic loading of images in HTML newsletters


In Notes 8 there is this nice new and improved display of HTML newsletters. An additional nice feature is that images are prevented from loading to combat SPAM bots that harvest e-mail addresses by using dynamic image URLs. See below for a screenshot of how a HTML newsletter looks before images are allowed.

It would however be nice if I could setup a list of e-mail addresses where image loading was enabled by default such as for my favorite HTML newsletters. Well it isn’t available out of the box with Notes 8 but you could easily write it yourself as an agent that processes incoming e-mail.

The agent only needs to set a text field called $DelayedImagesOK to the value “ok” (no quotes) for the e-mails where image loading should be enabled upfront.

Happy Friday!

Discovering Notes 8: Web service enabled script libraries


In a recent edition of the LotusUsergroup.org newsletter Julian listed some of the new AppDev features of Notes 8. Among them were the new web service enabled script libraries.

Basically what you do is simply pointing a script library to a WSDL file and some stub code is automatically generated for you. Then when you use the script library from agents etc. the methods you call will automatically be forwarded to the actual web service without you worrying about SOAP, HTTP etc. It actually is that easy!

To test it out I found an example of a public stock quote web service (http://www.webservicex.net/stockquote.asmx?WSDL) and used that for an example.

Start by creating a new empty LotusScript script library. Now click the “WSDL…” button at the bottom of Domino Designer and simply select “Import WSDL”. Now paste the above URL into the filename field and click Open (it’s really nice that you can actually simply paste the WSDL URL into the dialog instead of first saving the WSDL to a local file). Now your script library should look like this:

%INCLUDE "lsxsd.lss"
Const n4 = "http://www.webserviceX.NET/"
Class StockQuoteSoap_n4 As PortTypeBase

  Sub NEW
    Call Service.Initialize ("HttpWwwWebserviceXNETStockQuote", _
    "StockQuote.StockQuoteSoap", _
    "http://www.webservicex.net/stockquote.asmx", _
    "StockQuoteSoap_n4")

  End Sub

  Function GetQuote(symbol As XSD_STRING) As XSD_STRING
    Set GetQuote = Service.Invoke("GetQuote", symbol)
  End Function

End Class

Now save the script library and call it “Stock quote”.

Create a LotusScript agent and in Options import the script library (Use “Stock quote”). Now we want to call the script library which is done using code like this:

Sub Initialize
  Dim ws As New NotesUIWorkspace
  Dim sq As New StockQuoteSoap_n4()
  Dim symbol As String
  Dim symbols(2) As String
  symbols(0) = "IBM"
  symbols(1) = "JAVA"
  symbols(2) = "AAPL"
  symbol = ws.Prompt(4, "Stock symbol", _
    "Select stock for quote...", "", symbols)
  If symbol = "" Then
    Exit Sub
  Else
    Print "Using symbol: " + symbol
  End If

  Dim sh As New XSD_STRING()
  Call sh.setValueFromString(symbol)
  Set sh = sq.GetQuote(sh)
  Msgbox sh.getValueAsString()
End Sub

Now when you run the agent and you select a stock symbol it will actually automatically go out to the web service, get the quote and return it to the caller. All this with the code I just showed you. Nice!

Stand by for a post on the nitty, gritty details…

Discovering Notes 8: More spill-over from Eclipse


What’s going on? Well that’s the question… Did you notice the animated gif in the lower-right corner of your Notes 8 client that looks like this:

It is the new progress tab and by clicking on the orange ball you can get the progress bar to display in full screen mode like shown below. The cool thing is that you can see all the different operations that may be occurring at any one time. In this example below I’m only replicating but you can see that I just finished copying a database as well. In previous releases you only had the one progress bar at the bottom which meant that you couldn’t see simultaneous operations.

If you click “Show” in the upper right corner of the tab, select Preference there’s even more fun to be had… 🙂