How to display an attachment thumbnail in view in xpages -


i've searched answer not finding need. have attachment inside of notes document want display in view control thumbnail.

  1. do put @attachmentnames in view column formula?
  2. how tell column in view control display thumbnail?
  3. do need separate thumbnail "image" in doc or can create 1 file attached in notes document?

thank help.

everything know started blog post:

http://www.wissel.net/blog/d6plinks/shwl-86qknm

for posterity here 2 key functions (ssjs) :

function getattachmenturl(docid:java.lang.string, attachmentname:java.lang.string) {     var base = getbaseurl();     var middle = "/xsp/.ibmmodres/domino/openattachment";     if (base.substr(0,4) == "/xsp") {         middle += base.substr(4);     } else {         middle += base;     }     var result = base + middle + "/" + docid + "/$file/" + attachmentname + "?open";     return result; }  function getbaseurl() {     var cururl = context.geturl();     var curadr = cururl.getaddress();     var rel = cururl.getsiterelativeaddress(context);     var step1 = curadr.substr(0,curadr.indexof(rel));      // cut off http     var step2 = step1.substr(step1.indexof("//")+2);     var result = step2.substr(step2.indexof("/"));     return result;     } 

what you're going create old fashioned non xpages - meaning classic domino link. want :

http(s)://[yourserver]/[application.nsf]/[viewname|0]/[unid| viewkey]/$file/[attachmentname]?open

then link can put in xpages image control or whatever. don't use view panels there way image in there. might need make blank view column , drop in image control. forget exactly. it's been blogged i'm sure. google might there.

i avoid @attachmentnames.. highly recommend avoiding @formulas in xpages. i'm sure there's way attachmentnames via domino object model. use instead. it'll in future.

as thumbnail... might want one... if attaches 2mb image... sure browser can render size want... first need download whole 2mb! ouch. speed if have thumbnail nicer. in theory have server create thumbnail on fly... did once.. , got ugly quick if wanted have page 30 pictures or more , each time hits server resizing images down thumbnail.

what did.. made more involved attachment system. never store images in key document. put them in database shared keys. put them in 3 databases. when uploads image... store in "original.nsf". resize "large.nsf" , "small.nsf" can close size need when need it.

i've still not made video of yet. have semi-working project code examples , such on bitbucket. https://bitbucket.org/leedy/filevault