0
votes

I am charged with maintaining some old code, in which we are extracting a Notes link from a message, and turning it into a link that can be called from HTML on a local machine (on which Notes is installed). We have a situation where one link works, and another one does not.

I am struggling to understand what exactly this code is doing, and why it even works in the first place. Basically, we are looking at the property "$Links" in an email message. The value of this property, for example, when viewed in Notes, is something like:

RFC2257F23:004852B9
VFA5208C4C:6552DA01-VN422569FB:003AAC2D
NF6D24A297:6579B8E3-NNC225805D:004D8678

What our code does is get the binary value of this property, using NSFItemInfo and OSLockBlock. It then starts at offset 11, and works backwards 8 bytes, converting each byte to a 2 digit hex value. Then it does the same thing 3 more times, but moving the offset 8 bytes forward from the original 11. A '/' character is inserted after the 1st and 3rd of these 8 byte segments. Then the whole thing is appended to "notes:///". At the end, the link generated looks like this:

Notes:///C2257F23004852B9/A5208C4C6552DA01422569FB003AAC2D/6D24A2976579B8E3C225805D004D8678

I'm guessing that this value represents the Notes UNID of the document link, and that when clicked on, Notes starts up, and goes directly to the document. So does anyone have an idea as to why one link would work, and the other fail? Our customer claims that the Notes links database is intact, and can be viewed successfully from within Notes itself.

1
Could you provide a working example and a non-working example? Some Information about Notes Links can be found here: www-10.lotus.com/ldd/dominowiki.nsf/dx/notes-urls - Leonhard Triendl
The data above is the working example. The non-working example looks exactly the same, except a different set of hex codes, I don't think that would help much. I'll take a look at that info about Notes Links - thanks. - Jeff McKay
One obvious question is whether the non-working one in the Notes client is a dead link or not. Another obvious question is whether the user clicking on the link has access to the database and document. What -exactly- happens when you(and/or the end-user) click the non-working link in the browser? And what happens when you (and/or the end-user and/or a user with Full Access Administrator privileges assigned and activated) clicks it in the Notes client? - Richard Schwartz

1 Answers

1
votes

Notes- Links consist of the protocol, a server part, a database part and the element within the database.

A normal example would be:

notes://server/path/database.nsf/view/keytodocumentinview

Every part (except the server) can be replaced by an internal ID.

  • path/database.nsf --> Replica ID (C2257F23004852B9 in your example)
  • view --> Universal ID of the design element of the view (A5208C4C6552DA01422569FB003AAC2D)
  • keytodocumentinview --> Universal ID of the document (6D24A2976579B8E3C225805D004D8678)

If there is no server in the link, then the notes client tries to "guess" the right server. It checks:

  1. Is there an icon in the desktop for the Replica- ID requested. If yes: take the server of the last used replica (on the top if replicas are stacked)
  2. Can I find a catalog.nsf (either on catalog- server from location document or on mail- home- server. If yes: Is the replica- id in there? If yes: Take the server from there...
  3. Ask user for server (not sure about that part, as it not always seems to happen)

So the answer to your question is:

If the client can not find any reference to the server the link will not work. So it is always better to add the right server to the link (if you know it).

Just to explain, how to get from one form to the other, here is some more explanation:

Some times these IDs are represented differently as found in the $Links- Item:

The first letter stands for the "Type" of ID:

R = Replica ID V = View Universal ID N = Note Universal ID

All 32Bit values are separated in 2 halfs of 16 bit, prepended by another Character telling "First" (F) or "Second" (=Next, N) value.

The rest is divided in chunks of 8 letters, the first and third octet separated with colons, and the first half and second half split by a minus sign.

Like that you can easily see:

RFC2257F23:004852B9 translates into FC2257F23004852B9

VFA5208C4C:6552DA01-VN422569FB:003AAC2D translates into A5208C4C 6552DA01 422569FB 003AAC2D and

NF6D24A297:6579B8E3-NNC225805D:004D8678 translates into 6D24A297 6579B8E3 C225805D 004D8678