com.xpn.xwiki.xmlrpc
Class XWikiUtils

java.lang.Object
  extended by 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 $

Constructor Summary
XWikiUtils()
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XWikiUtils

public XWikiUtils()
Method Detail

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:

Parameters:
xwikiApi - The api object for accessing XWiki functionalities.
extendedPageId - The extended page id
failIfDoesntExist - 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.