lumis.doui.table.field
Class GenericTableSourceField

Package class diagram package GenericTableSourceField
java.lang.Object
  extended by lumis.doui.source.field.BaseSourceField
      extended by lumis.doui.source.field.BaseTabularSourceField
          extended by lumis.doui.table.field.BaseTableSourceField
              extended by lumis.doui.table.field.GenericTableSourceField
All Implemented Interfaces:
ISourceField, ITabularSourceField, ITableSourceField
Direct Known Subclasses:
ChannelTableSourceField, DocumentSourceField, FileSizeField, FileTableSourceField, ImageSourceField, PageTableSourceField, ParentContentSourceField, SingleColumnTableSourceField

@StableMinor(version="4.1",
             sinceVersion="4.0")
public class GenericTableSourceField
extends BaseTableSourceField

A generic table source field. This generic field maps to one column in a table and has the option to do a lookup on os taken from this field's definition node.

Since:
4.0.4

Field Summary
protected  QueryField lookupQueryField
          The lookup query field that is used for this field.
 
Fields inherited from class lumis.doui.source.field.BaseTabularSourceField
columnName, primaryKey, primaryName, searchable
 
Fields inherited from class lumis.doui.source.field.BaseSourceField
converter, dataType, defaultValue, definitionNode, display, doOptionLookup, externalData, getData, id, introduction, maximumValue, minimumValue, name, parentId, pattern, readOnly, required, requiredWhenVisible, source
 
Constructor Summary
GenericTableSourceField()
           
 
Method Summary
 void convertRowToFieldData(ISourceData databaseRow, ISourceData sourceRow)
          Converts a row read from the data provider to this source field type. This base implementation just copies the value in the database row relative to this field's id to the source row using the same id, converting it using BaseSourceField.convertToFieldValueClass(Object, java.util.Locale, String).
protected  Object convertToQueryFieldValue(QueryField queryField, Object value)
          Convert the value to the value to be assigned to the given query field.
 Object getAssignedValue(QueryBase queryBase)
          Returns the value assigned as this field's value in the given query.
protected  Object getDefaultInsertValue()
           
 QueryField getDisplayQueryField(QueryBase queryBase)
          Returns the query field to be used for display purposes for this field.
 List<QueryAssignment> getQueryAssignments(QueryInsert queryInsert, IParameters parameters)
          Returns a list of query assignments to be used in the given query insert.
 List<QueryAssignment> getQueryAssignments(QueryUpdate queryUpdate, IParameters parameters)
          Returns a list of query assignments to be used in the given query update.
protected  QueryField getQueryField(QueryBase queryBase)
          Returns the main query field for this source field.
protected  QueryField getQueryField(QueryBase queryBase, boolean useLookupField)
          Returns the query field for this field.
 IQueryFilter getQueryFilter(QueryBase queryBase, TableSourceFilter filter)
          Returns a query filter for this field.
 List<QuerySortOrder> getQuerySortOrders(QueryBase queryBase, String direction)
          Returns a list of sort orders to be applied when it is to be ordered by this field.
 TableSourceFieldMapping getTableMapping(QueryBase queryBase)
          Returns the table mapping for this field.
 void init(Source source, Node fieldNode)
          Initializes this source field.
 
Methods inherited from class lumis.doui.table.field.BaseTableSourceField
isLookupEnabled
 
Methods inherited from class lumis.doui.source.field.BaseTabularSourceField
getColumnName, isInsertable, isPrimaryKey, isPrimaryName, isSearchable, isUpdatable
 
Methods inherited from class lumis.doui.source.field.BaseSourceField
convertToFieldValueClass, createConverter, createDataType, getConverter, getDataType, getDefaultControlDefinition, getDefaultInputControlDefinition, getDefaultValue, getDefaultViewControlDefinition, getDefinitionNode, getId, getMaximumValue, getMinimumValue, getName, getValueClass, isDisplay, isExternalData, isGetData, isIntroduction, isParentId, isReadOnly, isRequired, isRequiredWhenVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lumis.doui.source.field.ITabularSourceField
isPrimaryKey, isSearchable
 
Methods inherited from interface lumis.doui.source.field.ISourceField
getConverter, getDataType, getDefaultControlDefinition, getDefaultInputControlDefinition, getDefaultValue, getDefaultViewControlDefinition, getDefinitionNode, getId, getMaximumValue, getMinimumValue, getName, getValueClass, isDisplay, isExternalData, isGetData, isIntroduction, isParentId, isPrimaryName, isReadOnly, isRequired, isRequiredWhenVisible
 

Field Detail

lookupQueryField

protected QueryField lookupQueryField
The lookup query field that is used for this field. It is expected that this attribute is set by the getTableMapping(QueryBase) method.

Since:
4.0.4
Constructor Detail

GenericTableSourceField

public GenericTableSourceField()
Method Detail

init

public void init(Source source,
                 Node fieldNode)
          throws PortalException
Description copied from interface: ISourceField
Initializes this source field. This method is called by the source after the field is created and before it is used. The implementation of this method must initialize all of this instance's attributes.

Specified by:
init in interface ISourceField
Overrides:
init in class BaseTabularSourceField
Parameters:
source - the source this field will belong to.
fieldNode - the xml node that contains this field's definition.
Throws:
PortalException - if this field could not be initialized.

getTableMapping

public TableSourceFieldMapping getTableMapping(QueryBase queryBase)
                                        throws PortalException
Description copied from interface: ITableSourceField
Returns the table mapping for this field. This specifies how the field data is accessed.

Specified by:
getTableMapping in interface ITableSourceField
Specified by:
getTableMapping in class BaseTableSourceField
Parameters:
queryBase - the query the mapping will be used.
Returns:
the field table mapping.
Throws:
PortalException

getDisplayQueryField

public QueryField getDisplayQueryField(QueryBase queryBase)
                                throws PortalException
Description copied from interface: ITableSourceField
Returns the query field to be used for display purposes for this field. This should be used only when it is needed at the query layer. Otherwise use the field's converter or the value render if it is lumis.util.IRenderable.

Parameters:
queryBase - the query base the query field will be used in.
Returns:
the query field.
Throws:
PortalException

getQueryField

protected QueryField getQueryField(QueryBase queryBase,
                                   boolean useLookupField)
                            throws PortalException
Returns the query field for this field.

Parameters:
queryBase - the query base where the query field will be used.
useLookupField -
Returns:
the query field for this field.
Throws:
PortalException
Since:
4.0.4

getQueryField

protected QueryField getQueryField(QueryBase queryBase)
                            throws PortalException
Returns the main query field for this source field.

Parameters:
queryBase - the query base where the query field will be used.
Returns:
the query field.
Throws:
PortalException
Since:
4.0.4

convertToQueryFieldValue

protected Object convertToQueryFieldValue(QueryField queryField,
                                          Object value)
Convert the value to the value to be assigned to the given query field.

Parameters:
queryField - the query field.
value - the original value.
Returns:
the value converted.
Since:
4.0.4

getQueryFilter

public IQueryFilter getQueryFilter(QueryBase queryBase,
                                   TableSourceFilter filter)
                            throws PortalException
Description copied from interface: ITableSourceField
Returns a query filter for this field.

Specified by:
getQueryFilter in interface ITableSourceField
Specified by:
getQueryFilter in class BaseTableSourceField
Parameters:
queryBase - the query where the filter will be applied to.
filter - the filter definition.
Returns:
the query filter.
Throws:
PortalException

getQuerySortOrders

public List<QuerySortOrder> getQuerySortOrders(QueryBase queryBase,
                                               String direction)
                                        throws PortalException
Description copied from interface: ITableSourceField
Returns a list of sort orders to be applied when it is to be ordered by this field.

Specified by:
getQuerySortOrders in interface ITableSourceField
Specified by:
getQuerySortOrders in class BaseTableSourceField
Parameters:
queryBase - the query where the sort orders will be applied to.
direction - the direction this field is to be sorted.
Returns:
a list of sort orders, never null. May be an empty list if this field is not sortable.
Throws:
PortalException

getDefaultInsertValue

protected Object getDefaultInsertValue()

getQueryAssignments

public List<QueryAssignment> getQueryAssignments(QueryInsert queryInsert,
                                                 IParameters parameters)
                                          throws PortalException
Description copied from interface: ITableSourceField
Returns a list of query assignments to be used in the given query insert.

Specified by:
getQueryAssignments in interface ITableSourceField
Specified by:
getQueryAssignments in class BaseTableSourceField
Parameters:
queryInsert - the query insert.
parameters - the parameters with the values to be used.
Returns:
the list of query assignments, never null.
Throws:
PortalException

getQueryAssignments

public List<QueryAssignment> getQueryAssignments(QueryUpdate queryUpdate,
                                                 IParameters parameters)
                                          throws PortalException
Description copied from interface: ITableSourceField
Returns a list of query assignments to be used in the given query update.

Specified by:
getQueryAssignments in interface ITableSourceField
Specified by:
getQueryAssignments in class BaseTableSourceField
parameters - the parameters with the values to be used.
Returns:
the list of query assignments, never null.
Throws:
PortalException

getAssignedValue

public Object getAssignedValue(QueryBase queryBase)
                        throws PortalException
Description copied from interface: ITableSourceField
Returns the value assigned as this field's value in the given query.

Specified by:
getAssignedValue in interface ITableSourceField
Specified by:
getAssignedValue in class BaseTableSourceField
Parameters:
queryBase - the query.
Returns:
the value assigned as this field's value.
Throws:
PortalException

convertRowToFieldData

public void convertRowToFieldData(ISourceData databaseRow,
                                  ISourceData sourceRow)
                           throws PortalException
Description copied from class: BaseTabularSourceField
Converts a row read from the data provider to this source field type.

This base implementation just copies the value in the database row relative to this field's id to the source row using the same id, converting it using BaseSourceField.convertToFieldValueClass(Object, java.util.Locale, String).

Specified by:
convertRowToFieldData in interface ITabularSourceField
Overrides:
convertRowToFieldData in class BaseTabularSourceField
Parameters:
databaseRow - a row containing the original data.
sourceRow - the row to be populated with this field's data.
Throws:
PortalException


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.