com.xpn.xwiki.xmlrpc
Class DomainObjectFactory

java.lang.Object
  extended by com.xpn.xwiki.xmlrpc.DomainObjectFactory

public class DomainObjectFactory
extends Object

This class contains utility methods for building xmlrpc domain objects.


Constructor Summary
DomainObjectFactory()
           
 
Method Summary
static Attachment createAttachment(Attachment xwikiAttachment)
          Create an Attachment object containing information about an attachment.
static Comment createComment(Document document, Object commentObject)
          Create a comment object containing all the information concerning a document comment.
static XWikiObject createEmptyXWikiObject()
           
static XWikiPage createEmptyXWikiPage()
           
static SearchResult createSearchResult(String pageId)
          Create a search result object.
static Space createSpace(Document spaceWebHome)
          Create a space from its WebHome document.
static Space createSpace(String spaceKey)
          Create a space description.
static SpaceSummary createSpaceSummary(Document spaceWebHome)
          Create a space summary starting from the space Web home.
static SpaceSummary createSpaceSummary(String spaceKey)
          Create a space summary
static XWikiClass createXWikiClass(Class xwikiClass)
          Create an XWikiClass object with all the information about a given XWiki class
static XWikiClassSummary createXWikiClassSummary(String className)
          Create a summary of an XWiki class.
static XWikiObject createXWikiObject(XWiki xwiki, XWikiContext xwikiContext, Document document, Object object)
          Create an XWikiObject containing all the information and attributed of a given xwiki object.
static XWikiObjectSummary createXWikiObjectSummary(Document document, Object object)
          Create a summary of a given xwiki object.
static XWikiPage createXWikiPage(Document document, boolean useExtendedPageId)
          Create a page description from an XWiki document.
static XWikiPageHistorySummary createXWikiPageHistorySummary(Document document)
          Create a page history summary containing revision information about a document.
static XWikiPageSummary createXWikiPageSummary(Document document)
          Create a page summary description from an XWiki document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomainObjectFactory

public DomainObjectFactory()
Method Detail

createSpaceSummary

public static SpaceSummary createSpaceSummary(String spaceKey)
Create a space summary

Returns:
The SpaceSummary representing the space.

createSpaceSummary

public static SpaceSummary createSpaceSummary(Document spaceWebHome)
Create a space summary starting from the space Web home.

Returns:
The SpaceSummary representing the space.

createSpace

public static Space createSpace(String spaceKey)
Create a space description.

Returns:
A Space object containing all the information about the space.

createSpace

public static Space createSpace(Document spaceWebHome)
Create a space from its WebHome document.

Returns:
A Space object containing all the information about the space.

createXWikiPageSummary

public static XWikiPageSummary createXWikiPageSummary(Document document)
                                               throws XWikiException
Create a page summary description from an XWiki document.

Returns:
An XWikiPageSummary with the information.
Throws:
XWikiException - If there is a problem getting page translations.

createXWikiPage

public static XWikiPage createXWikiPage(Document document,
                                        boolean useExtendedPageId)
                                 throws Exception
Create a page description from an XWiki document. The page title is the current title if the current title != "", otherwise it is set to the page name (i.e., the name part in the page Space.Name id)

Parameters:
useExtendedPageId - true if the id should contain additional information concerning the version, language etc. In this case the pageId will be in the form Space.Page?param=value¶m=value&...
Returns:
An XWikiPage object representing the page.
Throws:
XWikiException - If there is a problem getting page translations.
Exception

createEmptyXWikiPage

public static XWikiPage createEmptyXWikiPage()

createXWikiPageHistorySummary

public static XWikiPageHistorySummary createXWikiPageHistorySummary(Document document)
Create a page history summary containing revision information about a document.

Returns:
An XWikiPageHistorySummary object containing the revision information.

createComment

public static Comment createComment(Document document,
                                    Object commentObject)
Create a comment object containing all the information concerning a document comment.

Parameters:
commentObject - The XWiki object of type "XWiki.Comment" containing the actual comment.
Returns:
A Comment Object containing comment information.

createAttachment

public static Attachment createAttachment(Attachment xwikiAttachment)
Create an Attachment object containing information about an attachment.

Returns:
An Attachment object containing all the information.

createXWikiClassSummary

public static XWikiClassSummary createXWikiClassSummary(String className)
Create a summary of an XWiki class.

Returns:
An XWikiClassSummary containing information about the class.

createXWikiClass

public static XWikiClass createXWikiClass(Class xwikiClass)
Create an XWikiClass object with all the information about a given XWiki class

Returns:
An XWikiClass object with all the information.

createXWikiObjectSummary

public static XWikiObjectSummary createXWikiObjectSummary(Document document,
                                                          Object object)
Create a summary of a given xwiki object.

Returns:
An XWikiObjectSummary object containing all the information.

createXWikiObject

public static XWikiObject createXWikiObject(XWiki xwiki,
                                            XWikiContext xwikiContext,
                                            Document document,
                                            Object object)
                                     throws QueryException,
                                            XWikiException
Create an XWikiObject containing all the information and attributed of a given xwiki object.

Returns:
An XWikiObject containing all the information.
Throws:
QueryException
XWikiException

createEmptyXWikiObject

public static XWikiObject createEmptyXWikiObject()

createSearchResult

public static SearchResult createSearchResult(String pageId)
Create a search result object.

Parameters:
pageId - The page id representing the page associated with this result.
Returns:
A SearchResult object containing the information.