|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.objects.BaseElement<R>
com.xpn.xwiki.objects.BaseCollection<DocumentReference>
com.xpn.xwiki.objects.classes.BaseClass
public class BaseClass
Represents an XClass, and contains XClass properties. Each field from BaseCollection
is of type
PropertyClass
and defines a single XClass property.
Field Summary |
---|
Fields inherited from class com.xpn.xwiki.objects.BaseCollection |
---|
currentReferenceDocumentReferenceResolver, fields, fieldsToRemove, number, relativeEntityReferenceResolver |
Fields inherited from class com.xpn.xwiki.objects.BaseElement |
---|
localEntityReferenceSerializer, referenceCache |
Constructor Summary | |
---|---|
BaseClass()
|
Method Summary | |
---|---|
boolean |
addBooleanField(String fieldName,
String fieldPrettyName,
String displayType)
|
boolean |
addDateField(String fieldName,
String fieldPrettyName)
|
boolean |
addDateField(String fieldName,
String fieldPrettyName,
String dformat)
|
boolean |
addDateField(String fieldName,
String fieldPrettyName,
String dformat,
int emptyIsToday)
|
boolean |
addDBListField(String fieldName,
String fieldPrettyName,
int size,
boolean multiSelect,
boolean relationalStorage,
String sql)
|
boolean |
addDBListField(String fieldName,
String fieldPrettyName,
int size,
boolean multiSelect,
String sql)
|
boolean |
addDBListField(String fieldName,
String fieldPrettyName,
String sql)
|
boolean |
addDBTreeListField(String fieldName,
String fieldPrettyName,
int size,
boolean multiSelect,
boolean relationalStorage,
String sql)
|
boolean |
addDBTreeListField(String fieldName,
String fieldPrettyName,
int size,
boolean multiSelect,
String sql)
|
boolean |
addDBTreeListField(String fieldName,
String fieldPrettyName,
String sql)
|
void |
addField(String name,
PropertyInterface element)
|
boolean |
addGroupsField(String fieldName,
String fieldPrettyName)
|
boolean |
addGroupsField(String fieldName,
String fieldPrettyName,
int size)
|
boolean |
addLevelsField(String fieldName,
String fieldPrettyName)
|
boolean |
addLevelsField(String fieldName,
String fieldPrettyName,
int size)
|
boolean |
addNumberField(String fieldName,
String fieldPrettyName,
int size,
String type)
|
boolean |
addPasswordField(String fieldName,
String fieldPrettyName,
int size)
|
boolean |
addStaticListField(String fieldName,
String fieldPrettyName,
int size,
boolean multiSelect,
boolean relationalStorage,
String values,
String displayType,
String separators)
|
boolean |
addStaticListField(String fieldName,
String fieldPrettyName,
int size,
boolean multiSelect,
String values)
|
boolean |
addStaticListField(String fieldName,
String fieldPrettyName,
int size,
boolean multiSelect,
String values,
String displayType)
|
boolean |
addStaticListField(String fieldName,
String fieldPrettyName,
int size,
boolean multiSelect,
String values,
String displayType,
String separators)
|
boolean |
addStaticListField(String fieldName,
String fieldPrettyName,
String values)
|
boolean |
addTemplateField(String fieldName,
String fieldPrettyName)
|
boolean |
addTextAreaField(String fieldName,
String fieldPrettyName,
int cols,
int rows)
|
boolean |
addTextField(String fieldName,
String fieldPrettyName,
int size)
|
boolean |
addUsersField(String fieldName,
String fieldPrettyName)
|
boolean |
addUsersField(String fieldName,
String fieldPrettyName,
boolean multiSelect)
|
boolean |
addUsersField(String fieldName,
String fieldPrettyName,
int size)
|
boolean |
addUsersField(String fieldName,
String fieldPrettyName,
int size,
boolean multiSelect)
|
boolean |
apply(ElementInterface newElement,
boolean clean)
Apply the provided element so that the current one contains the same informations and indicate if it was necessary to modify it in any way. |
BaseClass |
clone()
|
void |
disableField(String name)
Mark a property as disabled. |
void |
enableField(String name)
Re-enable a property. |
boolean |
equals(Object obj)
|
void |
flushCache()
|
BaseCollection |
fromMap(Map<String,?> map,
BaseCollection object)
|
BaseCollection |
fromMap(Map<String,?> map,
XWikiContext context)
Deprecated. since 2.2.3 use fromMap(java.util.Map, com.xpn.xwiki.objects.BaseCollection) |
BaseProperty |
fromString(String value)
|
BaseCollection |
fromValueMap(Map<String,?> map,
BaseCollection object)
|
void |
fromXML(org.dom4j.Element cel)
|
void |
fromXML(String xml)
|
PropertyInterface |
get(String name)
|
String |
getCustomClass()
|
String |
getCustomMapping()
|
List<String> |
getCustomMappingPropertyList(XWikiContext context)
|
String |
getDefaultEditSheet()
|
String |
getDefaultViewSheet()
|
String |
getDefaultWeb()
|
List<BaseProperty> |
getDeprecatedObjectProperties(BaseObject object)
Retrieves deprecated properties of the given object compared to the class. |
List<ObjectDiff> |
getDiff(Object oldObject,
XWikiContext context)
|
List<PropertyClass> |
getDisabledObjectProperties(BaseObject object)
Get the list of disabled properties that exist in a given object. |
List<PropertyClass> |
getDisabledProperties()
Get the list of disabled property definitions that exist in this class. |
List<PropertyClass> |
getEnabledProperties()
Get the list of enabled (the default, normal state) property definitions that exist in this class. |
String |
getName()
Deprecated. since 2.2M2 use BaseElement.getDocumentReference() |
String |
getNameField()
|
DocumentReference |
getReference()
|
String |
getValidationScript()
|
boolean |
hasCustomMapping()
|
boolean |
hasExternalCustomMapping()
|
boolean |
hasInternalCustomMapping()
|
boolean |
isCustomMappingValid(String custommapping,
XWikiContext context)
|
boolean |
isCustomMappingValid(XWikiContext context)
|
void |
merge(BaseClass bclass)
|
void |
merge(ElementInterface previousElement,
ElementInterface newElement,
MergeConfiguration configuration,
XWikiContext context,
MergeResult mergeResult)
Apply a 3 ways merge on the current element based on provided previous and new version of the element. |
static BaseObject |
newCustomClassInstance(DocumentReference classReference,
XWikiContext context)
|
static BaseObject |
newCustomClassInstance(String className,
XWikiContext context)
Deprecated. since 2.2.3 use newCustomClassInstance(DocumentReference, XWikiContext) |
BaseObject |
newCustomClassInstance(XWikiContext context)
|
BaseCollection |
newObject(XWikiContext context)
Deprecated. since 2.2.3 use XWikiDocument.newXObject(org.xwiki.model.reference.EntityReference, com.xpn.xwiki.XWikiContext) |
void |
put(String name,
PropertyInterface property)
|
void |
setCustomClass(String customClass)
|
void |
setCustomMapping(String customMapping)
|
void |
setDefaultEditSheet(String defaultEditSheet)
|
void |
setDefaultViewSheet(String defaultViewSheet)
|
void |
setDefaultWeb(String defaultWeb)
|
void |
setDirty(boolean isDirty)
|
void |
setName(String name)
Deprecated. since 2.2M2 use BaseCollection.setDocumentReference(org.xwiki.model.reference.DocumentReference) |
void |
setNameField(String nameField)
|
void |
setOwnerDocument(XWikiDocument ownerDocument)
Set the owner document of this base property. |
void |
setValidationScript(String validationScript)
|
org.dom4j.Element |
toXML()
|
org.dom4j.Element |
toXML(BaseClass bclass)
|
boolean |
validateObject(BaseObject obj,
XWikiContext context)
|
Methods inherited from class com.xpn.xwiki.objects.BaseElement |
---|
createReference, getDocumentReference, getId, getLocalKey, getLocalUidStringEntityReferenceSerializer, getPrettyName, hashCode, setId, setPrettyName |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.xpn.xwiki.objects.ObjectInterface |
---|
getXClass, safeget, safeput |
Methods inherited from interface com.xpn.xwiki.objects.ElementInterface |
---|
getDocumentReference, setDocumentReference, toString |
Constructor Detail |
---|
public BaseClass()
Method Detail |
---|
public DocumentReference getReference()
getReference
in interface ElementInterface
getReference
in class BaseElement<DocumentReference>
@Deprecated public String getName()
BaseElement.getDocumentReference()
Note: This method is overridden to add the deprecation warning so that code using is can see it's deprecated.
getName
in interface ElementInterface
getName
in class BaseElement<DocumentReference>
BaseProperty
).ElementInterface.getName()
@Deprecated public void setName(String name)
BaseCollection.setDocumentReference(org.xwiki.model.reference.DocumentReference)
Note: BaseElement#setName() does not support setting reference anymore since 2.4M2. This was broken and has been replaced by this overridden method. See XWIKI-5285
setName
in interface ElementInterface
setName
in class BaseCollection<DocumentReference>
ElementInterface.setName(java.lang.String)
public void addField(String name, PropertyInterface element)
This insures natural ordering between properties.
addField
in class BaseCollection<DocumentReference>
BaseCollection.addField(java.lang.String, com.xpn.xwiki.objects.PropertyInterface)
public void disableField(String name)
name
- the name of the property to disablepublic void enableField(String name)
name
- the name of the property to enablepublic PropertyInterface get(String name)
get
in interface ObjectInterface
get
in class BaseCollection<DocumentReference>
public void put(String name, PropertyInterface property)
put
in interface ObjectInterface
put
in class BaseCollection<DocumentReference>
public List<PropertyClass> getEnabledProperties()
PropertyClass.isDisabled()
public List<PropertyClass> getDisabledProperties()
PropertyClass.isDisabled()
public List<PropertyClass> getDisabledObjectProperties(BaseObject object)
object
- the instance of this class where the disabled properties must exist
PropertyClass.isDisabled()
public List<BaseProperty> getDeprecatedObjectProperties(BaseObject object)
object
- the instance of this class where to look for undefined properties
public BaseProperty fromString(String value)
@Deprecated public BaseCollection newObject(XWikiContext context) throws XWikiException
XWikiDocument.newXObject(org.xwiki.model.reference.EntityReference, com.xpn.xwiki.XWikiContext)
XWikiException
@Deprecated public BaseCollection fromMap(Map<String,?> map, XWikiContext context) throws XWikiException
fromMap(java.util.Map, com.xpn.xwiki.objects.BaseCollection)
XWikiException
public BaseCollection fromMap(Map<String,?> map, BaseCollection object)
public BaseCollection fromValueMap(Map<String,?> map, BaseCollection object)
public BaseClass clone()
clone
in class BaseCollection<DocumentReference>
public boolean equals(Object obj)
equals
in class BaseCollection<DocumentReference>
public void merge(BaseClass bclass)
public org.dom4j.Element toXML(BaseClass bclass)
toXML
in interface ObjectInterface
toXML
in class BaseCollection<DocumentReference>
public org.dom4j.Element toXML()
public void fromXML(org.dom4j.Element cel) throws XWikiException
XWikiException
public void fromXML(String xml) throws XWikiException
XWikiException
public boolean addTextField(String fieldName, String fieldPrettyName, int size)
public boolean addPasswordField(String fieldName, String fieldPrettyName, int size)
public boolean addBooleanField(String fieldName, String fieldPrettyName, String displayType)
public boolean addUsersField(String fieldName, String fieldPrettyName)
public boolean addUsersField(String fieldName, String fieldPrettyName, boolean multiSelect)
public boolean addUsersField(String fieldName, String fieldPrettyName, int size)
public boolean addUsersField(String fieldName, String fieldPrettyName, int size, boolean multiSelect)
public boolean addLevelsField(String fieldName, String fieldPrettyName)
public boolean addLevelsField(String fieldName, String fieldPrettyName, int size)
public boolean addGroupsField(String fieldName, String fieldPrettyName)
public boolean addGroupsField(String fieldName, String fieldPrettyName, int size)
public boolean addTemplateField(String fieldName, String fieldPrettyName)
public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows)
public boolean addStaticListField(String fieldName, String fieldPrettyName, String values)
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String values)
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String values, String displayType)
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String values, String displayType, String separators)
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String values, String displayType, String separators)
public boolean addNumberField(String fieldName, String fieldPrettyName, int size, String type)
public boolean addDateField(String fieldName, String fieldPrettyName)
public boolean addDateField(String fieldName, String fieldPrettyName, String dformat)
public boolean addDateField(String fieldName, String fieldPrettyName, String dformat, int emptyIsToday)
public boolean addDBListField(String fieldName, String fieldPrettyName, String sql)
public boolean addDBListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String sql)
public boolean addDBListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String sql)
public boolean addDBTreeListField(String fieldName, String fieldPrettyName, String sql)
public boolean addDBTreeListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String sql)
public boolean addDBTreeListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String sql)
public void setCustomMapping(String customMapping)
public String getCustomMapping()
public boolean hasCustomMapping()
public boolean hasExternalCustomMapping()
public boolean hasInternalCustomMapping()
public boolean isCustomMappingValid(XWikiContext context) throws XWikiException
XWikiException
public boolean isCustomMappingValid(String custommapping, XWikiContext context) throws XWikiException
XWikiException
public List<String> getCustomMappingPropertyList(XWikiContext context)
public void setCustomClass(String customClass)
public String getCustomClass()
public BaseObject newCustomClassInstance(XWikiContext context) throws XWikiException
XWikiException
public static BaseObject newCustomClassInstance(DocumentReference classReference, XWikiContext context) throws XWikiException
XWikiException
@Deprecated public static BaseObject newCustomClassInstance(String className, XWikiContext context) throws XWikiException
newCustomClassInstance(DocumentReference, XWikiContext)
XWikiException
public String getDefaultWeb()
public void setDefaultWeb(String defaultWeb)
public String getDefaultViewSheet()
public void setDefaultViewSheet(String defaultViewSheet)
public String getDefaultEditSheet()
public void setDefaultEditSheet(String defaultEditSheet)
public String getNameField()
public void setNameField(String nameField)
public void setValidationScript(String validationScript)
public String getValidationScript()
public boolean validateObject(BaseObject obj, XWikiContext context) throws XWikiException
XWikiException
public void flushCache()
public List<ObjectDiff> getDiff(Object oldObject, XWikiContext context)
getDiff
in class BaseCollection<DocumentReference>
public void merge(ElementInterface previousElement, ElementInterface newElement, MergeConfiguration configuration, XWikiContext context, MergeResult mergeResult)
ElementInterface
All 3 elements are supposed to have the same class and reference.
merge
in interface ElementInterface
merge
in class BaseCollection<DocumentReference>
previousElement
- the previous version of the elementnewElement
- the next version of the elementconfiguration
- the configuration of the merge Indicate how to deal with some conflicts use cases, etc.context
- the XWiki contextmergeResult
- the merge reportpublic boolean apply(ElementInterface newElement, boolean clean)
ElementInterface
apply
in interface ElementInterface
apply
in class BaseCollection<DocumentReference>
newElement
- the element to applyclean
- true if informations that are not in the new element should be removed (for example class properties
not in the new class)
public void setOwnerDocument(XWikiDocument ownerDocument)
ownerDocument
- The owner document.public void setDirty(boolean isDirty)
isDirty
- Indicate if the dirty flag should be set or cleared.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |