|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xpn.xwiki.api.Api
com.xpn.xwiki.api.Document
com.xpn.xwiki.plugin.applicationmanager.core.doc.objects.classes.DefaultXObjectDocument
public class DefaultXObjectDocument
Default implementation of XObjectDocument. 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.
XObjectDocument,
XClassManager| 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 XClassManager |
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.XObjectDocument |
|---|
SPACE_DOC_SEPARATOR, WIKI_SPACE_SEPARATOR |
| Constructor Summary | |
|---|---|
DefaultXObjectDocument(XClassManager<? extends XObjectDocument> sclass,
com.xpn.xwiki.doc.XWikiDocument xdoc,
int objectId,
com.xpn.xwiki.XWikiContext context)
Create instance of DefaultXObjectDocument from provided XWikiDocument. |
|
| Method Summary | |
|---|---|
void |
delete()
|
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)
Deprecated. Use getStringValue(String) which support LargeStringProperty and StringProperty. |
java.util.List |
getListValue(java.lang.String fieldName)
Deprecated. Use getStringListValue(String) instead. Since 1.4. |
com.xpn.xwiki.api.Object |
getObjectApi()
|
int |
getObjectId()
|
java.util.List<java.lang.String> |
getStringListValue(java.lang.String fieldName)
Get the value of the field fieldName of the managed object's class. |
java.lang.String |
getStringValue(java.lang.String fieldName)
Get the value of the field fieldName of the managed object's class. |
XClassManager |
getXClassManager()
|
boolean |
isNew()
|
void |
mergeObject(DefaultXObjectDocument sdoc)
Overwrite current BaseObject fields with provided one. |
void |
reload(com.xpn.xwiki.XWikiContext context)
Reload XWiki document from database using Document full name. |
protected void |
saveDocument(java.lang.String comment,
boolean minorEdit)
|
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)
Deprecated. Use setStringValue(String, String) which support LargeStringProperty and StringProperty. |
void |
setListValue(java.lang.String fieldName,
java.util.List value)
Deprecated. Use getStringListValue(String) instead. Since 1.4. |
void |
setStringListValue(java.lang.String fieldName,
java.util.List<java.lang.String> 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, deleteDocument, 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, getObjects, getParent, getParentURL, getPrefixedFullName, getPreviousDocument, getPreviousVersion, getRCSVersion, getRealLanguage, getRecentRevisions, getRecentRevisions, getRenderedContent, getRenderedContent, getRenderedContent, getRenderedContentDiff, getRevisionInfo, getRevisions, getRevisions, getSpace, getSyntaxId, getTagList, getTags, getTagsPossibleValues, getTemplate, getTextArea, getTitle, getTOC, getTranslatedContent, getTranslatedContent, getTranslatedDocument, getTranslatedDocument, getTranslationList, getURL, getURL, getURL, getValidationScript, 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, save, saveWithProgrammingRights, saveWithProgrammingRights, saveWithProgrammingRights, set, set, setComment, setContent, setCustomClass, setDefaultTemplate, setMinorEdit, setParent, setTitle, setValidationScript, toString, toXML, toXMLDocument, updateObjectFromRequest, updateObjectFromRequest, updateObjectsFromRequest, updateObjectsFromRequest, use, use, use, validate, validate |
| Methods inherited from class com.xpn.xwiki.api.Api |
|---|
checkProgrammingRights, convert, convert, getXWikiContext, hasAdminRights, hasProgrammingRights |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected XClassManager sclass
protected int objectId
protected boolean isNew
| Constructor Detail |
|---|
public DefaultXObjectDocument(XClassManager<? extends XObjectDocument> sclass,
com.xpn.xwiki.doc.XWikiDocument xdoc,
int objectId,
com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
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.
com.xpn.xwiki.XWikiException - error when calling reload(XWikiContext).| Method Detail |
|---|
public void setFullName(java.lang.String docFullName)
docFullName - modify the full name the the managed XWikiDocument.
public void reload(com.xpn.xwiki.XWikiContext context)
throws com.xpn.xwiki.XWikiException
reload in interface XObjectDocumentcontext - the XWiki context.
com.xpn.xwiki.XWikiException - error when initialize document.XObjectDocument.reload(com.xpn.xwiki.XWikiContext)public com.xpn.xwiki.api.Document getDocumentApi()
getDocumentApi in interface XObjectDocumentXObjectDocument.getDocumentApi()public int getObjectId()
getObjectId in interface XObjectDocumentXObjectDocument.getObjectId()public com.xpn.xwiki.api.Object getObjectApi()
getObjectApi in interface XObjectDocumentXObjectDocument.getObjectApi()protected com.xpn.xwiki.objects.BaseObject getBaseObject(boolean toWrite)
BaseObject.
toWrite - indicate that the BaseObject will be modified.
BaseObject.public void mergeObject(DefaultXObjectDocument sdoc)
sdoc - the document to merge.public XClassManager getXClassManager()
getXClassManager in interface XObjectDocumentXObjectDocument.getXClassManager()public boolean isNew()
isNew in interface XObjectDocumentisNew in class com.xpn.xwiki.api.DocumentXObjectDocument.isNew()
protected void saveDocument(java.lang.String comment,
boolean minorEdit)
throws com.xpn.xwiki.XWikiException
saveDocument in class com.xpn.xwiki.api.Documentcom.xpn.xwiki.XWikiExceptionDocument.saveDocument(java.lang.String, boolean)
public void delete()
throws com.xpn.xwiki.XWikiException
delete in class com.xpn.xwiki.api.Documentcom.xpn.xwiki.XWikiExceptionDocument.delete()public java.lang.String getStringValue(java.lang.String fieldName)
fieldName of the managed object's class.
fieldName - the name of the field from the managed object's class where to find the value.
String of the field fieldName of the managed object's class.XWikiDocument.getStringValue(java.lang.String)
public void setStringValue(java.lang.String fieldName,
java.lang.String value)
fieldName of the managed object's class.
This method makes sure the right property type between LargeStringProperty and StringProperty is used.
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.XWikiDocument.setStringValue(java.lang.String,java.lang.String,java.lang.String)@Deprecated public java.lang.String getLargeStringValue(java.lang.String fieldName)
getStringValue(String) which support LargeStringProperty and StringProperty.
fieldName of the managed object's class.
fieldName - the name of the field from the managed object's class where to find the value.
String of the field fieldName of the managed object's class.XWikiDocument.getStringValue(java.lang.String)
@Deprecated
public void setLargeStringValue(java.lang.String fieldName,
java.lang.String value)
setStringValue(String, String) which support LargeStringProperty and StringProperty.
fieldName of the managed object's class.
This method makes sure the right property type between LargeStringProperty and StringProperty is used.
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.XWikiDocument.setLargeStringValue(java.lang.String,java.lang.String,java.lang.String)public java.util.List<java.lang.String> getStringListValue(java.lang.String fieldName)
fieldName of the managed object's class.
fieldName - the name of the field from the managed object's class where to find the value.
List of the field fieldName of the managed object's class.XWikiDocument.getListValue(java.lang.String)
public void setStringListValue(java.lang.String fieldName,
java.util.List<java.lang.String> value)
fieldName of the managed object's class.
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.XWikiDocument.setStringListValue(java.lang.String,java.lang.String,java.util.List)@Deprecated public java.util.List getListValue(java.lang.String fieldName)
getStringListValue(String) instead. Since 1.4.
fieldName of the managed object's class.
fieldName - the name of the field from the managed object's class where to find the value.
List of the field fieldName of the managed object's class.XWikiDocument.getListValue(java.lang.String)
@Deprecated
public void setListValue(java.lang.String fieldName,
java.util.List value)
getStringListValue(String) instead. Since 1.4.
fieldName of the managed object's class.
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.XWikiDocument.setStringListValue(java.lang.String,java.lang.String,java.util.List)public int getIntValue(java.lang.String fieldName)
fieldName of the managed object's class.
fieldName - the name of the field from the managed object's class where to find the value.
fieldName of the managed object's class.XWikiDocument.getListValue(java.lang.String)
public void setIntValue(java.lang.String fieldName,
int value)
fieldName of the managed object's class.
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.XWikiDocument.setIntValue(String, String, int)public java.lang.Boolean getBooleanValue(java.lang.String fieldName)
fieldName of the managed object's class.
fieldName - the name of the field from the managed object's class where to find the value.
Boolean of the field fieldName of the managed object's class.XWikiDocument.getListValue(java.lang.String)
public void setBooleanValue(java.lang.String fieldName,
java.lang.Boolean value)
fieldName of the managed object's class.
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.XWikiDocument.setIntValue(String, String, int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||