com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes
Class DefaultSuperDocument

java.lang.Object
  extended by com.xpn.xwiki.api.Api
      extended by com.xpn.xwiki.api.Document
          extended by com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.DefaultSuperDocument
All Implemented Interfaces:
SuperDocument
Direct Known Subclasses:
XWikiApplication

public class DefaultSuperDocument
extends com.xpn.xwiki.api.Document
implements SuperDocument

Default implementation of SuperDocument. This class manage an XWiki document containing provided XWiki class. It add some specifics methods, getters and setters for this type of object and fields. It also override Document (and then XWikiDocument) isNew concept considering as new a document that does not contains an XWiki object of the provided XWiki class.

Version:
$Id: $
See Also:
SuperDocument, SuperClass

Field Summary
protected  boolean isNew
          true if this is a new document of this class (this document can exist but does not contains object of this class).
protected  int objectId
          The id of the XWiki object included in the document to manage.
protected  SuperClass sclass
          The class manager for this document.
 
Fields inherited from class com.xpn.xwiki.api.Document
cloned, currentObj, doc
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Fields inherited from interface com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.SuperDocument
SPACE_DOC_SEPARATOR, WIKI_SPACE_SEPARATOR
 
Constructor Summary
DefaultSuperDocument(SuperClass sclass, com.xpn.xwiki.doc.XWikiDocument xdoc, int objectId, com.xpn.xwiki.XWikiContext context)
          Create instance of DefaultSuperDocument from provided XWikiDocument.
 
Method Summary
protected  void deleteDocument()
          
protected  com.xpn.xwiki.objects.BaseObject getBaseObject(boolean toWrite)
          Get the managed BaseObject.
 java.lang.Boolean getBooleanValue(java.lang.String fieldName)
          Get the value of the field fieldName of the managed object's class.
 com.xpn.xwiki.api.Document getDocumentApi()
          
 int getIntValue(java.lang.String fieldName)
          Get the value of the field fieldName of the managed object's class.
 java.lang.String getLargeStringValue(java.lang.String fieldName)
          Get the value of the field fieldName of the managed object's class.
 java.util.List getListValue(java.lang.String fieldName)
          Get the value of the field fieldName of the managed object's class.
 com.xpn.xwiki.api.Object getObjectApi()
          
 int getObjectId()
          
 java.lang.String getStringValue(java.lang.String fieldName)
          Get the value of the field fieldName of the managed object's class.
 SuperClass getSuperClass()
          
 boolean isNew()
          
 void mergeObject(DefaultSuperDocument sdoc)
          Merge two documents BaseObject.
 void reload(com.xpn.xwiki.XWikiContext context)
          Reload XWiki document from database using Document full name.
protected  void saveDocument(java.lang.String comment)
          
 void setBooleanValue(java.lang.String fieldName, java.lang.Boolean value)
          Modify the value of the field fieldName of the managed object's class.
 void setFullName(java.lang.String docFullName)
           
 void setIntValue(java.lang.String fieldName, int value)
          Modify the value of the field fieldName of the managed object's class.
 void setLargeStringValue(java.lang.String fieldName, java.lang.String value)
          Modify the value of the field fieldName of the managed object's class.
 void setListValue(java.lang.String fieldName, java.util.List value)
          Modify the value of the field fieldName of the managed object's class.
 void setStringValue(java.lang.String fieldName, java.lang.String value)
          Modify the value of the field fieldName of the managed object's class.
 
Methods inherited from class com.xpn.xwiki.api.Document
addAttachment, addAttachment, addAttachments, addAttachments, addObjectFromRequest, addObjectFromRequest, addObjectFromRequest, addObjectsFromRequest, addObjectsFromRequest, checkAccess, createNewObject, delete, deleteWithProgrammingRights, display, display, display, display, display, display, displayEdit, displayForm, displayForm, displayForm, displayHidden, displayPrettyName, displayPrettyName, displayPrettyName, displayPrettyName, displayPrettyName, displayPrettyName, displayRendered, displayTooltip, displayTooltip, displayView, equals, get, getActiveClass, getArchive, getAttachment, getAttachmentDiff, getAttachmentList, getAttachmentRevisionURL, getAttachmentRevisionURL, getAttachmentURL, getAttachmentURL, getAttachmentURL, getAuthor, getBacklinks, getClassDiff, getComment, getComments, getComments, getContent, getContentAuthor, getContentDiff, getContentUpdateDate, getCreationDate, getCreator, getCurrentMonthPageStats, getCurrentMonthRefStats, getCurrentMonthWebStats, getDate, getDefaultEditURL, getDefaultLanguage, getDefaultTemplate, getDisplayTitle, getDoc, getDocument, getDocumentArchive, getDocumentRevision, getEditURL, getEditURL, getEscapedContent, getExternalURL, getExternalURL, getExternalURL, getFirstObject, getFormat, getFullName, getId, getIncludedMacros, getIncludedPages, getLanguage, getLastChanges, getLinkedPages, getLinks, getLocked, getLockingDate, getLockingUser, getMetaDataDiff, getName, getObject, getObject, getObject, getObject, getObject, getObjectDiff, getObjectNumbers, getObjects, getObjects, getParent, getParentURL, getPrefixedFullName, getPreviousDocument, getPreviousVersion, getRCSVersion, getRealLanguage, getRecentRevisions, getRecentRevisions, getRenderedContent, getRenderedContent, getRenderedContentDiff, getRevisionInfo, getRevisions, getSpace, getTagList, getTags, getTagsPossibleValues, getTemplate, getTextArea, getTitle, getTOC, getTranslatedContent, getTranslatedContent, getTranslatedDocument, getTranslatedDocument, getTranslationList, getURL, getURL, getURL, getValue, getValue, getVersion, getVersionHashCode, getWeb, getWiki, getXMLContent, getXMLDiff, getxWikiClass, getxWikiClasses, getxWikiObjects, hasAccessLevel, hasAccessLevel, insertText, isAdvancedContent, isCreator, isCurrentLocalUserPage, isCurrentUserCreator, isCurrentUserPage, isFromCache, isMinorEdit, isMostRecent, isProgrammaticContent, newObject, removeObject, removeObjects, rename, rename, renameDocument, renameDocument, save, save, saveWithProgrammingRights, saveWithProgrammingRights, set, set, setComment, setContent, setCustomClass, setDefaultTemplate, setMinorEdit, setParent, setTitle, toXML, toXMLDocument, updateObjectFromRequest, updateObjectFromRequest, updateObjectsFromRequest, updateObjectsFromRequest, use, use, use, validate, validate
 
Methods inherited from class com.xpn.xwiki.api.Api
checkProgrammingRights, getXWikiContext, hasAdminRights, hasProgrammingRights
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sclass

protected SuperClass sclass
The class manager for this document.


objectId

protected int objectId
The id of the XWiki object included in the document to manage.


isNew

protected boolean isNew
true if this is a new document of this class (this document can exist but does not contains object of this class).

Constructor Detail

DefaultSuperDocument

public DefaultSuperDocument(SuperClass sclass,
                            com.xpn.xwiki.doc.XWikiDocument xdoc,
                            int objectId,
                            com.xpn.xwiki.XWikiContext context)
                     throws com.xpn.xwiki.XWikiException
Create instance of DefaultSuperDocument from provided XWikiDocument.

Parameters:
sclass - the class manager for this document.
xdoc - the XWikiDocument to manage.
objectId - the id of the XWiki object included in the document to manage.
context - the XWiki context.
Throws:
com.xpn.xwiki.XWikiException - error when calling reload(XWikiContext).
Method Detail

setFullName

public void setFullName(java.lang.String docFullName)
Parameters:
docFullName - modify the full name the the managed XWikiDocument.

reload

public void reload(com.xpn.xwiki.XWikiContext context)
            throws com.xpn.xwiki.XWikiException
Reload XWiki document from database using Document full name.

Specified by:
reload in interface SuperDocument
Parameters:
context - the XWiki context.
Throws:
com.xpn.xwiki.XWikiException - error when initialize document.
See Also:
SuperDocument.reload(com.xpn.xwiki.XWikiContext)

getDocumentApi

public com.xpn.xwiki.api.Document getDocumentApi()

Specified by:
getDocumentApi in interface SuperDocument
Returns:
the document.
See Also:
SuperDocument.getDocumentApi()

getObjectId

public int getObjectId()

Specified by:
getObjectId in interface SuperDocument
Returns:
the id of the managed XWiki object;
See Also:
SuperDocument.getObjectId()

getObjectApi

public com.xpn.xwiki.api.Object getObjectApi()

Specified by:
getObjectApi in interface SuperDocument
Returns:
the managed XWiki object.
See Also:
SuperDocument.getObjectApi()

getBaseObject

protected com.xpn.xwiki.objects.BaseObject getBaseObject(boolean toWrite)
Get the managed BaseObject.

Parameters:
toWrite - indicate that the BaseObject will be modified.
Returns:
the BaseObject.

mergeObject

public void mergeObject(DefaultSuperDocument sdoc)
Merge two documents BaseObject.

Parameters:
sdoc - the document to merge.

getSuperClass

public SuperClass getSuperClass()

Specified by:
getSuperClass in interface SuperDocument
Returns:
the class manager for this document.
See Also:
SuperDocument.getSuperClass()

isNew

public boolean isNew()

Specified by:
isNew in interface SuperDocument
Overrides:
isNew in class com.xpn.xwiki.api.Document
Returns:
true if this is a new document of this class (this document can exist but does not contains object of this class).
See Also:
SuperDocument.isNew()

saveDocument

protected void saveDocument(java.lang.String comment)
                     throws com.xpn.xwiki.XWikiException

Overrides:
saveDocument in class com.xpn.xwiki.api.Document
Throws:
com.xpn.xwiki.XWikiException
See Also:
Document.saveDocument(String)

deleteDocument

protected void deleteDocument()
                       throws com.xpn.xwiki.XWikiException

Overrides:
deleteDocument in class com.xpn.xwiki.api.Document
Throws:
com.xpn.xwiki.XWikiException
See Also:
Document.deleteDocument()

getStringValue

public java.lang.String getStringValue(java.lang.String fieldName)
Get the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
Returns:
the value in String of the field fieldName of the managed object's class.
See Also:
XWikiDocument.getStringValue(java.lang.String)

setStringValue

public void setStringValue(java.lang.String fieldName,
                           java.lang.String value)
Modify the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
value - the new value of the field fieldName of the managed object's class.
See Also:
XWikiDocument.setStringValue(java.lang.String,java.lang.String,java.lang.String)

getLargeStringValue

public java.lang.String getLargeStringValue(java.lang.String fieldName)
Get the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
Returns:
the value in String of the field fieldName of the managed object's class.
See Also:
XWikiDocument.getStringValue(java.lang.String)

setLargeStringValue

public void setLargeStringValue(java.lang.String fieldName,
                                java.lang.String value)
Modify the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
value - the new value of the field fieldName of the managed object's class.
See Also:
XWikiDocument.setLargeStringValue(java.lang.String,java.lang.String,java.lang.String)

getListValue

public java.util.List getListValue(java.lang.String fieldName)
Get the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
Returns:
the value in List of the field fieldName of the managed object's class.
See Also:
XWikiDocument.getListValue(java.lang.String)

setListValue

public void setListValue(java.lang.String fieldName,
                         java.util.List value)
Modify the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
value - the new value of the field fieldName of the managed object's class.
See Also:
XWikiDocument.setStringListValue(java.lang.String,java.lang.String,java.util.List)

getIntValue

public int getIntValue(java.lang.String fieldName)
Get the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
Returns:
the value in int of the field fieldName of the managed object's class.
See Also:
XWikiDocument.getListValue(java.lang.String)

setIntValue

public void setIntValue(java.lang.String fieldName,
                        int value)
Modify the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
value - the new value of the field fieldName of the managed object's class.
See Also:
XWikiDocument.setIntValue(String, String, int)

getBooleanValue

public java.lang.Boolean getBooleanValue(java.lang.String fieldName)
Get the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
Returns:
the value in Boolean of the field fieldName of the managed object's class.
See Also:
XWikiDocument.getListValue(java.lang.String)

setBooleanValue

public void setBooleanValue(java.lang.String fieldName,
                            java.lang.Boolean value)
Modify the value of the field fieldName of the managed object's class.

Parameters:
fieldName - the name of the field from the managed object's class where to find the value.
value - the new value of the field fieldName of the managed object's class.
See Also:
XWikiDocument.setIntValue(String, String, int)


Copyright ? 2004-2008 XWiki. All Rights Reserved.