1

This question covers adding XPages css resources via a theme which references a resource nsf database by adding /.ibmxpsres/domino to the path eg.

<resource>
<content-type>text/css</content-type>
<href>/.ibmxspres/domino/CommonElements.nsf/styles.css</href>
</resource>

This works fine in a browser the mark up generated being..

...href="/CommonElements.nsf/styles.css"

However in a Notes Client this results in ..

... href="/xsp/.ibmxspres/domino/xsp/CommonElements.nsf/styles.css

Which does not seem correct, I think I may need it to generate the following mark up in XPiNC.

href="/xsp/"servername"!!CommonElements.nsf/xsp/styles.css"

I have restarted Notes, used Ctrl Shift Del to try to remove any Notes cache, but I cannot get the style sheet to work.

I have resorted to using the full domain of the server http://mydomain/CommonElements.nsf/styles.css but I wish it to be server independent and allow the use of local copies when off line.

Any help would be appreciated.

Thanks

Community
  • 1
  • 1
Mark Maden
  • 468
  • 2
  • 13

1 Answers1

1

The client URL is correct. It says: load from the same server as the XPage. On the Notes client that is local host unless you specified that the page should be loaded from the server.

You have 3 options:

  • as you did: specify the server
  • set the property to load the XPage on the server
  • use a policy to push down your resource database to the clients

Note: when an XPage run locally on a client, the application scope is not shared with other clients. That only happens in server mode.

stwissel
  • 20,110
  • 6
  • 54
  • 101
  • I have 2 style sheets, one is in the nsf and is called from the XPage which runs fine. The second is in my dev resources nsf which will not load. The mark up produced is as follows. 1. href="/xsp/Ganymede!!NCLCusto.nsf/xsp/styles.css" 2. href="/xsp/.ibmxspres/domino/NCLDevRes.nsf/styles.css" This does not work. When following this URL I receive - Cannot load unregistered resource /domino/NCLDevRes.nsf/styles.css do I need to register it somehow? Many thanks. – Mark Maden Sep 01 '14 at 08:29
  • On a Notes client with Domino Designer installed, you can view the source on an XPage. Have a look at the stylesheet. You will see that the URL isn't translated into the http: form a browser needs. You need to fully qualify it using http if loading from a server – stwissel Sep 01 '14 at 08:41
  • I am not sure I follow you. The style sheet in the NCLDevRes.nsf works fine when referenced in a theme in other nsf's when accessed via browsers. It is in the Notes Client where I have the problem. Where am I adding http? before, /.ibmxspres/domino/NCLDevRes.nsf ? it doesn't seem to make any difference. Many thanks – Mark Maden Sep 01 '14 at 09:30
  • Step by step. make a normal reference in your Theme that works. Load the page in your Notes client. Use the "view source" to see what XPiNC has generated. If that points to somewhere where you don't have a stylesheet point to a fully qualified URL for CSS (not the Notes format) – stwissel Sep 01 '14 at 09:33
  • Hi, I can do that, but that means I am not server independent, doesn't it? The source is pointing to /xsp/.ibmxspres/domino/NCLDevRes.nsf/styles.css, ie. the location of the theme? – Mark Maden Sep 01 '14 at 09:39