com.xpn.xwiki.objects.classes
Class DBListClass

java.lang.Object
  extended by com.xpn.xwiki.objects.BaseElement
      extended by com.xpn.xwiki.objects.BaseCollection
          extended by com.xpn.xwiki.objects.classes.PropertyClass
              extended by com.xpn.xwiki.objects.classes.ListClass
                  extended by com.xpn.xwiki.objects.classes.DBListClass
All Implemented Interfaces:
PropertyClassInterface, ElementInterface, ObjectInterface, PropertyInterface, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DBTreeListClass

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
protected static java.lang.String DEFAULT_QUERY
           
 
Fields inherited from class com.xpn.xwiki.objects.BaseCollection
className, fields, fieldsToRemove, number
 
Constructor Summary
DBListClass()
           
DBListClass(PropertyMetaClass wclass)
           
DBListClass(java.lang.String name, java.lang.String prettyname, PropertyMetaClass wclass)
           
 
Method Summary
 void displayEdit(java.lang.StringBuffer buffer, java.lang.String name, java.lang.String prefix, BaseCollection object, XWikiContext context)
           
 void displayView(java.lang.StringBuffer buffer, java.lang.String name, java.lang.String prefix, BaseCollection object, XWikiContext context)
           
 void flushCache()
           
 java.util.List getCachedDBList(XWikiContext context)
           
 java.lang.String getClassname()
           
 java.util.List getDBList(XWikiContext context)
           
 java.lang.String getIdField()
           
 java.util.List getList(XWikiContext context)
           
 java.util.Map getMap(XWikiContext context)
           
 java.lang.String getQuery(XWikiContext context)
           Computes the query corresponding to the current XProperty.
 java.lang.String getSql()
           
 java.lang.String getValue(java.lang.String val, java.lang.String sql, XWikiContext context)
           
 java.lang.String getValueField()
           
 java.util.List makeList(java.util.List list)
           
 java.lang.String returnCol(java.lang.String hibquery, boolean first)
           
 void setCachedDBList(java.util.List cachedDBList, XWikiContext context)
           
 void setClassname(java.lang.String classname)
           
 void setIdField(java.lang.String idField)
           
 void setSql(java.lang.String sql)
           
 void setValueField(java.lang.String valueField)
           
 
Methods inherited from class com.xpn.xwiki.objects.classes.ListClass
displayHidden, displayRadioEdit, displayRadioSearch, displaySearch, displaySelectEdit, displaySelectSearch, fromSearchMap, fromString, fromStringArray, getDisplayType, getDisplayValue, getDisplayValue, getElementValue, getListFromString, getListFromString, getMapFromString, getSeparator, getSeparators, getSize, getSort, isCache, isMultiSelect, isPicker, isRelationalStorage, makeQuery, newProperty, newPropertyfromXML, setCache, setDisplayType, setMultiSelect, setPicker, setRelationalStorage, setSeparator, setSeparators, setSize, setSort
 
Methods inherited from class com.xpn.xwiki.objects.classes.PropertyClass
checkField, clone, displayCustom, displayEdit, displayEdit, displayHidden, displayHidden, displaySearch, displaySearch, displayView, displayView, fromValue, fromXML, getClassName, getClassType, getCustomDisplay, getFieldFullName, getId, getName, getNumber, getObject, getPrettyName, getPrettyName, getTooltip, getTooltip, getTranslatedPrettyName, getValidationMessage, getValidationRegExp, getxWikiClass, getxWikiClass, initLazyCollections, isCustomDisplayed, isUnmodifiable, isValidColumnTypes, setClassType, setCustomDisplay, 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, equals, get, getCustomMappingMap, getDateValue, getDiff, getDoubleValue, getField, getFieldList, getFieldsToRemove, getFloatValue, getIntValue, getIntValue, getLargeStringValue, getListValue, getLongValue, getProperties, getPropertyList, getPropertyNames, getSetValue, getSortedIterator, getStringValue, hashCode, merge, put, removeField, safeget, safeput, setClassName, setDateValue, setDBStringListValue, setDoubleValue, setFields, setFieldsToRemove, setFloatValue, setIntValue, setLargeStringValue, setLongValue, setSetValue, setStringListValue, setStringValue, toString, toXMLString
 
Methods inherited from class com.xpn.xwiki.objects.BaseElement
getDocumentSyntaxId, getWiki, setWiki
 
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
toString
 

Field Detail

DEFAULT_QUERY

protected static final java.lang.String DEFAULT_QUERY
See Also:
Constant Field Values
Constructor Detail

DBListClass

public DBListClass(java.lang.String name,
                   java.lang.String prettyname,
                   PropertyMetaClass wclass)

DBListClass

public DBListClass(PropertyMetaClass wclass)

DBListClass

public DBListClass()
Method Detail

makeList

public java.util.List makeList(java.util.List list)

getDBList

public java.util.List getDBList(XWikiContext context)

getList

public java.util.List getList(XWikiContext context)
Specified by:
getList in class ListClass

getMap

public java.util.Map getMap(XWikiContext context)
Specified by:
getMap in class ListClass

getQuery

public java.lang.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 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 java.lang.String getSql()

setSql

public void setSql(java.lang.String sql)

getClassname

public java.lang.String getClassname()

setClassname

public void setClassname(java.lang.String classname)

getIdField

public java.lang.String getIdField()

setIdField

public void setIdField(java.lang.String idField)

getValueField

public java.lang.String getValueField()

setValueField

public void setValueField(java.lang.String valueField)

getCachedDBList

public java.util.List getCachedDBList(XWikiContext context)

setCachedDBList

public void setCachedDBList(java.util.List cachedDBList,
                            XWikiContext context)

flushCache

public void flushCache()
Specified by:
flushCache in interface PropertyClassInterface
Overrides:
flushCache in class PropertyClass

returnCol

public java.lang.String returnCol(java.lang.String hibquery,
                                  boolean first)

getValue

public java.lang.String getValue(java.lang.String val,
                                 java.lang.String sql,
                                 XWikiContext context)

displayEdit

public void displayEdit(java.lang.StringBuffer buffer,
                        java.lang.String name,
                        java.lang.String prefix,
                        BaseCollection object,
                        XWikiContext context)
Specified by:
displayEdit in interface PropertyClassInterface
Overrides:
displayEdit in class ListClass

displayView

public void displayView(java.lang.StringBuffer buffer,
                        java.lang.String name,
                        java.lang.String prefix,
                        BaseCollection object,
                        XWikiContext context)
Specified by:
displayView in interface PropertyClassInterface
Overrides:
displayView in class ListClass


Copyright © 2004-2008 XWiki. All Rights Reserved.