• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

Dynamic URL Link Hotspot

I would like to link a picture (a thumbnail) to a file attachment (a PDF file) so when a Web user clicks on the thumbnail Domino launches the PDF file.

I can make this work through a URL Link Hotspot, but only if I specifiy the complete URL including the 32-character document unique ID and the file name of the attachment.

How can I get Domino to compute the Document unique ID and the file name of the attachement for the URL Link hotspot?
0
rashaler
Asked:
rashaler
1 Solution
 
rashalerAuthor Commented:
Edited text of question.
0
 
melbor1Commented:
this might work.....
formula for hotspot:

docUNID := @DocumentUniqueID ;
fileName := @AttachmentNames ;
@URLOpen( "http://server/db/view/" + docUNID + "/$file/" + fileName + "/?OpenElement" )

Good luck!

The @AttachmentNames will only work if there's only one file attached, if more, you'll have to do it another way.

Melissa
0
 
Rainer_KeizerCommented:
Hi rashaler,

You can use the following code for your hotspot:
DBNameHTML := @ReplaceSubstring( @Subset(@DbName; -1); " " : "\\"; "+" : "/" );
ViewName := @ReplaceSubstring( @Subset(@ViewTitle; 1); " " : "\\"; "+" : "/" );
@URLOpen(
"/" + DBNameHTML + "/" + ViewName + "/" + @Text(@DocumentUniqueID) + "/$File/" + @Subset(@AttachmentNames; 1)
)

This only works if the document has been opened from a view, otherwise @ViewTitle will not work. It may be a better idea to use a hard-coded view name. To do this, you can replace '@Subset(@ViewTitle; 1)' with the name (or even better, the alias) of the view. The desired document *must* be visible in this view. You can also use this code in a view, although you would have to generate the "<a href=" stuff etc. yourself.

I use @ReplaceSubstring formulas to make sure that the URL generated works on all Domino server variants (Linux for instance).

The @AttachmentNames gives the names of all attachments in the document in a text list. To get the first attachment, I use @Subset(@AttachmentNames; 1).

Good luck!
Rainer Keizer
rkeizer@passage.nl
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now