Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server independent reference in an XPages theme

Tags:

xpages

I have the following in the theme but I want to make it server independent so that it can be moved seemlessly from deve to test to prod.

how do I genericize http://www.devserver.com?

<resource>
    <content-type>text/css</content-type>
    <href>http://www.devserver.com/CommonElements.nsf/commonMAX.css</href>
</resource>

I would assume the following - but doesn't work as it makes the reference relative to the current .nsf

<resource>
    <content-type>text/css</content-type>
    <href>/CommonElements.nsf/commonMAX.css</href>
</resource>
like image 622
MarkyRoden Avatar asked Mar 09 '12 14:03

MarkyRoden


2 Answers

From an article on the Notes & Domino App Dev wiki:

"When the XPages runtime emits a URL, it assumes that the root "/" is the root of the application (e.g. /mydb.nsf). But as this notion doesn't exist in the browser, this is added by the JSF runtime. To work around this add the syntax "/.ibmxspres/domino" to the beginning of the path to set the root as the Domino data directory."

like image 66
Mark Leusink Avatar answered Jan 28 '23 22:01

Mark Leusink


In Chapter 14 of Mastering XPages there is a discussion of Themes. Beginning on page 597 there is a discussion of "Resource Paths" and the Path Aliases for three key paths:

/.ibmxspres/domino points to: /data/domino/html/

/.ibmxspres/global points to: /data/domino/java/xsp/

/.ibmxspres/dojoroot points to: /data/domino/js/dojo-1.4.3/ (or the current version of dojo)

So your block is:

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

Happy coding

/Newbs

like image 33
Newbs Avatar answered Jan 28 '23 23:01

Newbs