Package com.xpn.xwiki.objects.classes
Class UsersClass
- java.lang.Object
-
- com.xpn.xwiki.objects.BaseElement<R>
-
- com.xpn.xwiki.objects.BaseCollection<ClassPropertyReference>
-
- com.xpn.xwiki.objects.classes.PropertyClass
-
- com.xpn.xwiki.objects.classes.ListClass
-
- com.xpn.xwiki.objects.classes.UsersClass
-
- All Implemented Interfaces:
PropertyClassInterface
,ElementInterface
,ObjectInterface
,PropertyInterface
,Serializable
,Cloneable
,Comparable<PropertyClass>
public class UsersClass extends ListClass
Defines an XClass property type whose value is a list of user references.- Version:
- $Id: 4495db080e565db9e46f5df379a4d0d3dc456d64 $
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.xpn.xwiki.objects.classes.ListClass
ListClass.MapComparator
-
-
Field Summary
-
Fields inherited from class com.xpn.xwiki.objects.classes.ListClass
DEFAULT_SEPARATOR, DISPLAYTYPE_CHECKBOX, DISPLAYTYPE_INPUT, DISPLAYTYPE_RADIO, DISPLAYTYPE_SELECT, FREE_TEXT_ALLOWED, FREE_TEXT_DISCOURAGED, FREE_TEXT_FORBIDDEN, SEPARATOR_ESCAPE
-
Fields inherited from class com.xpn.xwiki.objects.classes.PropertyClass
cachedCustomDisplayer
-
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 UsersClass()
Default constructor.UsersClass(PropertyMetaClass metaClass)
Creates a new Users List property that is described by the given meta class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
fromList(BaseProperty<?> property, List<String> list)
Set the passedList
into the passed property.BaseProperty
fromString(String value)
BaseProperty
fromStringArray(String[] strings)
protected String
getFirstSeparator()
List<String>
getList(XWikiContext context)
static List<String>
getListFromString(String value)
Splits the given string into a list of user names.Map<String,ListItem>
getMap(XWikiContext context)
String
getText(String value, XWikiContext context)
boolean
isUsesList()
Deprecated.since 4.3M2 this meta property is not used anymore because we changed the default displayer<T extends EntityReference>
voidmergeProperty(BaseProperty<T> currentProperty, BaseProperty<T> previousProperty, BaseProperty<T> newProperty, MergeConfiguration configuration, XWikiContext xcontext, 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)
void
setUsesList(boolean usesList)
Deprecated.since 4.3M2 this meta property is not used anymore because we changed the default displayerList<String>
toList(BaseProperty<?> property)
ListClass
does not produce onlyListProperty
s and this method allows to access the value asList
whatever property is actually storing it.-
Methods inherited from class com.xpn.xwiki.objects.classes.ListClass
displayEdit, displayHidden, displayRadioEdit, displaySelectEdit, displayView, fromList, getDefaultValue, getDisplayType, getDisplayValue, getDisplayValue, getElementValue, getFreeText, getListFromString, getListFromString, getMapFromString, getSeparator, getSeparators, getSize, getSort, getStringFromList, getStringFromList, isCache, isLargeStorage, isMultiSelect, isPicker, isRelationalStorage, mergeNotOrderedListProperty, setCache, setDefaultValue, setDisplayType, setFreeText, setLargeStorage, setMultiSelect, setPicker, setRelationalStorage, setSeparator, setSeparators, setSize, setSort, toFormString
-
Methods inherited from class com.xpn.xwiki.objects.classes.PropertyClass
clone, compareTo, createReference, displayCustom, displayEdit, displayEdit, displayHidden, displayHidden, displayView, displayView, flushCache, fromValue, fromXML, getCachedDefaultCustomDisplayer, getClassName, getClassType, getCustomDisplay, getDefaultCustomDisplayer, getFieldFullName, getFullQueryPropertyName, getHint, getId, getName, getNumber, getObject, getPrettyName, getPrettyName, getTooltip, getTooltip, getTranslatedPrettyName, getValidationMessage, getValidationRegExp, getXClass, getxWikiClass, initLazyCollections, isCustomDisplayed, isDisabled, isUnmodifiable, isValidColumnTypes, renderContentInContext, renderContentInContext, setClassType, setCustomDisplay, setDisabled, setHint, setId, setName, setNumber, setObject, setPrettyName, setTooltip, setUnmodifiable, setValidationMessage, setValidationRegExp, setxWikiClass, toFormString, toString, toXML, toXML, validateProperty
-
Methods inherited from class com.xpn.xwiki.objects.BaseCollection
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
-
Methods inherited from class com.xpn.xwiki.objects.BaseElement
fromXML, getDocumentReference, getLocalEntityReferenceSerializer, getLocalization, getLocalKey, getLocalUidStringEntityReferenceSerializer, getMergeManager, getOwnerDocument, getReference, getXWikiContext, hashCode, localizePlain, localizePlainOrKey, merge, 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
apply, getDocumentReference, getReference, merge, merge, setDocumentReference, toString
-
Methods inherited from interface com.xpn.xwiki.objects.ObjectInterface
get, put, safeget, safeput
-
Methods inherited from interface com.xpn.xwiki.objects.classes.PropertyClassInterface
displayView
-
-
-
-
Constructor Detail
-
UsersClass
public UsersClass(PropertyMetaClass metaClass)
Creates a new Users List property that is described by the given meta class.- Parameters:
metaClass
- the meta class that defines the list of meta properties associated with this property type
-
UsersClass
public UsersClass()
Default constructor.
-
-
Method Detail
-
getFirstSeparator
protected String getFirstSeparator()
- Overrides:
getFirstSeparator
in classListClass
- Returns:
- the first separator of the list of separators, or fallback on
ListClass.DEFAULT_SEPARATOR
.
-
getList
public List<String> getList(XWikiContext context)
-
getMap
public Map<String,ListItem> getMap(XWikiContext context)
-
isUsesList
@Deprecated public boolean isUsesList()
Deprecated.since 4.3M2 this meta property is not used anymore because we changed the default displayer- Returns:
true
if the list box that is used to select the users should be filled with all the available users,false
otherwise
-
setUsesList
@Deprecated public void setUsesList(boolean usesList)
Deprecated.since 4.3M2 this meta property is not used anymore because we changed the default displayerSets whether to list all the available users in the list box used to select the users. This property should not be set when the number of users is very large.- Parameters:
usesList
-true
to fill the list box that is used to select the users with all the available users,false
otherwise
-
newProperty
public BaseProperty newProperty()
- Specified by:
newProperty
in interfacePropertyClassInterface
- Overrides:
newProperty
in classListClass
-
fromString
public BaseProperty fromString(String value)
- Specified by:
fromString
in interfacePropertyClassInterface
- Overrides:
fromString
in classListClass
-
fromStringArray
public BaseProperty fromStringArray(String[] strings)
- Overrides:
fromStringArray
in classListClass
-
fromList
public void fromList(BaseProperty<?> property, List<String> list)
Description copied from class:ListClass
Set the passedList
into the passed property.
-
getText
public String getText(String value, XWikiContext context)
- Parameters:
value
- a user namecontext
- the XWiki context- Returns:
- the real name of the specified user, that can be used for display
-
getListFromString
public static List<String> getListFromString(String value)
Splits the given string into a list of user names.- Parameters:
value
- a comma separate list of user names- Returns:
- the list of user names
-
newPropertyfromXML
public BaseProperty newPropertyfromXML(org.dom4j.Element ppcel)
- Overrides:
newPropertyfromXML
in classListClass
-
toList
public List<String> toList(BaseProperty<?> property)
Description copied from class:ListClass
ListClass
does not produce onlyListProperty
s and this method allows to access the value asList
whatever property is actually storing it.There is no guarantees the returned
List
will be modifiable.
-
mergeProperty
public <T extends EntityReference> void mergeProperty(BaseProperty<T> currentProperty, BaseProperty<T> previousProperty, BaseProperty<T> newProperty, MergeConfiguration configuration, XWikiContext xcontext, MergeResult mergeResult)
Description copied from class:PropertyClass
Apply a 3 ways merge on passed current, previous and new version of the same property. The passed current version is modified as result of the merge.- Overrides:
mergeProperty
in classListClass
- Parameters:
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.xcontext
- the XWiki contextmergeResult
- the merge report
-
-