com.xpn.xwiki.xmlrpc
Class XWikiUtils
java.lang.Object
com.xpn.xwiki.xmlrpc.XWikiUtils
public class XWikiUtils
- extends Object
This is an helper class containing some utility method for handling and setting up the XWiki and XMLRPC data objects
needed to serve XMLRPC requests.
- Version:
- $Id: 5d8e3dafc9274d734d82e9a12a49fae6cd8195fc $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XWikiUtils
public XWikiUtils()
getTokens
public static Map getTokens(XWikiContext context)
checkToken
public static XWikiXmlRpcUser checkToken(String token,
XWikiContext context)
throws Exception
- Throws:
Exception
getDocument
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 language
Main.WebHome?language=fr
: retrieves Main.WebHome in its french translation
Main.WebHome?version=3
: retrieves Main.WebHome at version 3.1 in the default language
Main.WebHome?language=fr&version=2
: retrieves the version 2.1 of the french translation
- Parameters:
xwikiApi
- 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.
- Returns:
- Always returns a document if success. Otherwise an exception is raised. Never returns null.
- Throws:
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
getObjectByGuid
public static Object getObjectByGuid(Document doc,
String guid)
xmlRpcConvert
public static Object xmlRpcConvert(Object object)
Copyright © 2004–2014 XWiki. All rights reserved.