public class DBTreeListClass extends DBListClass
ListClass.MapComparator
DEFAULT_QUERY
DEFAULT_SEPARATOR, DISPLAYTYPE_CHECKBOX, DISPLAYTYPE_INPUT, DISPLAYTYPE_RADIO, DISPLAYTYPE_SELECT, FREE_TEXT_ALLOWED, FREE_TEXT_DISCOURAGED, FREE_TEXT_FORBIDDEN, SEPARATOR_ESCAPE
cachedCustomDisplayer
currentReferenceDocumentReferenceResolver, fields, fieldsToRemove, number, relativeEntityReferenceResolver
documentReference, ownerDocument, referenceCache
Constructor and Description |
---|
DBTreeListClass() |
DBTreeListClass(PropertyMetaClass wclass) |
Modifier and Type | Method and Description |
---|---|
protected void |
addToList(Map<String,List<ListItem>> map,
String key,
ListItem item) |
protected void |
addToSelect(org.apache.ecs.xhtml.select select,
List<String> selectlist,
Map<String,ListItem> map,
Map<String,List<ListItem>> treemap,
String parent,
String level,
XWikiContext context) |
protected void |
addToTreeList(List<ListItem> treelist,
Map<String,List<ListItem>> treemap,
Map<String,ListItem> map,
String parent,
XWikiContext context) |
void |
displayEdit(StringBuffer buffer,
String name,
String prefix,
BaseCollection object,
XWikiContext context) |
protected void |
displayTreeSelectEdit(StringBuffer buffer,
String name,
String prefix,
BaseCollection object,
XWikiContext context) |
void |
displayView(StringBuffer buffer,
String name,
String prefix,
BaseCollection object,
XWikiContext context) |
protected List<ListItem> |
getCachedDBTreeList(XWikiContext context)
Get the ordered list of tree nodes that is currently cached, if any.
|
String |
getParentField() |
String |
getQuery(XWikiContext context)
Computes the query corresponding to the current XProperty.
|
protected List<ListItem> |
getTreeList(Map<String,List<ListItem>> treemap,
Map<String,ListItem> map,
XWikiContext context)
Gets an ordered list of items in the tree.
|
Map<String,List<ListItem>> |
getTreeMap(XWikiContext context) |
protected String |
renderItemsList(List<List<ListItem>> resList) |
protected void |
setCachedDBTreeList(List<ListItem> cachedDBTreeList,
XWikiContext context)
Store the ordered list of tree nodes in a cache.
|
void |
setParentField(String parentField) |
flushCache, getCachedDBList, getClassname, getDBList, getIdField, getList, getMap, getSql, getValue, getValueField, makeList, returnCol, setCachedDBList, setClassname, setIdField, setSql, setValueField
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
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
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
displayView
get, put, safeget, safeput
apply, getDocumentReference, getReference, merge, setDocumentReference, toString
public DBTreeListClass(PropertyMetaClass wclass)
public DBTreeListClass()
public String getParentField()
public void setParentField(String parentField)
protected List<ListItem> getCachedDBTreeList(XWikiContext context)
context
- the current request contextnull
if not already cachedprotected void setCachedDBTreeList(List<ListItem> cachedDBTreeList, XWikiContext context)
cachedDBTreeList
- the list to cachecontext
- the current request contextpublic Map<String,List<ListItem>> getTreeMap(XWikiContext context)
protected List<ListItem> getTreeList(Map<String,List<ListItem>> treemap, Map<String,ListItem> map, XWikiContext context)
treemap
- the unordered list of tree nodesmap
- the mapping between a node name and its corresponding tree nodecontext
- the current request contextListItem
tree nodesprotected void addToTreeList(List<ListItem> treelist, Map<String,List<ListItem>> treemap, Map<String,ListItem> map, String parent, XWikiContext context)
public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
displayView
in interface PropertyClassInterface
displayView
in class DBListClass
public void displayEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
displayEdit
in interface PropertyClassInterface
displayEdit
in class DBListClass
protected void addToSelect(org.apache.ecs.xhtml.select select, List<String> selectlist, Map<String,ListItem> map, Map<String,List<ListItem>> treemap, String parent, String level, XWikiContext context)
protected void displayTreeSelectEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context)
public String getQuery(XWikiContext context)
Computes 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 the classname, idField, valueField and parentField properties. The query is constructed according to the following rules:
The generated query always selects 3 columns, the first one is used as the stored value, the second one as the displayed value, and the third one defines the "parent" of the current value.
getQuery
in class DBListClass
context
- The current context
.Copyright © 2004–2022 XWiki. All rights reserved.