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
Method Summary |
void |
displayEdit(StringBuffer buffer,
String name,
String prefix,
BaseCollection object,
XWikiContext context)
|
void |
displayView(StringBuffer buffer,
String name,
String prefix,
BaseCollection object,
XWikiContext context)
|
void |
flushCache()
|
List<ListItem> |
getCachedDBList(XWikiContext context)
|
String |
getClassname()
|
List<ListItem> |
getDBList(XWikiContext context)
|
String |
getIdField()
|
List<String> |
getList(XWikiContext context)
|
Map<String,ListItem> |
getMap(XWikiContext context)
|
String |
getQuery(XWikiContext context)
Computes the query corresponding to the current XProperty. |
String |
getSql()
|
String |
getValue(String val,
String sql,
XWikiContext context)
|
String |
getValueField()
|
List<ListItem> |
makeList(List<Object> list)
|
String |
returnCol(String hibquery,
boolean first)
|
void |
setCachedDBList(List<ListItem> cachedDBList,
XWikiContext context)
|
void |
setClassname(String classname)
|
void |
setIdField(String idField)
|
void |
setSql(String sql)
|
void |
setValueField(String valueField)
|
Methods inherited from class com.xpn.xwiki.objects.classes.ListClass |
displayHidden, displayRadioEdit, displaySelectEdit, fromString, fromStringArray, getDisplayType, getDisplayValue, getDisplayValue, getElementValue, getListFromString, getListFromString, getMapFromString, getSeparator, getSeparators, getSize, getSort, isCache, isMultiSelect, isPicker, isRelationalStorage, newProperty, newPropertyfromXML, 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, 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, setSetValue, setStringListValue, setStringValue, setXClassReference, toString, toXMLString |
DEFAULT_QUERY
protected static final String DEFAULT_QUERY
- See Also:
- Constant Field Values
DBListClass
public DBListClass(String name,
String prettyname,
PropertyMetaClass wclass)
DBListClass
public DBListClass(PropertyMetaClass wclass)
DBListClass
public DBListClass()
makeList
public List<ListItem> makeList(List<Object> list)
getDBList
public List<ListItem> getDBList(XWikiContext context)
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
getQuery
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 and valueField 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 current context
.
- 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 interface PropertyClassInterface
- Overrides:
flushCache
in class PropertyClass
returnCol
public String returnCol(String hibquery,
boolean first)
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 interface PropertyClassInterface
- Overrides:
displayEdit
in class ListClass
displayView
public void displayView(StringBuffer buffer,
String name,
String prefix,
BaseCollection object,
XWikiContext context)
- Specified by:
displayView
in interface PropertyClassInterface
- Overrides:
displayView
in class ListClass
Copyright © 2004-2013 XWiki. All Rights Reserved.