org.xwiki.xmlrpc
Class XWikiXmlRpcClient

java.lang.Object
  extended by org.xwiki.xmlrpc.XWikiXmlRpcClient

public class XWikiXmlRpcClient
extends Object

This class implements the entry point for using the XWiki XMLRPC API. Methods compatible with Confluence are tagged with the category 'ConfluenceAPI'


Constructor Summary
XWikiXmlRpcClient(String endpoint)
          Constructor.
XWikiXmlRpcClient(String endpoint, String rpcHandler)
          Constructor.
 
Method Summary
 org.codehaus.swizzle.confluence.Attachment addAttachment(Integer contentId, org.codehaus.swizzle.confluence.Attachment attachment, byte[] attachmentData)
          Add a new attachment.
 org.codehaus.swizzle.confluence.Comment addComment(org.codehaus.swizzle.confluence.Comment comment)
          Add a new comment.
 org.codehaus.swizzle.confluence.Space addSpace(org.codehaus.swizzle.confluence.Space space)
          Add a new space.
 String convert(String source, String initialSyntaxId, String targetSyntaxId)
          Converts a wiki source from a syntax to another syntax.
 byte[] getAttachmentData(org.codehaus.swizzle.confluence.Attachment attachment)
          Convenience method.
 byte[] getAttachmentData(String pageId, String fileName, String versionNumber)
          Get the binary data associated to the attachment.
 List<org.codehaus.swizzle.confluence.Attachment> getAttachments(org.codehaus.swizzle.confluence.PageSummary pageSummary)
          Convenience method.
 List<org.codehaus.swizzle.confluence.Attachment> getAttachments(String pageId)
          Get attachments.
 XWikiClass getClass(String className)
          Get extended information about a class.
 XWikiClass getClass(XWikiClassSummary classSummary)
          Convenience method.
 List<XWikiClassSummary> getClasses()
          Get classes.
 org.codehaus.swizzle.confluence.Comment getComment(String commentId)
           
 List<org.codehaus.swizzle.confluence.Comment> getComments(org.codehaus.swizzle.confluence.PageSummary pageSummary)
          Convenience method.
 List<org.codehaus.swizzle.confluence.Comment> getComments(String pageId)
          Get page comments.
 List<String> getInputSyntaxes()
          Gets all syntaxes supported by the rendering parsers as an input for a syntax conversion.
 List<XWikiPageHistorySummary> getModifiedPagesHistory(Date date, Integer numberOfResults, Integer start, Boolean fromLatest)
          Returns a list of XWikiPageHistorySummary containing all the pages that have been modified since a given date in all their versions.
 List<XWikiPageHistorySummary> getModifiedPagesHistory(Integer numberOfResults, Integer start)
          Equivalent to getModifiedPagesHistory(new Date(0), numberOfResults, start, true).
 List<XWikiPageHistorySummary> getModifiedPagesHistory(Integer numberOfResults, Integer start, Boolean fromLatest)
          Equivalent to getModifiedPagesHistory(new Date(0), numberOfResults, start, fromLatest).
 XWikiObject getObject(String pageId, String guid)
          Get an XWiki object identified by its GUID.
 XWikiObject getObject(String pageId, String className, Integer id)
          Get XWiki object.
 XWikiObject getObject(String pageId, String className, Integer id, Integer version)
          Get the XWiki object associated with a page at a given version.
 XWikiObject getObject(String pageId, String className, Integer id, Integer version, Integer minorVersion)
          Get XWiki objects associated with a page at a given version.
 XWikiObject getObject(XWikiObjectSummary xwikiObjectSummary)
          Convenience method.
 List<XWikiObjectSummary> getObjects(org.codehaus.swizzle.confluence.PageSummary pageSummary)
          Convenience method.
 List<XWikiObjectSummary> getObjects(String pageId)
          Get XWiki objects associated with a page.
 List<XWikiObjectSummary> getObjects(String pageId, Integer version)
          Get XWiki objects associated with a page at a given version.
 List<XWikiObjectSummary> getObjects(String pageId, Integer version, Integer minorVersion)
          Get XWiki objects associated with a page at a given version.
 List<String> getOutputSyntaxes()
          Gets all syntaxes supported by the rendering as an output for a syntax conversion.
 XWikiPage getPage(String pageId)
          Get full page information and content.
 XWikiPage getPage(String pageId, Integer version)
          Get full page information and content at a given version.
 XWikiPage getPage(String pageId, Integer version, Integer minorVersion)
          Get full page information and content at a given version.
 XWikiPage getPage(String pageId, String language)
          Get full page information and content in a given language.
 XWikiPage getPage(XWikiPageHistorySummary pageHistorySummary)
          Convenience method.
 org.codehaus.swizzle.confluence.Page getPage(XWikiPageSummary pageSummary)
          Convenience method.
 org.codehaus.swizzle.confluence.Page getPage(XWikiPageSummary pageSummary, Integer version)
          Convenience method.
 org.codehaus.swizzle.confluence.Page getPage(XWikiPageSummary pageSummary, String language)
          Convenience method.
 List<XWikiPageHistorySummary> getPageHistory(String pageId)
          Get the history of a page.
 List<XWikiPageHistorySummary> getPageHistory(XWikiPageSummary pageSummary)
          Convenience method.
 List<XWikiPageSummary> getPages(org.codehaus.swizzle.confluence.SpaceSummary space)
          Convenience method.
 List<XWikiPageSummary> getPages(String spaceName)
          Get pages in space.
 String getRenderedContent(String pageId, String syntaxId)
          Gets the rendered content of an existing document.
 org.codehaus.swizzle.confluence.ServerInfo getServerInfo()
          Get server info.
 org.codehaus.swizzle.confluence.Space getSpace(org.codehaus.swizzle.confluence.SpaceSummary spaceSummary)
          Convenience method.
 org.codehaus.swizzle.confluence.Space getSpace(String spaceName)
          Get information about a given space.
 List<org.codehaus.swizzle.confluence.SpaceSummary> getSpaces()
          Get spaces.
 void login(String username, String password)
          Login with the provided user.
 boolean logout()
          Logout.
 Boolean removeAttachment(org.codehaus.swizzle.confluence.Attachment attachment)
          Convenience method.
 Boolean removeAttachment(String pageId, String fileName)
          Remove attachment.
 Boolean removeComment(String commentId)
          Remove a comment.
 Boolean removeObject(String pageId, String className, Integer id)
          Remove an XWiki Object.
 Boolean removeObject(XWikiObjectSummary objectSummary)
          Convenience method.
 Boolean removePage(String pageId)
          Remove a page.
 Boolean removePage(XWikiPageSummary page)
          Convenience method.
 Boolean removeSpace(org.codehaus.swizzle.confluence.SpaceSummary spaceSummary)
          Convenience method.
 Boolean removeSpace(String spaceKey)
          Remove space and all of its pages.
 String renderContent(String space, String pageId, String content)
          Render a page or content in HTML.
 String renderPageContent(String pageId, String content, String sourceSyntaxId, String targetSyntaxId)
          Renders a text in the context of a wiki page.
 List<org.codehaus.swizzle.confluence.SearchResult> search(String query, Integer maxResults)
           
 List<org.codehaus.swizzle.confluence.SearchResult> searchAllPagesIds()
           
 XWikiObject storeObject(XWikiObject xwikiObject)
          Add an XWiki object.
 XWikiObject storeObject(XWikiObject xwikiObject, Boolean checkVersion)
          Store an object and check if the current object's page version matches with the one of the object to be stored.
 XWikiPage storePage(org.codehaus.swizzle.confluence.Page page)
          Store a page.
 XWikiPage storePage(org.codehaus.swizzle.confluence.Page page, Boolean checkVersion)
          Store a page and check if the current page's version matches with the one of the page to be stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XWikiXmlRpcClient

public XWikiXmlRpcClient(String endpoint)
                  throws MalformedURLException
Constructor.

Parameters:
endpoint - The endpoint for the XMLRPC servlet.
Throws:
MalformedURLException

XWikiXmlRpcClient

public XWikiXmlRpcClient(String endpoint,
                         String rpcHandler)
                  throws MalformedURLException
Constructor.

Parameters:
endpoint - The endpoint for the XMLRPC servlet.
rpcHandler - The id of the XMLRPC handler.
Throws:
MalformedURLException
Method Detail

login

public void login(String username,
                  String password)
           throws org.apache.xmlrpc.XmlRpcException
Login with the provided user. If the method is not called anonymous user is used.

Parameters:
username - the user id
password - the user password
Throws:
org.apache.xmlrpc.XmlRpcException - If an invalid username/password was specified or communication problem.

logout

public boolean logout()
               throws org.apache.xmlrpc.XmlRpcException
Logout.

Returns:
True if logout was succesfull.
Throws:
org.apache.xmlrpc.XmlRpcException

getServerInfo

public org.codehaus.swizzle.confluence.ServerInfo getServerInfo()
                                                         throws org.apache.xmlrpc.XmlRpcException
Get server info.

Returns:
Server information.
Throws:
org.apache.xmlrpc.XmlRpcException

getSpaces

public List<org.codehaus.swizzle.confluence.SpaceSummary> getSpaces()
                                                             throws org.apache.xmlrpc.XmlRpcException
Get spaces.

Returns:
A list of SpaceSummaries for each space defined in the remote XWiki.
Throws:
org.apache.xmlrpc.XmlRpcException

getSpace

public org.codehaus.swizzle.confluence.Space getSpace(String spaceName)
                                               throws org.apache.xmlrpc.XmlRpcException
Get information about a given space.

Parameters:
spaceName -
Returns:
A Space object containing extended space information.
Throws:
org.apache.xmlrpc.XmlRpcException

getSpace

public org.codehaus.swizzle.confluence.Space getSpace(org.codehaus.swizzle.confluence.SpaceSummary spaceSummary)
                                               throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getSpace(String)

addSpace

public org.codehaus.swizzle.confluence.Space addSpace(org.codehaus.swizzle.confluence.Space space)
                                               throws org.apache.xmlrpc.XmlRpcException
Add a new space.

Parameters:
space - The Space object containing information about the new space.
Returns:
A Space object with up-to-date information about the newly created space.
Throws:
org.apache.xmlrpc.XmlRpcException

removeSpace

public Boolean removeSpace(String spaceKey)
                    throws org.apache.xmlrpc.XmlRpcException
Remove space and all of its pages.

Parameters:
spaceKey -
Returns:
True if the space was successfully deleted.
Throws:
org.apache.xmlrpc.XmlRpcException

removeSpace

public Boolean removeSpace(org.codehaus.swizzle.confluence.SpaceSummary spaceSummary)
                    throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
removeSpace(String)

getPages

public List<XWikiPageSummary> getPages(String spaceName)
                                throws org.apache.xmlrpc.XmlRpcException
Get pages in space.

Parameters:
spaceName -
Returns:
A list of SpaceSummaries for each page in the given space.
Throws:
org.apache.xmlrpc.XmlRpcException

getPages

public List<XWikiPageSummary> getPages(org.codehaus.swizzle.confluence.SpaceSummary space)
                                throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getPages(String)

getPage

public XWikiPage getPage(String pageId)
                  throws org.apache.xmlrpc.XmlRpcException
Get full page information and content.

Parameters:
pageId -
Returns:
A Page object containing all the information.
Throws:
org.apache.xmlrpc.XmlRpcException

getPage

public org.codehaus.swizzle.confluence.Page getPage(XWikiPageSummary pageSummary)
                                             throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getPage(String)

getPage

public XWikiPage getPage(String pageId,
                         String language)
                  throws org.apache.xmlrpc.XmlRpcException
Get full page information and content in a given language.

Parameters:
pageId -
language -
Returns:
A Page object containing all the information.
Throws:
org.apache.xmlrpc.XmlRpcException

getPage

public org.codehaus.swizzle.confluence.Page getPage(XWikiPageSummary pageSummary,
                                                    String language)
                                             throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getPage(String, String)

getPage

public XWikiPage getPage(String pageId,
                         Integer version)
                  throws org.apache.xmlrpc.XmlRpcException
Get full page information and content at a given version.

Parameters:
pageId -
version -
Returns:
A Page object containing all the information.
Throws:
org.apache.xmlrpc.XmlRpcException

getPage

public org.codehaus.swizzle.confluence.Page getPage(XWikiPageSummary pageSummary,
                                                    Integer version)
                                             throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getPage(String, Integer)

getPage

public XWikiPage getPage(String pageId,
                         Integer version,
                         Integer minorVersion)
                  throws org.apache.xmlrpc.XmlRpcException
Get full page information and content at a given version.

Parameters:
pageId -
version -
Returns:
A Page object containing all the information.
Throws:
org.apache.xmlrpc.XmlRpcException

getPage

public XWikiPage getPage(XWikiPageHistorySummary pageHistorySummary)
                  throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getPage(String, Integer, Integer)

getPageHistory

public List<XWikiPageHistorySummary> getPageHistory(String pageId)
                                             throws org.apache.xmlrpc.XmlRpcException
Get the history of a page.

Parameters:
pageId -
Returns:
A list of PageHistorySummary for each revision of the page.
Throws:
org.apache.xmlrpc.XmlRpcException

getPageHistory

public List<XWikiPageHistorySummary> getPageHistory(XWikiPageSummary pageSummary)
                                             throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getPageHistory(String)

storePage

public XWikiPage storePage(org.codehaus.swizzle.confluence.Page page)
                    throws org.apache.xmlrpc.XmlRpcException
Store a page.

Parameters:
page -
Returns:
The Page object with the up-to-date information about the newly stored page.
Throws:
org.apache.xmlrpc.XmlRpcException

removePage

public Boolean removePage(String pageId)
                   throws org.apache.xmlrpc.XmlRpcException
Remove a page.

Parameters:
pageId -
Returns:
True if the page has been successfully removed.
Throws:
org.apache.xmlrpc.XmlRpcException

removePage

public Boolean removePage(XWikiPageSummary page)
                   throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
removePage(String)

renderContent

public String renderContent(String space,
                            String pageId,
                            String content)
                     throws org.apache.xmlrpc.XmlRpcException
Render a page or content in HTML.

Parameters:
space - Ignored
pageId - The page id in the form of Space.Page
content - The content to be rendered. If content == "" then the page content is rendered.
Returns:
The rendered content.
Throws:
org.apache.xmlrpc.XmlRpcException - XmlRpcException If the page does not exist or the user has not the right to access it.

getComments

public List<org.codehaus.swizzle.confluence.Comment> getComments(String pageId)
                                                          throws org.apache.xmlrpc.XmlRpcException
Get page comments.

Parameters:
pageId -
Returns:
A list of Comment objects for each comment associated to the page.
Throws:
org.apache.xmlrpc.XmlRpcException

getComments

public List<org.codehaus.swizzle.confluence.Comment> getComments(org.codehaus.swizzle.confluence.PageSummary pageSummary)
                                                          throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getComments(String)

getComment

public org.codehaus.swizzle.confluence.Comment getComment(String commentId)
                                                   throws org.apache.xmlrpc.XmlRpcException
Throws:
org.apache.xmlrpc.XmlRpcException

addComment

public org.codehaus.swizzle.confluence.Comment addComment(org.codehaus.swizzle.confluence.Comment comment)
                                                   throws org.apache.xmlrpc.XmlRpcException
Add a new comment.

Parameters:
comment - A Comment object containing the comment to be added.
Returns:
A Comment object containing the information about the newly created comment.
Throws:
org.apache.xmlrpc.XmlRpcException

removeComment

public Boolean removeComment(String commentId)
                      throws org.apache.xmlrpc.XmlRpcException
Remove a comment.

Parameters:
commentId -
Returns:
True if the comment has been successfully removed.
Throws:
org.apache.xmlrpc.XmlRpcException

getAttachments

public List<org.codehaus.swizzle.confluence.Attachment> getAttachments(String pageId)
                                                                throws org.apache.xmlrpc.XmlRpcException
Get attachments.

Parameters:
pageId -
Returns:
A list of Attachment objects describing the attachments associated to the page.
Throws:
org.apache.xmlrpc.XmlRpcException

getAttachments

public List<org.codehaus.swizzle.confluence.Attachment> getAttachments(org.codehaus.swizzle.confluence.PageSummary pageSummary)
                                                                throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getAttachments(String)

getAttachmentData

public byte[] getAttachmentData(String pageId,
                                String fileName,
                                String versionNumber)
                         throws org.apache.xmlrpc.XmlRpcException
Get the binary data associated to the attachment.

Parameters:
pageId -
fileName -
versionNumber - Ignored.
Returns:
The actual attachment data.
Throws:
org.apache.xmlrpc.XmlRpcException

getAttachmentData

public byte[] getAttachmentData(org.codehaus.swizzle.confluence.Attachment attachment)
                         throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getAttachmentData(String, String, String)

addAttachment

public org.codehaus.swizzle.confluence.Attachment addAttachment(Integer contentId,
                                                                org.codehaus.swizzle.confluence.Attachment attachment,
                                                                byte[] attachmentData)
                                                         throws org.apache.xmlrpc.XmlRpcException
Add a new attachment.

Parameters:
contentId - Ignored. (It is here because the Confluence API signature declares it)
attachment - The Attachment object describing the attachment.
attachmentData - The actual attachment data.
Returns:
An Attachment object describing the newly added attachment.
Throws:
org.apache.xmlrpc.XmlRpcException

removeAttachment

public Boolean removeAttachment(String pageId,
                                String fileName)
                         throws org.apache.xmlrpc.XmlRpcException
Remove attachment.

Parameters:
pageId -
fileName -
Returns:
True if the attachment has been successfully removed.
Throws:
org.apache.xmlrpc.XmlRpcException

removeAttachment

public Boolean removeAttachment(org.codehaus.swizzle.confluence.Attachment attachment)
                         throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
removeAttachment(String, String)

getClasses

public List<XWikiClassSummary> getClasses()
                                   throws org.apache.xmlrpc.XmlRpcException
Get classes.

Returns:
A list of XWikiClassSummaries for each class defined in the XWiki instance.
Throws:
org.apache.xmlrpc.XmlRpcException

getClass

public XWikiClass getClass(String className)
                    throws org.apache.xmlrpc.XmlRpcException
Get extended information about a class.

Parameters:
className -
Returns:
A XWikiClass object with the extended information.
Throws:
org.apache.xmlrpc.XmlRpcException

getClass

public XWikiClass getClass(XWikiClassSummary classSummary)
                    throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getClass(String)

getObjects

public List<XWikiObjectSummary> getObjects(String pageId)
                                    throws org.apache.xmlrpc.XmlRpcException
Get XWiki objects associated with a page.

Parameters:
pageId -
Returns:
A list containing an XWikiObject summary for every object found in the page.
Throws:
org.apache.xmlrpc.XmlRpcException

getObjects

public List<XWikiObjectSummary> getObjects(String pageId,
                                           Integer version)
                                    throws org.apache.xmlrpc.XmlRpcException
Get XWiki objects associated with a page at a given version.

Parameters:
pageId -
version -
Returns:
A list containing an XWikiObject summary for every object found in the page.
Throws:
org.apache.xmlrpc.XmlRpcException

getObjects

public List<XWikiObjectSummary> getObjects(String pageId,
                                           Integer version,
                                           Integer minorVersion)
                                    throws org.apache.xmlrpc.XmlRpcException
Get XWiki objects associated with a page at a given version.

Parameters:
pageId -
version -
minorVersion -
Returns:
A list containing an XWikiObject summary for every object found in the page.
Throws:
org.apache.xmlrpc.XmlRpcException

getObjects

public List<XWikiObjectSummary> getObjects(org.codehaus.swizzle.confluence.PageSummary pageSummary)
                                    throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getObjects(PageSummary)

getObject

public XWikiObject getObject(String pageId,
                             String className,
                             Integer id)
                      throws org.apache.xmlrpc.XmlRpcException
Get XWiki object.

Parameters:
pageId -
className -
id - The XWiki object id.
Returns:
An XWiki object with all the association property -> values.
Throws:
org.apache.xmlrpc.XmlRpcException

getObject

public XWikiObject getObject(String pageId,
                             String guid)
                      throws org.apache.xmlrpc.XmlRpcException
Get an XWiki object identified by its GUID.

Parameters:
pageId - the document holding the object.
guid - the object's GUID.
Returns:
An XWiki object with all the association property -> values.
Throws:
org.apache.xmlrpc.XmlRpcException

getObject

public XWikiObject getObject(String pageId,
                             String className,
                             Integer id,
                             Integer version)
                      throws org.apache.xmlrpc.XmlRpcException
Get the XWiki object associated with a page at a given version.

Parameters:
pageId -
className -
id -
version -
Returns:
An XWiki object with all the association property -> values.
Throws:
org.apache.xmlrpc.XmlRpcException

getObject

public XWikiObject getObject(String pageId,
                             String className,
                             Integer id,
                             Integer version,
                             Integer minorVersion)
                      throws org.apache.xmlrpc.XmlRpcException
Get XWiki objects associated with a page at a given version.

Parameters:
pageId -
className -
id -
version -
minorVersion -
Returns:
An XWiki object with all the association property -> values.
Throws:
org.apache.xmlrpc.XmlRpcException

getObject

public XWikiObject getObject(XWikiObjectSummary xwikiObjectSummary)
                      throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
getObject(String, String, Integer)

storeObject

public XWikiObject storeObject(XWikiObject xwikiObject)
                        throws org.apache.xmlrpc.XmlRpcException
Add an XWiki object.

Parameters:
xwikiObject -
Returns:
An XWikiObject with the up-to-date information about the stored object.
Throws:
org.apache.xmlrpc.XmlRpcException

removeObject

public Boolean removeObject(String pageId,
                            String className,
                            Integer id)
                     throws org.apache.xmlrpc.XmlRpcException
Remove an XWiki Object.

Parameters:
pageId -
className -
id -
Returns:
True if the XWiki objec has been successfully removed.
Throws:
org.apache.xmlrpc.XmlRpcException

removeObject

public Boolean removeObject(XWikiObjectSummary objectSummary)
                     throws org.apache.xmlrpc.XmlRpcException
Convenience method.

Throws:
org.apache.xmlrpc.XmlRpcException
See Also:
removeObject(String, String, Integer)

search

public List<org.codehaus.swizzle.confluence.SearchResult> search(String query,
                                                                 Integer maxResults)
                                                          throws org.apache.xmlrpc.XmlRpcException
Parameters:
query - The string to be looked for.
maxResults - (0 for all)
Returns:
Throws:
org.apache.xmlrpc.XmlRpcException

searchAllPagesIds

public List<org.codehaus.swizzle.confluence.SearchResult> searchAllPagesIds()
                                                                     throws org.apache.xmlrpc.XmlRpcException
Returns:
All the page ids available in the wiki.
Throws:
org.apache.xmlrpc.XmlRpcException

getModifiedPagesHistory

public List<XWikiPageHistorySummary> getModifiedPagesHistory(Date date,
                                                             Integer numberOfResults,
                                                             Integer start,
                                                             Boolean fromLatest)
                                                      throws org.apache.xmlrpc.XmlRpcException
Returns a list of XWikiPageHistorySummary containing all the pages that have been modified since a given date in all their versions.

Parameters:
date - The starting date
numberOfResults - The number of results to be returned
start - The start offset in the result set
fromLatest - True if the result set will list recent changed pages before.
Returns:
A list of XWikiPageHistorySummary
Throws:
org.apache.xmlrpc.XmlRpcException
QueryException

getModifiedPagesHistory

public List<XWikiPageHistorySummary> getModifiedPagesHistory(Integer numberOfResults,
                                                             Integer start,
                                                             Boolean fromLatest)
                                                      throws org.apache.xmlrpc.XmlRpcException
Equivalent to getModifiedPagesHistory(new Date(0), numberOfResults, start, fromLatest). Takes into account all the modifications.

Throws:
org.apache.xmlrpc.XmlRpcException

getModifiedPagesHistory

public List<XWikiPageHistorySummary> getModifiedPagesHistory(Integer numberOfResults,
                                                             Integer start)
                                                      throws org.apache.xmlrpc.XmlRpcException
Equivalent to getModifiedPagesHistory(new Date(0), numberOfResults, start, true). Takes into account all the modifications in descending order (i.e., latest first).

Throws:
org.apache.xmlrpc.XmlRpcException

storePage

public XWikiPage storePage(org.codehaus.swizzle.confluence.Page page,
                           Boolean checkVersion)
                    throws org.apache.xmlrpc.XmlRpcException
Store a page and check if the current page's version matches with the one of the page to be stored.

Parameters:
page - The page to be stored.
checkVersion - True if the version has to be checked.
Returns:
The updated XWikiPage or an XWikiPage with all its fields empty in case of version mismatch.
Throws:
org.apache.xmlrpc.XmlRpcException

storeObject

public XWikiObject storeObject(XWikiObject xwikiObject,
                               Boolean checkVersion)
                        throws org.apache.xmlrpc.XmlRpcException
Store an object and check if the current object's page version matches with the one of the object to be stored.

Parameters:
xwikiObject - The object to be stored.
checkVersion - True if the version has to be checked.
Returns:
The updated XWikiObject or an XWikiObject with all its fields empty in case of version mismatch.
Throws:
org.apache.xmlrpc.XmlRpcException

convert

public String convert(String source,
                      String initialSyntaxId,
                      String targetSyntaxId)
               throws org.apache.xmlrpc.XmlRpcException
Converts a wiki source from a syntax to another syntax.

Parameters:
source - The content to be converted.
initialSyntaxId - The initial syntax of the source.
targetSyntaxId - The final syntax of the returned content.
Returns:
The converted source.
Throws:
org.apache.xmlrpc.XmlRpcException - An invalid token is provided, the syntaxId is not supported, the source is invalid or the conversion fails.

getInputSyntaxes

public List<String> getInputSyntaxes()
                              throws org.apache.xmlrpc.XmlRpcException
Gets all syntaxes supported by the rendering parsers as an input for a syntax conversion.

Returns:
A list containing all syntaxes supported by rendering parsers.
Throws:
Exception - An invalid token is provided or the syntax lookup fails.
org.apache.xmlrpc.XmlRpcException

getOutputSyntaxes

public List<String> getOutputSyntaxes()
                               throws org.apache.xmlrpc.XmlRpcException
Gets all syntaxes supported by the rendering as an output for a syntax conversion.

Returns:
A list containing all syntaxes supported by renderers.
Throws:
org.apache.xmlrpc.XmlRpcException - An invalid token is provided or the syntax lookup fails.

renderPageContent

public String renderPageContent(String pageId,
                                String content,
                                String sourceSyntaxId,
                                String targetSyntaxId)
                         throws org.apache.xmlrpc.XmlRpcException
Renders a text in the context of a wiki page.

Parameters:
pageId - The id of the page.
content - The contenxt to be rendered.
sourceSyntaxId - The syntax of the content.
targetSyntaxId - The target syntax of the rendered content
Returns:
The rendered content.
Throws:
org.apache.xmlrpc.XmlRpcException - If a invalid token is provided, an unsuported syntax id is given or the rendering fails.

getRenderedContent

public String getRenderedContent(String pageId,
                                 String syntaxId)
                          throws org.apache.xmlrpc.XmlRpcException
Gets the rendered content of an existing document.

Parameters:
pageId - The id of the page.
syntaxId - The target syntax of the rendered content
Returns:
The renderded content
Throws:
Exception - If a invalid token is provided, an unsuported syntax id is given or the rendering fails.
org.apache.xmlrpc.XmlRpcException


Copyright © 2004-2012 XWiki. All Rights Reserved.