public class PropertyClass extends BaseCollection<ClassPropertyReference> implements PropertyClassInterface, Comparable<PropertyClass>
BaseProperty
.Modifier and Type | Field and Description |
---|---|
protected String |
cachedCustomDisplayer |
currentReferenceDocumentReferenceResolver, fields, fieldsToRemove, number, relativeEntityReferenceResolver
documentReference, ownerDocument, referenceCache
Constructor and Description |
---|
PropertyClass() |
PropertyClass(String name,
String prettyname,
PropertyMetaClass xWikiClass) |
Modifier and Type | Method and Description |
---|---|
PropertyClass |
clone() |
int |
compareTo(PropertyClass other)
Compares two property definitions based on their index number.
|
protected ClassPropertyReference |
createReference() |
void |
displayCustom(StringBuffer buffer,
String fieldName,
String prefix,
String type,
BaseObject object,
XWikiContext context) |
String |
displayEdit(String name,
BaseCollection object,
XWikiContext context) |
void |
displayEdit(StringBuffer buffer,
String name,
String prefix,
BaseCollection object,
XWikiContext context) |
String |
displayEdit(String name,
String prefix,
BaseCollection object,
XWikiContext context) |
String |
displayHidden(String name,
BaseCollection object,
XWikiContext context) |
void |
displayHidden(StringBuffer buffer,
String name,
String prefix,
BaseCollection object,
XWikiContext context) |
String |
displayHidden(String name,
String prefix,
BaseCollection object,
XWikiContext context) |
String |
displayView(String name,
BaseCollection object,
XWikiContext context) |
void |
displayView(StringBuffer buffer,
String name,
String prefix,
BaseCollection object,
XWikiContext context) |
String |
displayView(String name,
String prefix,
BaseCollection object,
XWikiContext context) |
void |
flushCache() |
BaseProperty |
fromString(String value) |
BaseProperty |
fromStringArray(String[] strings) |
BaseProperty |
fromValue(Object value) |
void |
fromXML(org.dom4j.Element element) |
protected String |
getCachedDefaultCustomDisplayer(XWikiContext context)
Returns the current cached default custom displayer for the PropertyClass.
|
String |
getClassName()
Note that this method cannot be removed for now since it's used by Hibernate for saving an XObject.
|
String |
getClassType()
Each type of XClass property is identified by a string that specifies the data type of the property value (e.g.
|
String |
getCustomDisplay() |
protected String |
getDefaultCustomDisplayer(String propertyClassName,
XWikiContext context)
Method to find the default custom displayer to use for a specific Property Class.
|
String |
getFieldFullName()
Computes the field full name using this format:
parentName_fieldName . |
protected String |
getFullQueryPropertyName() |
String |
getHint()
Get the localized hint.
|
long |
getId()
Return an truncated MD5 hash of the local key computed in
BaseElement.getLocalKey() . |
String |
getName() |
int |
getNumber() |
BaseCollection |
getObject() |
String |
getPrettyName() |
String |
getPrettyName(XWikiContext context) |
String |
getTooltip() |
String |
getTooltip(XWikiContext context)
Gets international tooltip
|
String |
getTranslatedPrettyName(XWikiContext context) |
String |
getValidationMessage() |
String |
getValidationRegExp() |
BaseClass |
getXClass(XWikiContext context) |
BaseClass |
getxWikiClass() |
void |
initLazyCollections() |
boolean |
isCustomDisplayed(XWikiContext context) |
boolean |
isDisabled()
See if this property is disabled or not.
|
boolean |
isUnmodifiable() |
boolean |
isValidColumnTypes(org.hibernate.mapping.Property hibprop) |
<T extends EntityReference> |
mergeProperty(BaseProperty<T> currentProperty,
BaseProperty<T> previousProperty,
BaseProperty<T> newProperty,
MergeConfiguration configuration,
XWikiContext context,
MergeResult mergeResult)
Apply a 3 ways merge on passed current, previous and new version of the same property.
|
BaseProperty |
newProperty() |
BaseProperty |
newPropertyfromXML(org.dom4j.Element ppcel) |
protected String |
renderContentInContext(String content,
String syntax,
DocumentReference authorReference,
DocumentReference secureDocument,
XWikiContext context)
Render content in the current document's context with the rights of the given user.
|
protected String |
renderContentInContext(String content,
String syntax,
DocumentReference authorReference,
XWikiContext context)
Deprecated.
since 10.11RC1, use
renderContentInContext(String, String, DocumentReference, DocumentReference, XWikiContext)
instead |
void |
setClassType(String type)
Deprecated.
since 4.3M1, the property class type cannot be modified
|
void |
setCustomDisplay(String value) |
void |
setDisabled(boolean disabled)
Disable or re-enable this property.
|
void |
setHint(String hint)
Set the text displayed in the object editor to help the user filling some content.
|
void |
setId(long id)
Dummy function, do hibernate is always happy.
|
void |
setName(String name) |
void |
setNumber(int number) |
void |
setObject(BaseCollection object) |
void |
setPrettyName(String prettyName) |
void |
setTooltip(String tooltip) |
void |
setUnmodifiable(boolean unmodifiable) |
void |
setValidationMessage(String validationMessage) |
void |
setValidationRegExp(String validationRegExp) |
void |
setxWikiClass(BaseClass xWikiClass) |
String |
toFormString() |
String |
toString(BaseProperty property) |
org.dom4j.Element |
toXML() |
org.dom4j.Element |
toXML(BaseClass bclass) |
boolean |
validateProperty(BaseProperty property,
XWikiContext context) |
addField, addPropertyForRemoval, apply, equals, get, getCurrentReferenceDocumentReferenceResolver, getCustomMappingMap, getDateValue, getDiff, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getProperties, getPropertyList, getPropertyNames, getRelativeEntityReferenceResolver, getRelativeXClassReference, getSetValue, getSortedIterator, getStringValue, getXClassReference, merge, merge, mergeField, put, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDocumentReference, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setOwnerDocument, setSetValue, setStringListValue, setStringValue, setXClassReference, toXMLString
fromXML, getDocumentReference, getLocalEntityReferenceSerializer, getLocalization, getLocalKey, getLocalUidStringEntityReferenceSerializer, getMergeManager, getOwnerDocument, getReference, getXWikiContext, hashCode, localizePlain, localizePlainOrKey, toString, toXMLString
finalize, getClass, notify, notifyAll, wait, wait, wait
get, put, safeget, safeput
apply, getDocumentReference, getReference, merge, setDocumentReference, toString
protected String cachedCustomDisplayer
public PropertyClass()
public PropertyClass(String name, String prettyname, PropertyMetaClass xWikiClass)
protected ClassPropertyReference createReference()
createReference
in class BaseElement<ClassPropertyReference>
public BaseClass getXClass(XWikiContext context)
getXClass
in interface ObjectInterface
getXClass
in class BaseCollection<ClassPropertyReference>
public BaseClass getxWikiClass()
public void setxWikiClass(BaseClass xWikiClass)
public BaseCollection getObject()
getObject
in interface PropertyInterface
public void setObject(BaseCollection object)
setObject
in interface PropertyInterface
public String getFieldFullName()
parentName_fieldName
. There are 2 main cases:
public long getId()
BaseElement
BaseElement.getLocalKey()
.getId
in interface PropertyInterface
getId
in class BaseElement<ClassPropertyReference>
public void setId(long id)
BaseElement
setId
in interface PropertyInterface
setId
in class BaseElement<ClassPropertyReference>
id
- the identifier assigned by hibernate.public String toString(BaseProperty property)
toString
in interface PropertyClassInterface
public BaseProperty fromString(String value)
fromString
in interface PropertyClassInterface
public BaseProperty newPropertyfromXML(org.dom4j.Element ppcel)
public void displayHidden(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
displayHidden
in interface PropertyClassInterface
public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
displayView
in interface PropertyClassInterface
public void displayEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
displayEdit
in interface PropertyClassInterface
public String displayHidden(String name, String prefix, BaseCollection object, XWikiContext context)
public String displayHidden(String name, BaseCollection object, XWikiContext context)
public String displayView(String name, String prefix, BaseCollection object, XWikiContext context)
public String displayView(String name, BaseCollection object, XWikiContext context)
public String displayEdit(String name, String prefix, BaseCollection object, XWikiContext context)
public String displayEdit(String name, BaseCollection object, XWikiContext context)
public boolean isCustomDisplayed(XWikiContext context)
public void displayCustom(StringBuffer buffer, String fieldName, String prefix, String type, BaseObject object, XWikiContext context) throws XWikiException
XWikiException
@Deprecated protected String renderContentInContext(String content, String syntax, DocumentReference authorReference, XWikiContext context) throws Exception
renderContentInContext(String, String, DocumentReference, DocumentReference, XWikiContext)
insteadException
protected String renderContentInContext(String content, String syntax, DocumentReference authorReference, DocumentReference secureDocument, XWikiContext context) throws Exception
Exception
public String getClassName()
BaseCollection
getClassName
in class BaseCollection<ClassPropertyReference>
public String getName()
BaseElement
Note that this method is used by Hibernate for saving an element.
getName
in interface ElementInterface
getName
in class BaseElement<ClassPropertyReference>
BaseProperty
).ElementInterface.getName()
public void setName(String name)
BaseElement
Note that this method is used by Hibernate for loading an element.
setName
in interface ElementInterface
setName
in class BaseElement<ClassPropertyReference>
ElementInterface.setName(java.lang.String)
public String getCustomDisplay()
public void setCustomDisplay(String value)
public String getPrettyName()
getPrettyName
in class BaseElement<ClassPropertyReference>
public String getPrettyName(XWikiContext context)
public String getTranslatedPrettyName(XWikiContext context)
public void setPrettyName(String prettyName)
setPrettyName
in class BaseElement<ClassPropertyReference>
public String getHint()
public void setHint(String hint)
public String getTooltip()
public String getTooltip(XWikiContext context)
context
- public void setTooltip(String tooltip)
public int getNumber()
getNumber
in class BaseCollection<ClassPropertyReference>
public void setNumber(int number)
setNumber
in class BaseCollection<ClassPropertyReference>
public String getClassType()
classType
should not.
The classType
can be used as a hint to lookup various components related to this specific XClass property
type. See PropertyClassProvider
for instance.
@Deprecated public void setClassType(String type)
type
- the class typepublic PropertyClass clone()
clone
in interface PropertyInterface
clone
in class BaseCollection<ClassPropertyReference>
public org.dom4j.Element toXML(BaseClass bclass)
toXML
in interface ObjectInterface
toXML
in class BaseCollection<ClassPropertyReference>
public org.dom4j.Element toXML()
toXML
in interface PropertyInterface
toXML
in class BaseCollection<ClassPropertyReference>
public void fromXML(org.dom4j.Element element) throws XWikiException
fromXML
in class BaseElement<ClassPropertyReference>
XWikiException
public String toFormString()
toFormString
in interface PropertyInterface
public void initLazyCollections()
public boolean isUnmodifiable()
public void setUnmodifiable(boolean unmodifiable)
public boolean isDisabled()
true
if this property is disabled and should not be used, false
otherwisesetDisabled(boolean)
public void setDisabled(boolean disabled)
disabled
- whether the property is disabled or notisDisabled()
public BaseProperty fromStringArray(String[] strings)
public boolean isValidColumnTypes(org.hibernate.mapping.Property hibprop)
public BaseProperty fromValue(Object value)
fromValue
in interface PropertyClassInterface
public BaseProperty newProperty()
newProperty
in interface PropertyClassInterface
public void setValidationRegExp(String validationRegExp)
public String getValidationRegExp()
public String getValidationMessage()
public void setValidationMessage(String validationMessage)
public boolean validateProperty(BaseProperty property, XWikiContext context)
public void flushCache()
flushCache
in interface PropertyClassInterface
public int compareTo(PropertyClass other)
compareTo
in interface Comparable<PropertyClass>
other
- the other property definition to be compared withgetNumber()
protected String getFullQueryPropertyName()
protected String getCachedDefaultCustomDisplayer(XWikiContext context)
flushCache()
. If it returns the empty string, then there is no default custom displayer
for this class.context
- the current request contextclass
if there's custom display
code specified in the class itself, page:currentwiki:XWiki.BooleanDisplayer
if such a document
exists in the current wiki, page:xwiki:XWiki.StringDisplayer
if such a document exists in the
main wiki, or template:displayer_boolean.vm
if a template on the filesystem or in the current
skin exists.protected String getDefaultCustomDisplayer(String propertyClassName, XWikiContext context)
propertyClassName
- the type of the property; this is defined in each subclass, such as boolean
,
string
or dblist
context
- the current request contextclass
if there's custom display
code specified in the class itself, page:currentwiki:XWiki.BooleanDisplayer
if such a document
exists in the current wiki, page:xwiki:XWiki.StringDisplayer
if such a document exists in the
main wiki, or template:displayer_boolean.vm
if a template on the filesystem or in the current
skin exists.public <T extends EntityReference> void mergeProperty(BaseProperty<T> currentProperty, BaseProperty<T> previousProperty, BaseProperty<T> newProperty, MergeConfiguration configuration, XWikiContext context, MergeResult mergeResult)
currentProperty
- the current version of the element and the one to modifypreviousProperty
- the previous version of the elementnewProperty
- the new version of the propertyconfiguration
- the configuration of the merge Indicate how to deal with some conflicts use cases, etc.context
- the XWiki contextmergeResult
- the merge reportCopyright © 2004–2021 XWiki. All rights reserved.