Search in sources :

Example 16 with XWikiURLFactory

use of com.xpn.xwiki.web.XWikiURLFactory in project xwiki-platform by xwiki.

the class ObjectPropertyWikiResource method getURL.

@Override
public String getURL(XWikiDocument document) throws Exception {
    XWikiContext xcontext = this.xcontextProvider.get();
    XWikiURLFactory urlf = xcontext.getURLFactory();
    URL url = urlf.createSkinURL(this.reference.getName(), document.getSpace(), document.getName(), document.getDatabase(), xcontext);
    return urlf.getURL(url, xcontext);
}
Also used : XWikiURLFactory(com.xpn.xwiki.web.XWikiURLFactory) XWikiContext(com.xpn.xwiki.XWikiContext) URL(java.net.URL)

Aggregations

XWikiURLFactory (com.xpn.xwiki.web.XWikiURLFactory)16 XWikiContext (com.xpn.xwiki.XWikiContext)10 URL (java.net.URL)6 DocumentReference (org.xwiki.model.reference.DocumentReference)6 Test (org.junit.Test)4 ExternalServletURLFactory (com.xpn.xwiki.web.ExternalServletURLFactory)3 XWikiServletResponseStub (com.xpn.xwiki.web.XWikiServletResponseStub)3 XWiki (com.xpn.xwiki.XWiki)2 XWikiException (com.xpn.xwiki.XWikiException)2 XWikiDocument (com.xpn.xwiki.doc.XWikiDocument)2 BaseObject (com.xpn.xwiki.objects.BaseObject)2 IOException (java.io.IOException)2 Locale (java.util.Locale)2 MessagingException (javax.mail.MessagingException)2 VelocityContext (org.apache.velocity.VelocityContext)2 IBlogServiceRole (com.celements.blog.service.IBlogServiceRole)1 Document (com.xpn.xwiki.api.Document)1 WikiSkin (com.xpn.xwiki.internal.skin.WikiSkin)1 XWikiStoreInterface (com.xpn.xwiki.store.XWikiStoreInterface)1 XWikiRequest (com.xpn.xwiki.web.XWikiRequest)1