3

I would like to know if through Domino API it is possible to launch (start) Lotus or open a lotus notes email knowing the noteURL.Something like this

notes:///__C12579A3004143A1.nsf/0/07A2154411B264E5C12579A4004AD43E?OpenDocument

without specifying the path of the executable that is the notes.exe file.

For the moment, I using this java command

Runtime.getRuntime().exec( "C:\Program Files\IBM\Lotus\Notes\notes.exe " + document.getURL() );

but I don't want to specify the path to the executable.

Thanks

Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63
user1199323
  • 71
  • 1
  • 4

3 Answers3

2

You can on a Windows machine. When you install the Lotus Notes client on a windows PC, it registers the notes:// protocol and associates it with notes.exe. You can then use a URL formatted as notes://server/database.nsf/view/docid to launch Notes and open a particular document.

Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63
  • correction. It would be. notes://server/database.nsf/view/docid. If server is blank then it is local. eg. "notes:///database.nsf/view/docid". View is also optional so you can do something like "notes:///database.nsf/0/docid". – Simon O'Doherty Feb 16 '12 at 16:38
  • What you said work well in a document like html etc. but how can it be done in a normal java program? – user1199323 Feb 16 '12 at 16:49
  • 1
    Not sure - you'll have to launch a URL somehow? – Ken Pespisa Feb 16 '12 at 22:17
1

The java.awt.Desktop class has a browse(URI uri) method. The doc says that it launches the 'default browser', but it's unclear to me whether it will handle "notes://" URIs. That's what I might try, as I think it has the best chance of being a cross-platform solution.

If Windows-only meets your requirements, though, and if hard-coding the executable path is your real concern, then you can read it from the registry. The appropriate registry keys to use, and a method for reading the registry from Java are both covered in answers to other questions on stackoverflow:

Community
  • 1
  • 1
Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41
0

You could use a .NDL (Notes Data Link) file and "start" that. If the Notes Client is properly installed, it should open automatically.

Steps to create a .NDL file:

  1. Open a Notes database.
  2. Select Edit -> Copy As Link and select the type of link you want to create, for example a View link.
  3. Open the Windows Notepad and select Edit -> Paste.

The following is an example of what the Notepad file will look like:

discuss - By Category (discuss is the Notes Database name and "By Category" is the view link)
<NDL>
<REPLICA 852565A7:005180C7>
<VIEW OFAAC7D56C:A8FD884B-ON852563BE:00610639>
<HINT>CN=Slider.lotus.com/O=WWBPSS</HINT>
<REM>discuss</REM>
</NDL>

Source: How to start a Notes client from a browser or send doclinks to non-Notes users

leyrer
  • 1,444
  • 7
  • 9