com.xpn.xwiki.xmlrpc
Class XWikiXmlRpcURLFactory

java.lang.Object
  extended by com.xpn.xwiki.web.XWikiDefaultURLFactory
      extended by com.xpn.xwiki.web.XWikiServletURLFactory
          extended by com.xpn.xwiki.xmlrpc.XWikiXmlRpcURLFactory
All Implemented Interfaces:
XWikiURLFactory

public class XWikiXmlRpcURLFactory
extends XWikiServletURLFactory

Version:
$Id: 688448931d04887e6b2d524d99269fa804c0284c $

Field Summary
 
Fields inherited from class com.xpn.xwiki.web.XWikiServletURLFactory
contextPath, serverURL
 
Constructor Summary
XWikiXmlRpcURLFactory()
           
 
Method Summary
 String getURL(URL url, XWikiContext context)
          Converts a URL to a relative URL if it's a XWiki URL (keeping only the path + query string + anchor) and leave the URL unchanged if it's an external URL.
 
Methods inherited from class com.xpn.xwiki.web.XWikiServletURLFactory
addFileName, addFileName, createAttachmentRevisionURL, createAttachmentRevisionURL, createAttachmentURL, createExternalURL, createResourceURL, createSkinURL, createSkinURL, createTemplateURL, createURL, createURL, findAttachmentForDocRevision, findDeletedAttachmentForDocRevision, getContextPath, getRequestURL, getServerURL, getServerURL, init, isContextDoc
 
Methods inherited from class com.xpn.xwiki.web.XWikiDefaultURLFactory
createAttachmentRevisionURL, createAttachmentRevisionURL, createAttachmentURL, createExternalURL, createSkinURL, createURL, createURL, createURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XWikiXmlRpcURLFactory

public XWikiXmlRpcURLFactory()
Method Detail

getURL

public String getURL(URL url,
                     XWikiContext context)
Description copied from class: XWikiServletURLFactory
Converts a URL to a relative URL if it's a XWiki URL (keeping only the path + query string + anchor) and leave the URL unchanged if it's an external URL.

An URL is considered to be external if its server component doesn't match the server of the current request URL. This means that URLs are made relative with respect to the current request URL rather than the current wiki set on the XWiki context. Let's take an example:

 request URL: http://playground.xwiki.org/xwiki/bin/view/Sandbox/TestURL
 current wiki: code (code.xwiki.org)
 URL (1): http://code.xwiki.org/xwiki/bin/view/Main/WebHome
 URL (2): http://playground.xwiki.org/xwiki/bin/view/Spage/Page
 
 The result will be:
 (1) http://code.xwiki.org/xwiki/bin/view/Main/WebHome
 (2) /xwiki/bin/view/Spage/Page
 
 

Specified by:
getURL in interface XWikiURLFactory
Overrides:
getURL in class XWikiServletURLFactory
Parameters:
url - the URL to convert
Returns:
the converted URL as a string
See Also:
XWikiDefaultURLFactory.getURL(java.net.URL, com.xpn.xwiki.XWikiContext)


Copyright © 2004-2013 XWiki. All Rights Reserved.