Package com.xpn.xwiki.web
Interface XWikiURLFactory
-
- All Known Implementing Classes:
ExportURLFactory
,ExternalServletURLFactory
,FileSystemURLFactory
,PdfURLFactory
,XWikiDefaultURLFactory
,XWikiServletURLFactory
public interface XWikiURLFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description URL
createAttachmentRevisionURL(String filename, String spaces, String name, String revision, String querystring, XWikiContext context)
URL
createAttachmentRevisionURL(String filename, String spaces, String name, String revision, String querystring, String xwikidb, XWikiContext context)
URL
createAttachmentURL(String filename, String spaces, String name, String action, String querystring, XWikiContext context)
URL
createAttachmentURL(String filename, String spaces, String name, String action, String querystring, String xwikidb, XWikiContext context)
URL
createExternalURL(String spaces, String name, String action, String querystring, String anchor, XWikiContext context)
URL
createExternalURL(String spaces, String name, String action, String querystring, String anchor, String xwikidb, XWikiContext context)
URL
createResourceURL(String filename, boolean forceSkinAction, XWikiContext context)
Create an URL for the file resource.URL
createResourceURL(String filename, boolean forceSkinAction, XWikiContext context, Map<String,Object> queryParameters)
Create an URL for the file resource.URL
createSkinURL(String filename, String skin, XWikiContext context)
Create a skin URL for the given filename and skin directory.URL
createSkinURL(String filename, String skin, XWikiContext context, Map<String,Object> queryParameters)
Create an URL for the given filename in the given skin directory.URL
createSkinURL(String filename, String spaces, String name, XWikiContext context)
Create an URL for the filename located in the spaces and with given repository.URL
createSkinURL(String filename, String spaces, String name, XWikiContext context, Map<String,Object> queryParameters)
Create an URL for the filename located in the spaces and with given repository.URL
createSkinURL(String filename, String spaces, String name, String xwikidb, XWikiContext context)
Create an URL for the filename located in the spaces and with given repository.URL
createSkinURL(String filename, String spaces, String name, String xwikidb, XWikiContext context, Map<String,Object> queryParameters)
Create an URL for the filename located in the spaces and with given repository.URL
createURL(String spaces, String name, XWikiContext context)
URL
createURL(String spaces, String name, String action, boolean redirect, XWikiContext context)
URL
createURL(String spaces, String name, String action, XWikiContext context)
URL
createURL(String spaces, String name, String action, String querystring, String anchor, XWikiContext context)
URL
createURL(String spaces, String name, String action, String querystring, String anchor, String xwikidb, XWikiContext context)
URL
getRequestURL(XWikiContext context)
URL
getServerURL(XWikiContext context)
Generate the base external URL to access this server.String
getURL(URL url, XWikiContext context)
Converts a URL to a string representation.void
init(XWikiContext context)
-
-
-
Method Detail
-
init
void init(XWikiContext context)
-
createURL
URL createURL(String spaces, String name, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"
-
createURL
URL createURL(String spaces, String name, String action, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"
-
createURL
URL createURL(String spaces, String name, String action, boolean redirect, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"
-
createURL
URL createURL(String spaces, String name, String action, String querystring, String anchor, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"querystring
- the URL-encoded Query String. It's important to realize that the implementation of this method cannot encode it automatically since the Query String is passed as a String (and it's not possible to differentiate between a '=' character that should be encoded and one that shouldn't. Imagine an input of 'a=&b=c' which can be understood either as 'a' = '&b=c' or as 'a' = '' and 'b' = 'c'). Ideally we would need an API signature that accepts aMap<String, String>
for the Query String, for example
-
createExternalURL
URL createExternalURL(String spaces, String name, String action, String querystring, String anchor, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"querystring
- the URL-encoded Query String. It's important to realize that the implementation of this method cannot encode it automatically since the Query String is passed as a String (and it's not possible to differentiate between a '=' character that should be encoded and one that shouldn't. Imagine an input of 'a=&b=c' which can be understood either as 'a' = '&b=c' or as 'a' = '' and 'b' = 'c'). Ideally we would need an API signature that accepts aMap<String, String>
for the Query String, for example
-
createURL
URL createURL(String spaces, String name, String action, String querystring, String anchor, String xwikidb, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"querystring
- the URL-encoded Query String. It's important to realize that the implementation of this method cannot encode it automatically since the Query String is passed as a String (and it's not possible to differentiate between a '=' character that should be encoded and one that shouldn't. Imagine an input of 'a=&b=c' which can be understood either as 'a' = '&b=c' or as 'a' = '' and 'b' = 'c'). Ideally we would need an API signature that accepts aMap<String, String>
for the Query String, for example
-
createExternalURL
URL createExternalURL(String spaces, String name, String action, String querystring, String anchor, String xwikidb, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"querystring
- the URL-encoded Query String. It's important to realize that the implementation of this method cannot encode it automatically since the Query String is passed as a String (and it's not possible to differentiate between a '=' character that should be encoded and one that shouldn't. Imagine an input of 'a=&b=c' which can be understood either as 'a' = '&b=c' or as 'a' = '' and 'b' = 'c'). Ideally we would need an API signature that accepts aMap<String, String>
for the Query String, for example
-
createSkinURL
URL createSkinURL(String filename, String skin, XWikiContext context)
Create a skin URL for the given filename and skin directory.- Parameters:
filename
- the file to reach.skin
- the skin where the file should be loadedcontext
- current context- Returns:
- a URL to load the given file.
-
createSkinURL
URL createSkinURL(String filename, String skin, XWikiContext context, Map<String,Object> queryParameters)
Create an URL for the given filename in the given skin directory.- Parameters:
filename
- the file to reach.skin
- the skin where the file should be loadedcontext
- current contextqueryParameters
- the parameters to put at the end of the URL- Returns:
- a URL to load the given file with the given query parameters.
- Since:
- 11.1RC1
-
createSkinURL
URL createSkinURL(String filename, String spaces, String name, XWikiContext context)
Create an URL for the filename located in the spaces and with given repository.- Parameters:
filename
- the path of the file to reach.spaces
- the spaces where the file is located.name
- the directory where the file is located.context
- current context.- Returns:
- an URL to load the given file.
-
createSkinURL
URL createSkinURL(String filename, String spaces, String name, XWikiContext context, Map<String,Object> queryParameters)
Create an URL for the filename located in the spaces and with given repository.- Parameters:
filename
- the path of the file to reach.spaces
- the spaces where the file is located.name
- the directory where the file is located.context
- current context.queryParameters
- parameters to put at the end of the URL- Returns:
- an URL to load the given file.
- Since:
- 11.1RC1
-
createSkinURL
URL createSkinURL(String filename, String spaces, String name, String xwikidb, XWikiContext context)
Create an URL for the filename located in the spaces and with given repository.- Parameters:
filename
- the path of the file to reach.spaces
- the spaces where the file is located.name
- the directory where the file is located.xwikidb
- the wiki in which the file is located.context
- current context.- Returns:
- an URL to load the given file.
-
createSkinURL
URL createSkinURL(String filename, String spaces, String name, String xwikidb, XWikiContext context, Map<String,Object> queryParameters)
Create an URL for the filename located in the spaces and with given repository.- Parameters:
filename
- the path of the file to reach.spaces
- the spaces where the file is located.name
- the directory where the file is located.xwikidb
- the wiki in which the file is located.context
- current context.queryParameters
- parameters to put at the end of the URL.- Returns:
- an URL to load the given file.
- Since:
- 11.1RC1
-
createResourceURL
URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context)
Create an URL for the file resource.- Parameters:
filename
- the path of the file to load.forceSkinAction
- if true specify the skin directory in the URL.context
- the current context.- Returns:
- an URL to load the given file
-
createResourceURL
URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context, Map<String,Object> queryParameters)
Create an URL for the file resource.- Parameters:
filename
- the path of the file to load.forceSkinAction
- if true specify the skin directory in the URL.context
- the current context.queryParameters
- the parameters to put at the end of the URL.- Returns:
- an URL to load the given file
- Since:
- 11.1RC1
-
createAttachmentURL
URL createAttachmentURL(String filename, String spaces, String name, String action, String querystring, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"querystring
- the URL-encoded Query String. It's important to realize that the implementation of this method cannot encode it automatically since the Query String is passed as a String (and it's not possible to differentiate between a '=' character that should be encoded and one that shouldn't. Imagine an input of 'a=&b=c' which can be understood either as 'a' = '&b=c' or as 'a' = '' and 'b' = 'c'). Ideally we would need an API signature that accepts aMap<String, String>
for the Query String, for example
-
createAttachmentURL
URL createAttachmentURL(String filename, String spaces, String name, String action, String querystring, String xwikidb, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"querystring
- the URL-encoded Query String. It's important to realize that the implementation of this method cannot encode it automatically since the Query String is passed as a String (and it's not possible to differentiate between a '=' character that should be encoded and one that shouldn't. Imagine an input of 'a=&b=c' which can be understood either as 'a' = '&b=c' or as 'a' = '' and 'b' = 'c'). Ideally we would need an API signature that accepts aMap<String, String>
for the Query String, for example
-
createAttachmentRevisionURL
URL createAttachmentRevisionURL(String filename, String spaces, String name, String revision, String querystring, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"querystring
- the URL-encoded Query String. It's important to realize that the implementation of this method cannot encode it automatically since the Query String is passed as a String (and it's not possible to differentiate between a '=' character that should be encoded and one that shouldn't. Imagine an input of 'a=&b=c' which can be understood either as 'a' = '&b=c' or as 'a' = '' and 'b' = 'c'). Ideally we would need an API signature that accepts aMap<String, String>
for the Query String, for example
-
createAttachmentRevisionURL
URL createAttachmentRevisionURL(String filename, String spaces, String name, String revision, String querystring, String xwikidb, XWikiContext context)
- Parameters:
spaces
- a serialized space reference which can contain one or several spaces (e.g. "space1.space2"). If a space name contains a dot (".") it must be passed escaped as in "space1\.with\.dot.space2"querystring
- the URL-encoded Query String. It's important to realize that the implementation of this method cannot encode it automatically since the Query String is passed as a String (and it's not possible to differentiate between a '=' character that should be encoded and one that shouldn't. Imagine an input of 'a=&b=c' which can be understood either as 'a' = '&b=c' or as 'a' = '' and 'b' = 'c'). Ideally we would need an API signature that accepts aMap<String, String>
for the Query String, for example
-
getRequestURL
URL getRequestURL(XWikiContext context)
-
getURL
String getURL(URL url, XWikiContext context)
Converts a URL to a string representation. It's up to the implementation to decide whether to perform transformations or not on the URL. For example some implementations will convert the URL to a relative URL if the URL is an internal XWiki URL.- Parameters:
url
- the URL to convert- Returns:
- the converted URL as a string
-
getServerURL
URL getServerURL(XWikiContext context) throws MalformedURLException
Generate the base external URL to access this server.- Parameters:
context
- the XWiki context.- Returns:
- the URL of the server.
- Throws:
MalformedURLException
- error when creating theURL
.
-
-