com.xpn.xwiki.api
Class Document

java.lang.Object
  extended by com.xpn.xwiki.api.Api
      extended by com.xpn.xwiki.api.Document

public class Document
extends Api


Field Summary
protected  boolean cloned
           
protected  Object currentObj
           
protected  XWikiDocument doc
           
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Constructor Summary
Document(XWikiDocument doc, XWikiContext context)
           
 
Method Summary
 Attachment addAttachment(java.lang.String fileName, byte[] data)
           
 Attachment addAttachment(java.lang.String fileName, java.io.InputStream iStream)
           
 int addAttachments()
           
 int addAttachments(java.lang.String fieldName)
           
 Object addObjectFromRequest()
           
 Object addObjectFromRequest(java.lang.String className)
           
 Object addObjectFromRequest(java.lang.String className, java.lang.String prefix)
           
 java.util.List addObjectsFromRequest(java.lang.String className)
           
 java.util.List addObjectsFromRequest(java.lang.String className, java.lang.String prefix)
           
 boolean checkAccess(java.lang.String right)
           
 int createNewObject(java.lang.String classname)
           
 void delete()
           
protected  void deleteDocument()
          Remove document from the wiki.
 void deleteWithProgrammingRights()
           
 java.lang.String display(java.lang.String fieldname)
           
 java.lang.String display(java.lang.String fieldname, Object obj)
           
 java.lang.String display(java.lang.String fieldname, java.lang.String mode)
           
 java.lang.String display(java.lang.String fieldname, java.lang.String mode, Object obj)
           
 java.lang.String display(java.lang.String fieldname, java.lang.String mode, java.lang.String prefix)
           
 java.lang.String display(java.lang.String fieldname, java.lang.String mode, java.lang.String prefix, Object obj)
           
 java.lang.String displayEdit(PropertyClass pclass, java.lang.String prefix, Collection object)
           
 java.lang.String displayForm(java.lang.String className)
           
 java.lang.String displayForm(java.lang.String className, java.lang.String header, java.lang.String format)
           
 java.lang.String displayForm(java.lang.String className, java.lang.String header, java.lang.String format, boolean linebreak)
           
 java.lang.String displayHidden(PropertyClass pclass, java.lang.String prefix, Collection object)
           
 java.lang.String displayPrettyName(java.lang.String fieldname)
           
 java.lang.String displayPrettyName(java.lang.String fieldname, boolean showMandatory)
           
 java.lang.String displayPrettyName(java.lang.String fieldname, boolean showMandatory, boolean before)
           
 java.lang.String displayPrettyName(java.lang.String fieldname, boolean showMandatory, boolean before, Object obj)
           
 java.lang.String displayPrettyName(java.lang.String fieldname, boolean showMandatory, Object obj)
           
 java.lang.String displayPrettyName(java.lang.String fieldname, Object obj)
           
 java.lang.String displayRendered(PropertyClass pclass, java.lang.String prefix, Collection object)
           
 java.lang.String displayTooltip(java.lang.String fieldname)
           
 java.lang.String displayTooltip(java.lang.String fieldname, Object obj)
           
 java.lang.String displayView(PropertyClass pclass, java.lang.String prefix, Collection object)
           
 boolean equals(java.lang.Object arg0)
           
 java.lang.Object get(java.lang.String classOrFieldName)
           
 java.lang.String getActiveClass()
           
 java.lang.String getArchive()
          return the archive of the document in a string format
 Attachment getAttachment(java.lang.String filename)
           
 java.util.List getAttachmentDiff(Document origdoc, Document newdoc)
           
 java.util.List<Attachment> getAttachmentList()
           
 java.lang.String getAttachmentRevisionURL(java.lang.String filename, java.lang.String version)
          return the URL for accessing to the archive of the attachment "filename" at the version "version"
 java.lang.String getAttachmentRevisionURL(java.lang.String filename, java.lang.String version, java.lang.String querystring)
          return the URL for accessing to the archive of the attachment "filename" at the version "version" and with the given queryString parameters
 java.lang.String getAttachmentURL(java.lang.String filename)
          return the URL of download for the the given attachment name
 java.lang.String getAttachmentURL(java.lang.String filename, java.lang.String action)
          return the URL of the given action for the the given attachment name
 java.lang.String getAttachmentURL(java.lang.String filename, java.lang.String action, java.lang.String queryString)
          return the URL of the given action for the the given attachment name with "queryString" parameters
 java.lang.String getAuthor()
          return the name of the last author of the document
 java.util.List getBacklinks()
           
 java.util.List getClassDiff(Document origdoc, Document newdoc)
           
 java.lang.String getComment()
          return the comment of the latest update of the document
 java.util.Vector<Object> getComments()
           
 java.util.Vector<Object> getComments(boolean asc)
           
 java.lang.String getContent()
          return the content of the document
 java.lang.String getContentAuthor()
          return the name of the last author of the content of the document
 java.util.List getContentDiff(Document origdoc, Document newdoc)
           
 java.util.Date getContentUpdateDate()
          return the date of the last modification of the content
 java.util.Date getCreationDate()
          return the date of the creation of the document
 java.lang.String getCreator()
          return the name of the creator of the document
 DocumentStats getCurrentMonthPageStats(java.lang.String action)
           
 java.util.List getCurrentMonthRefStats()
           
 DocumentStats getCurrentMonthWebStats(java.lang.String action)
           
 java.util.Date getDate()
          return the modification date
 java.lang.String getDefaultEditURL()
           
 java.lang.String getDefaultLanguage()
          return the language of the default document
 java.lang.String getDefaultTemplate()
           
 java.lang.String getDisplayTitle()
           
protected  XWikiDocument getDoc()
           
 XWikiDocument getDocument()
          this function is accessible only if you have the programming rights give access to the priviledged API of the Document
 XWikiDocumentArchive getDocumentArchive()
          this function is accessible only if you have the programming rights return the archive of the document
 Document getDocumentRevision(java.lang.String revision)
          Allow to easily access any revision of a document
 java.lang.String getEditURL(java.lang.String action, java.lang.String mode)
           
 java.lang.String getEditURL(java.lang.String action, java.lang.String mode, java.lang.String language)
           
 java.lang.String getEscapedContent()
          return a escaped version of the content of this document
 java.lang.String getExternalURL()
          return the full URL of the document
 java.lang.String getExternalURL(java.lang.String action)
          return the full URL of the document for the given action
 java.lang.String getExternalURL(java.lang.String action, java.lang.String querystring)
           
 Object getFirstObject(java.lang.String fieldname)
           
 java.lang.String getFormat()
           
 java.lang.String getFullName()
          return the fullName of a document if a document has for name "MyDoc" and space "MySpace", the fullname is "MySpace.MyDoc" In a wiki, all the documents have a different fullName.
 long getId()
          return the ID of the document.
 java.util.List getIncludedMacros()
           
 java.util.List<java.lang.String> getIncludedPages()
           
 java.lang.String getLanguage()
          return the language of the document if it's a traduction, otherwise, it return default
 java.util.List getLastChanges()
           
 java.util.List getLinkedPages()
           
 java.util.List getLinks()
           
 boolean getLocked()
           
 java.util.Date getLockingDate()
           
 java.lang.String getLockingUser()
           
 java.util.List getMetaDataDiff(Document origdoc, Document newdoc)
           
 java.lang.String getName()
          return the name of a document.
 Object getObject(java.lang.String classname)
           
 Object getObject(java.lang.String classname, boolean create)
          get the object of the given className.
 Object getObject(java.lang.String classname, int nb)
           
 Object getObject(java.lang.String classname, java.lang.String key, java.lang.String value)
           
 Object getObject(java.lang.String classname, java.lang.String key, java.lang.String value, boolean failover)
           
 java.util.List getObjectDiff(Document origdoc, Document newdoc)
           
 int getObjectNumbers(java.lang.String classname)
           
 java.util.Vector<Object> getObjects(java.lang.String classname)
           
 java.util.Vector<Object> getObjects(java.lang.String classname, java.lang.String key, java.lang.String value)
          Select a subset of objects from a given class, filtered on a "key = value" criteria.
protected  java.util.Vector<Object> getObjects(java.util.Vector<BaseObject> objects)
           
 java.lang.String getParent()
          return the name of the parent document
 java.lang.String getParentURL()
           
 java.lang.String getPrefixedFullName()
           
 Document getPreviousDocument()
          Allow to easily access the previous revision of a document
 java.lang.String getPreviousVersion()
          return a String with the previous version of the document.
 org.suigeneris.jrcs.rcs.Version getRCSVersion()
           
 java.lang.String getRealLanguage()
          return the real language of the document
 java.lang.String[] getRecentRevisions()
           
 java.lang.String[] getRecentRevisions(int nb)
           
 java.lang.String getRenderedContent()
          return the content of the document rendererd
 java.lang.String getRenderedContent(java.lang.String text)
          Deprecated. since 1.6M1 use getRenderedContent(String, String)
 java.lang.String getRenderedContent(java.lang.String text, java.lang.String syntaxId)
           
 java.util.List getRenderedContentDiff(Document origdoc, Document newdoc)
           
 RevisionInfo getRevisionInfo(java.lang.String version)
          Get information about a document version : author, date, etc.
 org.suigeneris.jrcs.rcs.Version[] getRevisions()
           
 java.util.List<java.lang.String> getRevisions(RevisionCriteria criteria)
          Get document versions matching criterias like author, minimum creation date, etc.
 java.lang.String getSpace()
          return the name of the space of the document for example if the fullName of a document is "MySpace.Mydoc", the name is MySpace
 java.lang.String getSyntaxId()
           
 java.util.List getTagList()
           
 java.lang.String getTags()
           
 java.util.List getTagsPossibleValues()
           
 java.lang.String getTemplate()
           
 java.lang.String getTextArea()
           
 java.lang.String getTitle()
          return the title of a document
 java.util.Map getTOC(int init, int max, boolean numbered)
          Returns data needed for a generation of Table of Content for this document.
 java.lang.String getTranslatedContent()
          return the tranlated document's content if the wiki is multilingual, the language is first checked in the URL, the cookie, the user profile and finally the wiki configuration if not, the language is the one on the wiki configuration
 java.lang.String getTranslatedContent(java.lang.String language)
          return the translated content in the given language
 Document getTranslatedDocument()
          return the tranlated Document if the wiki is multilingual, the language is first checked in the URL, the cookie, the user profile and finally the wiki configuration if not, the language is the one on the wiki configuration
 Document getTranslatedDocument(java.lang.String language)
          return the translated document in the given document
 java.util.List getTranslationList()
          return the list of possible traduction for this document
 java.lang.String getURL()
          return the URL of this document in view mode
 java.lang.String getURL(java.lang.String action)
          return the URL of this document with the given action
 java.lang.String getURL(java.lang.String action, java.lang.String querystring)
          return the URL of this document with the given action and queryString as parameters
 java.lang.String getValidationScript()
          Retrieves the validation script associated with this document, a Velocity script that is executed when validating the document data.
 java.lang.Object getValue(java.lang.String fieldName)
           
 java.lang.Object getValue(java.lang.String fieldName, Object object)
           
 java.lang.String getVersion()
          return a String with the version of the document.
 java.lang.String getVersionHashCode()
           
 java.lang.String getWeb()
          Deprecated. use getSpace() instead of this function
 java.lang.String getWiki()
           
 java.lang.String getXMLContent()
           
 java.util.List getXMLDiff(Document origdoc, Document newdoc)
           
 Class getxWikiClass()
           
 Class[] getxWikiClasses()
           
 java.util.Map<java.lang.String,java.util.Vector<Object>> getxWikiObjects()
           
 boolean hasAccessLevel(java.lang.String level)
           
 boolean hasAccessLevel(java.lang.String level, java.lang.String user)
          Check if the current user has an access level on a given document.
 void insertText(java.lang.String text, java.lang.String marker)
           
 boolean isAdvancedContent()
           
 boolean isCreator(java.lang.String username)
           
 boolean isCurrentLocalUserPage()
           
 boolean isCurrentUserCreator()
           
 boolean isCurrentUserPage()
           
 boolean isFromCache()
           
 boolean isMinorEdit()
           
 boolean isMostRecent()
           
 boolean isNew()
           
 boolean isProgrammaticContent()
           
 Object newObject(java.lang.String classname)
           
 boolean removeObject(Object obj)
           
 boolean removeObjects(java.lang.String className)
           
 void rename(java.lang.String newDocumentName)
          Rename the current document and all the backlinks leading to it.
 void rename(java.lang.String newDocumentName, java.util.List backlinkDocumentNames)
          Rename the current document and all the links pointing to it in the list of passed backlink documents.
 void renameDocument(java.lang.String newDocumentName)
          Deprecated. use rename(String) instead
 void renameDocument(java.lang.String newDocumentName, java.util.List backlinkDocumentNames)
          Deprecated. use rename(String, java.util.List) instead
 void save()
           
 void save(java.lang.String comment)
           
 void save(java.lang.String comment, boolean minorEdit)
           
protected  void saveDocument(java.lang.String comment, boolean minorEdit)
           
 void saveWithProgrammingRights()
           
 void saveWithProgrammingRights(java.lang.String comment)
           
 void saveWithProgrammingRights(java.lang.String comment, boolean minorEdit)
           
 void set(java.lang.String fieldname, java.lang.Object value)
           
 void set(java.lang.String fieldname, java.lang.Object value, Object obj)
           
 void setComment(java.lang.String comment)
           
 void setContent(java.lang.String content)
           
 void setCustomClass(java.lang.String customClass)
           
 void setDefaultTemplate(java.lang.String dtemplate)
           
 void setMinorEdit(boolean isMinor)
           
 void setParent(java.lang.String parent)
           
 void setTitle(java.lang.String title)
           
 void setValidationScript(java.lang.String validationScript)
          Sets a new validation script for this document, a Velocity script that is executed when validating the document data.
 java.lang.String toString()
          
 java.lang.String toXML()
           
 org.dom4j.Document toXMLDocument()
           
 Object updateObjectFromRequest(java.lang.String className)
           
 Object updateObjectFromRequest(java.lang.String className, java.lang.String prefix)
           
 java.util.List updateObjectsFromRequest(java.lang.String className)
           
 java.util.List updateObjectsFromRequest(java.lang.String className, java.lang.String prefix)
           
 void use(Object object)
           
 void use(java.lang.String className)
           
 void use(java.lang.String className, int nb)
           
 boolean validate()
           
 boolean validate(java.lang.String[] classNames)
           
 
Methods inherited from class com.xpn.xwiki.api.Api
convert, convert, getXWikiContext, hasAdminRights, hasProgrammingRights
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

doc

protected XWikiDocument doc

cloned

protected boolean cloned

currentObj

protected Object currentObj
Constructor Detail

Document

public Document(XWikiDocument doc,
                XWikiContext context)
Method Detail

getDocument

public XWikiDocument getDocument()
this function is accessible only if you have the programming rights give access to the priviledged API of the Document


getDoc

protected XWikiDocument getDoc()

getId

public long getId()
return the ID of the document. this ID is uniq accross the wiki.

Returns:
the id of the document

getName

public java.lang.String getName()
return the name of a document. for exemple if the fullName of a document is "MySpace.Mydoc", the name is MyDoc

Returns:
the name of the document

getSpace

public java.lang.String getSpace()
return the name of the space of the document for example if the fullName of a document is "MySpace.Mydoc", the name is MySpace

Returns:
the name of the space of the document

getWiki

public java.lang.String getWiki()
Returns:
the name of the wiki where this document is stored.
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2

getWeb

@Deprecated
public java.lang.String getWeb()
Deprecated. use getSpace() instead of this function

return the name of the space of the document for exemple if the fullName of a document is "MySpace.Mydoc", the name is MySpace


getFullName

public java.lang.String getFullName()
return the fullName of a document if a document has for name "MyDoc" and space "MySpace", the fullname is "MySpace.MyDoc" In a wiki, all the documents have a different fullName.


getPrefixedFullName

public java.lang.String getPrefixedFullName()
Returns:
the real full name of a document containing wiki name where document is stored. For document in "xwiki" wiki, with name "MyDoc" and space "MySpace" the extended full name is "xwiki:MySpace.MyDoc".
Since:
XWiki Core 1.1.2, XWiki Core 1.2M2

getRCSVersion

public org.suigeneris.jrcs.rcs.Version getRCSVersion()

getVersion

public java.lang.String getVersion()
return a String with the version of the document.


getPreviousVersion

public java.lang.String getPreviousVersion()
return a String with the previous version of the document.


getTitle

public java.lang.String getTitle()
return the title of a document


getDisplayTitle

public java.lang.String getDisplayTitle()
Returns:
the document title. If a title has not been provided, look for a section title in the document's content and if not found return the page name. The returned title is also interpreted which means it's allowed to use Velocity, Groovy, etc syntax within a title.

getFormat

public java.lang.String getFormat()

getAuthor

public java.lang.String getAuthor()
return the name of the last author of the document


getContentAuthor

public java.lang.String getContentAuthor()
return the name of the last author of the content of the document


getDate

public java.util.Date getDate()
return the modification date


getContentUpdateDate

public java.util.Date getContentUpdateDate()
return the date of the last modification of the content


getCreationDate

public java.util.Date getCreationDate()
return the date of the creation of the document


getParent

public java.lang.String getParent()
return the name of the parent document


getCreator

public java.lang.String getCreator()
return the name of the creator of the document


getContent

public java.lang.String getContent()
return the content of the document


getLanguage

public java.lang.String getLanguage()
return the language of the document if it's a traduction, otherwise, it return default


getTemplate

public java.lang.String getTemplate()

getRealLanguage

public java.lang.String getRealLanguage()
                                 throws XWikiException
return the real language of the document

Throws:
XWikiException

getDefaultLanguage

public java.lang.String getDefaultLanguage()
return the language of the default document


getDefaultTemplate

public java.lang.String getDefaultTemplate()

getComment

public java.lang.String getComment()
return the comment of the latest update of the document


isMinorEdit

public boolean isMinorEdit()

getTranslationList

public java.util.List getTranslationList()
                                  throws XWikiException
return the list of possible traduction for this document

Throws:
XWikiException

getTranslatedContent

public java.lang.String getTranslatedContent()
                                      throws XWikiException
return the tranlated document's content if the wiki is multilingual, the language is first checked in the URL, the cookie, the user profile and finally the wiki configuration if not, the language is the one on the wiki configuration

Throws:
XWikiException

getTranslatedContent

public java.lang.String getTranslatedContent(java.lang.String language)
                                      throws XWikiException
return the translated content in the given language

Throws:
XWikiException

getTranslatedDocument

public Document getTranslatedDocument(java.lang.String language)
                               throws XWikiException
return the translated document in the given document

Throws:
XWikiException

getTranslatedDocument

public Document getTranslatedDocument()
                               throws XWikiException
return the tranlated Document if the wiki is multilingual, the language is first checked in the URL, the cookie, the user profile and finally the wiki configuration if not, the language is the one on the wiki configuration

Throws:
XWikiException

getRenderedContent

public java.lang.String getRenderedContent()
                                    throws XWikiException
return the content of the document rendererd

Throws:
XWikiException

getRenderedContent

@Deprecated
public java.lang.String getRenderedContent(java.lang.String text)
                                    throws XWikiException
Deprecated. since 1.6M1 use getRenderedContent(String, String)

Parameters:
text - the text to render
Returns:
the given text rendered in the context of this document
Throws:
XWikiException

getRenderedContent

public java.lang.String getRenderedContent(java.lang.String text,
                                           java.lang.String syntaxId)
                                    throws XWikiException
Parameters:
text - the text to render
syntaxId - the id of the Syntax used by the passed text (for example: "xwiki/1.0")
Returns:
the given text rendered in the context of this document using the passed Syntax
Throws:
XWikiException
Since:
1.6M1

getEscapedContent

public java.lang.String getEscapedContent()
                                   throws XWikiException
return a escaped version of the content of this document

Throws:
XWikiException

getArchive

public java.lang.String getArchive()
                            throws XWikiException
return the archive of the document in a string format

Throws:
XWikiException

getDocumentArchive

public XWikiDocumentArchive getDocumentArchive()
                                        throws XWikiException
this function is accessible only if you have the programming rights return the archive of the document

Throws:
XWikiException

isNew

public boolean isNew()
Returns:
true if the document is a new one (ie it has never been saved) or false otherwise

getAttachmentURL

public java.lang.String getAttachmentURL(java.lang.String filename)
return the URL of download for the the given attachment name

Parameters:
filename - the name of the attachment
Returns:
A String with the URL

getAttachmentURL

public java.lang.String getAttachmentURL(java.lang.String filename,
                                         java.lang.String action)
return the URL of the given action for the the given attachment name

Returns:
A string with the URL

getAttachmentURL

public java.lang.String getAttachmentURL(java.lang.String filename,
                                         java.lang.String action,
                                         java.lang.String queryString)
return the URL of the given action for the the given attachment name with "queryString" parameters

Parameters:
queryString - parameters added to the URL

getAttachmentRevisionURL

public java.lang.String getAttachmentRevisionURL(java.lang.String filename,
                                                 java.lang.String version)
return the URL for accessing to the archive of the attachment "filename" at the version "version"


getAttachmentRevisionURL

public java.lang.String getAttachmentRevisionURL(java.lang.String filename,
                                                 java.lang.String version,
                                                 java.lang.String querystring)
return the URL for accessing to the archive of the attachment "filename" at the version "version" and with the given queryString parameters


getURL

public java.lang.String getURL()
return the URL of this document in view mode


getURL

public java.lang.String getURL(java.lang.String action)
return the URL of this document with the given action


getURL

public java.lang.String getURL(java.lang.String action,
                               java.lang.String querystring)
return the URL of this document with the given action and queryString as parameters


getExternalURL

public java.lang.String getExternalURL()
return the full URL of the document


getExternalURL

public java.lang.String getExternalURL(java.lang.String action)
return the full URL of the document for the given action


getExternalURL

public java.lang.String getExternalURL(java.lang.String action,
                                       java.lang.String querystring)

getParentURL

public java.lang.String getParentURL()
                              throws XWikiException
Throws:
XWikiException

getxWikiClass

public Class getxWikiClass()

getxWikiClasses

public Class[] getxWikiClasses()

createNewObject

public int createNewObject(java.lang.String classname)
                    throws XWikiException
Throws:
XWikiException

newObject

public Object newObject(java.lang.String classname)
                 throws XWikiException
Throws:
XWikiException

isFromCache

public boolean isFromCache()

getObjectNumbers

public int getObjectNumbers(java.lang.String classname)

getxWikiObjects

public java.util.Map<java.lang.String,java.util.Vector<Object>> getxWikiObjects()

getObjects

protected java.util.Vector<Object> getObjects(java.util.Vector<BaseObject> objects)

getObjects

public java.util.Vector<Object> getObjects(java.lang.String classname)

getFirstObject

public Object getFirstObject(java.lang.String fieldname)

getObject

public Object getObject(java.lang.String classname,
                        java.lang.String key,
                        java.lang.String value,
                        boolean failover)

getObjects

public java.util.Vector<Object> getObjects(java.lang.String classname,
                                           java.lang.String key,
                                           java.lang.String value)
Select a subset of objects from a given class, filtered on a "key = value" criteria.

Parameters:
classname - The type of objects to return.
key - The name of the property used for filtering.
value - The required value.
Returns:
A Vector of objects matching the criteria. If no objects are found, or if the key is an empty String, then an empty vector is returned.

getObject

public Object getObject(java.lang.String classname,
                        java.lang.String key,
                        java.lang.String value)

getObject

public Object getObject(java.lang.String classname)

getObject

public Object getObject(java.lang.String classname,
                        boolean create)
get the object of the given className. If there is no object of this className and the create parameter at true, the object is created.


getObject

public Object getObject(java.lang.String classname,
                        int nb)

getXMLContent

public java.lang.String getXMLContent()
                               throws XWikiException
Throws:
XWikiException

toXML

public java.lang.String toXML()
                       throws XWikiException
Throws:
XWikiException

toXMLDocument

public org.dom4j.Document toXMLDocument()
                                 throws XWikiException
Throws:
XWikiException

getRevisions

public org.suigeneris.jrcs.rcs.Version[] getRevisions()
                                               throws XWikiException
Throws:
XWikiException

getRecentRevisions

public java.lang.String[] getRecentRevisions()
                                      throws XWikiException
Throws:
XWikiException

getRecentRevisions

public java.lang.String[] getRecentRevisions(int nb)
                                      throws XWikiException
Throws:
XWikiException

getRevisions

public java.util.List<java.lang.String> getRevisions(RevisionCriteria criteria)
                                              throws XWikiException
Get document versions matching criterias like author, minimum creation date, etc.

Parameters:
criteria - criteria used to match versions
Returns:
a list of matching versions
Throws:
XWikiException

getRevisionInfo

public RevisionInfo getRevisionInfo(java.lang.String version)
                             throws XWikiException
Get information about a document version : author, date, etc.

Parameters:
version - the version you want to get information about
Returns:
a new RevisionInfo object
Throws:
XWikiException

getAttachmentList

public java.util.List<Attachment> getAttachmentList()

getComments

public java.util.Vector<Object> getComments()

getComments

public java.util.Vector<Object> getComments(boolean asc)

use

public void use(Object object)

use

public void use(java.lang.String className)

use

public void use(java.lang.String className,
                int nb)

getActiveClass

public java.lang.String getActiveClass()

displayPrettyName

public java.lang.String displayPrettyName(java.lang.String fieldname)

displayPrettyName

public java.lang.String displayPrettyName(java.lang.String fieldname,
                                          Object obj)

displayPrettyName

public java.lang.String displayPrettyName(java.lang.String fieldname,
                                          boolean showMandatory)

displayPrettyName

public java.lang.String displayPrettyName(java.lang.String fieldname,
                                          boolean showMandatory,
                                          Object obj)

displayPrettyName

public java.lang.String displayPrettyName(java.lang.String fieldname,
                                          boolean showMandatory,
                                          boolean before)

displayPrettyName

public java.lang.String displayPrettyName(java.lang.String fieldname,
                                          boolean showMandatory,
                                          boolean before,
                                          Object obj)

displayTooltip

public java.lang.String displayTooltip(java.lang.String fieldname)

displayTooltip

public java.lang.String displayTooltip(java.lang.String fieldname,
                                       Object obj)

display

public java.lang.String display(java.lang.String fieldname)

display

public java.lang.String display(java.lang.String fieldname,
                                java.lang.String mode)

display

public java.lang.String display(java.lang.String fieldname,
                                java.lang.String mode,
                                java.lang.String prefix)

display

public java.lang.String display(java.lang.String fieldname,
                                Object obj)

display

public java.lang.String display(java.lang.String fieldname,
                                java.lang.String mode,
                                Object obj)

display

public java.lang.String display(java.lang.String fieldname,
                                java.lang.String mode,
                                java.lang.String prefix,
                                Object obj)

displayForm

public java.lang.String displayForm(java.lang.String className,
                                    java.lang.String header,
                                    java.lang.String format)

displayForm

public java.lang.String displayForm(java.lang.String className,
                                    java.lang.String header,
                                    java.lang.String format,
                                    boolean linebreak)

displayForm

public java.lang.String displayForm(java.lang.String className)

displayRendered

public java.lang.String displayRendered(PropertyClass pclass,
                                        java.lang.String prefix,
                                        Collection object)
                                 throws XWikiException
Throws:
XWikiException

displayView

public java.lang.String displayView(PropertyClass pclass,
                                    java.lang.String prefix,
                                    Collection object)

displayEdit

public java.lang.String displayEdit(PropertyClass pclass,
                                    java.lang.String prefix,
                                    Collection object)

displayHidden

public java.lang.String displayHidden(PropertyClass pclass,
                                      java.lang.String prefix,
                                      Collection object)

getIncludedPages

public java.util.List<java.lang.String> getIncludedPages()

getIncludedMacros

public java.util.List getIncludedMacros()

getLinkedPages

public java.util.List getLinkedPages()

getAttachment

public Attachment getAttachment(java.lang.String filename)

getContentDiff

public java.util.List getContentDiff(Document origdoc,
                                     Document newdoc)
                              throws XWikiException,
                                     org.suigeneris.jrcs.diff.DifferentiationFailedException
Throws:
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException

getXMLDiff

public java.util.List getXMLDiff(Document origdoc,
                                 Document newdoc)
                          throws XWikiException,
                                 org.suigeneris.jrcs.diff.DifferentiationFailedException
Throws:
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException

getRenderedContentDiff

public java.util.List getRenderedContentDiff(Document origdoc,
                                             Document newdoc)
                                      throws XWikiException,
                                             org.suigeneris.jrcs.diff.DifferentiationFailedException
Throws:
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException

getMetaDataDiff

public java.util.List getMetaDataDiff(Document origdoc,
                                      Document newdoc)
                               throws XWikiException
Throws:
XWikiException

getObjectDiff

public java.util.List getObjectDiff(Document origdoc,
                                    Document newdoc)
                             throws XWikiException
Throws:
XWikiException

getClassDiff

public java.util.List getClassDiff(Document origdoc,
                                   Document newdoc)
                            throws XWikiException
Throws:
XWikiException

getAttachmentDiff

public java.util.List getAttachmentDiff(Document origdoc,
                                        Document newdoc)
                                 throws XWikiException
Throws:
XWikiException

getLastChanges

public java.util.List getLastChanges()
                              throws XWikiException,
                                     org.suigeneris.jrcs.diff.DifferentiationFailedException
Throws:
XWikiException
org.suigeneris.jrcs.diff.DifferentiationFailedException

getCurrentMonthPageStats

public DocumentStats getCurrentMonthPageStats(java.lang.String action)

getCurrentMonthWebStats

public DocumentStats getCurrentMonthWebStats(java.lang.String action)

getCurrentMonthRefStats

public java.util.List getCurrentMonthRefStats()
                                       throws XWikiException
Throws:
XWikiException

checkAccess

public boolean checkAccess(java.lang.String right)

hasAccessLevel

public boolean hasAccessLevel(java.lang.String level)

hasAccessLevel

public boolean hasAccessLevel(java.lang.String level,
                              java.lang.String user)
Description copied from class: Api
Check if the current user has an access level on a given document.

Overrides:
hasAccessLevel in class Api
Parameters:
level - The name of the right to verify (eg "programming", "admin", "register", etc).
user - The document for which to verify the right.
Returns:
true if the current user has the specified right, false otherwise.

getLocked

public boolean getLocked()

getLockingUser

public java.lang.String getLockingUser()

getLockingDate

public java.util.Date getLockingDate()

get

public java.lang.Object get(java.lang.String classOrFieldName)

getValue

public java.lang.Object getValue(java.lang.String fieldName)

getValue

public java.lang.Object getValue(java.lang.String fieldName,
                                 Object object)

getTextArea

public java.lang.String getTextArea()

getTOC

public java.util.Map getTOC(int init,
                            int max,
                            boolean numbered)
Returns data needed for a generation of Table of Content for this document.

Parameters:
init - an intial level where the TOC generation should start at
max - maximum level TOC is generated for
numbered - if should generate numbering for headings
Returns:
a map where an heading (title) ID is the key and value is another map with two keys: text, level and numbering

getTags

public java.lang.String getTags()

getTagList

public java.util.List getTagList()

getTagsPossibleValues

public java.util.List getTagsPossibleValues()

insertText

public void insertText(java.lang.String text,
                       java.lang.String marker)
                throws XWikiException
Throws:
XWikiException

equals

public boolean equals(java.lang.Object arg0)
Overrides:
equals in class java.lang.Object

getBacklinks

public java.util.List getBacklinks()
                            throws XWikiException
Throws:
XWikiException

getLinks

public java.util.List getLinks()
                        throws XWikiException
Throws:
XWikiException

getDefaultEditURL

public java.lang.String getDefaultEditURL()
                                   throws XWikiException
Throws:
XWikiException

getEditURL

public java.lang.String getEditURL(java.lang.String action,
                                   java.lang.String mode)
                            throws XWikiException
Throws:
XWikiException

getEditURL

public java.lang.String getEditURL(java.lang.String action,
                                   java.lang.String mode,
                                   java.lang.String language)

isCurrentUserCreator

public boolean isCurrentUserCreator()

isCurrentUserPage

public boolean isCurrentUserPage()

isCurrentLocalUserPage

public boolean isCurrentLocalUserPage()

isCreator

public boolean isCreator(java.lang.String username)

set

public void set(java.lang.String fieldname,
                java.lang.Object value)

set

public void set(java.lang.String fieldname,
                java.lang.Object value,
                Object obj)

setTitle

public void setTitle(java.lang.String title)

setCustomClass

public void setCustomClass(java.lang.String customClass)

setParent

public void setParent(java.lang.String parent)

setContent

public void setContent(java.lang.String content)

setDefaultTemplate

public void setDefaultTemplate(java.lang.String dtemplate)

setComment

public void setComment(java.lang.String comment)

setMinorEdit

public void setMinorEdit(boolean isMinor)

save

public void save()
          throws XWikiException
Throws:
XWikiException

save

public void save(java.lang.String comment)
          throws XWikiException
Throws:
XWikiException

save

public void save(java.lang.String comment,
                 boolean minorEdit)
          throws XWikiException
Throws:
XWikiException

saveWithProgrammingRights

public void saveWithProgrammingRights()
                               throws XWikiException
Throws:
XWikiException

saveWithProgrammingRights

public void saveWithProgrammingRights(java.lang.String comment)
                               throws XWikiException
Throws:
XWikiException

saveWithProgrammingRights

public void saveWithProgrammingRights(java.lang.String comment,
                                      boolean minorEdit)
                               throws XWikiException
Throws:
XWikiException

saveDocument

protected void saveDocument(java.lang.String comment,
                            boolean minorEdit)
                     throws XWikiException
Throws:
XWikiException

addObjectFromRequest

public Object addObjectFromRequest()
                            throws XWikiException
Throws:
XWikiException

addObjectFromRequest

public Object addObjectFromRequest(java.lang.String className)
                            throws XWikiException
Throws:
XWikiException

addObjectsFromRequest

public java.util.List addObjectsFromRequest(java.lang.String className)
                                     throws XWikiException
Throws:
XWikiException

addObjectFromRequest

public Object addObjectFromRequest(java.lang.String className,
                                   java.lang.String prefix)
                            throws XWikiException
Throws:
XWikiException

addObjectsFromRequest

public java.util.List addObjectsFromRequest(java.lang.String className,
                                            java.lang.String prefix)
                                     throws XWikiException
Throws:
XWikiException

updateObjectFromRequest

public Object updateObjectFromRequest(java.lang.String className)
                               throws XWikiException
Throws:
XWikiException

updateObjectsFromRequest

public java.util.List updateObjectsFromRequest(java.lang.String className)
                                        throws XWikiException
Throws:
XWikiException

updateObjectFromRequest

public Object updateObjectFromRequest(java.lang.String className,
                                      java.lang.String prefix)
                               throws XWikiException
Throws:
XWikiException

updateObjectsFromRequest

public java.util.List updateObjectsFromRequest(java.lang.String className,
                                               java.lang.String prefix)
                                        throws XWikiException
Throws:
XWikiException

isAdvancedContent

public boolean isAdvancedContent()

isProgrammaticContent

public boolean isProgrammaticContent()

removeObject

public boolean removeObject(Object obj)

removeObjects

public boolean removeObjects(java.lang.String className)

deleteDocument

protected void deleteDocument()
                       throws XWikiException
Remove document from the wiki. Reinit cloned.

Throws:
XWikiException

delete

public void delete()
            throws XWikiException
Throws:
XWikiException

deleteWithProgrammingRights

public void deleteWithProgrammingRights()
                                 throws XWikiException
Throws:
XWikiException

getVersionHashCode

public java.lang.String getVersionHashCode()

addAttachments

public int addAttachments()
                   throws XWikiException
Throws:
XWikiException

addAttachments

public int addAttachments(java.lang.String fieldName)
                   throws XWikiException
Throws:
XWikiException

addAttachment

public Attachment addAttachment(java.lang.String fileName,
                                java.io.InputStream iStream)

addAttachment

public Attachment addAttachment(java.lang.String fileName,
                                byte[] data)

validate

public boolean validate()
                 throws XWikiException
Throws:
XWikiException

validate

public boolean validate(java.lang.String[] classNames)
                 throws XWikiException
Throws:
XWikiException

getValidationScript

public java.lang.String getValidationScript()
Retrieves the validation script associated with this document, a Velocity script that is executed when validating the document data.

Returns:
A String representation of the validation script, or an empty string if there is no such script.

setValidationScript

public void setValidationScript(java.lang.String validationScript)
Sets a new validation script for this document, a Velocity script that is executed when validating the document data.

Parameters:
validationScript - The new validation script, which can be an empty string or null if the script should be removed.

renameDocument

@Deprecated
public void renameDocument(java.lang.String newDocumentName)
                    throws XWikiException
Deprecated. use rename(String) instead

Throws:
XWikiException

rename

public void rename(java.lang.String newDocumentName)
            throws XWikiException
Rename the current document and all the backlinks leading to it. See renameDocument(String, java.util.List) for more details.

Parameters:
newDocumentName - the new document name. If the space is not specified then defaults to the current space.
Throws:
XWikiException - in case of an error

renameDocument

@Deprecated
public void renameDocument(java.lang.String newDocumentName,
                                      java.util.List backlinkDocumentNames)
                    throws XWikiException
Deprecated. use rename(String, java.util.List) instead

Throws:
XWikiException

rename

public void rename(java.lang.String newDocumentName,
                   java.util.List backlinkDocumentNames)
            throws XWikiException
Rename the current document and all the links pointing to it in the list of passed backlink documents. The renaming algorithm takes into account the fact that there are several ways to write a link to a given page and all those forms need to be renamed. For example the following links all point to the same page:

Note: links without a space are renamed with the space added.

Parameters:
newDocumentName - the new document name. If the space is not specified then defaults to the current space.
backlinkDocumentNames - the list of documents to parse and for which links will be modified to point to the new renamed document.
Throws:
XWikiException - in case of an error

getDocumentRevision

public Document getDocumentRevision(java.lang.String revision)
                             throws XWikiException
Allow to easily access any revision of a document

Parameters:
revision - version to access
Returns:
Document object
Throws:
XWikiException

getPreviousDocument

public Document getPreviousDocument()
                             throws XWikiException
Allow to easily access the previous revision of a document

Returns:
Document
Throws:
XWikiException

isMostRecent

public boolean isMostRecent()
Returns:
is document most recent. false if and only if there are older versions of this document.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getSyntaxId

public java.lang.String getSyntaxId()
Returns:
the Syntax id representing the syntax used for the current document. For example "xwiki/1.0" represents the first version XWiki syntax while "xwiki/2.0" represents version 2.0 of the XWiki Syntax.


Copyright © 2004-2008 XWiki. All Rights Reserved.