|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.web.XWikiDefaultURLFactory
com.xpn.xwiki.web.XWikiServletURLFactory
com.xpn.xwiki.web.ExportURLFactory
public class ExportURLFactory
Handle URL generation in rendered wiki pages. This implementation makes sure URL will be local URL for exported content (like skin, attachment and pages).
Field Summary | |
---|---|
protected File |
exportDir
Directory where to export attachment. |
protected Set<String> |
exportedPages
Pages for which to convert URL to local. |
protected static org.slf4j.Logger |
LOGGER
Logging tool. |
Fields inherited from class com.xpn.xwiki.web.XWikiServletURLFactory |
---|
contextPath, serverURL |
Constructor Summary | |
---|---|
ExportURLFactory()
ExportURLFactory constructor. |
Method Summary | |
---|---|
URL |
createAttachmentRevisionURL(String filename,
String web,
String name,
String revision,
String xwikidb,
XWikiContext context)
|
URL |
createAttachmentURL(String filename,
String web,
String name,
String action,
String querystring,
String xwikidb,
XWikiContext context)
|
URL |
createResourceURL(String filename,
boolean forceSkinAction,
XWikiContext context)
|
URL |
createSkinURL(String fileName,
String web,
String name,
String wikiId,
XWikiContext context)
|
URL |
createSkinURL(String fileName,
String web,
String name,
String wikiId,
XWikiContext context,
boolean skipSkinDirectory)
|
URL |
createSkinURL(String filename,
String web,
String name,
XWikiContext context)
|
URL |
createSkinURL(String filename,
String web,
String name,
XWikiContext context,
boolean skipSkinDirectory)
|
URL |
createSkinURL(String filename,
String skin,
XWikiContext context)
|
URL |
createURL(String web,
String name,
String action,
String querystring,
String anchor,
String xwikidb,
XWikiContext context)
|
Collection<String> |
getExportedSkinFiles()
|
Collection<String> |
getNeededSkins()
|
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. |
Methods inherited from class com.xpn.xwiki.web.XWikiServletURLFactory |
---|
addFileName, addFileName, createAttachmentRevisionURL, createAttachmentRevisionURL, createExternalURL, createTemplateURL, createURL, findAttachmentForDocRevision, findDeletedAttachmentForDocRevision, getContextPath, getRequestURL, getServerURL, getServerURL, init, isContextDoc, normalizeURL, normalizeURL |
Methods inherited from class com.xpn.xwiki.web.XWikiDefaultURLFactory |
---|
createAttachmentRevisionURL, createAttachmentURL, createExternalURL, createURL, createURL, createURL |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger LOGGER
protected Set<String> exportedPages
protected File exportDir
Constructor Detail |
---|
public ExportURLFactory()
Method Detail |
---|
public Collection<String> getNeededSkins()
public Collection<String> getExportedSkinFiles()
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 web, String name, XWikiContext context)
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiDefaultURLFactory
public URL createSkinURL(String filename, String web, String name, XWikiContext context, boolean skipSkinDirectory)
public URL createSkinURL(String fileName, String web, String name, String wikiId, XWikiContext context)
createSkinURL
in interface XWikiURLFactory
createSkinURL
in class XWikiServletURLFactory
public URL createSkinURL(String fileName, String web, 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 web, String name, String action, String querystring, String anchor, String xwikidb, XWikiContext context)
createURL
in interface XWikiURLFactory
createURL
in class XWikiServletURLFactory
public URL createAttachmentURL(String filename, String web, String name, String action, String querystring, String xwikidb, XWikiContext context)
createAttachmentURL
in interface XWikiURLFactory
createAttachmentURL
in class XWikiServletURLFactory
public URL createAttachmentRevisionURL(String filename, String web, String name, String revision, String xwikidb, XWikiContext context)
createAttachmentRevisionURL
in interface XWikiURLFactory
createAttachmentRevisionURL
in class XWikiDefaultURLFactory
public 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 convert
XWikiDefaultURLFactory.getURL(java.net.URL, com.xpn.xwiki.XWikiContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |