public class ExportURLFactory extends XWikiServletURLFactory
Modifier and Type | Field and Description |
---|---|
protected File |
exportDir
Deprecated.
since 6.2RC1, use {link #getExportURLFactoryContext} instead
|
protected Set<String> |
exportedPages
Deprecated.
since 6.2RC1, use {link #getExportURLFactoryContext} instead
|
protected static org.slf4j.Logger |
LOGGER
Logging tool.
|
contextPath, serverURL
Constructor and Description |
---|
ExportURLFactory()
ExportURLFactory constructor.
|
Modifier and Type | Method and Description |
---|---|
URL |
createAttachmentRevisionURL(String filename,
String spaces,
String name,
String revision,
String xwikidb,
XWikiContext context) |
URL |
createAttachmentURL(String filename,
String spaces,
String name,
String action,
String querystring,
String xwikidb,
XWikiContext context) |
URL |
createResourceURL(String filename,
boolean forceSkinAction,
XWikiContext context) |
URL |
createSkinURL(String fileName,
String spaces,
String name,
String wikiId,
XWikiContext context) |
URL |
createSkinURL(String fileName,
String spaces,
String name,
String wikiId,
XWikiContext context,
boolean skipSkinDirectory) |
URL |
createSkinURL(String filename,
String spaces,
String name,
XWikiContext context) |
URL |
createSkinURL(String filename,
String spaces,
String name,
XWikiContext context,
boolean skipSkinDirectory) |
URL |
createSkinURL(String filename,
String skin,
XWikiContext context) |
URL |
createURL(String spaces,
String name,
String action,
String querystring,
String anchor,
String xwikidb,
XWikiContext context) |
Collection<String> |
getExportedSkinFiles()
Deprecated.
since 6.2RC1, use
getFilesystemExportContext() |
FilesystemExportContext |
getFilesystemExportContext() |
Collection<String> |
getNeededSkins()
Deprecated.
since 6.2RC1, use
getFilesystemExportContext() |
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.
|
void |
init(Collection<String> exportedPages,
File exportDir,
XWikiContext context)
Init the url factory.
|
addFileName, addFileName, createAttachmentRevisionURL, createAttachmentRevisionURL, createExternalURL, createTemplateURL, createURL, findAttachmentForDocRevision, findDeletedAttachmentForDocRevision, getContextPath, getRequestURL, getServerURL, getServerURL, init, isContextDoc, normalizeURL, normalizeURL
createAttachmentRevisionURL, createAttachmentURL, createExternalURL, createURL, createURL, createURL
protected static final org.slf4j.Logger LOGGER
@Deprecated protected Set<String> exportedPages
@Deprecated protected File exportDir
@Unstable public FilesystemExportContext getFilesystemExportContext()
@Deprecated public Collection<String> getNeededSkins()
getFilesystemExportContext()
@Deprecated public Collection<String> getExportedSkinFiles()
getFilesystemExportContext()
public void init(Collection<String> exportedPages, File exportDir, XWikiContext context)
exportedPages
- the pages that will be exported.exportDir
- the directory where to copy exported objects (attachments).context
- the XWiki context.public URL createSkinURL(String filename, String skin, XWikiContext context)
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiServletURLFactory
public URL createSkinURL(String filename, String spaces, String name, XWikiContext context)
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiDefaultURLFactory
public URL createSkinURL(String filename, String spaces, String name, XWikiContext context, boolean skipSkinDirectory)
public URL createSkinURL(String fileName, String spaces, String name, String wikiId, XWikiContext context)
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiServletURLFactory
public URL createSkinURL(String fileName, String spaces, String name, String wikiId, XWikiContext context, boolean skipSkinDirectory)
public URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context)
createResourceURL
in interface XWikiURLFactory
createResourceURL
in class XWikiServletURLFactory
public URL createURL(String spaces, String name, String action, String querystring, String anchor, String xwikidb, XWikiContext context)
createURL
in interface XWikiURLFactory
createURL
in class XWikiServletURLFactory
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 a Map<String, String>
for the Query String, for
examplepublic URL createAttachmentURL(String filename, String spaces, String name, String action, String querystring, String xwikidb, XWikiContext context)
createAttachmentURL
in interface XWikiURLFactory
createAttachmentURL
in class XWikiServletURLFactory
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 a Map<String, String>
for the Query String, for
examplepublic URL createAttachmentRevisionURL(String filename, String spaces, String name, String revision, String xwikidb, XWikiContext context)
createAttachmentRevisionURL
in interface XWikiURLFactory
createAttachmentRevisionURL
in class XWikiDefaultURLFactory
xwikidb
- 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 a Map<String, String>
for the Query String, for
examplepublic String getURL(URL url, XWikiContext context)
XWikiServletURLFactory
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
getURL
in interface XWikiURLFactory
getURL
in class XWikiServletURLFactory
url
- the URL to convertXWikiDefaultURLFactory.getURL(java.net.URL, com.xpn.xwiki.XWikiContext)
Copyright © 2004–2015 XWiki. All rights reserved.