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 fromBaseCollectionis of typePropertyClassand defines a single XClass property.- Version:
- $Id: 8e88b4825d3e6468d2ef6947f67c3ecbc32ec4ff $
- 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 booleanaddBooleanField(String fieldName, String fieldPrettyName)booleanaddBooleanField(String fieldName, String fieldPrettyName, String displayType)booleanaddBooleanField(String fieldName, String fieldPrettyName, String displayType, Boolean def)booleanaddBooleanField(String fieldName, String fieldPrettyName, String formType, String displayType, Boolean def)booleanaddDateField(String fieldName, String fieldPrettyName)booleanaddDateField(String fieldName, String fieldPrettyName, String dformat)booleanaddDateField(String fieldName, String fieldPrettyName, String dformat, int emptyIsToday)booleanaddDBListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String sql)booleanaddDBListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String sql)booleanaddDBListField(String fieldName, String fieldPrettyName, String sql)booleanaddDBTreeListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String sql)booleanaddDBTreeListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String sql)booleanaddDBTreeListField(String fieldName, String fieldPrettyName, String sql)booleanaddEmailField(String fieldName, String fieldPrettyName, int size)voidaddField(String name, PropertyInterface element)booleanaddGroupsField(String fieldName, String fieldPrettyName)booleanaddGroupsField(String fieldName, String fieldPrettyName, int size)booleanaddLevelsField(String fieldName, String fieldPrettyName)booleanaddLevelsField(String fieldName, String fieldPrettyName, int size)booleanaddNumberField(String fieldName, String fieldPrettyName, int size, String type)booleanaddPageField(String fieldName, String fieldPrettyName, int size)Adds a page field to the class.booleanaddPageField(String fieldName, String fieldPrettyName, int size, boolean multiSelect)Adds a page field to the class.booleanaddPageField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String hqlQuery)Adds a page field to the class.booleanaddPageField(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.booleanaddPasswordField(String fieldName, String fieldPrettyName, int size)booleanaddPasswordField(String fieldName, String fieldPrettyName, int size, String storageType)StaticListClassaddStaticListField(String fieldName)Adds a new Static List xproperty to this xclass.booleanaddStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String values, String displayType, String separators)booleanaddStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String values, String displayType, String separators, String defaultValue)booleanaddStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, boolean relationalStorage, String values, String displayType, String separators, String defaultValue, String freeText, boolean largeStorage)booleanaddStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String values)booleanaddStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String values, String displayType)booleanaddStaticListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String values, String displayType, String separators)booleanaddStaticListField(String fieldName, String fieldPrettyName, String values)booleanaddStaticListField(String fieldName, String fieldPrettyName, String values, String defaultValue)booleanaddTemplateField(String fieldName, String fieldPrettyName)booleanaddTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows)booleanaddTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, boolean restricted)booleanaddTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, TextAreaClass.ContentType contentType)booleanaddTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, TextAreaClass.EditorType editorType)booleanaddTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, TextAreaClass.EditorType editorType, TextAreaClass.ContentType contentType)booleanaddTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor)booleanaddTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor, boolean restricted)booleanaddTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor, String contenttype)booleanaddTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows, String editor, String contenttype, boolean restricted)booleanaddTextField(String fieldName, String fieldPrettyName, int size)booleanaddTimezoneField(String fieldName, String fieldPrettyName, int size)booleanaddUsersField(String fieldName, String fieldPrettyName)booleanaddUsersField(String fieldName, String fieldPrettyName, boolean multiSelect)booleanaddUsersField(String fieldName, String fieldPrettyName, int size)booleanaddUsersField(String fieldName, String fieldPrettyName, int size, boolean multiSelect)booleanapply(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.BaseClassclone()voiddisableField(String name)Mark a property as disabled.voidenableField(String name)Re-enable a property.booleanequals(Object obj)voidflushCache()BaseCollectionfromMap(Map<String,?> map, BaseCollection object)BaseCollectionfromMap(Map<String,?> map, XWikiContext context)Deprecated.since 2.2.3 usefromMap(java.util.Map, com.xpn.xwiki.objects.BaseCollection)BasePropertyfromString(String value)BaseCollectionfromValueMap(Map<String,?> map, BaseCollection object)voidfromXML(String xml)voidfromXML(org.dom4j.Element element)PropertyInterfaceget(String name)StringgetCustomClass()StringgetCustomMapping()List<String>getCustomMappingPropertyList(XWikiContext context)StringgetDefaultEditSheet()StringgetDefaultViewSheet()StringgetDefaultWeb()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.StringgetName()Deprecated.since 2.2M2 useBaseElement.getDocumentReference()StringgetNameField()DocumentReferencegetReference()StringgetValidationScript()booleanhasCustomMapping()booleanhasExternalCustomMapping()booleanhasInternalCustomMapping()booleanisCustomMappingValid(XWikiContext context)booleanisCustomMappingValid(String custommapping, XWikiContext context)voidmerge(BaseClass bclass)MergeManagerResult<ElementInterface,Object>merge(ElementInterface previousElement, ElementInterface newElement, MergeConfiguration configuration, XWikiContext context)Apply a 3 ways merge on the current element based on provided previous and new version of the element.BaseObjectnewCustomClassInstance(boolean fallback)BaseObjectnewCustomClassInstance(XWikiContext context)static BaseObjectnewCustomClassInstance(String className, XWikiContext context)Deprecated.since 2.2.3 usenewCustomClassInstance(DocumentReference, XWikiContext)static BaseObjectnewCustomClassInstance(DocumentReference classReference, boolean fallback, XWikiContext context)static BaseObjectnewCustomClassInstance(DocumentReference classReference, XWikiContext context)BaseCollectionnewObject(XWikiContext context)Deprecated.voidput(String name, PropertyInterface property)voidsetCustomClass(String customClass)voidsetCustomMapping(String customMapping)voidsetDefaultEditSheet(String defaultEditSheet)voidsetDefaultViewSheet(String defaultViewSheet)voidsetDefaultWeb(String defaultWeb)voidsetDirty(boolean isDirty)voidsetName(String name)Deprecated.voidsetNameField(String nameField)voidsetOwnerDocument(XWikiDocument ownerDocument)Set the owner document of this base property.voidsetValidationScript(String validationScript)booleanvalidateObject(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, merge, 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, merge, setDocumentReference, toString
-
Methods inherited from interface com.xpn.xwiki.objects.ObjectInterface
getXClass, safeget, safeput, toXML
-
-
-
-
Method Detail
-
getReference
public DocumentReference getReference()
- Specified by:
getReferencein interfaceElementInterface- Overrides:
getReferencein 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:
getNamein interfaceElementInterface- Overrides:
getNamein 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:
setNamein interfaceElementInterface- Overrides:
setNamein classBaseElement<DocumentReference>- See Also:
ElementInterface.setName(java.lang.String)
-
addField
public void addField(String name, PropertyInterface element)
This insures natural ordering between properties.
- Overrides:
addFieldin 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:
getin interfaceObjectInterface- Overrides:
getin classBaseCollection<DocumentReference>
-
put
public void put(String name, PropertyInterface property)
- Specified by:
putin interfaceObjectInterface- Overrides:
putin 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:
clonein classBaseCollection<DocumentReference>
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classBaseCollection<DocumentReference>
-
merge
public void merge(BaseClass bclass)
-
fromXML
public void fromXML(org.dom4j.Element element) throws XWikiException- Overrides:
fromXMLin classBaseElement<DocumentReference>- Throws:
XWikiException
-
fromXML
public void fromXML(String xml) throws XWikiException
- Overrides:
fromXMLin 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 thePageClassrelationalStorageproperty 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 builderis 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 thePageClassrelationalStorageproperty 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 builderis usedclassName- optional class name used to filter suggested documents containing an object of this classdisplayType- eitherListClass.DISPLAYTYPE_CHECKBOX,ListClass.DISPLAYTYPE_INPUT,ListClass.DISPLAYTYPE_RADIOorListClass.DISPLAYTYPE_SELECThasPicker- 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 andfallbackis 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 andfallbackis 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:
getDiffin classBaseCollection<DocumentReference>
-
merge
public MergeManagerResult<ElementInterface,Object> merge(ElementInterface previousElement, ElementInterface newElement, MergeConfiguration configuration, XWikiContext context)
Description copied from interface:ElementInterfaceApply 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.
Note that the current element is modified only if
MergeConfiguration.isProvidedVersionsModifiables()returnstrue.- Specified by:
mergein interfaceElementInterface- Overrides:
mergein 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 context
-
apply
public boolean apply(ElementInterface newElement, boolean clean)
Description copied from interface:ElementInterfaceApply 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:
applyin interfaceElementInterface- Overrides:
applyin 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:
setOwnerDocumentin 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
-
-