DataFaucet 1.0 Beta

datafaucet.system.sql
Class collectionfilter

WEB-INF.cftags.component
        extended by datafaucet.system.sql.duck
            extended by datafaucet.system.sql.simplefiltergroup
                extended by datafaucet.system.sql.collectionfilter
Direct Known Subclasses:
andorcollectionfilter

public class collectionfilter
extends simplefiltergroup

filters a query using the contents of a structure (usually form input)


Constructor Summary
init(struct content, [string comparison='like'], [string include='and'], [boolean bindFilters='false'], [string delimiters=','], [boolean reverse='false'], [boolean casesensitive='false'], [any table=''], [string like='contains'])
 
Method Summary
private any getFilterDates(string cname, struct collection)
private any getFilterNumbers(string cname, struct collection)
private struct getORMCollection(struct collection, [string comparison='LIKE'])
 boolean hasFilters()
private any makeDateFilter(string cname, struct dates)
private void makeFilters()
private any makeNumericFilter(string cname, struct num)
private any newFilter(string column, string content, [string comparison='like'], [string delimiters=','], [boolean dynamic='false'], [boolean reverse='false'], [boolean casesensitive='false'])
private any setRangeFilter(struct collection, string cname, struct filters)
private any set_content(string propertyname, struct propertyvalue)
 
Methods inherited from class datafaucet.system.sql.simplefiltergroup
appendFilter, bindFilters, clearFilters, columnNotFoundException, execute, filtersExist, getAvailableColumnList, getDatasource, getFilters, getFirstFilter, getGroupSource, getSource, getSyntax, getTable, getTableArray, getTableForColumn, get_column, hasGroupSource, hasJoinSource, hasJoinTables, isGroup, raiseFilterExceptions, setTable, typeMismatchException
 
Methods inherited from class datafaucet.system.sql.duck
arg, getDefaultLocalization, getLocalization, getNext, getObject, getProperties, getProperty, getPropertylist, getTail, getValue, hasNext, identifyAccessorOrMutator, insertAfter, onMissingMethod, parseDate, parseNumber, raiseAbstractClassException, raiseMissingMethodException, removeAfter, setLocalization, setNext, setProperties, setProperty, setValue, simplify
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(struct content, [string comparison='like'], [string include='and'], [boolean bindFilters='false'], [string delimiters=','], [boolean reverse='false'], [boolean casesensitive='false'], [any table=''], [string like='contains'])

Parameters:
content - a structure containing search phrases for each key in the structure
comparison - indicates what kind of comparison should be performed against the structure element values - start and end are allowed in addition to standard sql comparison operators to set like conditions
include - and / or -- determines whether the filters are cumulative or exclusive
bindFilters - indicates if the created group of filters should be returned as a contained group (adds parenthesis around the sql syntax)
delimiters - a string of delimiters if the compare attribute is in or not in
reverse - indicates that the filter should be reversed, checking for the column value within the content string
casesensitive - indicates that the content of columns should not be made case-insensitive for databases with case-sensitive collation
table - an object of type statement.cfc
like - indicates if like filters should include wild-cards before, after or on both sides of the content string
Method Detail

getFilterDates

private any getFilterDates(string cname, struct collection)

Parameters:
cname
collection

getFilterNumbers

private any getFilterNumbers(string cname, struct collection)

Parameters:
cname
collection

getORMCollection

private struct getORMCollection(struct collection, [string comparison='LIKE'])

Parameters:
collection
comparison

hasFilters

public boolean hasFilters()

Overrides:
hasFilters in class simplefiltergroup

makeDateFilter

private any makeDateFilter(string cname, struct dates)

Parameters:
cname
dates

makeFilters

private void makeFilters()

Overrides:
makeFilters in class simplefiltergroup

makeNumericFilter

private any makeNumericFilter(string cname, struct num)

Parameters:
cname
num

newFilter

private any newFilter(string column, string content, [string comparison='like'], [string delimiters=','], [boolean dynamic='false'], [boolean reverse='false'], [boolean casesensitive='false'])

Parameters:
column - name of the column to filter
content - a structure containing search phrases for each key in the structure
comparison - indicates what kind of comparison should be performed against the structure element values - start and end are allowed in addition to standard sql comparison operators to set like conditions
delimiters - a string of delimiters if the compare attribute is in or not in
dynamic - indicates that the content argument is a string of arbitrary SQL
reverse - indicates that the filter should be reversed, checking for the column value within the content string
casesensitive - indicates that the content of columns should not be made case-insensitive for databases with case-sensitive collation

setRangeFilter

private any setRangeFilter(struct collection, string cname, struct filters)

Parameters:
collection
cname
filters

set_content

private any set_content(string propertyname, struct propertyvalue)

Parameters:
propertyname
propertyvalue

DataFaucet 1.0 Beta