On Sat, Aug 3, 2013 at 11:37 AM, Christian Meunier <[email protected]> wrote:
Thanks Marius for your feedback !
When you say proper wiki descriptor, are you referencing the WikiManager ? Right now under http://myserver.com:8080/WikiManager/WebHome , all i have are my sub wikis, there is no entry for the main wiki.
Yes, we created a descriptor (WikiManager) for the main wiki, see http://www.xwiki.org/xwiki/bin/view/XWiki/XWikiServerXwiki . Hope this helps, Marius
Thanks in advance for your help.
-- Chris
On 8/2/2013 14:06, Marius Dumitru Florea wrote:
We had the same issue on xwiki.org when we upgraded to 5.1 but in our case removing the xwiki.home setting worked. We reported and fixed http://jira.xwiki.org/browse/XWIKI-9333 . Make sure all your wikis (including the main wiki) have a proper wiki descriptor. If it still doesn't work the maybe you can try Thomas' fix
https://github.com/xwiki/xwiki-platform/commit/0a5d76f408b2404444a7241a79f10... (patch xwiki-platform-oldcore then build it and also xwiki-platform-legacy-oldcore, and use the jar of the later in WEB-INF/lib).
Hope this helps, Marius
On Thu, Aug 1, 2013 at 8:54 PM, Christian Meunier <[email protected]> wrote:
Unfortunately, the fix is not as trivial as I originally planned given how XWiki works with the url factory.
I assumed the url in the case of a subwiki ressources would be relative and absolute to the subwiki but it is always normalized after the main wiki so the wiki reference of the document being linked is lost and there is no way right now to fix this by just touching this method I believe, as the context does not have anything useful to figure out correctly what to do...
The solution seems to not set the wiki.home so the urls reflect the domain they are coming from however then the following fails:
XWikiServletURLFactory @ 179: ------------------------------------------------------------ public URL getServerURL(String xwikidb, XWikiContext context) throws MalformedURLException { if (xwikidb == null || xwikidb.equals(context.getOriginalDatabase())) { // This is the case if we are getting a URL for a page which is in // the same wiki as the page which is now being displayed. return this.serverURL; }
if (context.isMainWiki(xwikidb)) { // Not in the same wiki so we are in a subwiki and we want a URL which points to the main wiki. // if xwiki.home is set then lets return that. final URL homeParam = getXWikiHomeParameter(context); if (homeParam != null) { return homeParam; } }
URL url = context.getWiki().getServerURL(xwikidb, context); return url == null ? this.serverURL : url; } ----------------------------------------------------------------------
Since wiki.home is not set, the method fails to return an url pointing to the main wiki....
XWikiServletURLFactory @ 505 ------------------------------------------------------ public String getURL(URL url, XWikiContext context) { String relativeURL = "";
try { if (url != null) { String surl = url.toString();
if (!surl.startsWith(serverURL.toString())) { // External URL: leave it as is. relativeURL = surl; } else { ......... } ------------------------------------------------------------
Variables of interest: surl = http://wiki.domain.com:8080/bin/view/XWiki/myUser serverUrl = http://wiki.domain.com:8080
Note that main wiki is 'http://wiki.domain.com:8080' and subwiki is 'http://rift.wiki.domain.com:8080'
So basically the test if (!surl.startsWith(serverURL.toString())) is either not sufficient (need to test we are no in the main wiki) or the serverURL is wrong in case of a subwiki (shouldnt it point to the sub wiki ??). _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs