Sean Cull

SNTT: Using OpenNTF Xpages Wiki with multiple domains 

Sean Cull  25 February 2010 07:30:00

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



 8.5.1  Admin Tips  Dev Tips  Lotus  Show-n-Tell Thursday  Wiki Template  XPages 


No Comments Found

Please leave a comment


Subject:
   
Name:
E-mail:
 
Comment:  (No HTML - Links will be converted if prefixed http://)
 
Remember Me?