Package com.xpn.xwiki.objects.classes
Class DBListClass
- 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.DBListClass
-
- All Implemented Interfaces:
PropertyClassInterface
,ElementInterface
,ObjectInterface
,PropertyInterface
,Serializable
,Cloneable
,Comparable<PropertyClass>
- Direct Known Subclasses:
DBTreeListClass
,PageClass
public class DBListClass extends ListClass
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.xpn.xwiki.objects.classes.ListClass
ListClass.MapComparator
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
DEFAULT_QUERY
-
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 DBListClass()
DBListClass(PropertyMetaClass wclass)
DBListClass(String name, String prettyname, PropertyMetaClass wclass)
-
Method Summary
-
Methods inherited from class com.xpn.xwiki.objects.classes.ListClass
displayHidden, displayRadioEdit, displaySelectEdit, fromList, fromList, fromString, fromStringArray, getDefaultValue, getDisplayType, getDisplayValue, getDisplayValue, getElementValue, getFirstSeparator, getFreeText, getListFromString, getListFromString, getListFromString, getMapFromString, getSeparator, getSeparators, getSize, getSort, getStringFromList, getStringFromList, isCache, isLargeStorage, isMultiSelect, isPicker, isRelationalStorage, mergeNotOrderedListProperty, mergeProperty, newProperty, newPropertyfromXML, setCache, setDefaultValue, setDisplayType, setFreeText, setLargeStorage, setMultiSelect, setPicker, setRelationalStorage, setSeparator, setSeparators, setSize, setSort, toFormString, toList
-
Methods inherited from class com.xpn.xwiki.objects.classes.PropertyClass
clone, compareTo, createReference, displayCustom, displayEdit, displayEdit, displayHidden, displayHidden, displayView, displayView, 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
-
-
-
-
Field Detail
-
DEFAULT_QUERY
protected static final String DEFAULT_QUERY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DBListClass
public DBListClass(String name, String prettyname, PropertyMetaClass wclass)
-
DBListClass
public DBListClass(PropertyMetaClass wclass)
-
DBListClass
public DBListClass()
-
-
Method Detail
-
getDBList
public List<ListItem> getDBList(XWikiContext context)
-
getList
public List<String> getList(XWikiContext context)
-
getMap
public Map<String,ListItem> getMap(XWikiContext context)
-
getQuery
@Deprecated public String getQuery(XWikiContext context)
Deprecated.since 9.8RC1, use theQueryBuilder<DBListClass>
component insteadComputes the query corresponding to the current XProperty. The query is either manually specified by the XClass creator in the
sql
field, or, if the query field is blank, constructed using theclassname
,idField
andvalueField
properties. The query is constructed according to the following rules:- If no classname, id or value fields are selected, return a query that return no rows.
- If only the classname is provided, select all document names which have an object of that type.
- If only one of id and value is provided, select just one column.
- If id = value, select just one column.
- If no classname is provided, assume the fields are document properties.
- If the document is not used at all, don't put it in the query.
- If the object is not used at all, don't put it in the query.
If there are two columns selected, use the first one as the stored value and the second one as the displayed value.
- Parameters:
context
- The currentcontext
.- Returns:
- The HQL query corresponding to this property.
-
getSql
public String getSql()
-
setSql
public void setSql(String sql)
-
getClassname
public String getClassname()
-
setClassname
public void setClassname(String classname)
-
getIdField
public String getIdField()
-
setIdField
public void setIdField(String idField)
-
getValueField
public String getValueField()
-
setValueField
public void setValueField(String valueField)
-
getCachedDBList
public List<ListItem> getCachedDBList(XWikiContext context)
-
setCachedDBList
public void setCachedDBList(List<ListItem> cachedDBList, XWikiContext context)
-
flushCache
public void flushCache()
- Specified by:
flushCache
in interfacePropertyClassInterface
- Overrides:
flushCache
in classPropertyClass
-
getValue
public String getValue(String val, String sql, XWikiContext context)
-
displayEdit
public void displayEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
- Specified by:
displayEdit
in interfacePropertyClassInterface
- Overrides:
displayEdit
in classListClass
-
displayView
public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
- Specified by:
displayView
in interfacePropertyClassInterface
- Overrides:
displayView
in classListClass
-
-