Domino Upgrade

VersionSupport end
5.0
6.0
6.5
7.0
Upgrade to 8.5x now!
(see the full Lotus lifcyle) To make your upgrade a success use the Upgrade Cheat Sheet. Contemplating to replace Notes? You have to read this!

Search

Reference

1. Learn XPages online
2. Communicate with IBMers and Lotus Experts using Sametime

About Me

I am the "IBM Collaboration & Productivity Advisor" for IBM Asia Pacific. I'm based in Singapore.
Reach out to me via:
Follow notessensei on Twitter
(posts)
Skype
Sametime
IBM
Facebook
LinkedIn
XING
Amazon Store
Amazon Kindle

Mobile tag

Twitter

Languages

Other languages on request.

Visitors

Useful Tools

Get Firefox
Use OpenDNS
The support for Windows XP is coming to an end and has . Time to consider an alternative to move on. sounds like a lot of time, but, like an object in a mirror, it is closer than you think.

« Hidden IBM Software Gems | Main| Customer Disservice »

Investigate notes:// links.

QuickImage 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

Comments

Gravatar Image1 - @Christian: in a properly installed system you don't need to touch the registry, the installer did that for you. However there are cases where the Notes directory has been just copied from another machine and the settings are missing.
You *want* to change the registry to investigate what other applications are sending over to the handler of { Link }

Gravatar Image2 - Instead of modifying the registry, it might help to add the Notes data directory to the system path.

Gravatar Image3 - I've been using a toolbar icon with pretty good success. I've found that client installs >= R6 understand notes: // urls.

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)

Gravatar Image4 - Great program. But cannot compile.
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 Emoticon

Gravatar Image5 - Can I create a NOTES : //xxxx?CreateDocument uri? I looked in Help and found nothing.

Post A Comment

Please note: Comments without a valid and working eMail address will be removed. This is my site, so I decide what stays here and what goes.

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::rolleyes:;-)

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: Creative Commons License
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.