xpages: how do attachments work in a web page -


the context here that, in cms type of app, users create content reproduce notes' way of having attachments anywhere in text, not list of attachments @ bottom of page. when creating page, want able create links attachments right away, using link , img tag, not saving document first , edit again.

i have found youatnotes html5 multi file upload control, enables users upload attachments before document saved. url attachment uploaded befor ethe doc saved then:

http://myserver/mydb.nsf/xsp/.ibmmodres/persistence/dominodoc-new_569-body/indifference.jpg

i use url in ckeditor create image , looks ok: image shows in editor , has url:

/mydb.nsf/xsp/.ibmmodres/persistence/dominodoc-new_569-body/insanity.jpg

i save document, , still looks good. image showing , url still:

http://myserver/mydb.nsf/xsp/.ibmmodres/persistence/dominodoc-new_569-body/indifference.jpg

i close browser, , open page again, , see image not showing up, url still:

/belair/xbiblio.nsf/xsp/.ibmmodres/persistence/dominodoc-new_569-body/indifference.jpg

but if @ url used download control, has:

http://myserver/mydb.nsf/xsp/.ibmmodres/domino/openattachment/belair/xbiblio.nsf/e4e384094564ee9e85257f33005953ae/body/indifference.jpg

why did change?

is there documentation on how whole attachmentprocess works, can understand , give proper indications users can create valid links.

we have particularity in our publishing code: need keep unid of published document links made using unids still working. app lot of content , many external apps link it. when publish, copy content of draft published document, unid different draft document, , have issues attachment links because of that. else...

the url "/belair/xbiblio.nsf/xsp/.ibmmodres/persistence/dominodoc-new_569-body/indifference.jpg" relates temporary location before docment has been saved. standard functionality because

  1. for ssjs / java save file nsf, it's got have been uploaded server prior commit.
  2. the user has not chosen save file yet, shouldn't added nsf.
  3. the document hasn't been saved yet, if should saved nsf, no document yet exists save to.

the components of url are:

  • "/belair/xbiblio.nsf", url of database need committed to.
  • "xsp/.ibmmodres/persistence", url corresponds physical folder location temporary files nsf stored, based on xsp.properties of nsf; if nothing defined in xsp.properties of nsf, xsp.properties of server used; if nothing defined there, default location used.
  • "dominodoc-new_569", temporary reference new, unsaved dominodocument datasource. if close browser , re-open it, you'll getting different temporary dominodocument datasource reference, wouldn't expect image show up. otherwise, different users 1 another's attachments.
  • "-body", field file needs saving into.
  • "/indifference.jpg" file name.

once document saved, file stored body field of relevant document, , file system cleaned up. url has change, because otherwise attachment not available on other replicas, because database gets replicated, , not managed daos.

the new url "http://myserver/mydb.nsf/xsp/.ibmmodres/domino/openattachment/belair/xbiblio.nsf/e4e384094564ee9e85257f33005953ae/body/indifference.jpg" corresponds to:

  • "myserver/mydb.nsf/xsp/.ibmmodres/domino/openattachment", shorthand url open relevant attachment.
  • "/belair/xbiblio.nsf/e4e384094564ee9e85257f33005953ae", location of document attachment stored in.
  • "/body", field name.
  • "/indifference.jpg", attachment name (the field have multiple attachments, of course).

the information above based on has been documented in xpages portable command guide (for xsp.properties settings changing default temporary locations) , mastering xpages 2nd edition.

i'm not sure youatnotes uploader does, can't whether should changing url or not on save. in more recent versions of domino, attachments can uploaded without full refresh, may of use alternative.

when you're copying documents, if you're storing html references images urls, including unids, you'll need modify references.

if want keep unids, remember read-write - can set them them. however, bear in mind you'll have problems if change url same url of existing document. bear in mind xpages, data accessed via xpages applications don't have in same database.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -