« Hidden IBM Software Gems |
Main|
Customer Disservice »

You are sending out emails that contain Notes links to other email systems. The router converts them to notes:// links (and with
a little help even into good looking HTML mails). However when you click the document in your target database doesn't open, even if you have a Notes client installed. Now you need to investigate what is happening. These are the steps:
- Open your windows registry using regedit
- Look for HKEY_Classes_Root\Notes, which is the protocol handling definition for Lotus Notes. It should look like this:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Notes]
@="URL:Notes Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\Notes\DefaultIcon]
@="C:\\Notes\\notes.exe,0"
[HKEY_CLASSES_ROOT\Notes\shell]
[HKEY_CLASSES_ROOT\Notes\shell\open]
[HKEY_CLASSES_ROOT\Notes\shell\open\Command]
@="\"C:\\Notes\\notes.exe\" -defini \"%1\""
Note, that your path to the Notes location might be different.
- With this fixed Notes will pickup Notes URLs and display them correctly. However there are more possible caveats. One could be the Notes URL in the email, the other the way the email application is calling the Windows function to launch Notes
- The syntax for a Notes URL is notes://servername/database/view/documentuniqueid (For a full description see the online help). If you omit the documentuniqueid Notes will open the view (the view can be specified by name or by unid), when you omit documentuniqueid and view Notes will open the database.
- When you create a link from a local database the server name is missing, so the Notes URL has a triple slash notes:///database/.... The Notes client will look for it locally. If the database is not local (or on the desktop) it will throw an error. With a little help you can force server names even if the database was created locally.
- Sometimes the mail application isn't calling the notes url properly. This is a little harder to investigate. You need to edit your registry to point the URL protocol to something else than notes.exe, so you see what is exactly handed over at the command line (You backup your registry, isn't it?). I've written a small Java class that can do that for you. So instead of @="\"C:\\Notes\\notes.exe\" -defini \"%1\"", you would write: @="\"java.exe\" C:\\temp\\CommandlineSpy.class \"%1\"". The little class will spit out a prompt with the URL handed over to the OS.
import java.awt.Frame;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Label;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class CommandlineSpy {
/**
* @param args
*/
public static void main(String[] args) {
String message;
if (args.length < 1) {
message = "No command line parameters provided";
} else {
message = "Commandline parameters used:\n";
for (int i = 0; i < args.length; i++) {
message += Integer.toString(i+1) + ":";
message += args[i];
message +="; ";
}
}
CommandlineSpy s = new CommandlineSpy();
s.box(message);
System.exit(0);
}
public void box(String message) {
Frame f = new Frame();
f.setSize(400,400);
f.setVisible(false);
MessageBox box = new MessageBox(f , message, true);
box.dispose();
f.dispose();
}
private class MessageBox extends Dialog implements ActionListener {
private static final long serialVersionUID = 1L;
private Button ok, can;
public boolean isOk = false;
/**
* @param frame parent frame
*
* @param msg message to be displayed
*
* @param okcan true : ok cancel buttons, false : ok button only
*/
public MessageBox(Frame frame, String msg, boolean okcan) {
super(frame, "Message", true);
setLayout(new BorderLayout());
add("Center", new Label(msg));
addOKCancelPanel(okcan);
createFrame();
pack();
setVisible(true);
}
MessageBox(Frame frame, String msg) {
this(frame, msg, false);
}
void addOKCancelPanel(boolean okcan) {
Panel p = new Panel();
p.setLayout(new FlowLayout());
createOKButton(p);
if (okcan == true)
createCancelButton(p);
add("South", p);
}
void createOKButton(Panel p) {
p.add(ok = new Button("OK"));
ok.addActionListener(this);
}
void createCancelButton(Panel p) {
p.add(can = new Button("Cancel"));
can.addActionListener(this);
}
void createFrame() {
Dimension d = getToolkit().getScreenSize();
setLocation(d.width / 3, d.height / 3);
}
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == ok) {
isOk = true;
setVisible(false);
} else if (ae.getSource() == can) {
setVisible(false);
}
}
}
}
|
|
Java2html
|
Disclaimer
This site is in no way affiliated, endorsed, sanctioned, supported, nor enlightened by Lotus Software nor IBM Corporation. I may be an employee, but the opinions, theories, facts, etc. presented here are my own and are in now way given in any official capacity. In short, these are my words and this is my site, not IBM's - and don't even begin to think otherwise. (Disclaimer shamelessly plugged from Rocky Oliver)
© 2003 - 2012 Stephan H. Wissel - all rights reserved as listed here:

Unless otherwise labeled by its originating author, the content found on this site is made available under the terms of an Attribution/NonCommercial/ShareAlike Creative Commons License, with the exception that no rights are granted -- since they are not mine to grant -- in any logo, graphic design, trademarks or trade names of any type.
Comments
You *want* to change the registry to investigate what other applications are sending over to the handler of { Link }
Posted by Stephan H. Wissel At 11:31:18 On 02/26/2009 | - Website - |
Posted by Christian Henseler At 02:39:32 On 02/26/2009 | - Website - |
dbn:=@LowerCase(@DbName);
db:=@ReplaceSubstring(@Subset(dbn;-1);"\\";"/");
svr:=@Name([CN];@Subset(dbn;1));
id:=@Text(@DocumentUniqueID);
u:="notes: //"+svr+"/"+db+"/0/"+id+"?opendocument";
@Prompt([OkCancelEdit];"url";"here it is";u)
Creates a url like;
notes: //misfarm01ds/mail/rvangame.nsf/0/9E08C6E4E5D050DE8525756800502442?opendocument
(spaces entered after : to display text of urls rather than links)
Posted by Rick VanGameren At 23:56:43 On 02/25/2009 | - Website - |
On line 28, where says
message += argsi;
should be
message += args[ i ];
(had to put spaces on the brackets to bypass the BBCode)
Works great
Posted by ICeman At 16:38:28 On 11/14/2009 | - Website - |
Posted by Atish At 06:33:46 On 06/18/2010 | - Website - |