Package com.xpn.xwiki.objects.classes
Class BaseClass
- java.lang.Object
-
- com.xpn.xwiki.objects.BaseElement<R>
-
- com.xpn.xwiki.objects.BaseCollection<DocumentReference>
-
- com.xpn.xwiki.objects.classes.BaseClass
-
- All Implemented Interfaces:
ClassInterface
,ElementInterface
,ObjectInterface
,Serializable
,Cloneable
- Direct Known Subclasses:
MetaClass
,PropertyMetaClass
public class BaseClass extends BaseCollection<DocumentReference> implements ClassInterface
Represents an XClass, and contains XClass properties. Each field fromBaseCollection
is of typePropertyClass
and defines a single XClass property.- Version:
- $Id: 3b29bbf4725c26141dad6c9755a2f8e0b641ad60 $
- See Also:
- Serialized Form
-
-
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
documentReference, ownerDocument, referenceCache
-
-
Constructor Summary
Constructors Constructor Description BaseClass()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
addBooleanField(String fieldName, String fieldPrettyName)
boolean
addBooleanField(String fieldName, String fieldPrettyName, String displayType)
boolean
addBooleanField(String fieldName, String fieldPrettyName, String displayType, Boolean def)
boolean
addBooleanField(String fieldName, String fieldPrettyName, String formType, String displayType, Boolean def)
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)
boolean
addEmailField(String fieldName, String fieldPrettyName, int size)
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
addPageField(String fieldName, String fieldPrettyName, int size)
Adds a page field to the class.boolean
addPageField(String fieldName, String fieldPrettyName, int size, boolean multiSelect)
Adds a page field to the class.boolean
addPageField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String hqlQuery)
Adds a page field to the class.boolean
addPageField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String hqlQuery, String className, String displayType, boolean hasPicker, String freeText)
Adds a page field to the class.boolean
addPasswordField(String fieldName, String fieldPrettyName, int size)
boolean
addPasswordField(String fieldName, String fieldPrettyName, int size, String storageType)
StaticListClass
addStaticListField(String fieldName)
Adds a new Static List xproperty to this xclass.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, boolean relationalStorage, String values, String displayType, String separators, String defaultValue)
boolean
addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String values, String displayType, String separators, String defaultValue, String freeText, boolean largeStorage)
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
addStaticListField(String fieldName, String fieldPrettyName, String values, String defaultValue)
boolean
addTemplateField(String fieldName, String fieldPrettyName)
boolean
addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows)
boolean
addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, boolean restricted)
boolean
addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, TextAreaClass.ContentType contentType)
boolean
addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, TextAreaClass.EditorType editorType)
boolean
addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, TextAreaClass.EditorType editorType, TextAreaClass.ContentType contentType)
boolean
addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor)
boolean
addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor, boolean restricted)
boolean
addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor, String contenttype)
boolean
addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor, String contenttype, boolean restricted)
boolean
addTextField(String fieldName, String fieldPrettyName, int size)
boolean
addTimezoneField(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 usefromMap(java.util.Map, com.xpn.xwiki.objects.BaseCollection)
BaseProperty
fromString(String value)
BaseCollection
fromValueMap(Map<String,?> map, BaseCollection object)
void
fromXML(String xml)
void
fromXML(org.dom4j.Element element)
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 useBaseElement.getDocumentReference()
String
getNameField()
DocumentReference
getReference()
String
getValidationScript()
boolean
hasCustomMapping()
boolean
hasExternalCustomMapping()
boolean
hasInternalCustomMapping()
boolean
isCustomMappingValid(XWikiContext context)
boolean
isCustomMappingValid(String custommapping, 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.BaseObject
newCustomClassInstance(boolean fallback)
BaseObject
newCustomClassInstance(XWikiContext context)
static BaseObject
newCustomClassInstance(String className, XWikiContext context)
Deprecated.since 2.2.3 usenewCustomClassInstance(DocumentReference, XWikiContext)
static BaseObject
newCustomClassInstance(DocumentReference classReference, boolean fallback, XWikiContext context)
static BaseObject
newCustomClassInstance(DocumentReference classReference, XWikiContext context)
BaseCollection
newObject(XWikiContext context)
Deprecated.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.void
setNameField(String nameField)
void
setOwnerDocument(XWikiDocument ownerDocument)
Set the owner document of this base property.void
setValidationScript(String validationScript)
boolean
validateObject(BaseObject obj, XWikiContext context)
-
Methods inherited from class com.xpn.xwiki.objects.BaseCollection
addPropertyForRemoval, getClassName, getCurrentReferenceDocumentReferenceResolver, getCustomMappingMap, getDateValue, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getNumber, getProperties, getPropertyList, getPropertyNames, getRelativeEntityReferenceResolver, getRelativeXClassReference, getSetValue, getSortedIterator, getStringValue, getXClass, getXClassReference, merge, mergeField, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDocumentReference, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setNumber, setSetValue, setStringListValue, setStringValue, setXClassReference, toXML, toXML, toXMLString
-
Methods inherited from class com.xpn.xwiki.objects.BaseElement
createReference, getDocumentReference, getId, getLocalEntityReferenceSerializer, getLocalization, getLocalKey, getLocalUidStringEntityReferenceSerializer, getMergeManager, getOwnerDocument, getPrettyName, getXWikiContext, hashCode, localizePlain, localizePlainOrKey, setId, setPrettyName, toString, toXMLString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.xpn.xwiki.objects.ElementInterface
getDocumentReference, setDocumentReference, toString
-
Methods inherited from interface com.xpn.xwiki.objects.ObjectInterface
getXClass, safeget, safeput, toXML
-
-
-
-
Method Detail
-
getReference
public DocumentReference getReference()
- Specified by:
getReference
in interfaceElementInterface
- Overrides:
getReference
in classBaseElement<DocumentReference>
- Returns:
- the reference of the element
-
getName
@Deprecated public String getName()
Deprecated.since 2.2M2 useBaseElement.getDocumentReference()
Note that this method is used by Hibernate for saving an element.
Note: This method is overridden to add the deprecation warning so that code using is can see it's deprecated.
- Specified by:
getName
in interfaceElementInterface
- Overrides:
getName
in classBaseElement<DocumentReference>
- Returns:
- the free form name (for elements which don't point to a reference, for example for instances of
BaseProperty
). - See Also:
ElementInterface.getName()
-
setName
@Deprecated public void setName(String name)
Deprecated.Note that this method is used by Hibernate for loading an element.
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
- Specified by:
setName
in interfaceElementInterface
- Overrides:
setName
in classBaseElement<DocumentReference>
- See Also:
ElementInterface.setName(java.lang.String)
-
addField
public void addField(String name, PropertyInterface element)
This insures natural ordering between properties.
- Overrides:
addField
in classBaseCollection<DocumentReference>
- See Also:
BaseCollection.addField(java.lang.String, com.xpn.xwiki.objects.PropertyInterface)
-
disableField
public void disableField(String name)
Mark a property as disabled. A disabled property should not be editable, but existing object values are still kept in the database.- Parameters:
name
- the name of the property to disable- Since:
- 2.4M2
-
enableField
public void enableField(String name)
Re-enable a property. This field will appear again in object instances.- Parameters:
name
- the name of the property to enable- Since:
- 2.4M2
-
get
public PropertyInterface get(String name)
- Specified by:
get
in interfaceObjectInterface
- Overrides:
get
in classBaseCollection<DocumentReference>
-
put
public void put(String name, PropertyInterface property)
- Specified by:
put
in interfaceObjectInterface
- Overrides:
put
in classBaseCollection<DocumentReference>
-
getEnabledProperties
public List<PropertyClass> getEnabledProperties()
Get the list of enabled (the default, normal state) property definitions that exist in this class. The resulting list is unmodifiable, but the contained elements are live.- Returns:
- an unmodifiable list containing the enabled properties of the class
- Since:
- 2.4M2
- See Also:
PropertyClass.isDisabled()
-
getDisabledProperties
public List<PropertyClass> getDisabledProperties()
Get the list of disabled property definitions that exist in this class. The resulting list is unmodifiable, but the contained elements are live.- Returns:
- an unmodifiable list containing the disabled properties of the class
- Since:
- 2.4M2
- See Also:
PropertyClass.isDisabled()
-
getDisabledObjectProperties
public List<PropertyClass> getDisabledObjectProperties(BaseObject object)
Get the list of disabled properties that exist in a given object. This list is a subset of all the disabled properties in a class, since the object could have been created and stored before some of the class properties were added. The resulting list is unmodifiable, but the contained elements are live.- Parameters:
object
- the instance of this class where the disabled properties must exist- Returns:
- an unmodifiable list containing the disabled properties of the given object
- Since:
- 2.4M2
- See Also:
PropertyClass.isDisabled()
-
getDeprecatedObjectProperties
public List<BaseProperty> getDeprecatedObjectProperties(BaseObject object)
Retrieves deprecated properties of the given object compared to the class. A deprecated property is a property which exists in the Object but doesn't exist anymore in the Class, or which has the wrong data type. This is used for synchronization of existing or imported Objects with respect to the modifications of their associated Class.- Parameters:
object
- the instance of this class where to look for undefined properties- Returns:
- an unmodifiable list containing the properties of the object which don't exist in the class
- Since:
- 2.4M2
-
fromString
public BaseProperty fromString(String value)
-
newObject
@Deprecated public BaseCollection newObject(XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
fromMap
@Deprecated public BaseCollection fromMap(Map<String,?> map, XWikiContext context) throws XWikiException
Deprecated.since 2.2.3 usefromMap(java.util.Map, com.xpn.xwiki.objects.BaseCollection)
- Throws:
XWikiException
-
fromMap
public BaseCollection fromMap(Map<String,?> map, BaseCollection object)
-
fromValueMap
public BaseCollection fromValueMap(Map<String,?> map, BaseCollection object)
-
clone
public BaseClass clone()
- Overrides:
clone
in classBaseCollection<DocumentReference>
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classBaseCollection<DocumentReference>
-
merge
public void merge(BaseClass bclass)
-
fromXML
public void fromXML(org.dom4j.Element element) throws XWikiException
- Overrides:
fromXML
in classBaseElement<DocumentReference>
- Throws:
XWikiException
-
fromXML
public void fromXML(String xml) throws XWikiException
- Overrides:
fromXML
in classBaseElement<DocumentReference>
- Parameters:
xml
- the XML to read- Throws:
XWikiException
- when failing to parse XML
-
addPasswordField
public boolean addPasswordField(String fieldName, String fieldPrettyName, int size)
-
addPasswordField
public boolean addPasswordField(String fieldName, String fieldPrettyName, int size, String storageType)
-
addTimezoneField
public boolean addTimezoneField(String fieldName, String fieldPrettyName, int size)
-
addBooleanField
public boolean addBooleanField(String fieldName, String fieldPrettyName)
- Since:
- 10.10RC1
-
addBooleanField
public boolean addBooleanField(String fieldName, String fieldPrettyName, String displayType)
-
addBooleanField
public boolean addBooleanField(String fieldName, String fieldPrettyName, String displayType, Boolean def)
-
addBooleanField
public boolean addBooleanField(String fieldName, String fieldPrettyName, String formType, String displayType, Boolean def)
- Since:
- 10.7RC1
-
addUsersField
public boolean addUsersField(String fieldName, String fieldPrettyName, boolean multiSelect)
- Since:
- 1.1.2, 1.2M2
-
addUsersField
public boolean addUsersField(String fieldName, String fieldPrettyName, int size, boolean multiSelect)
- Since:
- 1.1.2, 1.2M2
-
addTextAreaField
public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows)
-
addTextAreaField
@Unstable public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, boolean restricted)
- Since:
- 14.10, 14.4.7, 13.10.11
-
addTextAreaField
public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, TextAreaClass.EditorType editorType)
-
addTextAreaField
public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor)
-
addTextAreaField
@Unstable public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor, boolean restricted)
- Since:
- 14.10, 14.4.7, 13.10.11
-
addTextAreaField
public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, TextAreaClass.ContentType contentType)
- Since:
- 8.3
-
addTextAreaField
public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, TextAreaClass.EditorType editorType, TextAreaClass.ContentType contentType)
- Since:
- 8.3
-
addTextAreaField
public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor, String contenttype)
- Since:
- 8.3
-
addTextAreaField
@Unstable public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor, String contenttype, boolean restricted)
- Since:
- 14.10, 14.4.7, 13.10.11
-
addStaticListField
public boolean addStaticListField(String fieldName, String fieldPrettyName, String values)
-
addStaticListField
public boolean addStaticListField(String fieldName, String fieldPrettyName, String values, String defaultValue)
- Since:
- 10.9, 10.8.1
-
addStaticListField
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String values)
-
addStaticListField
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String values, String displayType)
-
addStaticListField
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String values, String displayType, String separators)
- Since:
- 1.1.2, 1.2M2
-
addStaticListField
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String values, String displayType, String separators)
- Since:
- 1.8M1
-
addStaticListField
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String values, String displayType, String separators, String defaultValue)
- Since:
- 10.9, 10.8.1
-
addStaticListField
public boolean addStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String values, String displayType, String separators, String defaultValue, String freeText, boolean largeStorage)
- Since:
- 11.5RC1
-
addStaticListField
public StaticListClass addStaticListField(String fieldName)
Adds a new Static List xproperty to this xclass. This allows calling the various methods on the returnedStaticListClass
.- Parameters:
fieldName
- the id of the Static List xproperty to add- Returns:
- the added Static List xproperty or the existing xproperty if it was already existing
- Since:
- 12.8RC1
-
addNumberField
public boolean addNumberField(String fieldName, String fieldPrettyName, int size, String type)
-
addDateField
public boolean addDateField(String fieldName, String fieldPrettyName, String dformat, int emptyIsToday)
-
addDBListField
public boolean addDBListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String sql)
-
addDBListField
public boolean addDBListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String sql)
- Since:
- 1.8M1
-
addDBTreeListField
public boolean addDBTreeListField(String fieldName, String fieldPrettyName, String sql)
-
addDBTreeListField
public boolean addDBTreeListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String sql)
-
addDBTreeListField
public boolean addDBTreeListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String sql)
- Since:
- 1.8M1
-
addPageField
public boolean addPageField(String fieldName, String fieldPrettyName, int size)
Adds a page field to the class.The input has no multiselect by default.
- Parameters:
fieldName
- the field namefieldPrettyName
- the shown namesize
- size of the input- Returns:
- true if the field has been added
- Since:
- 10.8RC1
-
addPageField
public boolean addPageField(String fieldName, String fieldPrettyName, int size, boolean multiSelect)
Adds a page field to the class.- Parameters:
fieldName
- the field namefieldPrettyName
- the shown namesize
- size of the inputmultiSelect
- specifies if there can be several values- Returns:
- true if the field has been added
- Since:
- 10.8RC1
-
addPageField
public boolean addPageField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String hqlQuery)
Adds a page field to the class.- Parameters:
fieldName
- the field namefieldPrettyName
- the shown namesize
- size of the inputmultiSelect
- specifies if there can be several valuesrelationalStorage
- sets thePageClass
relationalStorage
property metadata with the specified value. SeeListClass.setRelationalStorage(boolean)
for more detailshqlQuery
- the optional HQL query to execute to return allowed document references. If null or empty, theimplicit page query builder
is used- Returns:
- true if the field has been added
- Since:
- 10.8RC1
-
addPageField
public boolean addPageField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String hqlQuery, String className, String displayType, boolean hasPicker, String freeText)
Adds a page field to the class.- Parameters:
fieldName
- the field namefieldPrettyName
- the shown namesize
- size of the inputmultiSelect
- specifies if there can be several valuesrelationalStorage
- sets thePageClass
relationalStorage
property metadata with the specified value. SeeListClass.setRelationalStorage(boolean)
for more detailshqlQuery
- the optional HQL query to execute to return allowed document references. If null or empty, theimplicit page query builder
is usedclassName
- optional class name used to filter suggested documents containing an object of this classdisplayType
- eitherListClass.DISPLAYTYPE_CHECKBOX
,ListClass.DISPLAYTYPE_INPUT
,ListClass.DISPLAYTYPE_RADIO
orListClass.DISPLAYTYPE_SELECT
hasPicker
- enables auto suggestion displayfreeText
- indicate how non document reference values are handled (forbidden, discouraged or allowed)- Returns:
- true if the field has been added
- Since:
- 10.8RC1
-
setCustomMapping
public void setCustomMapping(String customMapping)
-
getCustomMapping
public String getCustomMapping()
-
hasCustomMapping
public boolean hasCustomMapping()
-
hasExternalCustomMapping
public boolean hasExternalCustomMapping()
-
hasInternalCustomMapping
public boolean hasInternalCustomMapping()
-
isCustomMappingValid
public boolean isCustomMappingValid(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
isCustomMappingValid
public boolean isCustomMappingValid(String custommapping, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
getCustomMappingPropertyList
public List<String> getCustomMappingPropertyList(XWikiContext context)
-
setCustomClass
public void setCustomClass(String customClass)
-
getCustomClass
public String getCustomClass()
-
newCustomClassInstance
public BaseObject newCustomClassInstance(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
newCustomClassInstance
public BaseObject newCustomClassInstance(boolean fallback) throws XWikiException
- Parameters:
fallback
- if true, fallback on BaseObject if there is any problem with the configured custom class- Returns:
- a new Java instance of an object represented by this XWiki class
- Throws:
XWikiException
- if there is a problem when creating an new instance andfallback
is false- Since:
- 12.4RC1, 11.10.5
-
newCustomClassInstance
public static BaseObject newCustomClassInstance(DocumentReference classReference, XWikiContext context) throws XWikiException
- Throws:
XWikiException
- Since:
- 2.2.3
-
newCustomClassInstance
public static BaseObject newCustomClassInstance(DocumentReference classReference, boolean fallback, XWikiContext context) throws XWikiException
- Parameters:
classReference
- the reference of the document containing the XWiki class for which to create a new objectfallback
- if true, fallback on BaseObject if there is any problem with the configured custom classcontext
- the XWiki context used to load theBaseClass
- Returns:
- a new Java instance of an object represented by this XWiki class
- Throws:
XWikiException
- if there is a problem when creating an new instance andfallback
is false- Since:
- 12.4RC1, 11.10.5
-
newCustomClassInstance
@Deprecated public static BaseObject newCustomClassInstance(String className, XWikiContext context) throws XWikiException
Deprecated.since 2.2.3 usenewCustomClassInstance(DocumentReference, XWikiContext)
- Throws:
XWikiException
-
getDefaultWeb
public String getDefaultWeb()
-
setDefaultWeb
public void setDefaultWeb(String defaultWeb)
-
getDefaultViewSheet
public String getDefaultViewSheet()
-
setDefaultViewSheet
public void setDefaultViewSheet(String defaultViewSheet)
-
getDefaultEditSheet
public String getDefaultEditSheet()
-
setDefaultEditSheet
public void setDefaultEditSheet(String defaultEditSheet)
-
getNameField
public String getNameField()
-
setNameField
public void setNameField(String nameField)
-
setValidationScript
public void setValidationScript(String validationScript)
-
getValidationScript
public String getValidationScript()
-
validateObject
public boolean validateObject(BaseObject obj, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
flushCache
public void flushCache()
-
getDiff
public List<ObjectDiff> getDiff(Object oldObject, XWikiContext context)
- Overrides:
getDiff
in classBaseCollection<DocumentReference>
-
merge
public void merge(ElementInterface previousElement, ElementInterface newElement, MergeConfiguration configuration, XWikiContext context, MergeResult mergeResult)
Description copied from interface:ElementInterface
Apply a 3 ways merge on the current element based on provided previous and new version of the element.All 3 elements are supposed to have the same class and reference.
- Specified by:
merge
in interfaceElementInterface
- Overrides:
merge
in classBaseCollection<DocumentReference>
- Parameters:
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 report
-
apply
public boolean apply(ElementInterface newElement, boolean clean)
Description copied from interface:ElementInterface
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.- Specified by:
apply
in interfaceElementInterface
- Overrides:
apply
in classBaseCollection<DocumentReference>
- Parameters:
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)- Returns:
- true if the element has been modified
-
setOwnerDocument
public void setOwnerDocument(XWikiDocument ownerDocument)
Set the owner document of this base property.- Overrides:
setOwnerDocument
in classBaseCollection<DocumentReference>
- Parameters:
ownerDocument
- The owner document.- Since:
- 4.3M2
-
setDirty
public void setDirty(boolean isDirty)
- Parameters:
isDirty
- Indicate if the dirty flag should be set or cleared.- Since:
- 4.3M2
-
-