|
||||||||||
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,
XWikiDocument xdoc,
int objectId,
XWikiContext context)
Create instance of DefaultXObjectDocument from provided XWikiDocument. |
Method Summary | |
---|---|
void |
delete()
|
protected BaseObject |
getBaseObject(boolean toWrite)
Get the managed BaseObject . |
Boolean |
getBooleanValue(String fieldName)
Get the value of the field fieldName of the managed object's class. |
Document |
getDocumentApi()
|
int |
getIntValue(String fieldName)
Get the value of the field fieldName of the managed object's class. |
String |
getLargeStringValue(String fieldName)
Deprecated. Use getStringValue(String) which support LargeStringProperty and StringProperty. |
List |
getListValue(String fieldName)
Deprecated. Use getStringListValue(String) instead. Since 1.4. |
Object |
getObjectApi()
|
int |
getObjectId()
|
List<String> |
getStringListValue(String fieldName)
Get the value of the field fieldName of the managed object's class. |
String |
getStringValue(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(XWikiContext context)
Reload XWiki document from database using Document full name. |
protected void |
saveDocument(String comment,
boolean minorEdit)
|
void |
setBooleanValue(String fieldName,
Boolean value)
Modify the value of the field fieldName of the managed object's class. |
void |
setFullName(String docFullName)
|
void |
setIntValue(String fieldName,
int value)
Modify the value of the field fieldName of the managed object's class. |
void |
setLargeStringValue(String fieldName,
String value)
Deprecated. Use setStringValue(String, String) which support LargeStringProperty and StringProperty. |
void |
setListValue(String fieldName,
List value)
Deprecated. Use getStringListValue(String) instead. Since 1.4. |
void |
setStringListValue(String fieldName,
List<String> value)
Modify the value of the field fieldName of the managed object's class. |
void |
setStringValue(String fieldName,
String value)
Modify the value of the field fieldName of the managed object's class. |
Methods inherited from class com.xpn.xwiki.api.Api |
---|
convert, convert, convert, convertAttachments, getXWikiContext, hasAdminRights, hasProgrammingRights, hasWikiAdminRights |
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, XWikiDocument xdoc, int objectId, XWikiContext context) throws 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.
XWikiException
- error when calling reload(XWikiContext)
.Method Detail |
---|
public void setFullName(String docFullName)
docFullName
- modify the full name the the managed XWikiDocument.public void reload(XWikiContext context) throws XWikiException
XObjectDocument
reload
in interface XObjectDocument
context
- the XWiki context.
XWikiException
- error when initialize document.public Document getDocumentApi()
getDocumentApi
in interface XObjectDocument
public int getObjectId()
getObjectId
in interface XObjectDocument
public Object getObjectApi()
getObjectApi
in interface XObjectDocument
protected 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 XObjectDocument
public boolean isNew()
isNew
in interface XObjectDocument
isNew
in class Document
protected void saveDocument(String comment, boolean minorEdit) throws XWikiException
saveDocument
in class Document
XWikiException
public void delete() throws XWikiException
delete
in class Document
XWikiException
public String getStringValue(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(String fieldName, 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 String getLargeStringValue(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(String fieldName, 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 List<String> getStringListValue(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(String fieldName, List<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 List getListValue(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(String fieldName, 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(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(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 Boolean getBooleanValue(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(String fieldName, 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 |