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, daemon, defaultURL, defaultURLs, originalURL
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)
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 spaces,
String name,
String wikiId,
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 wikiId,
XWikiContext context,
boolean skipSkinDirectory) |
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 |
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,
boolean skipSkinDirectory) |
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 |
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<DocumentReference> exportedPages,
File exportDir,
FilesystemExportContext exportContext,
XWikiContext context)
Init the url factory.
|
void |
init(Collection<String> exportedPages,
File exportDir,
XWikiContext context)
Deprecated.
starting with 8.4.5/9.0, use
init(Collection, File, FilesystemExportContext, XWikiContext) |
addFileName, addFileName, createAttachmentRevisionURL, createAttachmentRevisionURL, createExternalURL, createTemplateURL, createURL, findAttachmentForDocRevision, findDeletedAttachmentForDocRevision, getContextPath, getDefaultURL, getRequestURL, getServerURL, getServerURL, init, isContextDoc, normalizeURL, normalizeURL, setDefaultURL
createAttachmentRevisionURL, createAttachmentURL, createExternalURL, createSkinURL, createURL, createURL, createURL
protected static final org.slf4j.Logger LOGGER
@Deprecated protected Set<String> exportedPages
@Deprecated protected File exportDir
public FilesystemExportContext getFilesystemExportContext()
@Deprecated public Collection<String> getNeededSkins()
getFilesystemExportContext()
@Deprecated public Collection<String> getExportedSkinFiles()
getFilesystemExportContext()
public void init(Collection<DocumentReference> exportedPages, File exportDir, FilesystemExportContext exportContext, XWikiContext context)
exportedPages
- the pages that will be exported.exportDir
- the directory where to copy exported objects (attachments).exportContext
- the context for the exportcontext
- the XWiki context.@Deprecated public void init(Collection<String> exportedPages, File exportDir, XWikiContext context)
init(Collection, File, FilesystemExportContext, XWikiContext)
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, Map<String,Object> queryParameters)
XWikiURLFactory
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiServletURLFactory
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 URLpublic URL createSkinURL(String filename, String skin, XWikiContext context)
XWikiURLFactory
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiDefaultURLFactory
filename
- the file to reach.skin
- the skin where the file should be loadedcontext
- current contextpublic URL createSkinURL(String filename, String spaces, String name, XWikiContext context)
XWikiURLFactory
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiDefaultURLFactory
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.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)
XWikiURLFactory
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiDefaultURLFactory
fileName
- the path of the file to reach.spaces
- the spaces where the file is located.name
- the directory where the file is located.wikiId
- the wiki in which the file is located.context
- current context.public URL createSkinURL(String filename, String spaces, String name, String xwikidb, XWikiContext context, Map<String,Object> queryParameters)
XWikiURLFactory
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiServletURLFactory
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.public URL createSkinURL(String fileName, String spaces, String name, String wikiId, XWikiContext context, boolean skipSkinDirectory)
public URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context, Map<String,Object> queryParameters)
XWikiURLFactory
createResourceURL
in interface XWikiURLFactory
createResourceURL
in class XWikiServletURLFactory
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.public URL createResourceURL(String filename, boolean forceSkinAction, XWikiContext context)
XWikiURLFactory
createResourceURL
in interface XWikiURLFactory
createResourceURL
in class XWikiDefaultURLFactory
filename
- the path of the file to load.forceSkinAction
- if true specify the skin directory in the URL.context
- the current context.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
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 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
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 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
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"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–2021 XWiki. All rights reserved.