SNTT: Using OpenNTF Xpages Wiki with multiple domains

I have been working on a public facing OpenNtf Xpages Wiki for our Delivery Toolkit suite of products and wanted the Wiki to work with multiple domains e.g. if a user arrived via www.focul.net or www.deliverytoolkit.com then the wiki links would remain consistent.

The current wiki code ( 0.6 ) causes the internal wiki links to resolve to the domain which is configured as the host name on the server document.

Image:SNTT: Using OpenNTF Xpages Wiki with multiple domains
Looking at the code in the xpWikiStyle SSJS library the links are absolute. Changing the following line produces relative urls which will honour the domain

url=@LeftBack(database.getHttpURL(),”/”)+facesContext.getExternalContext().getRequestContextPath();

to

to url=””+facesContext.getExternalContext().getRequestContextPath();

so http://www.deliverytoolkit.com/Public/FDT/FDTWiki.nsf/home.xsp and
http://www.focul.net/Public/FDT/FDTWiki.nsf/home.xsp both work.

Using facesContext.getExternalContext().getRequest().getHeader(“Host”) to get the domain should also work if a computed domain is required

The project entry is here

Update  11th March 2010
You need to make similar changes tot he edit button on the prtContent custom control i.e. the wiki page

Leave a Reply

Your email address will not be published. Required fields are marked *

1 + 3 =