public class XWikiUtils extends Object
Constructor and Description |
---|
XWikiUtils() |
Modifier and Type | Method and Description |
---|---|
static XWikiXmlRpcUser |
checkToken(String token,
XWikiContext context) |
static Document |
getDocument(XWiki xwikiApi,
String extendedPageId,
boolean failIfDoesntExist)
Gets a document.
|
static Object |
getObjectByGuid(Document doc,
String guid) |
static Map |
getTokens(XWikiContext context) |
static Object |
xmlRpcConvert(Object object) |
public static Map getTokens(XWikiContext context)
public static XWikiXmlRpcUser checkToken(String token, XWikiContext context) throws Exception
Exception
public static Document getDocument(XWiki xwikiApi, String extendedPageId, boolean failIfDoesntExist) throws Exception
Gets a document. This method can be used to retrieve a specific translation or a version of a page by using extended ids in the form of Space.Page[?language=l&version=v&minorVersion=mv] where all parameters are optional.
For example:
Main.WebHome
: retrieves Main.WebHome at its latest version in the default languageMain.WebHome?language=fr
: retrieves Main.WebHome in its french translationMain.WebHome?version=3
: retrieves Main.WebHome at version 3.1 in the default languageMain.WebHome?language=fr&version=2
: retrieves the version 2.1 of the french translationxwikiApi
- The api object for accessing XWiki functionalities.extendedPageId
- The extended page idfailIfDoesntExist
- True is an exception has to be raised if the page doesn't exist.Exception
XmlRpcException
- An exception is thrown if the requested document doesn't exist or cannot be accessed or
if there has been a problem with the underlying XWiki infrastructure.Exception
Copyright © 2004–2014 XWiki. All rights reserved.