tmortagne (SVN) wrote:
Author: tmortagne
Date: 2008-12-04 14:00:49 +0100 (Thu, 04 Dec 2008)
New Revision: 14542
Log:
XWIKI-2824: Support multiwiki using path urls and not host urls
Modified: platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/XWiki.java
===================================================================
+ public String getServletPath(String wikiName, XWikiContext context)
+ {
+ // unless we are in virtual wiki path mode we should return null
+ if (!context.getMainXWiki().equalsIgnoreCase(wikiName) &&
"1".equals(Param("xwiki.virtual.usepath", "0"))) {
+ String database = context.getDatabase();
+ try {
+ context.setDatabase(context.getMainXWiki());
+ XWikiDocument doc = getDocument(getServerWikiPage(wikiName), context);
+ BaseObject serverobject =
doc.getObject("XWiki.XWikiServerClass");
+ if (serverobject != null) {
+ String server = serverobject.getStringValue("server");
+ return "wiki/" + server + "/";
+ }
+ } catch (Exception e) {
+ LOG.error("Failed to get URL for provided wiki [" + wikiName +
"]", e);
+ } finally {
+ context.setDatabase(database);
+ }
+ }
+
This means that only struts is accepted for this kind of virtual
servers? What about xmlrpc, webdav, wysiwg, gwt, and the incoming REST?
--
Sergiu Dumitriu
http://purl.org/net/sergiu/