So how do you open an xpage in a different database in XPINC ?
Sean Cull 20 December 2011 00:27:03
| I have spent a large chunk of the weekend and tonight trying to make a suite of XPages applications work in both XPINC and the browser. I'm still confused |
How it works when everything is in the same database
If you want to open a document from a repeat when it is from the same database the recommended method is to use Open Page simple action using parameters and it works really well for both browser and XPiNC and is also helpful in that it is a put request rather than a GET request ( Mastering XPages page 658 ) - apologies to Tony McGuckin who I promised I would blog this 9 months ago.
The problem with data sources from other Notes databases
OK, so XPages is all about consolidating the presentation of multiple data sources in one place.
How then do you open a document from another database via a repeat ?
The crux here is that the dialogue above only presents "XPage" choices for the current database and there is no way of computing the other database - so you cannot use the simple action method.
Well for the browser you construct a URL, that is pretty straight forward. But what do you do for XPiNC ?
There are 3 methods which I believe should work although I have found that 2 are very flaky for me.
1) You can modify the underlying form associated with the XPage so that if the document is called then it will automatically be presented as the relevant XPage
To do this you would use a URL like this :
notes://server as common name/0/universalid
The downside to this is that where I work our "Best Practice" is to be able to open the back end forms as native Notes forms for administration and troubleshooting - it is a very powerful tool.
I also have some suspicions as to whether the specified server is honored in this scenario.
So all in all not a good option.
2) You could call the XPage using the following construct
notes://server as common name/dp replica id/xp_f_document.xsp?openXPage&action=readDocument&documentId=8E800DB89E9E144A80257968004CDEE4
This should work although case sensitivity may be at play on our linux server - its hard to tell sometimes as daft as that sounds.
This method only works on 2/3 of my documents. I have eliminated issues with the logic on the XPage being the cause by using a very simple XPage with no improvement
So all in all not a viable option.
3) You could use a non rendering XPage with a "before render" script to redirect to the correct document.
This would be in the target database but might be more than 2/3 reliable. This would be a pure frig but I am tempted.
Again, not a great choice.
Some Observations
I have been on a real high with XPages of late and we have been doing some great stuff which I hope to share soon. But this project is dual XPINC and Browser.
Just at the moment I am beat - this feels like the dark days of XPages 8.5.0 and 8.5.1 - spending hours and days getting nowhere and feeling like you are the first to try something and find it lacking.
If XPINC is to be a first class client and if IBM is to deliver the vision of code once deliver on many platforms ( which is so so close based on my recent experience ) then XPINC needs to get more exposure inside IBM.
It simply wasn't usable in 8.5.2 but is much better in 8.5.3. Darren Duke once said that he would know XPages was here to stay when the mail client was in XPages - in my opinion that would make a big difference in flushing out the issues.
Come on IBM, drink your own XPages champagne.
Lotus XPages XPINC
2Glen Urban 21.12.2011 21:26:06 "Display XPage instead" option For Option 1 if you set the form property "On Web Access" - "Display XPage instead" the XPage opens in the browser and XPiNC and in standard Notes the Notes form is opened. But if you use a notes url then I suspect it will follow the same rules as Notes doc links when determining the server. ie first option is the DB at the top of your replica stack
3Glen Urban 22.12.2011 0:06:20 notes url with IP address just tried opening a notes DB with a notes url but instead of using a servername specifying an IP address. Seems to work but haven't tested exhaustively.
4Martin Donnelly 22.12.2011 14:31:29 XPiNC - answer and observation The answer to your question is posted back in the forum by Padraic Edwards. He just uses standard XPages Notes URLs. Hope that solves your problem. As for other comments above, in particular with regard to XPiNC not being usable in 8.5.2, this is simply not the case. Yes, there was an issue with application load time for remote applications and this was addressed in 8.5.3, but this problem does not impact all types of XPiNC applications. As you remember, we invested some time with you in February analyzing a non-performant XPiNC sample app you sent us, and the two main problems there were remedied by simple modifications to the application design. Best wishes of the season, -Martin
5Sean Cull 04.02.2012 10:57:24 @Glen @Glen, you are right, the web property also applies to XPINC except I have discovered that if you use a notes// style link in XPINC as described above the native notes form is opened. This is particularly important where you have a search view where you have different documents requiring different xpages to render them. Our solution will prbably be to include the required xpage name in a column in the view so that we can build a url efficiently.
6Sean Cull 04.02.2012 11:02:19 Feedback from IBM I have had some feedback form IBM that the ?OpenXPage is case sensitive - it needs to b exactly ?OpenXPage. An SPR has been raised so it will be fixed at some point.
Please leave a comment


1Devin Olson 21.12.2011 13:52:26 Why XPages suck
I started to comment here -but it got too long. So I posted a response on my own blog { Link }