1

I'm working on migrating an existing, large application to XPages by implementing new feature requests in XPinc. XPages migration by stealth, so to speak.

My first task is a brand new document type, which will be a response to a main document that has it's own notes form. I have this requirement for two systems I'm working on right now. I'm planning on using a lotusscript button to get a handle to the response document (or create a new one if one doesn't exist) and then open that document using an XPage instead of a form. The user then interacts with the XPage, saves and closes.

Each method I use has some drawbacks, so I thought I would see if there is a best practice out there - google's not giving me much. Here's what I've tried so far and where it got me:

1) Use uiworkspace.EditDocument(False, doc) This one works pretty well if you've got the form set up to open the XPage instead. However, they have to edit and I'd prefer to open in edit mode. It works well on one of my apps, but the other throws an error "Notes error: No error" before opening the document.

2) uiworkspace.EditDocument(True, doc) I was hoping this would work, but my XPage still opens in read mode. App number two still throws the "No error" error as well. The default action for the data source is "Edit document" so I'm not sure why this won't come out in edit mode.

3) notes:// url to the document This works perfectly on server-based applications, but if I try this on a local replica I get an error "XPages cannot process the application launch page". I don't absolutely need local replicas, but I know that as soon as I break them I will get a user who insists on taking it offline.

4) http:// url to the document Actually haven't tested this one fully, but the sign-in prompt would mean that it is a last resort.

So, no perfect solution for opening the document. Am I doing it wrong? Is there a better way?

Also, what's the best way to close the document once you have it open in XPiNC? Any suggestions?

Cheers,

Brendan

Brendan Long
  • 71
  • 10
  • Question marked as answered. As for the question of how to close the document, I'm going to try the solution suggested here - http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Whats_New_in_852_for_XPages#window.close%28%29+support and I will add a comment if it works. – Brendan Long Jun 25 '12 at 07:28
  • Just an update - closing the window is not easy - see this question - http://stackoverflow.com/questions/11093639/how-to-close-xpages-in-notes-client-i-use-csjs-window-close-but-its-not-workin In the end I resorted to closing the parent document in the original lotusscript after I open the notes:/// link, and then I redirect the XPage to the notes:/// url for the parent doc using facesContext.getExternalContext().redirect - hope that helps somebody! – Brendan Long Jun 27 '12 at 01:05

1 Answers1

1

Local http:// most likely won't work since you don't know the port.

How did you construct the Notes URL on local?

You need to have: notes:///path_to_nsf_repid_wont_work.nsf/0/unid?OpenDocument (or ?EditDocument)

.or.

notes:///path_to_nsf_repid_wont_work.nsf/xsp/yourPage.xsp?documentId=[UNID]

(Yes this are 3 slashes)

I played with it for attachments so you could use some of that to catch the URL needed. Also check the Mindoo Tool and their XPage to Eclipse tool

stwissel
  • 20,110
  • 6
  • 54
  • 101
  • Thanks Stephan, that's exactly what I was after. I was using notes://localhost//XPage.xsp&action=editDocument&documentId="UNID". It makes sense that this won't work now that I think about it. I had also tried using the path but had mixed results - the trick with the third slash fixed that. – Brendan Long Jun 25 '12 at 07:25