This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 24, 2011, 4:37 PM
135 Posts

XPages in Notes Client - why local HTTP task?

  • Category: Other
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: notes client,XPiNC
  • Replies: 3

XPages on Notes Client, what a great idea! All that needs to be done to implement it is to embed a browser window in Notes client! But for some reason IBM decided to do it in a very complicated way, by a local HTTP task even when the database is not local. Why?

 

Today I started experimenting with xpages on Notes client for the first time. I created an xpage for a form I had used for a long time with Notes client only. Then I opened a document from a view with my Notes client. I waited for one minute, then a text "Loading <database title>" appeared. After a second minute of waiting the xpage finally opened but it was missing the CSS images. The waiting time - I believe - was due to starting the HTTP task.

 

When I looked at the source, I found the reason for missing CSS images: the <link> tag generated by the xpage which loads the css file adds on extra xsp/ to the URL making it look like this: /xsp/myserver!!mydb.nsf/xsp/mycss.css. This causes the background-image:url(mypicture.jpg) in my css file to look for the image from mydb.nsf/xsp/mypicture.jpg when the correct URL to the image is mydb.nsf/mypicture.jpg. Why is there an extra xsp/ and why the css file is found with that URL but not the image?

 

These are the two big problems I found immediately when trying xpages on Notes client. Any solutions? 

 
EDIT: Third problem, preview pane shows the form!
 
EDIT2: 4th, Refresh button nor F5 refreshes the page. 
 
EDIT3: 5th, won't open in edit mode when "Automatically enable Edit Mode" is checked on form. This whole xpages on Notes client thing seems to be a joke, nothing works. 
Sep 28, 2011, 9:56 AM
10 Posts
Re: XPages in Notes Client - why local HTTP task?
Why http task ? I suppose it was easier for IBM to reuse whats already on server :)
 
I dont have solution for You.
But I can give You some additional problems that You need to watch out for :)
Make sure before implementing bigger applications that need to run on client side that You gather a lot of knowledge about xpages development. In our experience its really hard to create application that is efficient enough to be accepted by our customers. On the other hand our applications are quite complex so You need to check it out on Your own.
 
But under no circumstances try to build production application before gathering few months of experience.
 
Maybe 8.5.3 will change something here (or maybe not - cd5 did nothing for our applications...).
Sep 28, 2011, 1:23 PM
122 Posts
Re: XPages in Notes Client - why local HTTP task?

Firstly, the answers here are not all mine. Given the breadth of the questions here, I've pointed a number of experts in the direction of your post and I'm collating them all.
 
Firstly, on the implementation of XPiNC, the chapter in the Mastering XPages book is probably the best explanation of how it works and why it was developed that way. I don't think it's as simple as embedding a browser window, one of the challenges being which browser bearing in mind Notes runs on Linux and Mac as well as Windows. Each uses a different default browser. XULRunner was used and one of the big changes for XPiNC in 8.5.2 was an upgrade in the XULRunner, which improved some issues. The main use case for XPiNC appears to have been for local applications, which almost certainly had a big impact on the direction taken. There are some discrepancies but, on the whole, there's a high degree of fidelity in the HTML outputted. The xsp is one example, but Per Lausten tried loading an image from CSS within the database and couldn't reproduce your problem. I also tried with XPages Help Application which I provided for OpenNTF. This uses css to implement a loading gif when switching between views, and this seems to work fine in 8.5.2. Does the correct image show if you launch your XPage in a full browser, e.g. Firefox? If not, there may be a different problem but tools like Firebug will help debug. Does the loading mask image show in the middle of the screen with XPages Help Application opened in XPiNC? I'm seeing that with 8.5.2 FP1. We agreed our approaches were to develop and test on something like Firefox first - a browser with good developer tools for troubleshooting - and then address the small number of differences in e.g. XPiNC or IE.

Performance is an issue that has been heavily discussed. Initial load of the first XPage is very slow. Performance of opening subsequent XPages or XPage applications is then quicker, but still slower than via a full browser. Enhancements are coming in 8.5.3 to improve this with the facility to preload the XPages runtime for the Notes Client.

I presume you're trying to add XPages functionality to an existing client application. There are places where that's appropriate, for example if you need a form for users to update multiple documents at once. I will shortly be adding that for a customer, but only after demonstrating the performance hit that will be recieved. But on the whole, few developers would take that route as a preferred option. It's much harder to integrate the two seamlessly in Notes Client compared to building a hybrid XPages/traditional web application.

The preview pane issue, I take it this is when previewing from a parent document. The XPage launch only works when opening a document, not previewing. We discussed a few options. PostOpenDocument event isn't going to work, because events don't fire from preview. The alternatives would be to have a read-only form available for preview but the XPage available for opening. Alternatively @SetTargetFrame + @UrlOpen from a view was suggested.

On Refresh and F5 not working, if I click onto the XPage F5 appears to refresh the contents as does the refresh button, again in 8.5.2. Could the problem be that the focus is elsewhere, so F5 is acting on a different area of the Notes Client?

In terms of XPages, the Form is for data structure, so fields, input translation and input validation. The latter two are managed by the computeWithForm property on the datasource. Other settings on the Form have no effect - events, action buttons, Form properties such as "Automatically enable Edit Mode". The XPage manages all presentation of the data, including edit or read mode. To force edit mode you just need to go to the datasource on your XPage and set the action to editDocument instead of openDocument.

XPages in Notes Client still has significant limitations. Some commented that they would not yet use it for a production application. There are places it has strengths within the Notes Client, for example in a sidebar application, something I delivered as a browser widget for a customer and which, because it's a browser widget rather than XPiNC, works on 8.0.2. I hope, like you, it improves and investment is being made. With 8.5.3 initially loading time is improved and XPages can be dispayed in a sidebar without using a browser widget or composite application, all of which give opportunities to use the sidebar to utilise the benefits of XPages development (pulling data from different views, different datasources, different databases, charting and other Dojo functionality, combining multiple documents easily into a single editable interface). There will be further improvements I'm sure for Notes 8.5.4.

Sep 30, 2011, 6:43 PM
135 Posts
Re: XPages in Notes Client - why local HTTP task?
Thanks for the replies. I've been learning XPages and as you know, it's quite an effort. I've been thinking that at least they work in Notes client also, it's the same browser based stuff there. It was very disappointing to realize that that is not the case and you can see the frustration in my post.
 
After my post I started reading the XPiNC chapter in "Mastering XPages" book. From there I learned that there are all kinds of client-only features in XPages. That would be OK if also the web stuff would work on the client but it does not. For me the perfect solution would have been just to embed a browser/XULRunner to Notes Client and access the pages from Domino server exactly the same way browsers do. Everything would work perfectly (or at least the same way they do with standalone browser :-) and me and my customers would be happy.
 
Here are my further comments to points presented:
  1. Local HTTP task. Based on my reading I understand that this is because of the Notes Client specific features they want to offer. But the price we have to pay for those features (which I will probably never use) is just too high. If they want to generate client specific HTML or XUL, it could be done from the server end. The server would know based on a cookie, user agent or something that the client is Notes Client. Of course the local HTTP task is needed for accessing local databases but that's something I do very seldom. XULRunner is the Mozilla runtime package and in my understanding works as a browser just like Firefox and thus is good choice for Notes client browser.
  2. Loading time. It was only when I loaded the the first XPage time ever when it took a really long time to open (I'd estimate 2 minutes). After that the performance has been OK. Of course it's not like opening a form and hopefully it will get better (XPages are supposed to be better than forms, not worse!) but I think it's usable after the first load.
  3. CSS images. My CSS background images work fine when accessed with a browser (including Firefox) from server but not in XPiNC. Did you use them the same way I do (no db path in image url): background-image:url(mypicture.jpg) and do you see the extra /xsp/ in your XPiNC source?
  4. Preview pane. I'm previewing the document itself from a view, there is no parent. I think I'm just going to hide everything on the form and it will be clear to users that preview is not available in XPiNC.
  5. Refresh. If I modify the XPage, refresh will not load the new version.
  6. Edit mode. "Automatically enable Edit Mode" on form makes XPage to go to edit mode but this does not work in XPiNC. Setting data source action to "editDocument" in my Custom Control will not enable edit mode for web access either.
I'm using FP3 in client and server.
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal