Show ‘n Tell Thursday: Migrating Outlook Express e-mail to Lotus Notes (2 Mar 2006)

Introduction
Please note that this post does not address the complexities of migrating entire Microsoft Exchange installations. For this there are IBM tools as well as some 3rd party solutions that I really prefer. After reading through the below example you’ll see that this approach really doesn’t work for larger migrations but might work well for migrating individual users coming into your organization with an existing Outlook Express installation.

Migrate contacts from the address book by exporting them as vCards and then import these into the personal NAB of the user.

Requirements
Well for starters make sure to install the migration tools as part of the Notes Client install package. There are a couple of different mail systems you can migrate from but here I’ll focus on Microsoft Outlook Express since it is the most common scenario for single user migrations. It is also required that you run the IMAP server task on the Domino server.

From here on I’ll assume:

  • That you succesfully installed the Notes client, including the migration tools, on the machine where the Outlook Express client is installed.
  • That you already created the user using Domino Administrator and configured the Notes client accordingly.
  • That the user mail database is using the Extended Mail Template (or above).
  • That the mail server is running the IMAP server task.

This post covers Notes 6.5.x/7.x (but I assume Notes 6.0.x will work as well).

Steps to migrate Outlook Express
Open a command prompt and navigate to your Notes binary directory (e.g. C:Program FilesLotusNotes). Running the nupgrade.exe tool with the “/?” command line option will show the list of available options.

C:Program FilesLotusNotes>nupgrade.exe /?

Notes 7.x Notes.6.5.x

As you can see from the screenshot on the left the command line option “4” means Outlook Express so we go ahead and run the command again using that option. As you can see from the screenshot on the right, the prompt from Notes 6.5.x (and probably also Notes 6.0.x) is wrong. Although the command line option “4” isn’t listed it is still available.

C:Program FilesLotusNotes>nupgrade.exe 4

After being prompted for the Notes password the following dialog box is presented. Make sure the information on the right is correct.

  • User Name
    It is pretty common having to change is the specified username. The username should be a username valid for logging in using the IMAP/HTTP protocol.
  • Account name
    This can be anything and is only used to create an account in Outlook Express as shown later.
  • IMAP server
    Specify a DNS resolvable hostname to the Domino server containing the mail database of the specified username.

Click OK and (very) quickly hereafter the process is complete.

A common error message at this point is the “Internet Address Is Missing” dialog box. To resolve this refer to technote 1091375. The message basically means that the user doesn’t have an e-mail address specified in his Person document on the server.

Now when you open the Outlook Express client you should see something like the screenshot below. Aside from the existing account a new account has been added at the bottom (in this case called “Domino Administrator”).

Select the account on the left and click the “IMAP Folders…” button in the right pane as shown below.

You will be presented with a dialog box showing the existing folders in the Notes mail database. Select the individual folders you would like to make visible and click the “Show”-button. A little icon will indicate that the folder is visible. New folders can be created as normally in Outlook Express.

Back in Outlook Express simply drag the e-mails from the existing Outlook Express folders to the folders added from the mail database or to newly created folders. You can select multiple e-mails at once.

Once you migrating the e-mails you should see the e-mails appearing in the Notes mail database as shown below.

Technorati tag(s):

Lotus Domino – the killer API for DB2? Why I think the DB2/Domino integration makes total sense

The aforementioned application is being developed for a small media company producing print material and some B2B and B2C web portals. The problem with this particular customer is that they have really grown used to having barebones Domino as their platform for mail, calendar and applications. Having Domino in a small shop really means a no fuss, always available platform that just works, so when confronted with having to manage, support and backup a separate system they really wasn’t that interested.

In the end we, as the ever-wise team of consultants, still managed to convinced them to go with the combined Domino/relation solution since it was really the “correct” thing to do. With MySQL as an affordable (in this case read free) database capable of supporting the load the customer gave the thumbs up.

Please note: With the recent introduction of DB2 Express-C which is a free “entry level” version of DB2 we will probably start the customer of on DB2 instead of MySQL. This will make it easy to move the customer to another edition of DB2, if applicable at a later point in time, using a simple backup/restore operation.

So why does the Domino/DB2 combination make total sense?
As part of the discussions we have had with the customer it has become clear to me just how much sense the Domino/DB2 integration will make once it really goes public1. From my perspective the Domino/DB2 is a real God sent – also for the smaller clientele.

When DB2 is deployed in the organization you can leverage the DB2 server for all your storage needs. Once DB2 is there whether you have one, five or one hundred databases don’t really matter – creating the first database is really the pivotal moment. Having the relational infrastructure in place and having the option of storing all your data there, means that Domino becomes just another application you install on top of the storage facility. Through those glasses Domino really becomes an API to easily access loosely structured data stored in DB2.

This has a number of important implications:

  • One unified database backend across IBM products.
  • One place to manage the necessary storage.
  • One place to manage the necessary backup – no more need for separate backup clients since all data reside in DB2 (I assume backup can be conducted entirely through DB2).
  • No need for specific Domino I/O tuning skills – you can focus on managing DB2.
  • Relational data becomes a “native” data format of DB2.
  • Domino data becomes just another federated data source for existing DB2 applications.

I’m not saying it is going to be easy to get customers like our small media company to move to a DB2 backed Domino infrastructure but I think it really makes sense. Of cause the skill set needed is going to be different from the current but I think it is small price to pay for the power and flexibility it affords.

I think the integration is really going to bring benefits and the possibility of creating applications that seamlessly combine data from, what seems like, very diverse sources. We of cause know it is just DB2.

Sorry for the rant.

Footnotes:
1 The inclusion of the DB2 backend in the current Domino 7.0 release is only for evaluation and you need an agreement with IBM to use the functionality in production with support. The agreement isn’t hard to get and is a matter of filling in a form on a webpage.

Imported Java agent

I saw a post on Lotus developerWorks asking for help on creating an imported Java agent. Since I have seen this question so many times I finally decided to create an example.

Please note: Lotus Notes/Domino will ignore the CLASSPATH variable set on the local machine. The equivalent of CLASSPATH in the Notes/Domino world is the JavaUserClasses notes.ini variable. Likewise Notes/Domino doesn’t use Manifest files in jar-files.

I case you didn’t know you can create Java agents in two ways in Domino Designer:

  • Write the agent in Domino Designer (this is the most common way to write a Java agent).
  • Import compiled code into Domino Designer.

This example will focus on the latter.

When creating an agent with imported code you must make sure that one of the classes extend the lotus.domino.AgentBase class. When the agent is run in Notes an instance of this class is created and the NotesMain() method is called. As you can see in the first screenshot I have written a simple agent in Eclipse. The class (dk.heisterberg.lekkim.blog.TestAgent) extend lotus.domino.AgentBase and have some simple Java code in he NotesMain() method. Apart from being a requirement, one of the advantages of extending AgentBase is that you do not have to worry about threads and how to get a Session object (you can simply call getSession() as shown in the example).

Once you have compiled the agent (automatically done if using Eclipse) you create a zip-/jar-file with the compiled classes. Make sure to include the entire package hierarchy if you are using packages. Then create an agent in Domino Designer, set the type to “Imported Java” and click the “Import Class Files…” as shown below.

In the dialog box you select the zip-/jar-file you created and add it to the right pane. Then, and this is the important point here, specify the class that extend the lotus.domino.AgentBase class in the “Base class” field. Remember to include the package name if you are using packages.

Click OK and verify the choices you made in the dialog box has been set correctly.

Give the agent a name, set the desired agent trigger and save the agent. That’s it!

The example database is available for download.

Sametime 7.5 – upgrading is going to be cool!

Technorati tag(s):

The buzz about the next release of Sametime started at Lotusphere 2006 and now IBM is starting to really tease us. The new information is looking VERY promising. While I guess the users will mainly focus on the updated UI the release brings a host to new features of which I’m really excited about a couple of them:

  • A supported, standards based, plugin architecture for 3rd party extension
  • Location based awareness
  • Possibility to save chat history
  • Administration of users and groups based on policies
  • Emoticons (I think it definately has its place in business IM’ing)

Further information:

Override standard Notes client error messages

While perrusing the fix list for Notes 6.5.5 I stumbled upon an entry describing how it is now possible to override the standard error messages if you know the hex error code. It’s SPR #ARUI6FRLJ5.

It means that you will be able to customize error messages like “The server is not responding” etc. I will need to look into this.

I guess the only thing we need to know now is the actual hex error codes… 🙂

Update: Chris jumped in and told me where to find the error codes. As of Notes/Domino 7.0.1 there are 7308 error codes!! Wild.

Technorati tag(s):

If anyone has Rockys e-mail address…

…please let him know that his RSS feed is messed up and hence not working. Something about a mismatched tag:

XML Parsing Error: mismatched tag. Expected: </content:encoded>.
Location: http://www.lotusgeek.com/SapphireOak/LotusGeekBlog.nsf/stories.rss
Line Number 80, Column 802:

I discovered it by accident since I went to his site for the link to the super cool button maker and saw some posts I hadn’t seen in my RSS reader. I almost missed Bob Balaban guest blogging about UTF-8, UTF-16 and LMBCS (which are character sets if you were wondering)… 🙂

Another quirk in Lotus Notes 7.x found

At the office we have found another funny quirk in Lotus Notes 7.0/7.0.1. Suppose you have a form with an embedded categorized view restricting the documents to a category. If you move the focus to the embedded view and press Shift – to collapse all sections the shown documents dissapear. My guess is that Notes collapse the view section we are restricting to.

The issue is only visible in Notes 7.x but not in Notes 6.5.1 or 6.5.4 (the only two 6.5 versions we’ve tested).

I guess I’m going to have to open a PMR with Lotus Support.

Technorati tag(s):

Show ‘n Tell Thursday: Export directly from a web agent to an Excel spreadsheet in landscape format (23 Feb 2006)

A lot of web applications has a requirement to export some data to Excel spreadsheets. Whether you write the code (normally an agent) to export the data in LotusScript or Java you normally have two options:

  • Use a HTML page
  • Use a XML document

I’m going to concentrate here on using the HTML option since it is by far the easiest and the one that produces the shortest agent. However using the XML option affords you a number of other advanced options such as creating named cells and creating multiple worksheets in a workbook. I really suggest looking into this option if you need more specialized formatting.

To do this the easiest approach is creating the spreadsheet in Excel, saving is as XML and then using the generated XML document as a “template”.

Anyways – on with the export. To export from the web to Excel using a HTML document is mind numbingly easy. Simply create a HTML document with a HTML table and set the Content-type to application/vnd.ms-excel. Exporting a static spreadsheet with two columns and two rows is as simple as the following:

Sub Initialize
   Dim session As New NotesSession
   Dim docContext As NotesDocument
   Set docContext = session.DocumentContext

   'set content-type
   Print "Content-type: application/vnd.ms-excel"

   'start table
   Print |<HTML>|
   Print |<body><table border="1">|

   'output table
   Print |<tr><td>|
   Print |1-1|
   Print |</td><td>|
   Print |1-2|
   Print |</td></tr>|
   Print |<tr><td>|
   Print |2-1|
   Print |</td><td>|
   Print |2-2|
   Print |</td></tr>|

   'stop table and document
   Print |</table></body></html>|

End Sub

The trick is however to set the page title and page orientation for print. To do this you use can use some Microsoft proprietary CSS extensions. The changes from the above code is highlighted in bold.

Sub Initialize
   Dim session As New NotesSession
   Dim docContext As NotesDocument
   Set docContext = session.DocumentContext

   'set content-type
   Print "Content-type: application/vnd.ms-excel"

   'start table
   Print |<html xmlns:x="urn:schemas-microsoft-com:office:excel">|
   Print |<head>|
   Print |
<style>
  <!--table
  @page
   {mso-header-data:"&CMultiplication Table00ADate: &D00APage &P";
   mso-page-orientation:landscape;}
   br
     {mso-data-placement:same-cell;}

  -->
</style>
  <!--[if gte mso 9]><xml>
   <x:ExcelWorkbook>
    <x:ExcelWorksheets>
     <x:ExcelWorksheet>
      <x:Name>Sample Workbook</x:Name>
      <x:WorksheetOptions>
       <x:Print>
        <x:ValidPrinterInfo/>
       </x:Print>
      </x:WorksheetOptions>
     </x:ExcelWorksheet>
    </x:ExcelWorksheets>
   </x:ExcelWorkbook>
  </xml><![endif]-->|

   'start body and table
   Print |</head><body><table border="1">|

   'output table
   Print |<tr><td>|
   Print |1-1|
   Print |</td><td>|
   Print |1-2|
   Print |</td></tr>|
   Print |<tr><td>|
   Print |2-1|
   Print |</td><td>|
   Print |2-2|
   Print |</td></tr>|

   'stop table and document
   Print |</table></body></html>|

End Sub

It is as simple as that. The trick is of cause in the CSS extensions to control the page setup. The ones used here should be pretty self-explainatory. There are numerous other CSS extensions you can use – see the link at the bottom for more information.

Hope it helps someone. Happy Thursday.

Further reading:

Technorati tags: ,