3
votes

I am developping web applications using the Xpages framework from the IBM Lotus Notes technology.

My users don't use the embedded Notes Client browser, but use a regular modern browser (Firefox, Chrome) to browse Notes applications.

Everything is ok when the user has an internet connexion, he can access the application on the online server through his favorite browser.

However some of my applications need to be used Offline, in local. When a user works in local, he opens the IBM Notes Client, go to his workspace and click to open an application locally. Then, the Notes Client runs a http server on a random port and open the application with the embedded Notes Client browser.

What I want to achieve is to be able to open the application on a regular browser (Firefox, Chrome), by just using the default system browser and not the embedded Notes Client browser.

Here is what I tried without success :

With window.location.href I get the port where the local http server runs and the path to the page that is opened in the embedded Notes Client browser. I get this kind of result :

127.0.0.1:54428/xsp/Gfn/CoffeShop.nsf/xp_home.xsp?OpenXPage&&xspRunningContext=Notes

So I just keep the interesting part :

127.0.0.1:54428/xsp/Gfn/CoffeShop.nsf/xp_home.xsp

Now I need to pass the session id has a parameter of this http request so the browser will have the right to access the application. I get the session ID with the following :

facesContext.getExternalContext().getRequest().getSession().getId()

From this I get an ID and I build my complete http request :

127.0.0.1:54428/xsp/Gfn/CoffeShop.nsf/xp_home.xsp?SessionID=ID-fae7aca8f062023972fe35e5909b0106f44ba2ae

But when I try this into a regular browser, instead of getting the page I get an error 500. If I look at the log of the server, I see the following error message :

Exception Thrown javax.servlet.ServletException: The request is not coming from a trusted Rich Client part

But I am sure my ID is correct. I tried to investigate this on the internet but no success for now, I would be happy if someone has an idea about what do I miss? Or maybe another way to open a local application in the default system browser?

Thank you!

3
What's wrong with XPiNC? IMO the way you hacked it is dead end. What you want is "local preview", different http task, but AFAIK it works with installed IBM Designer only.Frantisek Kossuth
XPiNC is an old version of firefox, it doesn't support a lot of new web technologies that I use in my application (HTML5 for example). It's also slower. I can of course adapt my code to make it work nicely on XPiNC but it will be more time confusing than just finding a solution to use regular browser when working on local. The users don't have the Designer, only the client so the preview is not a good solution for me.jeremy_krein
I agree, XPiNC is few years behind. Good applications, especially the ones working for years do not rely on "bells and whistles". Unless your target customers are teenagers ;-) My 2 cents. And of course - Designer is not an option - you can not use it for that purpose, impractical and against the license, I think.Frantisek Kossuth

3 Answers

1
votes

In short, you can't. This is disabled by security restrictions.

But maybe you should think again about a XPiNC application: With 9.0.1, the underlying XULRunner component was upgraded and supports now HTML5 and a lot of the "newer" features.

It matches Firefox 10.0.6, here are the HTML5 test results: https://html5test.com/s/555ae51ca555ac7b.html

0
votes

The only reasonable action you have at you disposal is to install Domino designer on the clients. Then you get the nhttp task that serves to a standard browser (you might get away analysing what nhttp needs and only install that part).

The caveat there: the local nhttp does not support authentication. So you need to hack around it (e.g. copy data back and forth between the local NSF and the properly secured one).

Alternative you could try the approach I took with vert.x (should work with any Java container, but then you won't have any XPages, just raw Domino data.

Danielle pushed that forward with the Crossworlds Project - which might be what you need.

0
votes

Stephan says it as it is: the way you are considering is just going to cause you huge headaches.

If offline capacity is a must, have you thought about creating a pure Notes-Client application? That would certainly be far easier.