com.xpn.xwiki.objects.classes
Class UsersClass

java.lang.Object
  extended by com.xpn.xwiki.objects.BaseElement<R>
      extended by com.xpn.xwiki.objects.BaseCollection<ClassPropertyReference>
          extended by com.xpn.xwiki.objects.classes.PropertyClass
              extended by com.xpn.xwiki.objects.classes.ListClass
                  extended by 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: 835ba1ac94dc7e62039db6647f5caf473e2b9eec $
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.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, localEntityReferenceSerializer, ownerDocument, referenceCache
 
Constructor Summary
UsersClass()
          Default constructor.
UsersClass(PropertyMetaClass metaClass)
          Creates a new Users List property that is described by the given meta class.
 
Method Summary
 BaseProperty fromString(String value)
           
 BaseProperty fromStringArray(String[] strings)
           
 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
 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 displayer
 
Methods inherited from class com.xpn.xwiki.objects.classes.ListClass
displayEdit, displayHidden, displayRadioEdit, displaySelectEdit, displayView, getDisplayType, getDisplayValue, getDisplayValue, getElementValue, getListFromString, getMapFromString, getSeparator, getSeparators, getSize, getSort, isCache, isMultiSelect, isPicker, isRelationalStorage, setCache, setDisplayType, setMultiSelect, setPicker, setRelationalStorage, setSeparator, setSeparators, setSize, setSort
 
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, getId, getName, getNumber, getObject, getPrettyName, getPrettyName, getTooltip, getTooltip, getTranslatedPrettyName, getValidationMessage, getValidationRegExp, getXClass, getxWikiClass, initLazyCollections, isCustomDisplayed, isDisabled, isUnmodifiable, isValidColumnTypes, setClassType, setCustomDisplay, setDisabled, 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, getCustomMappingMap, getDateValue, getDiff, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getProperties, getPropertyList, getPropertyNames, getRelativeXClassReference, getSetValue, getSortedIterator, getStringValue, getXClassReference, merge, merge, put, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDocumentReference, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setOwnerDocument, setSetValue, setStringListValue, setStringValue, setXClassReference, toString, toXMLString
 
Methods inherited from class com.xpn.xwiki.objects.BaseElement
getDocumentReference, getLocalKey, getLocalUidStringEntityReferenceSerializer, getOwnerDocument, getReference, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.xpn.xwiki.objects.ObjectInterface
get, put, safeget, safeput
 
Methods inherited from interface com.xpn.xwiki.objects.ElementInterface
apply, getDocumentReference, getReference, merge, setDocumentReference, toString
 

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

getList

public List<String> getList(XWikiContext context)
Specified by:
getList in class ListClass

getMap

public Map<String,ListItem> getMap(XWikiContext context)
Specified by:
getMap in class ListClass

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 displayer

Sets 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 interface PropertyClassInterface
Overrides:
newProperty in class ListClass

fromString

public BaseProperty fromString(String value)
Specified by:
fromString in interface PropertyClassInterface
Overrides:
fromString in class ListClass

fromStringArray

public BaseProperty fromStringArray(String[] strings)
Overrides:
fromStringArray in class ListClass

getText

public String getText(String value,
                      XWikiContext context)
Parameters:
value - a user name
context - 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 class ListClass


Copyright © 2004–2014 XWiki. All rights reserved.