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?
rashalerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.